@limetech/lime-elements 37.44.3 → 37.45.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 +23 -0
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +143 -17
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js +81 -10
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-items.js +27 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-items.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-schema-extender.js +12 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-schema-extender.js.map +1 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/types.js +3 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/types.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +16 -7
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js.map +1 -1
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/collection/components/text-editor/utils/markdown-converter.js +8 -2
- package/dist/collection/components/text-editor/utils/markdown-converter.js.map +1 -1
- package/dist/collection/util/get-attributes.js +27 -0
- package/dist/collection/util/get-attributes.js.map +1 -0
- package/dist/esm/limel-prosemirror-adapter.entry.js +143 -17
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-50a34fa3.entry.js → p-3ae3b23e.entry.js} +2 -2
- package/dist/lime-elements/p-3ae3b23e.entry.js.map +1 -0
- package/dist/lime-elements/p-c5f96fcd.entry.js.map +1 -1
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-commands.d.ts +9 -6
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-items.d.ts +3 -0
- package/dist/types/components/text-editor/prosemirror-adapter/menu/menu-schema-extender.d.ts +3 -0
- package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +1 -0
- package/dist/types/util/get-attributes.d.ts +15 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-50a34fa3.entry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [37.45.1](https://github.com/Lundalogik/lime-elements/compare/v37.45.0...v37.45.1) (2024-05-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **text-editor:** throw error if the content type is not supported ([b5183e6](https://github.com/Lundalogik/lime-elements/commit/b5183e62202be3127146ced823e02daec3884ff8))
|
|
8
|
+
|
|
9
|
+
### Performance Improvements
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* **text-editor:** destroy view on disconnect ([2acbf8c](https://github.com/Lundalogik/lime-elements/commit/2acbf8cc59396079aa7c99a64620955385e7fffa))
|
|
13
|
+
|
|
14
|
+
## [37.45.0](https://github.com/Lundalogik/lime-elements/compare/v37.44.3...v37.45.0) (2024-05-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
* **editor menu:** add commands for toggling blocks and lists ([e4d9ed8](https://github.com/Lundalogik/lime-elements/commit/e4d9ed880137de282964acad8ae4e2c8a12d0a13))
|
|
21
|
+
* **text-editor:** add support for `code` and `code-block` formatting ([d3d724b](https://github.com/Lundalogik/lime-elements/commit/d3d724b65b0feee43f7598ecd71c706e3ed53e6e))
|
|
22
|
+
* **text-editor:** add support for `strikethrough` formatting ([985efb1](https://github.com/Lundalogik/lime-elements/commit/985efb1a624d266d85221185614a1029e6f9ec0a))
|
|
23
|
+
|
|
1
24
|
## [37.44.3](https://github.com/Lundalogik/lime-elements/compare/v37.44.2...v37.44.3) (2024-05-28)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -16542,6 +16542,9 @@ const EditorMenuTypes = {
|
|
|
16542
16542
|
Link: 'link',
|
|
16543
16543
|
OrderedList: 'ordered_list',
|
|
16544
16544
|
BulletList: 'bullet_list',
|
|
16545
|
+
Strikethrough: 'strikethrough',
|
|
16546
|
+
Code: 'code',
|
|
16547
|
+
CodeBlock: 'code_block',
|
|
16545
16548
|
};
|
|
16546
16549
|
/**
|
|
16547
16550
|
* `LevelMapping` is used to map string identifiers to numerical header levels.
|
|
@@ -16574,7 +16577,7 @@ const setActiveMethodForNode = (command, nodeType, level) => {
|
|
|
16574
16577
|
const { $from } = state.selection;
|
|
16575
16578
|
const node = $from.node($from.depth);
|
|
16576
16579
|
if (node && node.type.name === nodeType.name) {
|
|
16577
|
-
if (nodeType.name ===
|
|
16580
|
+
if (nodeType.name === LevelMapping.Heading && level) {
|
|
16578
16581
|
return node.attrs.level === level;
|
|
16579
16582
|
}
|
|
16580
16583
|
return true;
|
|
@@ -16619,14 +16622,44 @@ const getAttributes = (markName, url) => {
|
|
|
16619
16622
|
const isExternalLink = (url) => {
|
|
16620
16623
|
return !url.startsWith(window.location.origin);
|
|
16621
16624
|
};
|
|
16625
|
+
const toggleBlockType = (schema, type, attrs = {}, wrap = false) => {
|
|
16626
|
+
const blockType = schema.nodes[type];
|
|
16627
|
+
const paragraphType = schema.nodes.paragraph;
|
|
16628
|
+
return (state, dispatch) => {
|
|
16629
|
+
const { $from, to } = state.selection;
|
|
16630
|
+
if (state.selection instanceof TextSelection &&
|
|
16631
|
+
$from.sameParent($from.doc.resolve(to))) {
|
|
16632
|
+
if ($from.parent.type === blockType) {
|
|
16633
|
+
if (dispatch) {
|
|
16634
|
+
dispatch(state.tr.setBlockType($from.pos, to, paragraphType));
|
|
16635
|
+
}
|
|
16636
|
+
return true;
|
|
16637
|
+
}
|
|
16638
|
+
else {
|
|
16639
|
+
if (wrap) {
|
|
16640
|
+
return wrapIn(blockType, attrs)(state, dispatch);
|
|
16641
|
+
}
|
|
16642
|
+
else {
|
|
16643
|
+
return setBlockType(blockType, attrs)(state, dispatch);
|
|
16644
|
+
}
|
|
16645
|
+
}
|
|
16646
|
+
}
|
|
16647
|
+
return false;
|
|
16648
|
+
};
|
|
16649
|
+
};
|
|
16622
16650
|
const createSetNodeTypeCommand = (schema, nodeType, level) => {
|
|
16623
16651
|
const type = schema.nodes[nodeType];
|
|
16624
16652
|
if (!type) {
|
|
16625
16653
|
throw new Error(`Node type "${nodeType}" not found in schema`);
|
|
16626
16654
|
}
|
|
16627
16655
|
let command;
|
|
16628
|
-
if (nodeType ===
|
|
16629
|
-
command =
|
|
16656
|
+
if (nodeType === LevelMapping.Heading && level) {
|
|
16657
|
+
command = toggleBlockType(schema, LevelMapping.Heading, {
|
|
16658
|
+
level: level,
|
|
16659
|
+
});
|
|
16660
|
+
}
|
|
16661
|
+
else if (nodeType === EditorMenuTypes.CodeBlock) {
|
|
16662
|
+
command = toggleBlockType(schema, EditorMenuTypes.CodeBlock);
|
|
16630
16663
|
}
|
|
16631
16664
|
else {
|
|
16632
16665
|
command = setBlockType(type);
|
|
@@ -16639,16 +16672,50 @@ const createWrapInCommand = (schema, nodeType) => {
|
|
|
16639
16672
|
if (!type) {
|
|
16640
16673
|
throw new Error(`Node type "${nodeType}" not found in schema`);
|
|
16641
16674
|
}
|
|
16642
|
-
|
|
16675
|
+
let command;
|
|
16676
|
+
if (nodeType === EditorMenuTypes.Blockquote) {
|
|
16677
|
+
command = toggleBlockType(schema, EditorMenuTypes.Blockquote, {}, true);
|
|
16678
|
+
}
|
|
16679
|
+
else {
|
|
16680
|
+
command = wrapIn(type);
|
|
16681
|
+
}
|
|
16643
16682
|
setActiveMethodForWrap(command, type);
|
|
16644
16683
|
return command;
|
|
16645
16684
|
};
|
|
16685
|
+
const toggleList = (listType) => {
|
|
16686
|
+
return (state, dispatch) => {
|
|
16687
|
+
const { $from, $to } = state.selection;
|
|
16688
|
+
const range = $from.blockRange($to);
|
|
16689
|
+
if (!range) {
|
|
16690
|
+
return false;
|
|
16691
|
+
}
|
|
16692
|
+
const wrapping = range && findWrapping(range, listType);
|
|
16693
|
+
if (wrapping) {
|
|
16694
|
+
// Wrap the selection in a list
|
|
16695
|
+
if (dispatch) {
|
|
16696
|
+
dispatch(state.tr.wrap(range, wrapping).scrollIntoView());
|
|
16697
|
+
}
|
|
16698
|
+
return true;
|
|
16699
|
+
}
|
|
16700
|
+
else {
|
|
16701
|
+
// Check if we are in a list item and lift out of the list
|
|
16702
|
+
const liftRange = range && liftTarget(range);
|
|
16703
|
+
if (liftRange !== null) {
|
|
16704
|
+
if (dispatch) {
|
|
16705
|
+
dispatch(state.tr.lift(range, liftRange).scrollIntoView());
|
|
16706
|
+
}
|
|
16707
|
+
return true;
|
|
16708
|
+
}
|
|
16709
|
+
return false;
|
|
16710
|
+
}
|
|
16711
|
+
};
|
|
16712
|
+
};
|
|
16646
16713
|
const createListCommand = (schema, listType) => {
|
|
16647
16714
|
const type = schema.nodes[listType];
|
|
16648
16715
|
if (!type) {
|
|
16649
16716
|
throw new Error(`List type "${listType}" not found in schema`);
|
|
16650
16717
|
}
|
|
16651
|
-
const command =
|
|
16718
|
+
const command = toggleList(type);
|
|
16652
16719
|
setActiveMethodForWrap(command, type);
|
|
16653
16720
|
return command;
|
|
16654
16721
|
};
|
|
@@ -16656,15 +16723,18 @@ const commandMapping = {
|
|
|
16656
16723
|
strong: createToggleMarkCommand,
|
|
16657
16724
|
em: createToggleMarkCommand,
|
|
16658
16725
|
underline: createToggleMarkCommand,
|
|
16726
|
+
strikethrough: createToggleMarkCommand,
|
|
16727
|
+
code: createToggleMarkCommand,
|
|
16728
|
+
link: createToggleMarkCommand,
|
|
16659
16729
|
headerlevel1: (schema) => createSetNodeTypeCommand(schema, LevelMapping.Heading, LevelMapping.one),
|
|
16660
16730
|
headerlevel2: (schema) => createSetNodeTypeCommand(schema, LevelMapping.Heading, LevelMapping.two),
|
|
16661
16731
|
headerlevel3: (schema) => createSetNodeTypeCommand(schema, LevelMapping.Heading, LevelMapping.three),
|
|
16662
|
-
blockquote: createWrapInCommand,
|
|
16732
|
+
blockquote: (schema) => createWrapInCommand(schema, EditorMenuTypes.Blockquote),
|
|
16663
16733
|
/* eslint-disable camelcase */
|
|
16664
|
-
|
|
16665
|
-
|
|
16734
|
+
code_block: (schema) => createSetNodeTypeCommand(schema, EditorMenuTypes.CodeBlock),
|
|
16735
|
+
ordered_list: (schema) => createListCommand(schema, EditorMenuTypes.OrderedList),
|
|
16736
|
+
bullet_list: (schema) => createListCommand(schema, EditorMenuTypes.BulletList),
|
|
16666
16737
|
/* eslint-enable camelcase */
|
|
16667
|
-
link: createToggleMarkCommand,
|
|
16668
16738
|
};
|
|
16669
16739
|
class MenuCommandFactory {
|
|
16670
16740
|
constructor(schema) {
|
|
@@ -16684,6 +16754,9 @@ class MenuCommandFactory {
|
|
|
16684
16754
|
'Mod-Shift-1': this.getCommand(EditorMenuTypes.HeaderLevel1),
|
|
16685
16755
|
'Mod-Shift-2': this.getCommand(EditorMenuTypes.HeaderLevel2),
|
|
16686
16756
|
'Mod-Shift-3': this.getCommand(EditorMenuTypes.HeaderLevel3),
|
|
16757
|
+
'Mod-Shift-X': this.getCommand(EditorMenuTypes.Strikethrough),
|
|
16758
|
+
'Mod-`': this.getCommand(EditorMenuTypes.Code),
|
|
16759
|
+
'Mod-Shift-C': this.getCommand(EditorMenuTypes.CodeBlock),
|
|
16687
16760
|
};
|
|
16688
16761
|
}
|
|
16689
16762
|
}
|
|
@@ -16713,6 +16786,30 @@ const textEditorMenuItems = [
|
|
|
16713
16786
|
iconOnly: true,
|
|
16714
16787
|
selected: false,
|
|
16715
16788
|
},
|
|
16789
|
+
{
|
|
16790
|
+
value: EditorMenuTypes.Strikethrough,
|
|
16791
|
+
text: 'Strikethrough',
|
|
16792
|
+
commandText: `${mod} ${shift} X`,
|
|
16793
|
+
icon: '-lime-text-strikethrough',
|
|
16794
|
+
iconOnly: true,
|
|
16795
|
+
selected: false,
|
|
16796
|
+
},
|
|
16797
|
+
{
|
|
16798
|
+
value: EditorMenuTypes.Code,
|
|
16799
|
+
text: 'Code',
|
|
16800
|
+
commandText: `${mod} \``,
|
|
16801
|
+
icon: '-lime-text-code',
|
|
16802
|
+
iconOnly: true,
|
|
16803
|
+
selected: false,
|
|
16804
|
+
},
|
|
16805
|
+
{
|
|
16806
|
+
value: EditorMenuTypes.CodeBlock,
|
|
16807
|
+
text: 'Code Block',
|
|
16808
|
+
commandText: `${mod} ${shift} C`,
|
|
16809
|
+
icon: '-lime-text-code-block',
|
|
16810
|
+
iconOnly: true,
|
|
16811
|
+
selected: false,
|
|
16812
|
+
},
|
|
16716
16813
|
{ separator: true },
|
|
16717
16814
|
{
|
|
16718
16815
|
value: EditorMenuTypes.HeaderLevel1,
|
|
@@ -16771,9 +16868,12 @@ const menuTranslationIDs = {
|
|
|
16771
16868
|
/* eslint-disable camelcase */
|
|
16772
16869
|
bullet_list: 'editor-menu.bulleted-list',
|
|
16773
16870
|
ordered_list: 'editor-menu.numbered-list',
|
|
16871
|
+
code_block: 'editor-menu.code-block',
|
|
16774
16872
|
/* eslint-enable camelcase */
|
|
16775
16873
|
blockquote: 'editor-menu.blockquote',
|
|
16776
16874
|
link: 'editor-menu.link',
|
|
16875
|
+
strikethrough: 'editor-menu.strikethrough',
|
|
16876
|
+
code: 'editor-menu.code',
|
|
16777
16877
|
};
|
|
16778
16878
|
|
|
16779
16879
|
/* eslint-disable no-bitwise */
|
|
@@ -25396,6 +25496,12 @@ class MarkdownSerializerState {
|
|
|
25396
25496
|
}
|
|
25397
25497
|
}
|
|
25398
25498
|
|
|
25499
|
+
const customMarkdownSerializer = new MarkdownSerializer(Object.assign({}, defaultMarkdownSerializer.nodes), Object.assign(Object.assign({}, defaultMarkdownSerializer.marks), { strikethrough: {
|
|
25500
|
+
open: '~~',
|
|
25501
|
+
close: '~~',
|
|
25502
|
+
mixable: true,
|
|
25503
|
+
expelEnclosingWhitespace: true,
|
|
25504
|
+
} }));
|
|
25399
25505
|
/**
|
|
25400
25506
|
* @private
|
|
25401
25507
|
*/
|
|
@@ -25409,7 +25515,7 @@ class markdownConverter {
|
|
|
25409
25515
|
return '';
|
|
25410
25516
|
}
|
|
25411
25517
|
else {
|
|
25412
|
-
return
|
|
25518
|
+
return customMarkdownSerializer.serialize(view.state.doc);
|
|
25413
25519
|
}
|
|
25414
25520
|
};
|
|
25415
25521
|
}
|
|
@@ -25436,6 +25542,18 @@ class HTMLConverter {
|
|
|
25436
25542
|
}
|
|
25437
25543
|
}
|
|
25438
25544
|
|
|
25545
|
+
const strikethrough = {
|
|
25546
|
+
parseDOM: [
|
|
25547
|
+
{ tag: 's' },
|
|
25548
|
+
{ tag: 'del' },
|
|
25549
|
+
{ tag: 'strike' },
|
|
25550
|
+
{ style: 'text-decoration=line-through' },
|
|
25551
|
+
],
|
|
25552
|
+
toDOM: () => {
|
|
25553
|
+
return ['s', 0];
|
|
25554
|
+
},
|
|
25555
|
+
};
|
|
25556
|
+
|
|
25439
25557
|
const prosemirrorAdapterCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-prosemirror-adapter){display:flex;flex-direction:column}:host(limel-prosemirror-adapter) limel-action-bar{order:1}:host(limel-prosemirror-adapter) div#editor{order:2;height:100%}:host(limel-prosemirror-adapter) div[contenteditable=true]{height:100%}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{display:grid;grid-template-rows:auto 1fr}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}limel-action-bar{--action-bar-border-radius:0.25rem;position:sticky;z-index:1;top:1px;background-color:rgba(var(--contrast-200), 0.5);backdrop-filter:blur(0.5rem);-webkit-backdrop-filter:blur(0.5rem);opacity:0.6;transition:opacity 0.5s ease;margin:0 1px;width:calc(100% - 2px)}:host(limel-prosemirror-adapter:focus-within) limel-action-bar,:host(limel-prosemirror-adapter:hover) limel-action-bar{opacity:1}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;padding:var(--limel-text-editor-padding)}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}";
|
|
25440
25558
|
|
|
25441
25559
|
const ProsemirrorAdapter = class {
|
|
@@ -25528,13 +25646,19 @@ const ProsemirrorAdapter = class {
|
|
|
25528
25646
|
index.h("limel-action-bar", { accessibleLabel: "Toolbar", actions: this.actionBarItems, onItemSelected: this.handleActionBarItem }),
|
|
25529
25647
|
];
|
|
25530
25648
|
}
|
|
25649
|
+
disconnectedCallback() {
|
|
25650
|
+
this.view.destroy();
|
|
25651
|
+
}
|
|
25531
25652
|
setupContentConverter() {
|
|
25532
|
-
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
|
|
25536
|
-
|
|
25537
|
-
|
|
25653
|
+
if (this.contentType === 'markdown') {
|
|
25654
|
+
this.contentConverter = new markdownConverter();
|
|
25655
|
+
}
|
|
25656
|
+
else if (this.contentType === 'html') {
|
|
25657
|
+
this.contentConverter = new HTMLConverter();
|
|
25658
|
+
}
|
|
25659
|
+
else {
|
|
25660
|
+
throw new Error(`Unsupported content type: ${this.contentType}. Only 'markdown' and 'html' are supported.`);
|
|
25661
|
+
}
|
|
25538
25662
|
}
|
|
25539
25663
|
async initializeTextEditor() {
|
|
25540
25664
|
this.schema = this.initializeSchema();
|
|
@@ -25551,7 +25675,9 @@ const ProsemirrorAdapter = class {
|
|
|
25551
25675
|
initializeSchema() {
|
|
25552
25676
|
return new Schema({
|
|
25553
25677
|
nodes: addListNodes(schema$1.spec.nodes, 'paragraph block*', 'block'),
|
|
25554
|
-
marks: schema$1.spec.marks
|
|
25678
|
+
marks: schema$1.spec.marks.append({
|
|
25679
|
+
strikethrough: strikethrough,
|
|
25680
|
+
}),
|
|
25555
25681
|
});
|
|
25556
25682
|
}
|
|
25557
25683
|
async parseInitialContent() {
|