Skip to content

Commit

Permalink
Merge pull request #357 from lblod/feat/rdfa-editing-ui
Browse files Browse the repository at this point in the history
Plugin support for reworked RDFa parsing/serializing and UI/UX
  • Loading branch information
dkozickis authored Apr 30, 2024
2 parents b2847f2 + 8cfa3eb commit 5d39eca
Show file tree
Hide file tree
Showing 111 changed files with 21,938 additions and 39,985 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-tips-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': patch
---

Remove `@import "ember-appuniversum"` statements from plugin sass modules in order to prevent style overrding.
6 changes: 6 additions & 0 deletions .changeset/chilly-ravens-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': minor
---

- Addition of the `say-template-comment` class to the static version of template comments.
- Addition of some extra styles to the `say-template-comment` class.
17 changes: 17 additions & 0 deletions .changeset/great-lions-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@lblod/ember-rdfa-editor-lblod-plugins": major
---

### RDFa aware editing

This release adapts plugins
to [RDFa (RDF in Attributes)](https://github.com/lblod/ember-rdfa-editor/blob/9c32a9dea0da13df4092c39d9a092ba0803a3f42/README.md#experimental-a-new-approach-to-handle-rdfa-in-documents)
aware editing, based on the changes in `ember-rdfa-editor`
version [9.6.0](https://github.com/lblod/ember-rdfa-editor/releases/tag/v9.6.0)

#### N.B. This release is not compatible with `ember-rdfa-editor` configurations that don't use ` rdfaAware` features, see [editor documentation](https://github.com/lblod/ember-rdfa-editor/blob/9c32a9dea0da13df4092c39d9a092ba0803a3f42/README.md#experimental-a-new-approach-to-handle-rdfa-in-documents) for more.

#### Changes

* Plugins now use RDFa aware specs when rendering to HTML, and they also expect RDFa aware specs when parsing from HTML.
* Introduces RDFa aware version of `snippet-plugin`, that allows to record allowed snippet list IDs on a resource node level in the document.
5 changes: 5 additions & 0 deletions .changeset/hot-owls-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': patch
---

GN-4650: Fix behavior of "Insert snippet" button
5 changes: 5 additions & 0 deletions .changeset/loud-coins-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lblod/ember-rdfa-editor-lblod-plugins": patch
---

article-structure-plugin: Make `setStartNumber` and `getStartNumber` properties optional
5 changes: 5 additions & 0 deletions .changeset/olive-pets-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': minor
---

GN-4650: Snippet selection placeholder in template
5 changes: 5 additions & 0 deletions .changeset/smooth-fireants-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': minor
---

Add helper function to help with locale selection and add translation note to readme
5 changes: 5 additions & 0 deletions .changeset/tall-carrots-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': patch
---

Fix template-comment padding
5 changes: 5 additions & 0 deletions .changeset/wet-baboons-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lblod/ember-rdfa-editor-lblod-plugins": minor
---

Ensure that variables are node-selected/focused after insertion
5 changes: 5 additions & 0 deletions .changeset/witty-suns-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lblod/ember-rdfa-editor-lblod-plugins": patch
---

Allow to insert structure even if insertion range does not have RDFA attributes.
18 changes: 18 additions & 0 deletions .woodpecker/.release-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
install:
image: node:20-slim
commands:
- corepack enable
- pnpm i --frozen-lockfile
version:
image: node:20-slim
commands:
- npm version --no-git-tag-version $(npm pkg get version | sed 's/"//g')-dev.${CI_COMMIT_SHA}
release:
image: plugins/npm
settings:
token:
from_secret: npm_access_token
tag: dev
when:
- event: push
21 changes: 21 additions & 0 deletions .woodpecker/.release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
steps:
install:
image: node:20-slim
commands:
- corepack enable
- pnpm i --frozen-lockfile
release:
image: plugins/npm
settings:
token:
from_secret: npm_access_token
push-tagged-build:
image: plugins/docker
settings:
repo: lblod/ember-rdfa-editor-lblod-plugins
tags: '${CI_COMMIT_TAG##v}'
purge: true
secrets: [docker_username, docker_password]
when:
event: tag
ref: refs/tags/v*
50 changes: 0 additions & 50 deletions .woodpecker/.test.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .woodpecker/.verify-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
steps:
install:
image: node:20-slim
commands:
- corepack enable
- pnpm i --frozen-lockfile
lint-js:
image: node:20-slim
group: lint
commands:
- corepack enable
- pnpm lint:js
lint-hbs:
image: node:20-slim
group: lint
commands:
- corepack enable
- pnpm lint:hbs
test:
image: danlynn/ember-cli:4.12.1
commands:
- corepack enable
- pnpm test:ember
precompile:
image: node:20-slim
commands:
- corepack enable
- pnpm prepack
when:
- evaluate: 'CI_PIPELINE_EVENT == "pull_request" && not (CI_COMMIT_PULL_REQUEST_LABELS contains "dependabot")'
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM madnificent/ember:4.12.1-node_18 as builder
FROM node:20-slim AS builder

LABEL maintainer="[email protected]"

RUN corepack enable
RUN corepack prepare pnpm@latest-8 --activate
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY package.json pnpm-lock.yaml ./
RUN pnpm i --frozen-lockfile
COPY . .
RUN ember build -prod
RUN pnpm build

FROM semtech/static-file-service:0.2.0
COPY --from=builder /app/dist /data
1 change: 1 addition & 0 deletions addon/commands/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as replaceSelectionWithAndSelectNode } from './replace-selection-and-select-node';
24 changes: 24 additions & 0 deletions addon/commands/replace-selection-and-select-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Command, NodeSelection, PNode } from '@lblod/ember-rdfa-editor';

const replaceSelectionWithAndSelectNode = (node: PNode): Command => {
return (state, dispatch) => {
if (!node.type.spec.selectable) {
return false;
}

if (dispatch) {
const tr = state.tr;
tr.replaceSelectionWith(node);
if (tr.selection.$anchor.nodeBefore) {
const resolvedPos = tr.doc.resolve(
tr.selection.anchor - tr.selection.$anchor.nodeBefore?.nodeSize,
);
tr.setSelection(new NodeSelection(resolvedPos));
}
dispatch(tr);
}
return true;
};
};

export default replaceSelectionWithAndSelectNode;
68 changes: 35 additions & 33 deletions addon/components/article-structure-plugin/structure-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,39 +80,41 @@

</AuButtonGroup>
</Item>
<Item class="au-u-padding-left-small">
<AuFormRow>
{{#let (unique-id) as |id|}}
<AuLabel for={{id}}>
{{t 'article-structure-plugin.start-number.start-number'}}
</AuLabel>
<AuInput
id={{id}}
value={{this.startNumberInputValue}}
{{on "change" this.onStartNumberChange}}
placeholder={{t 'article-structure-plugin.start-number.start-number'}}
type="number"
min="1"
/>
{{/let}}
</AuFormRow>
<AuButton
@iconAlignment="left"
class="au-u-margin-top-tiny"
{{on 'click' this.setStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.set'}}
</AuButton>
<AuButton
@iconAlignment="left"
@skin="secondary"
@disabled={{not this.structureStartNumber}}
class="au-u-margin-top-tiny"
{{on 'click' this.resetStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.reset'}}
</AuButton>
</Item>
{{#if this.currentStructureType.getStartNumber}}
<Item class="au-u-padding-left-small">
<AuFormRow>
{{#let (unique-id) as |id|}}
<AuLabel for={{id}}>
{{t 'article-structure-plugin.start-number.start-number'}}
</AuLabel>
<AuInput
id={{id}}
value={{this.startNumberInputValue}}
{{on "change" this.onStartNumberChange}}
placeholder={{t 'article-structure-plugin.start-number.start-number'}}
type="number"
min="1"
/>
{{/let}}
</AuFormRow>
<AuButton
@iconAlignment="left"
class="au-u-margin-top-tiny"
{{on 'click' this.setStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.set'}}
</AuButton>
<AuButton
@iconAlignment="left"
@skin="secondary"
@disabled={{not this.structureStartNumber}}
class="au-u-margin-top-tiny"
{{on 'click' this.resetStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.reset'}}
</AuButton>
</Item>
{{/if}}
</AuList>
</c.content>
</AuCard>
Expand Down
Loading

0 comments on commit 5d39eca

Please sign in to comment.