Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin support for reworked RDFa parsing/serializing and UI/UX #357

Merged
merged 109 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
a8d11b5
Copy editable-node sample from editor dummy app
piemonkey Nov 13, 2023
2bf2680
Update article structure plugin to support rdfa editing (#358)
piemonkey Dec 14, 2023
ca11ca6
Call editable node plugin function
piemonkey Dec 21, 2023
414040e
Parse pre-rdfa-editing article structures correctly as new structures
piemonkey Dec 21, 2023
091b762
Merge pull request #367 from lblod/rdfa/backwards-compat
piemonkey Jan 16, 2024
83be553
Merge branch 'master' into feat/rdfa-editing-ui
piemonkey Jan 16, 2024
8d76b88
Merge branch 'master' into feat/rdfa-editing-ui
elpoelma Jan 19, 2024
c645179
Use git branch version of editor instead of release version
piemonkey Jan 16, 2024
88266dd
Improve backwards compatibility of article structure node parsing
piemonkey Jan 23, 2024
639aeea
Fix parsing of article structure headings
piemonkey Jan 23, 2024
5182904
Merge pull request #379 from lblod/rdfa/actual-structure-compat
piemonkey Jan 25, 2024
fbbf920
Make variables rdfa-aware (#365)
abeforgit Jan 26, 2024
8eb536d
GN-4650: Snippet selection placeholder in template
dkozickis Jan 15, 2024
302b29f
GN-4650: Snippet selection placeholder in template - MR changes
dkozickis Jan 16, 2024
bb61422
GN-4650: Show "Insert snippet" in all nodes
dkozickis Jan 29, 2024
c73a7f8
GN-4650: Do not show "Inset snippets" button if there are no assigned…
dkozickis Jan 30, 2024
7af4a30
GN-4650: Rename predicate
dkozickis Jan 30, 2024
1c4c35f
GN-4650: Use `namespace` util for predicate
dkozickis Jan 30, 2024
923cd60
GN-4650: Retrieve current resource from subject
dkozickis Jan 30, 2024
5bb4ab9
GN-4650: Correct storing and retrieving
dkozickis Jan 30, 2024
271f6b2
GN-4650: Replace `AuControlCheckbox` with `AuCheckbox`
dkozickis Jan 30, 2024
53efe90
GN-4650: Fix walking up
dkozickis Jan 30, 2024
345fb04
Merge pull request #369 from lblod/GN-4650
dkozickis Jan 30, 2024
45913e1
GN-4650: Fix behavior of "Insert snippet" button
dkozickis Jan 30, 2024
b71067c
Update standard template plugin nodes to support RDFa aware editor
piemonkey Jan 29, 2024
0787777
Check for resource node when looking for RDFa attributes
piemonkey Jan 29, 2024
dba364f
Add standard template plugin parse rules for new RDFa nodespecs
piemonkey Jan 29, 2024
7732171
Move back to using an editor version number to avoid slow builds
piemonkey Jan 30, 2024
67ac5aa
Add new dummy app routes to test with 'editable nodes' turned on
piemonkey Jan 30, 2024
b675eea
Update standard-template and besluit-type plugins to not rely on typeof
piemonkey Jan 30, 2024
e2b48a5
Update to latest rdfa-links-ui branch of editor with datatype support
piemonkey Jan 31, 2024
f849e9f
update to newest rdfa-links-ui datatype API
elpoelma Feb 1, 2024
b2c35ed
drop type-roots field from tsconfig.json
elpoelma Feb 1, 2024
8e076c2
internal(volta): pin to node version 20
elpoelma Feb 1, 2024
a7c6d38
Move references to `resource` attribute over to `subject`
piemonkey Feb 1, 2024
8a804c6
Move variable plugin nodes to use new outgoing triple types correctly
piemonkey Feb 1, 2024
d38597b
fix: use released version of editor
abeforgit Feb 2, 2024
1fc527e
fix: add a default nodeType to structures to stop it from crashing
abeforgit Feb 2, 2024
ce0a90d
fix: wrong subject type for backlink
abeforgit Feb 2, 2024
8aec0ac
bump editor peerdep
elpoelma Feb 2, 2024
391c540
fix syntax of default rdfaNodeType
elpoelma Feb 2, 2024
682c16e
linting
elpoelma Feb 2, 2024
0a9f0ca
Merge pull request #381 from lblod/GN-4650-fix
dkozickis Feb 2, 2024
44dc255
Merge branch 'feat/rdfa-editing-ui' into rdfa/gn-compat-again
elpoelma Feb 2, 2024
2610900
Merge branch 'rdfa/gn-compat-again' into fix/typescript-issues
elpoelma Feb 2, 2024
25996d3
add non-default subject attribute to structure-specs to prevent autom…
elpoelma Feb 2, 2024
2ed85b2
modify content rule of document nodes in schema as to not automatical…
elpoelma Feb 2, 2024
1e66734
Merge pull request #382 from lblod/rdfa/gn-compat-again
piemonkey Feb 2, 2024
93a7f59
Merge branch 'feat/rdfa-editing-ui' into fix/typescript-issues
abeforgit Feb 2, 2024
78c9dca
Merge pull request #383 from lblod/fix/typescript-issues
elpoelma Feb 2, 2024
860b4ac
remove top-level appuniversum imports from sass modules
elpoelma Jan 19, 2024
c2c9deb
use long version of heading in static version of template comments
elpoelma Jan 19, 2024
d995c69
add improved styling to static version of template comments
elpoelma Jan 19, 2024
6b3b926
add changesets
elpoelma Jan 19, 2024
8ca4edf
improve browser language detection of dummy app
elpoelma Jan 22, 2024
48858e8
fix template-comment padding
elpoelma Jan 26, 2024
af53ace
fix: make dummy application route js again
abeforgit Feb 3, 2024
5d9ef68
Cleanup issues from hasty conversion of nodes to datatype branch (#384)
piemonkey Feb 11, 2024
443666d
Various parsing and UX fixes (#385)
abeforgit Feb 11, 2024
5f07539
More backwards compatibility changes for article structure nodes
piemonkey Feb 13, 2024
ddbe23c
Change RS editable nodes page to more closely follow RS frontend
piemonkey Feb 13, 2024
d8ed4dc
Add blackbox tests, mostly copied from editor repo
piemonkey Feb 14, 2024
765d433
Enable tests on CI for PRs
piemonkey Feb 14, 2024
38d2078
Merge pull request #387 from lblod/rdfa/more-structs
piemonkey Feb 15, 2024
f8af509
fix translation-key for snippet loading message
elpoelma Feb 22, 2024
73a7b99
ad snippet-list-rdfa components to editable-nodes-regulatory-statemen…
elpoelma Feb 22, 2024
fe23e86
Migrate to pnpm (#390)
elpoelma Feb 23, 2024
7fa8a75
simplify label of template-comments
elpoelma Feb 12, 2024
1039dd3
Merge pull request #391 from lblod/feat/simpler-wording
elpoelma Feb 23, 2024
aa169b1
update to latest editor commit
elpoelma Feb 26, 2024
f537cac
add workaround for broken npm prepack behaviour
elpoelma Feb 26, 2024
f1d8bba
Merge branch 'feat/rdfa-editing-ui' into rdfa/blackbox-tests
elpoelma Feb 26, 2024
493ce3f
Merge pull request #388 from lblod/rdfa/blackbox-tests
elpoelma Feb 26, 2024
3262b3d
drop prepare script
elpoelma Feb 26, 2024
67a2c14
install editor using hosted tarball
elpoelma Feb 26, 2024
a420731
add tarball
elpoelma Feb 26, 2024
d23e0bb
ensure variables are node-selected after insertion
elpoelma Feb 27, 2024
94759da
GN-4729: Integrate structure start numbers work with RDFA branch
dkozickis Feb 28, 2024
c879935
GN-4729: Integrate structure start numbers work with RDFA branch
dkozickis Feb 29, 2024
8f942f2
introduce seperate replace-and-select command
elpoelma Feb 29, 2024
42c2333
GN-4729: Integrate structure start numbers work with RDFA branch
dkozickis Mar 1, 2024
f950b84
Merge pull request #393 from lblod/feat/rdfa-structure
dkozickis Mar 4, 2024
ef65588
Merge remote-tracking branch 'origin/master' into feat/rdfa-editing-ui
dkozickis Mar 4, 2024
99d01ed
Fix merge
dkozickis Mar 4, 2024
266b7f8
Merge branch 'feat/rdfa-editing-ui' into GN-4732-cursor-location-afte…
elpoelma Mar 7, 2024
442efd8
Merge pull request #392 from lblod/GN-4732-cursor-location-after-inse…
elpoelma Mar 8, 2024
4af84ec
drop tar.gz build
elpoelma Mar 11, 2024
99b660c
ci(woodpecker): add release-commit pipeline
elpoelma Mar 11, 2024
f2020d0
Merge branch 'master' into feat/rdfa-editing-ui
abeforgit Apr 4, 2024
3cc0097
Update editor to rdfa-backwards-compatibility build (#395)
elpoelma Apr 4, 2024
fbe6116
Allow to insert structure even if insertion range does not have RDFA …
dkozickis Apr 16, 2024
424040d
Pin `pnpm` version with `packageManager` field
dkozickis Apr 16, 2024
0fb03e9
Merge branch 'feat/rdfa-editing-ui' into allow-insert-structure
dkozickis Apr 16, 2024
792776c
Merge pull request #408 from lblod/allow-insert-structure
dkozickis Apr 17, 2024
2b3babf
Merge branch 'master' into feat/rdfa-editing-ui
piemonkey Apr 17, 2024
f473cdf
Improve types of variable plugin config
piemonkey Apr 17, 2024
dbd9b31
test(rdfa-blackbox-tests): skip structure title test for now
elpoelma Apr 23, 2024
2e6767b
fix functionality of location variable
elpoelma Apr 23, 2024
d1f8b6a
add correct rdfa-node-type to decision article node
elpoelma Apr 23, 2024
f038c90
merge decision dummy routes into one configurable route
elpoelma Apr 23, 2024
ca3db7a
remove obsolete editable-node dummy route
elpoelma Apr 23, 2024
06ca93f
merge regulatory-statement dummy routes into one configurable route
elpoelma Apr 23, 2024
227d018
fix ts errors
elpoelma Apr 23, 2024
5ef7157
Merge branch 'master' into feat/rdfa-editing-ui
elpoelma Apr 26, 2024
46eca30
Merge remote-tracking branch 'origin/master' into feat/rdfa-editing-ui
dkozickis Apr 29, 2024
847383d
Removal of redundant attributes and parse-rules from decision node-sp…
elpoelma Apr 29, 2024
36de6ef
Fix behaviour of rdfa-aware decision articles (#413)
elpoelma Apr 29, 2024
21e98fa
Adjust behaviour of decision nodes in terms of UX (#414)
elpoelma Apr 29, 2024
8cfa3eb
GN-4802: RDFa changeset (#420)
dkozickis Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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