Skip to content

Commit

Permalink
Merge branch 'master' into internal/update-ember-data
Browse files Browse the repository at this point in the history
  • Loading branch information
elpoelma committed May 31, 2023
2 parents 2a988b8 + 86eaf63 commit e541156
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
16 changes: 14 additions & 2 deletions app/components/zitting-text-document-container.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
@property={{@type}}
@schema={{this.schema}}
@plugins={{this.plugins}}
@widgets={{this.widgets}}
@nodeViews={{this.nodeViews}}
/>
>
<:sidebar-collapsible>
<RdfaDatePlugin::Insert
@controller={{this.editor}}
@options={{this.config.date}}
/>
</:sidebar-collapsible>
<:sidebar>
<RdfaDatePlugin::Card
@controller={{this.editor}}
@options={{this.config.date}}
/>
</:sidebar>
</RdfaEditorContainer>
47 changes: 24 additions & 23 deletions app/components/zitting-text-document-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,14 @@ import { link, linkView } from '@lblod/ember-rdfa-editor/nodes/link';
import date from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/rdfa-date-plugin/nodes/date';

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

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

import {
rdfaDateCardWidget,
rdfaDateInsertWidget,
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/rdfa-date-plugin';
import { inject as service } from '@ember/service';
import { PLUGIN_CONFIGS } from '../config/constants';
import { linkPasteHandler } from '@lblod/ember-rdfa-editor/plugins/link';
import { tracked } from '@glimmer/tracking';

export default class ZittingTextDocumentContainerComponent extends Component {
@service intl;
profile = 'none';
editor;
@tracked editor;
type = this.args.type;

editorOptions = {
Expand All @@ -78,12 +71,7 @@ export default class ZittingTextDocumentContainerComponent extends Component {
bullet_list,
placeholder,
...tableNodes({ tableGroup: 'block', cellContent: 'block+' }),
date: date({
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
}),
date: date(this.config.date),
heading,
blockquote,
horizontal_rule,
Expand Down Expand Up @@ -142,21 +130,34 @@ export default class ZittingTextDocumentContainerComponent extends Component {
link: {
interactive: true,
},
date: {
placeholder: {
insertDate: this.intl.t('date-plugin.insert.date'),
insertDateTime: this.intl.t('date-plugin.insert.datetime'),
},
formats: [
{
label: this.intl.t('date-format.short-date'),
key: 'short',
dateFormat: 'dd/MM/yy',
dateTimeFormat: 'dd/MM/yy HH:mm',
},
{
label: this.intl.t('date-format.long-date'),
key: 'long',
dateFormat: 'EEEE dd MMMM yyyy',
dateTimeFormat: 'PPPPp',
},
],
allowCustomFormat: true,
},
};
}

get plugins() {
return [tablePlugin, tableKeymap, linkPasteHandler(this.schema.nodes.link)];
}

get widgets() {
return [
tableMenu,
rdfaDateCardWidget(PLUGIN_CONFIGS.date(this.intl)),
rdfaDateInsertWidget(PLUGIN_CONFIGS.date(this.intl)),
];
}

get nodeViews() {
return (controller) => {
return {
Expand Down

0 comments on commit e541156

Please sign in to comment.