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

KAS-4678: Update van rdfa-editor package naar meest recente versie #2141

Merged
merged 37 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dc6f626
KAS-4656 Save changes for a future PR (regarding the actual package u…
brenner-company May 15, 2024
cef53f6
Merge branch 'development' into DES/KAS-4656-analyzing-potential-rdfa…
brenner-company May 15, 2024
89e6270
Merge branch 'development' into DES/KAS-4656-analyzing-potential-rdfa…
brenner-company Jun 12, 2024
14bd75d
KAS-4678 Package update & changes to editor itself (part 1)
brenner-company Jun 12, 2024
660ed51
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Jun 17, 2024
db5452a
KAS-4678 Changes to editor itself & styling (part 2)
brenner-company Jun 17, 2024
2618813
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Jun 18, 2024
1686a1a
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Jun 23, 2024
1cbbfba
Merge branch 'development' of github.com:kanselarij-vlaanderen/fronte…
ValenberghsSven Jun 26, 2024
2a5a847
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Jul 1, 2024
a0a5b47
Merge branch 'DES/KAS-4741-cleanup-wu-legacy' into DES/KAS-4678-rdfa-…
brenner-company Jul 25, 2024
deedfd5
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Jul 31, 2024
723cfbf
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Aug 13, 2024
2c0c04b
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Aug 18, 2024
b647d25
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Aug 20, 2024
7f8146c
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Aug 27, 2024
e16205b
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Sep 2, 2024
92fee1f
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Sep 27, 2024
1a961ac
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Oct 8, 2024
c8b5c05
KAS-4678 Fix package-lock
brenner-company Oct 8, 2024
8397d79
Merge branch 'development' of github.com:kanselarij-vlaanderen/fronte…
ValenberghsSven Oct 16, 2024
1b20b3f
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Oct 22, 2024
6dc4731
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Nov 5, 2024
f9b76e3
KAS-4678 Another package update & (styling) changes to editor itself
brenner-company Nov 5, 2024
b317695
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Nov 5, 2024
55fef2f
tweaked styling for new rdfa editor
tdn Nov 5, 2024
5da0756
fix rdfa editor buttons no longer contain identifiable text
ValenberghsSven Nov 5, 2024
d5bb042
Merge branch 'DES/KAS-4678-rdfa-editor-package-update' of github.com:…
ValenberghsSven Nov 5, 2024
5139e60
KAS-4678 use sections everywhere for custom rdfa editor parts
ValenberghsSven Nov 6, 2024
0d6173a
KAS-4678 remove commented code
ValenberghsSven Nov 6, 2024
ea8ac40
fix html elements in wrong order
ValenberghsSven Nov 7, 2024
70e27a4
Merge branch 'development' into DES/KAS-4678-rdfa-editor-package-update
brenner-company Nov 11, 2024
ab39920
KAS-4678 Fix uneven and shifting column widths
brenner-company Nov 11, 2024
4cfbaa5
Merge branch 'DES/KAS-4678-rdfa-editor-package-update' into DES/KAS-4…
brenner-company Nov 11, 2024
72878ef
Merge pull request #2243 from kanselarij-vlaanderen/DES/KAS-4678-rdfa…
brenner-company Nov 11, 2024
93ae087
Merge branch 'development' of github.com:kanselarij-vlaanderen/fronte…
ValenberghsSven Nov 26, 2024
552c25a
Merge branch 'development' of github.com:kanselarij-vlaanderen/fronte…
ValenberghsSven Nov 26, 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
8 changes: 4 additions & 4 deletions app/components/agenda/agendaitem/send-to-vp-modal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<p>{{t "check-documents-to-be-sent-to-vp"}}</p>
<ul class="au-u-margin-top au-u-margin-left-none">
{{#each this.subcasesWithPieces as |subcaseWithPieces|}}
<li class="list-style-none">
<li class="au-c-content__list--no-style">
{{#if subcaseWithPieces.subcaseName}}
<p>
<strong class="auk-u-text-bold">
Expand All @@ -26,7 +26,7 @@
</p>
<ul class="au-u-margin-top-small au-u-margin-left-none">
{{#each subcaseWithPieces.pieces as |piece|}}
<li class="list-style-none">
<li class="au-c-content__list--no-style">
{{#if (this.isDisabled piece.accessLevel)}}
<AuCheckbox
@checked={{this.isSelected piece}}
Expand Down Expand Up @@ -64,15 +64,15 @@
</ul>
{{else}}
{{#each subcaseWithPieces.pieces as |piece|}}
<li class="list-style-none">
<li class="au-c-content__list--no-style">
{{#if (this.isDisabled piece.accessLevel)}}
<AuCheckbox
@checked={{this.isSelected piece}}
@onChange={{fn this.togglePieceSelection piece}}
@disabled={{true}}
>
<LinkTo
@route="document"
@route="document"
@model={{piece.id}}
disabled={{true}}
>
Expand Down
9 changes: 8 additions & 1 deletion app/components/sanitize-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { isPresent } from '@ember/utils';
const additionalAllowedTags = ['del'];
const additionalAllowedAttributes = {
'*': ['data-indentation-level'],
'ol': ['data-list-style'],
'ol': ['style', 'data-hierarchical', 'data-list-style'],
'li': ['data-list-marker'],
'table': [
{
name: 'id',
Expand All @@ -20,6 +21,11 @@ const additionalAllowedAttributes = {
},
],
};
const additionalAllowedStyles = {
'ol': {
'list-style-type': [/.*/]
}
}

export default class SanitizeHtmlComponent extends Component {
constructor() {
Expand All @@ -31,6 +37,7 @@ export default class SanitizeHtmlComponent extends Component {
const options = this.args.options || {};
options.allowedTags = isPresent(options.allowedTags) ? options.allowedTags : sanitizeHtml.defaults.allowedTags.concat(additionalAllowedTags); // add more tags to the default allowed tags
options.allowedAttributes = isPresent(options.allowedAttributes) ? options.allowedAttributes : assign(sanitizeHtml.defaults.allowedAttributes, additionalAllowedAttributes); // add more attributes to the default allowed attributes
options.allowedStyles = isPresent(options.allowedStyles) ? options.allowedStyles : assign(sanitizeHtml.defaults.allowedStyles, additionalAllowedStyles); // add more styles to the default allowed styles
const value = Array.isArray(this.args.value) ? this.args.value.join(' - ') : this.args.value || '';
return sanitizeHtml(value, options) || '';
}
Expand Down
60 changes: 30 additions & 30 deletions app/components/web-components/rdfa-editor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@
{{#if this.browserIsSupported}}
<EditorContainer>
<:top>
<Toolbar as |Tb|>
<Tb.Group>
<Plugins::History::Undo @controller={{this.controller}} />
<Plugins::History::Redo @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::Heading::HeadingMenu @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::TextStyle::Bold @controller={{this.controller}} />
<Plugins::TextStyle::Italic @controller={{this.controller}} />
<Plugins::TextStyle::Strikethrough
@controller={{this.controller}}
/>
<Plugins::TextStyle::Underline @controller={{this.controller}} />
<Plugins::TextStyle::Subscript @controller={{this.controller}} />
<Plugins::TextStyle::Superscript @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::Indentation::IndentationMenu @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::List::Unordered @controller={{this.controller}} />
<Plugins::List::Ordered @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::Table::TableMenu @controller={{this.controller}} />
</Tb.Group>
</Toolbar>
<ResponsiveToolbar>
<:main as |Tb|>
<Tb.Group>
<Plugins::History::Undo @controller={{this.controller}} />
<Plugins::History::Redo @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::Heading::HeadingMenu @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::TextStyle::Bold @controller={{this.controller}} />
<Plugins::TextStyle::Italic @controller={{this.controller}} />
<Plugins::TextStyle::Strikethrough @controller={{this.controller}} />
<Plugins::TextStyle::Underline @controller={{this.controller}} />
<Plugins::TextStyle::Subscript @controller={{this.controller}} />
<Plugins::TextStyle::Superscript @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::Indentation::IndentationMenu @controller={{this.controller}} />
</Tb.Group>
<Tb.Group>
<Plugins::List::Unordered @controller={{this.controller}} />
<Plugins::List::Ordered @controller={{this.controller}} @enableHierarchicalList={{true}} />
</Tb.Group>
<Tb.Group>
<Plugins::Table::TableMenu @controller={{this.controller}} />
</Tb.Group>
</:main>
</ResponsiveToolbar>
</:top>
<:default>
<Editor
@plugins={{this.plugins}}
@schema={{this.schema}}
@rdfaEditorInit={{this.onEditorInit}}
@plugins={{this.plugins}}
/>
</:default>
</EditorContainer>
Expand Down
81 changes: 39 additions & 42 deletions app/components/web-components/rdfa-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,37 @@ import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { isPresent } from '@ember/utils';

import { Schema } from '@lblod/ember-rdfa-editor';
import { Schema } from 'prosemirror-model';
import {
em,
strikethrough,
strong,
subscript,
superscript,
underline,
} from '@lblod/ember-rdfa-editor/plugins/text-style';
import {
block_rdfa,
doc,
hard_break,
invisible_rdfa,
paragraph,
repaired_block,
text,
} from '@lblod/ember-rdfa-editor/nodes';
import { inline_rdfa } from '@lblod/ember-rdfa-editor/marks';
import {
tableKeymap,
tableNodes,
tablePlugins,
} from '@lblod/ember-rdfa-editor/plugins/table';
import {
bulletListWithConfig,
listItemWithConfig,
listTrackingPlugin,
orderedListWithConfig,
} from '@lblod/ember-rdfa-editor/plugins/list';
import { heading } from '@lblod/ember-rdfa-editor/plugins/heading';

export const section_rdfa = {
content: 'block+',
Expand All @@ -27,44 +56,8 @@ export const section_rdfa = {
},
}

import {
block_rdfa,
doc,
hard_break,
invisible_rdfa,
paragraph,
repaired_block,
text,
} from '@lblod/ember-rdfa-editor/nodes';

import { inline_rdfa } from '@lblod/ember-rdfa-editor/marks';

import {
em,
strikethrough,
strong,
subscript,
superscript,
underline,
} from '@lblod/ember-rdfa-editor/plugins/text-style';

import {
tableKeymap,
tableNodes,
tablePlugin,
} from '@lblod/ember-rdfa-editor/plugins/table';

import {
bullet_list,
list_item,
ordered_list,
} from '@lblod/ember-rdfa-editor/plugins/list';

import { heading } from '@lblod/ember-rdfa-editor/plugins/heading';

export default class WebComponentsRdfaEditor extends Component {
@service userAgent;

@tracked controller;

get sizeClass() {
Expand All @@ -74,7 +67,11 @@ export default class WebComponentsRdfaEditor extends Component {
}

get plugins() {
return [tablePlugin, tableKeymap];
return [
listTrackingPlugin(),
...tablePlugins,
tableKeymap,
];
}

get browserName() {
Expand All @@ -100,9 +97,9 @@ export default class WebComponentsRdfaEditor extends Component {
paragraph,
section_rdfa,
repaired_block,
list_item,
ordered_list,
bullet_list,
list_item: listItemWithConfig({ enableHierarchicalList: true }),
ordered_list: orderedListWithConfig({ enableHierarchicalList: true }),
bullet_list: bulletListWithConfig({ enableHierarchicalList: true }),
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
heading,
text,
Expand Down
99 changes: 24 additions & 75 deletions app/styles/addon-overrides/_ember-rdfa-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Variables

$say-toolbar-background: var(--au-white);
// $say-toolbar-background: var(--au-white);
$say-editor-background: var(--au-white);
$say-editor-padding: 1rem;
$say-paper-min-height: 120rem;
Expand Down Expand Up @@ -32,6 +32,19 @@ $say-editor-border-radius: $au-input-border-radius;
@import 'ember-rdfa-editor/shame';


// Copy from ember-rdfa-editor package as we can't individually import this yet

ol > li[data-list-marker]::marker {
content: attr(data-list-marker);
font-variant-numeric: tabular-nums;
}

ol > *[data-content-container] > li[data-list-marker]::marker {
content: attr(data-list-marker);
font-variant-numeric: tabular-nums;
}


// Overrides

.say-container {
Expand All @@ -52,32 +65,6 @@ $say-editor-border-radius: $au-input-border-radius;
}
}

.say-toolbar {
border-bottom-color: $say-editor-border-color;
border-top-left-radius: $say-editor-border-radius;
border-top-right-radius: $say-editor-border-radius;
}

.say-toolbar__group {
padding-right: 0;
padding-left: 0;
}

.say-toolbar__button,
.say-dropdown__button {
&:focus {
outline-offset: -0.3rem;
}
}

.say-toolbar__button + .say-toolbar__button {
border-left-color: $say-editor-border-color;
}

.say-dropdown + .say-toolbar__button {
border-left: 0.1rem solid $say-editor-border-color;
}

.say-container__main {
border-bottom-right-radius: $say-editor-border-radius;
border-bottom-left-radius: $say-editor-border-radius;
Expand Down Expand Up @@ -123,60 +110,22 @@ $say-editor-border-radius: $au-input-border-radius;
@include au-font-size(1.8rem);
}

> * + * {
margin-top: 1.5rem;
}

> p + ul,
> p + ol {
margin-top: 0;
p:not(.say-hidden) + :is(ul, ol) {
margin-top: 0.2rem;
}

> ul[data-list-style='upper-alpha'] + p,
> ol[data-list-style='upper-alpha'] + p {
margin-top: 0;
}

ul,
ol {
padding-left: 5.8rem; // `margin-left: 2.8rem;` replaced by 3rem (default padding-left) + 2.8rem (default margin-left)

ul,
ol {
padding-left: 3.8rem;
}

&[data-list-style='upper-alpha'] {
padding-left: 2.9rem;

ol {
padding-left: 1.9rem;
}
ul, ol {
p:not(.say-hidden) + :is(ul, ol) {
margin-top: 0;
}
}

@mixin decimal-extended-styling($levels, $current-level: 1) {
padding-left: 0;

> li {
&:before {
@if $current-level == 1 {
min-width: 5.8rem;
} @else {
min-width: 3.8rem;
}
}

@if $current-level < $levels {
> ol:not([data-list-style]) {
@include decimal-extended-styling($levels, $current-level + 1);
}
}
}
}
ol[style*="upper-alpha"] {
padding-left: 2rem;

ol[data-list-style='decimal-extended'] {
@include decimal-extended-styling(5, 1);
ol[style*="upper-alpha"] {
padding-left: 3rem;
}
}
}

Expand Down
Loading