@limetech/lime-elements 37.43.0 → 37.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +94 -56
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +2 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-a67fc927.js → translations-988a3f51.js} +55 -1
- package/dist/cjs/translations-988a3f51.js.map +1 -0
- package/dist/collection/components/input-field/input-field.css +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-items.js +19 -4
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-items.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +97 -51
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
- package/dist/collection/components/text-editor/text-editor.js +25 -1
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/collection/translations/da.js +9 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/en.js +9 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +9 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/nl.js +9 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +9 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +9 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js.map +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +94 -56
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-text-editor.entry.js +2 -1
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-cab6bc1e.js → translations-e73d7840.js} +55 -1
- package/dist/esm/translations-e73d7840.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-61f3a6ab.entry.js → p-16f7ddd0.entry.js} +2 -2
- package/dist/lime-elements/{p-e1641410.entry.js → p-25d2faff.entry.js} +2 -2
- package/dist/lime-elements/{p-50d01bf8.entry.js → p-2f453044.entry.js} +2 -2
- package/dist/lime-elements/p-2f453044.entry.js.map +1 -0
- package/dist/lime-elements/p-50a34fa3.entry.js +2 -0
- package/dist/lime-elements/p-50a34fa3.entry.js.map +1 -0
- package/dist/lime-elements/{p-cab2fc85.entry.js → p-7681dae8.entry.js} +2 -2
- package/dist/lime-elements/{p-24c69726.entry.js → p-ab13cb4a.entry.js} +2 -2
- package/dist/lime-elements/{p-6886036e.entry.js → p-c5f96fcd.entry.js} +2 -2
- package/dist/lime-elements/p-c5f96fcd.entry.js.map +1 -0
- package/dist/lime-elements/{p-1b10fc91.entry.js → p-c8ce7cd4.entry.js} +2 -2
- package/dist/lime-elements/p-cd6b9ff0.js +2 -0
- package/dist/lime-elements/p-cd6b9ff0.js.map +1 -0
- package/dist/lime-elements/{p-0b52bddf.entry.js → p-dfc28411.entry.js} +2 -2
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-items.d.ts +13 -2
- package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +15 -3
- package/dist/types/components/text-editor/text-editor.d.ts +5 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/translations/da.d.ts +9 -0
- package/dist/types/translations/en.d.ts +9 -0
- package/dist/types/translations/fi.d.ts +9 -0
- package/dist/types/translations/nl.d.ts +9 -0
- package/dist/types/translations/no.d.ts +9 -0
- package/dist/types/translations/sv.d.ts +9 -0
- package/package.json +1 -1
- package/dist/cjs/translations-a67fc927.js.map +0 -1
- package/dist/esm/translations-cab6bc1e.js.map +0 -1
- package/dist/lime-elements/p-00caa45f.js +0 -2
- package/dist/lime-elements/p-00caa45f.js.map +0 -1
- package/dist/lime-elements/p-11565c0e.entry.js +0 -2
- package/dist/lime-elements/p-11565c0e.entry.js.map +0 -1
- package/dist/lime-elements/p-50d01bf8.entry.js.map +0 -1
- package/dist/lime-elements/p-6886036e.entry.js.map +0 -1
- /package/dist/lime-elements/{p-61f3a6ab.entry.js.map → p-16f7ddd0.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e1641410.entry.js.map → p-25d2faff.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-cab2fc85.entry.js.map → p-7681dae8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-24c69726.entry.js.map → p-ab13cb4a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1b10fc91.entry.js.map → p-c8ce7cd4.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-0b52bddf.entry.js.map → p-dfc28411.entry.js.map} +0 -0
|
@@ -7,9 +7,10 @@ import { addListNodes } from 'prosemirror-schema-list';
|
|
|
7
7
|
import { exampleSetup } from 'prosemirror-example-setup';
|
|
8
8
|
import { keymap } from 'prosemirror-keymap';
|
|
9
9
|
import { MenuCommandFactory } from './menu/menu-commands';
|
|
10
|
-
import {
|
|
10
|
+
import { menuTranslationIDs, getTextEditorMenuItems } from './menu/menu-items';
|
|
11
11
|
import { markdownConverter } from '../utils/markdown-converter';
|
|
12
12
|
import { HTMLConverter } from '../utils/html-converter';
|
|
13
|
+
import translate from 'src/global/translations';
|
|
13
14
|
import { isItem } from 'src/components/action-bar/isItem';
|
|
14
15
|
import { cloneDeep } from 'lodash-es';
|
|
15
16
|
/**
|
|
@@ -23,53 +24,30 @@ import { cloneDeep } from 'lodash-es';
|
|
|
23
24
|
*/
|
|
24
25
|
export class ProsemirrorAdapter {
|
|
25
26
|
constructor() {
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (this.value) {
|
|
37
|
-
initialContentElement.innerHTML =
|
|
38
|
-
await this.contentConverter.parseAsHTML(this.value, schema);
|
|
39
|
-
}
|
|
40
|
-
const initialDoc = DOMParser.fromSchema(mySchema).parse(initialContentElement);
|
|
41
|
-
this.menuCommandFactory = new MenuCommandFactory(mySchema);
|
|
42
|
-
this.editorKeyMap = this.menuCommandFactory.buildKeymap();
|
|
43
|
-
const keymapPlugin = keymap(this.editorKeyMap);
|
|
44
|
-
this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
|
|
45
|
-
state: EditorState.create({
|
|
46
|
-
doc: initialDoc,
|
|
47
|
-
plugins: [
|
|
48
|
-
...exampleSetup({
|
|
49
|
-
schema: mySchema,
|
|
50
|
-
menuBar: false,
|
|
51
|
-
}),
|
|
52
|
-
keymapPlugin,
|
|
53
|
-
this.createMenuStateTrackingPlugin(this.actionBarItems),
|
|
54
|
-
],
|
|
55
|
-
}),
|
|
56
|
-
dispatchTransaction: (transaction) => {
|
|
57
|
-
const newState = this.view.state.apply(transaction);
|
|
58
|
-
this.view.updateState(newState);
|
|
59
|
-
this.change.emit(this.contentConverter.serialize(this.view, schema));
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
this.menuCommandFactory = new MenuCommandFactory(mySchema);
|
|
63
|
-
if (this.value) {
|
|
64
|
-
this.updateView(this.value);
|
|
27
|
+
this.getActionBarItems = () => {
|
|
28
|
+
this.actionBarItems = getTextEditorMenuItems().map(this.getTranslatedItem);
|
|
29
|
+
};
|
|
30
|
+
this.getTranslatedItem = (item) => {
|
|
31
|
+
const newItem = cloneDeep(item);
|
|
32
|
+
if (isItem(item)) {
|
|
33
|
+
const translationId = menuTranslationIDs[item.value];
|
|
34
|
+
if (translationId) {
|
|
35
|
+
newItem.text = translate.get(translationId, this.language);
|
|
36
|
+
}
|
|
65
37
|
}
|
|
38
|
+
return newItem;
|
|
39
|
+
};
|
|
40
|
+
this.handleTransaction = (transaction) => {
|
|
41
|
+
const newState = this.view.state.apply(transaction);
|
|
42
|
+
this.view.updateState(newState);
|
|
43
|
+
this.change.emit(this.contentConverter.serialize(this.view, this.schema));
|
|
66
44
|
};
|
|
67
45
|
this.handleActionBarItem = (event) => {
|
|
68
46
|
event.preventDefault();
|
|
69
47
|
const { value } = event.detail;
|
|
70
48
|
try {
|
|
71
49
|
const command = this.menuCommandFactory.getCommand(value);
|
|
72
|
-
this.
|
|
50
|
+
this.dispatchMenuCommand(command);
|
|
73
51
|
}
|
|
74
52
|
catch (error) {
|
|
75
53
|
throw new Error(`Error executing command: ${error}`);
|
|
@@ -103,29 +81,28 @@ export class ProsemirrorAdapter {
|
|
|
103
81
|
};
|
|
104
82
|
this.contentType = 'markdown';
|
|
105
83
|
this.value = undefined;
|
|
84
|
+
this.language = undefined;
|
|
106
85
|
this.view = undefined;
|
|
107
86
|
this.actionBarItems = [];
|
|
108
87
|
}
|
|
109
88
|
watchValue(newValue) {
|
|
110
89
|
if (!this.view ||
|
|
111
|
-
newValue === this.contentConverter.serialize(this.view, schema)) {
|
|
90
|
+
newValue === this.contentConverter.serialize(this.view, this.schema)) {
|
|
112
91
|
return;
|
|
113
92
|
}
|
|
114
93
|
this.updateView(newValue);
|
|
115
94
|
}
|
|
116
95
|
componentWillLoad() {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
else if (this.contentType === 'html') {
|
|
121
|
-
this.contentConverter = new HTMLConverter();
|
|
122
|
-
}
|
|
96
|
+
this.getActionBarItems();
|
|
97
|
+
this.setupContentConverter();
|
|
123
98
|
}
|
|
124
99
|
componentDidLoad() {
|
|
125
100
|
// Stencil complains loudly about triggering rerenders in
|
|
126
101
|
// componentDidLoad, but we have to, so we're using setTimeout to
|
|
127
102
|
// suppress the warning. /Ads
|
|
128
|
-
setTimeout(
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
this.initializeTextEditor();
|
|
105
|
+
}, 0);
|
|
129
106
|
}
|
|
130
107
|
render() {
|
|
131
108
|
return [
|
|
@@ -133,8 +110,55 @@ export class ProsemirrorAdapter {
|
|
|
133
110
|
h("limel-action-bar", { accessibleLabel: "Toolbar", actions: this.actionBarItems, onItemSelected: this.handleActionBarItem }),
|
|
134
111
|
];
|
|
135
112
|
}
|
|
113
|
+
setupContentConverter() {
|
|
114
|
+
/* eslint-disable multiline-ternary */
|
|
115
|
+
this.contentConverter =
|
|
116
|
+
this.contentType === 'markdown'
|
|
117
|
+
? new markdownConverter()
|
|
118
|
+
: new HTMLConverter();
|
|
119
|
+
/* eslint-enable multiline-ternary */
|
|
120
|
+
}
|
|
121
|
+
async initializeTextEditor() {
|
|
122
|
+
this.schema = this.initializeSchema();
|
|
123
|
+
const initialDoc = await this.parseInitialContent();
|
|
124
|
+
this.menuCommandFactory = new MenuCommandFactory(this.schema);
|
|
125
|
+
this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
|
|
126
|
+
state: this.createEditorState(initialDoc),
|
|
127
|
+
dispatchTransaction: this.handleTransaction,
|
|
128
|
+
});
|
|
129
|
+
if (this.value) {
|
|
130
|
+
this.updateView(this.value);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
initializeSchema() {
|
|
134
|
+
return new Schema({
|
|
135
|
+
nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block'),
|
|
136
|
+
marks: schema.spec.marks,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
async parseInitialContent() {
|
|
140
|
+
const initialContentElement = document.createElement('div');
|
|
141
|
+
if (this.value) {
|
|
142
|
+
initialContentElement.innerHTML =
|
|
143
|
+
await this.contentConverter.parseAsHTML(this.value, this.schema);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
initialContentElement.innerHTML = '<p></p>';
|
|
147
|
+
}
|
|
148
|
+
return DOMParser.fromSchema(this.schema).parse(initialContentElement);
|
|
149
|
+
}
|
|
150
|
+
createEditorState(initialDoc) {
|
|
151
|
+
return EditorState.create({
|
|
152
|
+
doc: initialDoc,
|
|
153
|
+
plugins: [
|
|
154
|
+
...exampleSetup({ schema: this.schema, menuBar: false }),
|
|
155
|
+
keymap(this.menuCommandFactory.buildKeymap()),
|
|
156
|
+
this.createMenuStateTrackingPlugin(this.actionBarItems),
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
}
|
|
136
160
|
async updateView(content) {
|
|
137
|
-
const html = await this.contentConverter.parseAsHTML(content, schema);
|
|
161
|
+
const html = await this.contentConverter.parseAsHTML(content, this.schema);
|
|
138
162
|
const prosemirrorDOMparser = DOMParser.fromSchema(this.view.state.schema);
|
|
139
163
|
const domParser = new window.DOMParser();
|
|
140
164
|
const doc = domParser.parseFromString(html, 'text/html');
|
|
@@ -143,7 +167,7 @@ export class ProsemirrorAdapter {
|
|
|
143
167
|
tr.replaceWith(0, tr.doc.content.size, prosemirrorDoc.content);
|
|
144
168
|
this.view.dispatch(tr);
|
|
145
169
|
}
|
|
146
|
-
|
|
170
|
+
dispatchMenuCommand(command) {
|
|
147
171
|
const { state } = this.view;
|
|
148
172
|
const selection = state.selection;
|
|
149
173
|
let transaction = state.tr;
|
|
@@ -208,6 +232,28 @@ export class ProsemirrorAdapter {
|
|
|
208
232
|
},
|
|
209
233
|
"attribute": "value",
|
|
210
234
|
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"language": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "Languages",
|
|
241
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
242
|
+
"references": {
|
|
243
|
+
"Languages": {
|
|
244
|
+
"location": "import",
|
|
245
|
+
"path": "../../date-picker/date.types"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"required": false,
|
|
250
|
+
"optional": false,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": "Defines the language for translations."
|
|
254
|
+
},
|
|
255
|
+
"attribute": "language",
|
|
256
|
+
"reflect": true
|
|
211
257
|
}
|
|
212
258
|
};
|
|
213
259
|
}
|
package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosemirror-adapter.js","sourceRoot":"","sources":["../../../../src/components/text-editor/prosemirror-adapter/prosemirror-adapter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,GACJ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,C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h,\n} from '@stencil/core';\nimport { EditorState, Plugin, PluginKey } from 'prosemirror-state';\nimport { EditorView } from 'prosemirror-view';\nimport { Schema, DOMParser } from 'prosemirror-model';\nimport { schema } from 'prosemirror-schema-basic';\nimport { addListNodes } from 'prosemirror-schema-list';\nimport { exampleSetup } from 'prosemirror-example-setup';\nimport { keymap } from 'prosemirror-keymap';\nimport { ActionBarItem } from 'src/components/action-bar/action-bar.types';\nimport { ListSeparator } from 'src/components/list/list-item.types';\nimport { CommandWithActive, MenuCommandFactory } from './menu/menu-commands';\nimport { textEditorMenuItems } from './menu/menu-items';\nimport { ContentTypeConverter } from '../utils/content-type-converter';\nimport { markdownConverter } from '../utils/markdown-converter';\nimport { HTMLConverter } from '../utils/html-converter';\nimport { EditorMenuTypes } from './menu/types';\nimport { isItem } from 'src/components/action-bar/isItem';\nimport { cloneDeep } from 'lodash-es';\n\n/**\n * The ProseMirror adapter offers a rich text editing experience with markdown support.\n * [Read more...](https://prosemirror.net/)\n *\n * @exampleComponent limel-example-prosemirror-adapter-basic\n * @exampleComponent limel-example-prosemirror-adapter-with-custom-menu\n * @beta\n * @private\n */\n@Component({\n tag: 'limel-prosemirror-adapter',\n shadow: true,\n styleUrl: 'prosemirror-adapter.scss',\n})\nexport class ProsemirrorAdapter {\n /**\n * The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * The value of the editor, expected to be markdown\n */\n @Prop()\n public value: string;\n\n @Element()\n private host: HTMLLimelTextEditorElement;\n\n @State()\n private view: EditorView;\n\n @State()\n private actionBarItems: Array<\n ActionBarItem<EditorMenuTypes> | ListSeparator\n > = [];\n\n private menuCommandFactory: MenuCommandFactory;\n private editorKeyMap = {};\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n private change: EventEmitter<string>;\n\n @Watch('value')\n protected watchValue(newValue: string) {\n if (\n !this.view ||\n newValue === this.contentConverter.serialize(this.view, schema)\n ) {\n return;\n }\n\n this.updateView(newValue);\n }\n\n private contentConverter: ContentTypeConverter;\n\n public componentWillLoad() {\n if (this.contentType === 'markdown') {\n this.contentConverter = new markdownConverter();\n } else if (this.contentType === 'html') {\n this.contentConverter = new HTMLConverter();\n }\n }\n\n public componentDidLoad() {\n // Stencil complains loudly about triggering rerenders in\n // componentDidLoad, but we have to, so we're using setTimeout to\n // suppress the warning. /Ads\n setTimeout(this.initializeTextEditor, 0);\n }\n\n public render() {\n return [\n <div id=\"editor\" />,\n <limel-action-bar\n accessibleLabel=\"Toolbar\"\n actions={this.actionBarItems}\n onItemSelected={this.handleActionBarItem}\n />,\n ];\n }\n\n private initializeTextEditor = async () => {\n this.actionBarItems = textEditorMenuItems;\n\n const mySchema = new Schema({\n nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block'),\n marks: schema.spec.marks,\n });\n\n // Parse initial content directly if 'value' is provided\n const initialContentElement = document.createElement('div');\n initialContentElement.innerHTML = '<p></p>';\n if (this.value) {\n initialContentElement.innerHTML =\n await this.contentConverter.parseAsHTML(this.value, schema);\n }\n\n const initialDoc = DOMParser.fromSchema(mySchema).parse(\n initialContentElement,\n );\n\n this.menuCommandFactory = new MenuCommandFactory(mySchema);\n\n this.editorKeyMap = this.menuCommandFactory.buildKeymap();\n\n const keymapPlugin = keymap(this.editorKeyMap);\n\n this.view = new EditorView(\n this.host.shadowRoot.querySelector('#editor'),\n {\n state: EditorState.create({\n doc: initialDoc,\n plugins: [\n ...exampleSetup({\n schema: mySchema,\n menuBar: false,\n }),\n keymapPlugin,\n this.createMenuStateTrackingPlugin(this.actionBarItems),\n ],\n }),\n dispatchTransaction: (transaction) => {\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n\n this.change.emit(\n this.contentConverter.serialize(this.view, schema),\n );\n },\n },\n );\n\n this.menuCommandFactory = new MenuCommandFactory(mySchema);\n\n if (this.value) {\n this.updateView(this.value);\n }\n };\n\n private async updateView(content: string) {\n const html = await this.contentConverter.parseAsHTML(content, schema);\n const prosemirrorDOMparser = DOMParser.fromSchema(\n this.view.state.schema,\n );\n const domParser = new window.DOMParser();\n const doc = domParser.parseFromString(html, 'text/html');\n const prosemirrorDoc = prosemirrorDOMparser.parse(doc.body);\n const tr = this.view.state.tr;\n tr.replaceWith(0, tr.doc.content.size, prosemirrorDoc.content);\n\n this.view.dispatch(tr);\n }\n\n private handleActionBarItem = (event: CustomEvent<ActionBarItem>) => {\n event.preventDefault();\n\n const { value } = event.detail;\n\n try {\n const command = this.menuCommandFactory.getCommand(value);\n this.executeCommand(command);\n } catch (error) {\n throw new Error(`Error executing command: ${error}`);\n }\n };\n\n private executeCommand(command) {\n const { state } = this.view;\n const selection = state.selection;\n\n let transaction = state.tr;\n\n if (!selection.empty) {\n transaction.setSelection(selection);\n }\n\n command(state, (tr) => {\n transaction = tr;\n });\n this.view.dispatch(transaction);\n\n this.setFocus();\n }\n\n public setFocus() {\n this.view?.focus();\n }\n\n actionBarPluginKey = new PluginKey('actionBarPlugin');\n\n private updateActionBarItems = (\n actionBarItems: Array<ActionBarItem<EditorMenuTypes> | ListSeparator>,\n view: EditorView,\n ) => {\n const updatedItems = cloneDeep(actionBarItems);\n updatedItems.forEach((item) => {\n if (isItem(item)) {\n const command: CommandWithActive =\n this.menuCommandFactory.getCommand(item.value);\n if (command && command.active) {\n item.selected = command.active(view.state);\n } else {\n item.selected = false;\n }\n }\n });\n this.actionBarItems = updatedItems;\n };\n\n private createMenuStateTrackingPlugin = (\n actionBarItems: Array<ActionBarItem<EditorMenuTypes> | ListSeparator>,\n ) => {\n return new Plugin({\n key: this.actionBarPluginKey,\n view: () => ({\n update: (view) => {\n this.updateActionBarItems(actionBarItems, view);\n },\n }),\n });\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"prosemirror-adapter.js","sourceRoot":"","sources":["../../../../src/components/text-editor/prosemirror-adapter/prosemirror-adapter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAA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,CAAC;IAC5D,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9B,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;EAC3B,CAAC;EAwBO,mBAAmB,CAAC,OAAO;IAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC;IAC3B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;MAClB,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;KACvC;IAED,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;MAClB,WAAW,GAAG,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;EACpB,CAAC;EAEM,QAAQ;;IACX,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,EAAE,CAAC;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { EditorState, Plugin, PluginKey } from 'prosemirror-state';\nimport { EditorView } from 'prosemirror-view';\nimport { Schema, DOMParser } from 'prosemirror-model';\nimport { schema } from 'prosemirror-schema-basic';\nimport { addListNodes } from 'prosemirror-schema-list';\nimport { exampleSetup } from 'prosemirror-example-setup';\nimport { keymap } from 'prosemirror-keymap';\nimport { ActionBarItem } from 'src/components/action-bar/action-bar.types';\nimport { ListSeparator } from 'src/components/list/list-item.types';\nimport { CommandWithActive, MenuCommandFactory } from './menu/menu-commands';\nimport { menuTranslationIDs, getTextEditorMenuItems } from './menu/menu-items';\nimport { ContentTypeConverter } from '../utils/content-type-converter';\nimport { markdownConverter } from '../utils/markdown-converter';\nimport { HTMLConverter } from '../utils/html-converter';\nimport { EditorMenuTypes } from './menu/types';\nimport translate from 'src/global/translations';\nimport { isItem } from 'src/components/action-bar/isItem';\nimport { cloneDeep } from 'lodash-es';\nimport { Languages } from '../../date-picker/date.types';\n\n/**\n * The ProseMirror adapter offers a rich text editing experience with markdown support.\n * [Read more...](https://prosemirror.net/)\n *\n * @exampleComponent limel-example-prosemirror-adapter-basic\n * @exampleComponent limel-example-prosemirror-adapter-with-custom-menu\n * @beta\n * @private\n */\n@Component({\n tag: 'limel-prosemirror-adapter',\n shadow: true,\n styleUrl: 'prosemirror-adapter.scss',\n})\nexport class ProsemirrorAdapter {\n /**\n * The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * The value of the editor, expected to be markdown\n */\n @Prop()\n public value: string;\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages;\n\n @Element()\n private host: HTMLLimelTextEditorElement;\n\n @State()\n private view: EditorView;\n\n @State()\n private actionBarItems: Array<\n ActionBarItem<EditorMenuTypes> | ListSeparator\n > = [];\n\n private menuCommandFactory: MenuCommandFactory;\n private schema: Schema;\n private contentConverter: ContentTypeConverter;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n private change: EventEmitter<string>;\n\n @Watch('value')\n protected watchValue(newValue: string) {\n if (\n !this.view ||\n newValue === this.contentConverter.serialize(this.view, this.schema)\n ) {\n return;\n }\n\n this.updateView(newValue);\n }\n\n public componentWillLoad() {\n this.getActionBarItems();\n this.setupContentConverter();\n }\n\n public componentDidLoad() {\n // Stencil complains loudly about triggering rerenders in\n // componentDidLoad, but we have to, so we're using setTimeout to\n // suppress the warning. /Ads\n setTimeout(() => {\n this.initializeTextEditor();\n }, 0);\n }\n\n public render() {\n return [\n <div id=\"editor\" />,\n <limel-action-bar\n accessibleLabel=\"Toolbar\"\n actions={this.actionBarItems}\n onItemSelected={this.handleActionBarItem}\n />,\n ];\n }\n\n private setupContentConverter() {\n /* eslint-disable multiline-ternary */\n this.contentConverter =\n this.contentType === 'markdown'\n ? new markdownConverter()\n : new HTMLConverter();\n /* eslint-enable multiline-ternary */\n }\n\n private getActionBarItems = () => {\n this.actionBarItems = getTextEditorMenuItems().map(\n this.getTranslatedItem,\n );\n };\n\n private getTranslatedItem = (item) => {\n const newItem = cloneDeep(item);\n\n if (isItem(item)) {\n const translationId = menuTranslationIDs[item.value];\n\n if (translationId) {\n newItem.text = translate.get(translationId, this.language);\n }\n }\n\n return newItem;\n };\n\n private async initializeTextEditor() {\n this.schema = this.initializeSchema();\n const initialDoc = await this.parseInitialContent();\n this.menuCommandFactory = new MenuCommandFactory(this.schema);\n this.view = new EditorView(\n this.host.shadowRoot.querySelector('#editor'),\n {\n state: this.createEditorState(initialDoc),\n dispatchTransaction: this.handleTransaction,\n },\n );\n if (this.value) {\n this.updateView(this.value);\n }\n }\n\n private initializeSchema() {\n return new Schema({\n nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block'),\n marks: schema.spec.marks,\n });\n }\n\n private async parseInitialContent() {\n const initialContentElement = document.createElement('div');\n\n if (this.value) {\n initialContentElement.innerHTML =\n await this.contentConverter.parseAsHTML(\n this.value,\n this.schema,\n );\n } else {\n initialContentElement.innerHTML = '<p></p>';\n }\n\n return DOMParser.fromSchema(this.schema).parse(initialContentElement);\n }\n\n private createEditorState(initialDoc) {\n return EditorState.create({\n doc: initialDoc,\n plugins: [\n ...exampleSetup({ schema: this.schema, menuBar: false }),\n keymap(this.menuCommandFactory.buildKeymap()),\n this.createMenuStateTrackingPlugin(this.actionBarItems),\n ],\n });\n }\n\n private async updateView(content: string) {\n const html = await this.contentConverter.parseAsHTML(\n content,\n this.schema,\n );\n const prosemirrorDOMparser = DOMParser.fromSchema(\n this.view.state.schema,\n );\n const domParser = new window.DOMParser();\n const doc = domParser.parseFromString(html, 'text/html');\n const prosemirrorDoc = prosemirrorDOMparser.parse(doc.body);\n const tr = this.view.state.tr;\n tr.replaceWith(0, tr.doc.content.size, prosemirrorDoc.content);\n this.view.dispatch(tr);\n }\n\n private handleTransaction = (transaction) => {\n const newState = this.view.state.apply(transaction);\n this.view.updateState(newState);\n this.change.emit(\n this.contentConverter.serialize(this.view, this.schema),\n );\n };\n\n private handleActionBarItem = (\n event: CustomEvent<ActionBarItem<EditorMenuTypes>>,\n ) => {\n event.preventDefault();\n const { value } = event.detail;\n\n try {\n const command = this.menuCommandFactory.getCommand(value);\n this.dispatchMenuCommand(command);\n } catch (error) {\n throw new Error(`Error executing command: ${error}`);\n }\n };\n\n private dispatchMenuCommand(command) {\n const { state } = this.view;\n const selection = state.selection;\n let transaction = state.tr;\n if (!selection.empty) {\n transaction.setSelection(selection);\n }\n\n command(state, (tr) => {\n transaction = tr;\n });\n this.view.dispatch(transaction);\n this.setFocus();\n }\n\n public setFocus() {\n this.view?.focus();\n }\n\n actionBarPluginKey = new PluginKey('actionBarPlugin');\n\n private updateActionBarItems = (\n actionBarItems: Array<ActionBarItem<EditorMenuTypes> | ListSeparator>,\n view: EditorView,\n ) => {\n const updatedItems = cloneDeep(actionBarItems);\n updatedItems.forEach((item) => {\n if (isItem(item)) {\n const command: CommandWithActive =\n this.menuCommandFactory.getCommand(item.value);\n if (command && command.active) {\n item.selected = command.active(view.state);\n } else {\n item.selected = false;\n }\n }\n });\n this.actionBarItems = updatedItems;\n };\n\n private createMenuStateTrackingPlugin = (\n actionBarItems: Array<ActionBarItem<EditorMenuTypes> | ListSeparator>,\n ) => {\n return new Plugin({\n key: this.actionBarPluginKey,\n view: () => ({\n update: (view) => {\n this.updateActionBarItems(actionBarItems, view);\n },\n }),\n });\n };\n}\n"]}
|
|
@@ -41,6 +41,7 @@ export class TextEditor {
|
|
|
41
41
|
this.change.emit(event.detail);
|
|
42
42
|
};
|
|
43
43
|
this.contentType = 'markdown';
|
|
44
|
+
this.language = 'en';
|
|
44
45
|
this.disabled = false;
|
|
45
46
|
this.readonly = false;
|
|
46
47
|
this.helperText = undefined;
|
|
@@ -73,7 +74,7 @@ export class TextEditor {
|
|
|
73
74
|
];
|
|
74
75
|
}
|
|
75
76
|
return [
|
|
76
|
-
h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : 0, "aria-disabled": this.disabled }),
|
|
77
|
+
h("limel-prosemirror-adapter", { "aria-placeholder": this.placeholder, contentType: this.contentType, onChange: this.handleChange, value: this.value, "aria-controls": this.helperTextId, id: this.editorId, tabindex: this.disabled ? -1 : 0, "aria-disabled": this.disabled, language: this.language }),
|
|
77
78
|
this.renderPlaceholder(),
|
|
78
79
|
this.renderHelperLine(),
|
|
79
80
|
];
|
|
@@ -122,6 +123,29 @@ export class TextEditor {
|
|
|
122
123
|
"reflect": false,
|
|
123
124
|
"defaultValue": "'markdown'"
|
|
124
125
|
},
|
|
126
|
+
"language": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "Languages",
|
|
131
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
132
|
+
"references": {
|
|
133
|
+
"Languages": {
|
|
134
|
+
"location": "import",
|
|
135
|
+
"path": "../date-picker/date.types"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Defines the language for translations."
|
|
144
|
+
},
|
|
145
|
+
"attribute": "language",
|
|
146
|
+
"reflect": true,
|
|
147
|
+
"defaultValue": "'en'"
|
|
148
|
+
},
|
|
125
149
|
"disabled": {
|
|
126
150
|
"type": "boolean",
|
|
127
151
|
"mutable": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-editor.js","sourceRoot":"","sources":["../../../src/components/text-editor/text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AAMH,MAAM,OAAO,UAAU;EA+FnB;IAmFQ,qBAAgB,GAAG,GAAG,EAAE;MAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAClB,OAAO;OACV;MAED,OAAO,CACH,yBACI,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,GAC3B,CACL,CAAC;IACN,CAAC,CAAC;IAEM,cAAS,GAAG,GAAG,EAAE;MACrB,IAAI,IAAI,CAAC,QAAQ,EAAE;QACf,yCAAyC;QACzC,OAAO,KAAK,CAAC;OAChB;MAED,IAAI,IAAI,CAAC,OAAO,EAAE;QACd,OAAO,IAAI,CA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AAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,mBACF,IAAI,CAAC,YAAY,EAChC,EAAE,EAAE,IAAI,CAAC,QAAQ,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBACjB,IAAI,CAAC,QAAQ,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACzB;MACF,IAAI,CAAC,iBAAiB,EAAE;MACxB,IAAI,CAAC,gBAAgB,EAAE;KAC1B,CAAC;EACN,CAAC;EAEO,WAAW;IACf,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;MACb,OAAO;KACV;IAED,OAAO,CACH,YAAM,KAAK,EAAC,OAAO;MACf,aAAO,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,KAAK,CAAS,CAChD,CACV,CAAC;EACN,CAAC;EAEO,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;MACjC,OAAO;KACV;IAED,OAAO,CACH,YAAM,KAAK,EAAC,aAAa,iBAAa,MAAM,IACvC,IAAI,CAAC,WAAW,CACd,CACV,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BJ","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { FormComponent } from '../form/form.types';\nimport { createRandomString } from 'src/util/random-string';\nimport { Languages } from '../date-picker/date.types';\n/**\n * A rich text editor that offers a rich text editing experience with markdown support,\n * in the sense that you can easily type markdown syntax and see the rendered\n * result as rich text in real-time. For instance, you can type `# Hello, world!`\n * and see it directly turning to a heading 1 (an `<h1>` HTML element).\n *\n * Naturally, you can use standard keyboard hotkeys such as <kbd>Ctrl</kbd> + <kbd>B</kbd>\n * to toggle bold text, <kbd>Ctrl</kbd> + <kbd>I</kbd> to toggle italic text, and so on.\n *\n * @exampleComponent limel-example-text-editor-basic\n * @exampleComponent limel-example-text-editor-as-form-component\n * @exampleComponent limel-example-text-editor-with-markdown\n * @exampleComponent limel-example-text-editor-with-html\n * @exampleComponent limel-example-text-editor-allow-resize\n * @exampleComponent limel-example-text-editor-size\n * @exampleComponent limel-example-text-editor-composite\n * @beta\n * @private\n */\n@Component({\n tag: 'limel-text-editor',\n shadow: true,\n styleUrl: 'text-editor.scss',\n})\nexport class TextEditor implements FormComponent<string> {\n /** The type of content that the editor should handle and emit, defaults to `markdown`\n *\n * Assumed to be set only once, so not reactive to changes\n */\n @Prop()\n public contentType: 'markdown' | 'html' = 'markdown';\n\n /**\n * Defines the language for translations.\n */\n @Prop({ reflect: true })\n public language: Languages = 'en';\n\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled?: boolean = false;\n\n /**\n * Set to `true` to make the component read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n * :::note\n * Consider that it might be better to use `limel-markdown`\n * instead of `limel-text-editor` when the goal is visualizing data.\n * :::\n */\n @Prop({ reflect: true })\n public readonly?: boolean = false;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText?: string;\n\n /**\n * The placeholder text shown inside the input field,\n * when the field is empty.\n */\n @Prop({ reflect: true })\n public placeholder?: string;\n\n /**\n * The label of the editor\n */\n @Prop({ reflect: true })\n public label?: string;\n\n /**\n * Set to `true` to indicate that the current value of the editor is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid?: boolean = false;\n\n /**\n * Description of the text inside the editor as markdown\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n *\n * :::important\n * An empty but required field is not automatically considered invalid.\n * You must make sure to check the validity of the field on your own,\n * and properly handle the `invalid` state.\n * :::\n */\n @Prop({ reflect: true })\n public required?: boolean = false;\n\n /**\n * Set to `true` to allow the user to vertically resize the editor.\n * Set to `false` to disable the resize functionality.\n */\n @Prop({ reflect: true })\n public allowResize: boolean = true;\n\n /**\n * Dispatched when a change is made to the editor\n */\n @Event()\n public change: EventEmitter<string>;\n\n private helperTextId: string;\n private editorId: string;\n\n public constructor() {\n this.helperTextId = createRandomString();\n this.editorId = createRandomString();\n }\n\n public render() {\n return (\n <Host\n class={{\n 'has-helper-text': !!this.helperText,\n }}\n >\n <span class=\"notched-outline\">\n <span class=\"leading-outline\" />\n {this.renderLabel()}\n <span class=\"trailing-outline\" />\n </span>\n {this.renderEditor()}\n </Host>\n );\n }\n\n private renderEditor() {\n if (this.readonly && !this.value) {\n return [\n <span class=\"lime-looks-like-input-value\">–</span>,\n this.renderHelperLine(),\n ];\n }\n\n if (this.readonly) {\n return [\n <limel-markdown\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n return [\n <limel-prosemirror-adapter\n aria-placeholder={this.placeholder}\n contentType={this.contentType}\n onChange={this.handleChange}\n value={this.value}\n aria-controls={this.helperTextId}\n id={this.editorId}\n tabindex={this.disabled ? -1 : 0}\n aria-disabled={this.disabled}\n language={this.language}\n />,\n this.renderPlaceholder(),\n this.renderHelperLine(),\n ];\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"notch\">\n <label htmlFor={this.editorId}>{this.label}</label>\n </span>\n );\n }\n\n private renderPlaceholder() {\n if (!this.placeholder || this.value) {\n return;\n }\n\n return (\n <span class=\"placeholder\" aria-hidden=\"true\">\n {this.placeholder}\n </span>\n );\n }\n\n private renderHelperLine = () => {\n if (!this.helperText) {\n return;\n }\n\n return (\n <limel-helper-line\n helperText={this.helperText}\n helperTextId={this.helperTextId}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n return true;\n }\n };\n\n private handleChange = () => (event: CustomEvent<string>) => {\n event.stopPropagation();\n this.change.emit(event.detail);\n };\n}\n"]}
|
|
@@ -17,5 +17,14 @@ export default {
|
|
|
17
17
|
'file-viewer.open-in-fullscreen': 'Åbn i fuld skærm',
|
|
18
18
|
'file-viewer.open-in-new-tab': 'Åbn i en ny fane',
|
|
19
19
|
'file-viewer.more-actions': 'Mere…',
|
|
20
|
+
'editor-menu.bold': 'Fed',
|
|
21
|
+
'editor-menu.italic': 'Kursiv',
|
|
22
|
+
'editor-menu.h1': 'Overskrift 1',
|
|
23
|
+
'editor-menu.h2': 'Overskrift 2',
|
|
24
|
+
'editor-menu.h3': 'Overskrift 3',
|
|
25
|
+
'editor-menu.bulleted-list': 'Punktliste',
|
|
26
|
+
'editor-menu.numbered-list': 'Nummereret liste',
|
|
27
|
+
'editor-menu.blockquote': 'Blokcitat',
|
|
28
|
+
'editor-menu.link': 'Tilføj link',
|
|
20
29
|
};
|
|
21
30
|
//# sourceMappingURL=da.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"da.js","sourceRoot":"","sources":["../../src/translations/da.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,OAAO;EACf,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,UAAU;EAChC,yBAAyB,EACrB,qDAAqD;EACzD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,MAAM;EAC9B,6BAA6B,EAAE,kBAAkB;EACjD,gCAAgC,EAAE,kBAAkB;EACpD,6BAA6B,EAAE,kBAAkB;EACjD,0BAA0B,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"da.js","sourceRoot":"","sources":["../../src/translations/da.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,OAAO;EACf,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,UAAU;EAChC,yBAAyB,EACrB,qDAAqD;EACzD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,MAAM;EAC9B,6BAA6B,EAAE,kBAAkB;EACjD,gCAAgC,EAAE,kBAAkB;EACpD,6BAA6B,EAAE,kBAAkB;EACjD,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,kBAAkB;EAC/C,wBAAwB,EAAE,WAAW;EACrC,kBAAkB,EAAE,aAAa;CACpC,CAAC","sourcesContent":["export default {\n remove: 'Fjern',\n 'callout.note': 'Bemærk',\n 'callout.important': 'Vigtig',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Advarsel',\n 'callout.warning': 'Advarsel',\n 'date-picker.today': 'Idag',\n 'date-picker.month.heading': 'Måned',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Ryd alle',\n 'file.drag-and-drop-tips':\n 'Træk og slip filen her, eller klik for at gennemse.',\n 'file-viewer.message.unsupported-filetype': 'Denne fil kan ikke vises!',\n 'file-viewer.download': 'Hent',\n 'file-viewer.exit-fullscreen': 'Afslut fuldskærm',\n 'file-viewer.open-in-fullscreen': 'Åbn i fuld skærm',\n 'file-viewer.open-in-new-tab': 'Åbn i en ny fane',\n 'file-viewer.more-actions': 'Mere…',\n 'editor-menu.bold': 'Fed',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.h1': 'Overskrift 1',\n 'editor-menu.h2': 'Overskrift 2',\n 'editor-menu.h3': 'Overskrift 3',\n 'editor-menu.bulleted-list': 'Punktliste',\n 'editor-menu.numbered-list': 'Nummereret liste',\n 'editor-menu.blockquote': 'Blokcitat',\n 'editor-menu.link': 'Tilføj link',\n};\n"]}
|
|
@@ -18,5 +18,14 @@ export default {
|
|
|
18
18
|
'file-viewer.open-in-fullscreen': 'Open in fullscreen',
|
|
19
19
|
'file-viewer.open-in-new-tab': 'Open in a new tab',
|
|
20
20
|
'file-viewer.more-actions': 'More…',
|
|
21
|
+
'editor-menu.bold': 'Bold',
|
|
22
|
+
'editor-menu.italic': 'Italic',
|
|
23
|
+
'editor-menu.h1': 'Heading 1',
|
|
24
|
+
'editor-menu.h2': 'Heading 2',
|
|
25
|
+
'editor-menu.h3': 'Heading 3',
|
|
26
|
+
'editor-menu.bulleted-list': 'Bulleted list',
|
|
27
|
+
'editor-menu.numbered-list': 'Numbered list',
|
|
28
|
+
'editor-menu.blockquote': 'Blockquote',
|
|
29
|
+
'editor-menu.link': 'Link',
|
|
21
30
|
};
|
|
22
31
|
//# sourceMappingURL=en.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/translations/en.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,MAAM;EACtB,mBAAmB,EAAE,WAAW;EAChC,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,SAAS;EAC5B,iBAAiB,EAAE,SAAS;EAC5B,mBAAmB,EAAE,OAAO;EAC5B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,MAAM;EAClC,oBAAoB,EAAE,WAAW;EACjC,kBAAkB,EAAE,SAAS;EAC7B,yBAAyB,EACrB,mDAAmD;EACvD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,UAAU;EAClC,6BAA6B,EAAE,iBAAiB;EAChD,gCAAgC,EAAE,oBAAoB;EACtD,6BAA6B,EAAE,mBAAmB;EAClD,0BAA0B,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/translations/en.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,MAAM;EACtB,mBAAmB,EAAE,WAAW;EAChC,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,SAAS;EAC5B,iBAAiB,EAAE,SAAS;EAC5B,mBAAmB,EAAE,OAAO;EAC5B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,MAAM;EAClC,oBAAoB,EAAE,WAAW;EACjC,kBAAkB,EAAE,SAAS;EAC7B,yBAAyB,EACrB,mDAAmD;EACvD,0CAA0C,EAAE,2BAA2B;EACvE,sBAAsB,EAAE,UAAU;EAClC,6BAA6B,EAAE,iBAAiB;EAChD,gCAAgC,EAAE,oBAAoB;EACtD,6BAA6B,EAAE,mBAAmB;EAClD,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,MAAM;EAC1B,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,WAAW;EAC7B,gBAAgB,EAAE,WAAW;EAC7B,gBAAgB,EAAE,WAAW;EAC7B,2BAA2B,EAAE,eAAe;EAC5C,2BAA2B,EAAE,eAAe;EAC5C,wBAAwB,EAAE,YAAY;EACtC,kBAAkB,EAAE,MAAM;CAC7B,CAAC","sourcesContent":["export default {\n remove: 'Remove',\n 'callout.note': 'Note',\n 'callout.important': 'Important',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Caution',\n 'callout.warning': 'Warning',\n 'date-picker.today': 'Today',\n 'date-picker.month.heading': 'Month',\n 'date-picker.quarter.heading': 'Quarter',\n 'date-picker.year.heading': 'Year',\n 'chip-set.clear-all': 'Clear all',\n 'snackbar.dismiss': 'Dismiss',\n 'file.drag-and-drop-tips':\n 'Drag and drop your file here, or click to browse.',\n 'file-viewer.message.unsupported-filetype': 'Cannot display this file!',\n 'file-viewer.download': 'Download',\n 'file-viewer.exit-fullscreen': 'Exit fullscreen',\n 'file-viewer.open-in-fullscreen': 'Open in fullscreen',\n 'file-viewer.open-in-new-tab': 'Open in a new tab',\n 'file-viewer.more-actions': 'More…',\n 'editor-menu.bold': 'Bold',\n 'editor-menu.italic': 'Italic',\n 'editor-menu.h1': 'Heading 1',\n 'editor-menu.h2': 'Heading 2',\n 'editor-menu.h3': 'Heading 3',\n 'editor-menu.bulleted-list': 'Bulleted list',\n 'editor-menu.numbered-list': 'Numbered list',\n 'editor-menu.blockquote': 'Blockquote',\n 'editor-menu.link': 'Link',\n};\n"]}
|
|
@@ -17,5 +17,14 @@ export default {
|
|
|
17
17
|
'file-viewer.open-in-fullscreen': 'Avaa koko näytössä',
|
|
18
18
|
'file-viewer.open-in-new-tab': 'Avaa uudella välilehdellä',
|
|
19
19
|
'file-viewer.more-actions': 'Lisää…',
|
|
20
|
+
'editor-menu.bold': 'Lihavoitu',
|
|
21
|
+
'editor-menu.italic': 'Kursivoitu',
|
|
22
|
+
'editor-menu.h1': 'Otsikkotaso 1',
|
|
23
|
+
'editor-menu.h2': 'Otsikkotaso 2',
|
|
24
|
+
'editor-menu.h3': 'Otsikkotaso 3',
|
|
25
|
+
'editor-menu.bulleted-list': 'Luettelomerkitty lista',
|
|
26
|
+
'editor-menu.numbered-list': 'Numeroitu lista',
|
|
27
|
+
'editor-menu.blockquote': 'Lohkoteksti',
|
|
28
|
+
'editor-menu.link': 'Lisää linkki',
|
|
20
29
|
};
|
|
21
30
|
//# sourceMappingURL=fi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fi.js","sourceRoot":"","sources":["../../src/translations/fi.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,SAAS;EAC9B,aAAa,EAAE,QAAQ;EACvB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,QAAQ;EAC7B,2BAA2B,EAAE,UAAU;EACvC,6BAA6B,EAAE,gBAAgB;EAC/C,0BAA0B,EAAE,OAAO;EACnC,oBAAoB,EAAE,iBAAiB;EACvC,yBAAyB,EACrB,4DAA4D;EAChE,0CAA0C,EACtC,gCAAgC;EACpC,sBAAsB,EAAE,QAAQ;EAChC,6BAA6B,EAAE,sBAAsB;EACrD,gCAAgC,EAAE,oBAAoB;EACtD,6BAA6B,EAAE,2BAA2B;EAC1D,0BAA0B,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"fi.js","sourceRoot":"","sources":["../../src/translations/fi.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,QAAQ;EACxB,mBAAmB,EAAE,SAAS;EAC9B,aAAa,EAAE,QAAQ;EACvB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,QAAQ;EAC7B,2BAA2B,EAAE,UAAU;EACvC,6BAA6B,EAAE,gBAAgB;EAC/C,0BAA0B,EAAE,OAAO;EACnC,oBAAoB,EAAE,iBAAiB;EACvC,yBAAyB,EACrB,4DAA4D;EAChE,0CAA0C,EACtC,gCAAgC;EACpC,sBAAsB,EAAE,QAAQ;EAChC,6BAA6B,EAAE,sBAAsB;EACrD,gCAAgC,EAAE,oBAAoB;EACtD,6BAA6B,EAAE,2BAA2B;EAC1D,0BAA0B,EAAE,QAAQ;EACpC,kBAAkB,EAAE,WAAW;EAC/B,oBAAoB,EAAE,YAAY;EAClC,gBAAgB,EAAE,eAAe;EACjC,gBAAgB,EAAE,eAAe;EACjC,gBAAgB,EAAE,eAAe;EACjC,2BAA2B,EAAE,wBAAwB;EACrD,2BAA2B,EAAE,iBAAiB;EAC9C,wBAAwB,EAAE,aAAa;EACvC,kBAAkB,EAAE,cAAc;CACrC,CAAC","sourcesContent":["export default {\n remove: 'Poista',\n 'callout.note': 'Huomio',\n 'callout.important': 'Tärkeää',\n 'callout.tip': 'Vinkki',\n 'callout.caution': 'Varoitus',\n 'callout.warning': 'Varoitus',\n 'date-picker.today': 'Tänään',\n 'date-picker.month.heading': 'Kuukausi',\n 'date-picker.quarter.heading': 'Vuosineljännes',\n 'date-picker.year.heading': 'Vuosi',\n 'chip-set.clear-all': 'Tyhjennä kaikki',\n 'file.drag-and-drop-tips':\n 'Vedä ja pudota tiedostosi tähän, tai napsauta selataksesi.',\n 'file-viewer.message.unsupported-filetype':\n 'Tätä tiedostoa ei voi näyttää!',\n 'file-viewer.download': 'Ladata',\n 'file-viewer.exit-fullscreen': 'Poistu koko näytöstä',\n 'file-viewer.open-in-fullscreen': 'Avaa koko näytössä',\n 'file-viewer.open-in-new-tab': 'Avaa uudella välilehdellä',\n 'file-viewer.more-actions': 'Lisää…',\n 'editor-menu.bold': 'Lihavoitu',\n 'editor-menu.italic': 'Kursivoitu',\n 'editor-menu.h1': 'Otsikkotaso 1',\n 'editor-menu.h2': 'Otsikkotaso 2',\n 'editor-menu.h3': 'Otsikkotaso 3',\n 'editor-menu.bulleted-list': 'Luettelomerkitty lista',\n 'editor-menu.numbered-list': 'Numeroitu lista',\n 'editor-menu.blockquote': 'Lohkoteksti',\n 'editor-menu.link': 'Lisää linkki',\n};\n"]}
|
|
@@ -17,5 +17,14 @@ export default {
|
|
|
17
17
|
'file-viewer.open-in-fullscreen': 'Open in volledig scherm',
|
|
18
18
|
'file-viewer.open-in-new-tab': 'Openen op een nieuw tabblad',
|
|
19
19
|
'file-viewer.more-actions': 'Meer…',
|
|
20
|
+
'editor-menu.bold': 'Vet',
|
|
21
|
+
'editor-menu.italic': 'Cursief',
|
|
22
|
+
'editor-menu.h1': 'Kopniveau 1',
|
|
23
|
+
'editor-menu.h2': 'Kopniveau 2',
|
|
24
|
+
'editor-menu.h3': 'Kopniveau 3',
|
|
25
|
+
'editor-menu.bulleted-list': 'Opsomming',
|
|
26
|
+
'editor-menu.numbered-list': 'Genummerde lijst',
|
|
27
|
+
'editor-menu.blockquote': 'Blokcitaat',
|
|
28
|
+
'editor-menu.link': 'Link toevoegen',
|
|
20
29
|
};
|
|
21
30
|
//# sourceMappingURL=nl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../src/translations/nl.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,WAAW;EACnB,cAAc,EAAE,WAAW;EAC3B,mBAAmB,EAAE,YAAY;EACjC,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,cAAc;EACjC,iBAAiB,EAAE,cAAc;EACjC,mBAAmB,EAAE,SAAS;EAC9B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,UAAU;EACzC,0BAA0B,EAAE,MAAM;EAClC,oBAAoB,EAAE,cAAc;EACpC,yBAAyB,EACrB,+DAA+D;EACnE,0CAA0C,EACtC,iCAAiC;EACrC,sBAAsB,EAAE,YAAY;EACpC,6BAA6B,EAAE,yBAAyB;EACxD,gCAAgC,EAAE,yBAAyB;EAC3D,6BAA6B,EAAE,6BAA6B;EAC5D,0BAA0B,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"nl.js","sourceRoot":"","sources":["../../src/translations/nl.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,WAAW;EACnB,cAAc,EAAE,WAAW;EAC3B,mBAAmB,EAAE,YAAY;EACjC,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,cAAc;EACjC,iBAAiB,EAAE,cAAc;EACjC,mBAAmB,EAAE,SAAS;EAC9B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,UAAU;EACzC,0BAA0B,EAAE,MAAM;EAClC,oBAAoB,EAAE,cAAc;EACpC,yBAAyB,EACrB,+DAA+D;EACnE,0CAA0C,EACtC,iCAAiC;EACrC,sBAAsB,EAAE,YAAY;EACpC,6BAA6B,EAAE,yBAAyB;EACxD,gCAAgC,EAAE,yBAAyB;EAC3D,6BAA6B,EAAE,6BAA6B;EAC5D,0BAA0B,EAAE,OAAO;EACnC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,SAAS;EAC/B,gBAAgB,EAAE,aAAa;EAC/B,gBAAgB,EAAE,aAAa;EAC/B,gBAAgB,EAAE,aAAa;EAC/B,2BAA2B,EAAE,WAAW;EACxC,2BAA2B,EAAE,kBAAkB;EAC/C,wBAAwB,EAAE,YAAY;EACtC,kBAAkB,EAAE,gBAAgB;CACvC,CAAC","sourcesContent":["export default {\n remove: 'Verwijder',\n 'callout.note': 'Opmerking',\n 'callout.important': 'Belangrijk',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Waarschuwing',\n 'callout.warning': 'Waarschuwing',\n 'date-picker.today': 'Vandaag',\n 'date-picker.month.heading': 'Maand',\n 'date-picker.quarter.heading': 'Kwartaal',\n 'date-picker.year.heading': 'Jaar',\n 'chip-set.clear-all': 'Alles wissen',\n 'file.drag-and-drop-tips':\n 'Sleep uw bestand en zet het hier neer of klik om te bladeren.',\n 'file-viewer.message.unsupported-filetype':\n 'Kan dit bestand niet weergeven!',\n 'file-viewer.download': 'Downloaden',\n 'file-viewer.exit-fullscreen': 'Verlaat volledig scherm',\n 'file-viewer.open-in-fullscreen': 'Open in volledig scherm',\n 'file-viewer.open-in-new-tab': 'Openen op een nieuw tabblad',\n 'file-viewer.more-actions': 'Meer…',\n 'editor-menu.bold': 'Vet',\n 'editor-menu.italic': 'Cursief',\n 'editor-menu.h1': 'Kopniveau 1',\n 'editor-menu.h2': 'Kopniveau 2',\n 'editor-menu.h3': 'Kopniveau 3',\n 'editor-menu.bulleted-list': 'Opsomming',\n 'editor-menu.numbered-list': 'Genummerde lijst',\n 'editor-menu.blockquote': 'Blokcitaat',\n 'editor-menu.link': 'Link toevoegen',\n};\n"]}
|
|
@@ -17,5 +17,14 @@ export default {
|
|
|
17
17
|
'file-viewer.open-in-fullscreen': 'Åpne i fullskjerm',
|
|
18
18
|
'file-viewer.open-in-new-tab': 'Åpne i en ny fane',
|
|
19
19
|
'file-viewer.more-actions': 'Mer…',
|
|
20
|
+
'editor-menu.bold': 'Fet',
|
|
21
|
+
'editor-menu.italic': 'Kursiv',
|
|
22
|
+
'editor-menu.h1': 'Overskrift 1',
|
|
23
|
+
'editor-menu.h2': 'Overskrift 2',
|
|
24
|
+
'editor-menu.h3': 'Overskrifts 3',
|
|
25
|
+
'editor-menu.bulleted-list': 'Punktliste',
|
|
26
|
+
'editor-menu.numbered-list': 'Nummerert liste',
|
|
27
|
+
'editor-menu.blockquote': 'Blokksitat',
|
|
28
|
+
'editor-menu.link': 'Legg til lenke',
|
|
20
29
|
};
|
|
21
30
|
//# sourceMappingURL=no.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no.js","sourceRoot":"","sources":["../../src/translations/no.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,MAAM;EACtB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,OAAO;EAC5B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,YAAY;EAClC,yBAAyB,EACrB,wDAAwD;EAC5D,0CAA0C,EAAE,4BAA4B;EACxE,sBAAsB,EAAE,YAAY;EACpC,6BAA6B,EAAE,qBAAqB;EACpD,gCAAgC,EAAE,mBAAmB;EACrD,6BAA6B,EAAE,mBAAmB;EAClD,0BAA0B,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"no.js","sourceRoot":"","sources":["../../src/translations/no.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,QAAQ;EAChB,cAAc,EAAE,MAAM;EACtB,mBAAmB,EAAE,QAAQ;EAC7B,aAAa,EAAE,KAAK;EACpB,iBAAiB,EAAE,UAAU;EAC7B,iBAAiB,EAAE,UAAU;EAC7B,mBAAmB,EAAE,OAAO;EAC5B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,YAAY;EAClC,yBAAyB,EACrB,wDAAwD;EAC5D,0CAA0C,EAAE,4BAA4B;EACxE,sBAAsB,EAAE,YAAY;EACpC,6BAA6B,EAAE,qBAAqB;EACpD,gCAAgC,EAAE,mBAAmB;EACrD,6BAA6B,EAAE,mBAAmB;EAClD,0BAA0B,EAAE,MAAM;EAClC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,cAAc;EAChC,gBAAgB,EAAE,eAAe;EACjC,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,iBAAiB;EAC9C,wBAAwB,EAAE,YAAY;EACtC,kBAAkB,EAAE,gBAAgB;CACvC,CAAC","sourcesContent":["export default {\n remove: 'Fjerne',\n 'callout.note': 'Note',\n 'callout.important': 'Viktig',\n 'callout.tip': 'Tip',\n 'callout.caution': 'Advarsel',\n 'callout.warning': 'Advarsel',\n 'date-picker.today': 'I dag',\n 'date-picker.month.heading': 'Måned',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Fjern alle',\n 'file.drag-and-drop-tips':\n 'Dra og slipp filen her, eller klikk for å bla gjennom.',\n 'file-viewer.message.unsupported-filetype': 'Kan ikke vise denne filen!',\n 'file-viewer.download': 'Nedlasting',\n 'file-viewer.exit-fullscreen': 'Gå ut av fullskjerm',\n 'file-viewer.open-in-fullscreen': 'Åpne i fullskjerm',\n 'file-viewer.open-in-new-tab': 'Åpne i en ny fane',\n 'file-viewer.more-actions': 'Mer…',\n 'editor-menu.bold': 'Fet',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.h1': 'Overskrift 1',\n 'editor-menu.h2': 'Overskrift 2',\n 'editor-menu.h3': 'Overskrifts 3',\n 'editor-menu.bulleted-list': 'Punktliste',\n 'editor-menu.numbered-list': 'Nummerert liste',\n 'editor-menu.blockquote': 'Blokksitat',\n 'editor-menu.link': 'Legg til lenke',\n};\n"]}
|
|
@@ -18,5 +18,14 @@ export default {
|
|
|
18
18
|
'file-viewer.open-in-fullscreen': 'Öppna i fullskärmsläge',
|
|
19
19
|
'file-viewer.open-in-new-tab': 'Öppna i ny flik',
|
|
20
20
|
'file-viewer.more-actions': 'Mer…',
|
|
21
|
+
'editor-menu.bold': 'Fet',
|
|
22
|
+
'editor-menu.italic': 'Kursiv',
|
|
23
|
+
'editor-menu.h1': 'Rubrik 1',
|
|
24
|
+
'editor-menu.h2': 'Rubrik 2',
|
|
25
|
+
'editor-menu.h3': 'Rubrik 3',
|
|
26
|
+
'editor-menu.bulleted-list': 'Punktlista',
|
|
27
|
+
'editor-menu.numbered-list': 'Numrerad lista',
|
|
28
|
+
'editor-menu.blockquote': 'Blockcitat',
|
|
29
|
+
'editor-menu.link': 'Lägg till länk',
|
|
21
30
|
};
|
|
22
31
|
//# sourceMappingURL=sv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sv.js","sourceRoot":"","sources":["../../src/translations/sv.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,SAAS;EACjB,cAAc,EAAE,KAAK;EACrB,mBAAmB,EAAE,SAAS;EAC9B,aAAa,EAAE,MAAM;EACrB,iBAAiB,EAAE,SAAS;EAC5B,iBAAiB,EAAE,SAAS;EAC5B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,YAAY;EAClC,kBAAkB,EAAE,OAAO;EAC3B,yBAAyB,EACrB,0DAA0D;EAC9D,0CAA0C,EAAE,8BAA8B;EAC1E,sBAAsB,EAAE,WAAW;EACnC,6BAA6B,EAAE,wBAAwB;EACvD,gCAAgC,EAAE,wBAAwB;EAC1D,6BAA6B,EAAE,iBAAiB;EAChD,0BAA0B,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"sv.js","sourceRoot":"","sources":["../../src/translations/sv.ts"],"names":[],"mappings":"AAAA,eAAe;EACX,MAAM,EAAE,SAAS;EACjB,cAAc,EAAE,KAAK;EACrB,mBAAmB,EAAE,SAAS;EAC9B,aAAa,EAAE,MAAM;EACrB,iBAAiB,EAAE,SAAS;EAC5B,iBAAiB,EAAE,SAAS;EAC5B,mBAAmB,EAAE,MAAM;EAC3B,2BAA2B,EAAE,OAAO;EACpC,6BAA6B,EAAE,SAAS;EACxC,0BAA0B,EAAE,IAAI;EAChC,oBAAoB,EAAE,YAAY;EAClC,kBAAkB,EAAE,OAAO;EAC3B,yBAAyB,EACrB,0DAA0D;EAC9D,0CAA0C,EAAE,8BAA8B;EAC1E,sBAAsB,EAAE,WAAW;EACnC,6BAA6B,EAAE,wBAAwB;EACvD,gCAAgC,EAAE,wBAAwB;EAC1D,6BAA6B,EAAE,iBAAiB;EAChD,0BAA0B,EAAE,MAAM;EAClC,kBAAkB,EAAE,KAAK;EACzB,oBAAoB,EAAE,QAAQ;EAC9B,gBAAgB,EAAE,UAAU;EAC5B,gBAAgB,EAAE,UAAU;EAC5B,gBAAgB,EAAE,UAAU;EAC5B,2BAA2B,EAAE,YAAY;EACzC,2BAA2B,EAAE,gBAAgB;EAC7C,wBAAwB,EAAE,YAAY;EACtC,kBAAkB,EAAE,gBAAgB;CACvC,CAAC","sourcesContent":["export default {\n remove: 'Ta bort',\n 'callout.note': 'Obs',\n 'callout.important': 'Viktigt',\n 'callout.tip': 'Tips',\n 'callout.caution': 'Varning',\n 'callout.warning': 'Varning',\n 'date-picker.today': 'Idag',\n 'date-picker.month.heading': 'Månad',\n 'date-picker.quarter.heading': 'Kvartal',\n 'date-picker.year.heading': 'År',\n 'chip-set.clear-all': 'Rensa alla',\n 'snackbar.dismiss': 'Stäng',\n 'file.drag-and-drop-tips':\n 'Dra och släpp filen här eller klicka om du vill bläddra.',\n 'file-viewer.message.unsupported-filetype': 'Kan inte visa den här filen!',\n 'file-viewer.download': 'Ladda ner',\n 'file-viewer.exit-fullscreen': 'Avsluta fullskärmsläge',\n 'file-viewer.open-in-fullscreen': 'Öppna i fullskärmsläge',\n 'file-viewer.open-in-new-tab': 'Öppna i ny flik',\n 'file-viewer.more-actions': 'Mer…',\n 'editor-menu.bold': 'Fet',\n 'editor-menu.italic': 'Kursiv',\n 'editor-menu.h1': 'Rubrik 1',\n 'editor-menu.h2': 'Rubrik 2',\n 'editor-menu.h3': 'Rubrik 3',\n 'editor-menu.bulleted-list': 'Punktlista',\n 'editor-menu.numbered-list': 'Numrerad lista',\n 'editor-menu.blockquote': 'Blockcitat',\n 'editor-menu.link': 'Lägg till länk',\n};\n"]}
|