@onereach/ui-components 8.19.1 → 8.19.2
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/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +15 -8
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +2 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +1 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/props.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +1 -1
- package/dist/bundled/v3/components/{OrRichTextEditorV3-243f2ed9.js → OrRichTextEditorV3-46b9246b.js} +13 -11
- package/dist/bundled/v3/components/index.js +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/{OrRichTextEditor-1b7aeae0.js → OrRichTextEditor-8b4d1d64.js} +15 -8
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +2 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v2/components/or-textarea/OrTextarea.vue.d.ts +2 -2
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrRichTextEditor-9b45fff5.js → OrRichTextEditor-06c85acf.js} +13 -11
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +1 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v3/index.js +1 -1
- package/package.json +2 -2
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +8 -4
|
@@ -1716,11 +1716,12 @@ var script = defineComponent({
|
|
|
1716
1716
|
proxyModelValue.value = markdownOutput.value;
|
|
1717
1717
|
};
|
|
1718
1718
|
const handleToolbarClick = (item, level) => {
|
|
1719
|
-
var _a, _b;
|
|
1719
|
+
var _a, _b, _c, _d;
|
|
1720
1720
|
switch (item) {
|
|
1721
1721
|
case 'source':
|
|
1722
1722
|
disableMarkdown.value = !disableMarkdown.value;
|
|
1723
1723
|
sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
1724
|
+
(_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('height', `${((_b = editorRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 88}px`);
|
|
1724
1725
|
nextTick(() => {
|
|
1725
1726
|
var _a;
|
|
1726
1727
|
return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -1738,15 +1739,15 @@ var script = defineComponent({
|
|
|
1738
1739
|
to,
|
|
1739
1740
|
empty
|
|
1740
1741
|
} = editor.state.selection;
|
|
1741
|
-
const isLink = (
|
|
1742
|
-
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((
|
|
1742
|
+
const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
|
|
1743
|
+
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_d = editor.view.state.doc.nodeAt(cursorPosition)) === null || _d === void 0 ? void 0 : _d.text) || '' : '';
|
|
1743
1744
|
text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
|
|
1744
1745
|
link.value = editor.getAttributes('link').href || '';
|
|
1745
1746
|
}
|
|
1746
1747
|
isOpenLinkModal.value = !isOpenLinkModal.value;
|
|
1747
1748
|
break;
|
|
1748
1749
|
case 'blockquote':
|
|
1749
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
1750
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
|
|
1750
1751
|
break;
|
|
1751
1752
|
case 'codeBlock':
|
|
1752
1753
|
if (!isActive.value['codeBlock']) {
|
|
@@ -1767,7 +1768,6 @@ var script = defineComponent({
|
|
|
1767
1768
|
level: level
|
|
1768
1769
|
});
|
|
1769
1770
|
}
|
|
1770
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
1771
1771
|
break;
|
|
1772
1772
|
case 'undo':
|
|
1773
1773
|
case 'redo':
|
|
@@ -1777,7 +1777,7 @@ var script = defineComponent({
|
|
|
1777
1777
|
context.emit('file-upload');
|
|
1778
1778
|
break;
|
|
1779
1779
|
default:
|
|
1780
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
1780
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
|
|
1781
1781
|
break;
|
|
1782
1782
|
}
|
|
1783
1783
|
};
|
|
@@ -1896,7 +1896,8 @@ var script = defineComponent({
|
|
|
1896
1896
|
handleInput,
|
|
1897
1897
|
proxyModelValue,
|
|
1898
1898
|
disableMarkdown,
|
|
1899
|
-
sourceValue
|
|
1899
|
+
sourceValue,
|
|
1900
|
+
activeHeadingLevel
|
|
1900
1901
|
};
|
|
1901
1902
|
}
|
|
1902
1903
|
});
|
|
@@ -1955,7 +1956,7 @@ var __vue_render__ = function () {
|
|
|
1955
1956
|
},
|
|
1956
1957
|
on: {
|
|
1957
1958
|
"click": function ($event) {
|
|
1958
|
-
return _vm.menuRef.
|
|
1959
|
+
return _vm.menuRef.toggle();
|
|
1959
1960
|
}
|
|
1960
1961
|
}
|
|
1961
1962
|
}) : _vm.isVisible(item) ? _c('or-icon-button', {
|
|
@@ -2076,6 +2077,9 @@ var __vue_render__ = function () {
|
|
|
2076
2077
|
}, [_vm._l(_vm.headingLevels, function (heading) {
|
|
2077
2078
|
return _c('or-menu-item', {
|
|
2078
2079
|
key: heading,
|
|
2080
|
+
attrs: {
|
|
2081
|
+
"selected": _vm.activeHeadingLevel === heading
|
|
2082
|
+
},
|
|
2079
2083
|
on: {
|
|
2080
2084
|
"click": function ($event) {
|
|
2081
2085
|
return _vm.handleToolbarClick('heading', heading);
|
|
@@ -2083,6 +2087,9 @@ var __vue_render__ = function () {
|
|
|
2083
2087
|
}
|
|
2084
2088
|
}, [_vm._v("\n Heading " + _vm._s(heading) + "\n ")]);
|
|
2085
2089
|
}), _vm._v(" "), _c('or-menu-item', {
|
|
2090
|
+
attrs: {
|
|
2091
|
+
"selected": !_vm.activeHeadingLevel
|
|
2092
|
+
},
|
|
2086
2093
|
on: {
|
|
2087
2094
|
"click": function ($event) {
|
|
2088
2095
|
return _vm.handleToolbarClick('heading');
|
|
@@ -53,6 +53,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
53
53
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
54
54
|
disableMarkdown: import("@vue/composition-api").Ref<boolean>;
|
|
55
55
|
sourceValue: import("@vue/composition-api").Ref<string>;
|
|
56
|
+
activeHeadingLevel: import("@vue/composition-api").Ref<number>;
|
|
56
57
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
57
58
|
modelValue: {
|
|
58
59
|
type: StringConstructor;
|
|
@@ -172,6 +173,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
172
173
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
173
174
|
disableMarkdown: import("@vue/composition-api").Ref<boolean>;
|
|
174
175
|
sourceValue: import("@vue/composition-api").Ref<string>;
|
|
176
|
+
activeHeadingLevel: import("@vue/composition-api").Ref<number>;
|
|
175
177
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
176
178
|
modelValue: string;
|
|
177
179
|
toolbar: Tools;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrRichTextEditorV3-
|
|
1
|
+
export { s as default } from '../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -74,6 +74,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
74
|
proxyModelValue: import("vue-demi").WritableComputedRef<string | undefined>;
|
|
75
75
|
disableMarkdown: import("vue-demi").Ref<boolean>;
|
|
76
76
|
sourceValue: import("vue-demi").Ref<string>;
|
|
77
|
+
activeHeadingLevel: import("vue-demi").Ref<number>;
|
|
77
78
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("update:modelValue" | "input" | "file-upload")[], "update:modelValue" | "input" | "file-upload", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
78
79
|
modelValue: {
|
|
79
80
|
type: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditorV3-
|
|
1
|
+
export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Formats } from '../OrRichTextEditorV3-
|
|
1
|
+
export { F as Formats } from '../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as EditorContainer, f as EditorInput, b as Toolbar, c as ToolbarButton, e as ToolbarButtonFocused, T as ToolbarContainer } from '../OrRichTextEditorV3-
|
|
1
|
+
export { E as EditorContainer, f as EditorInput, b as Toolbar, c as ToolbarButton, e as ToolbarButtonFocused, T as ToolbarContainer } from '../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { i as default } from '../../../OrRichTextEditorV3-
|
|
1
|
+
export { i as default } from '../../../OrRichTextEditorV3-46b9246b.js';
|
|
2
2
|
import '../../../OrCode-46b1b8aa.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as default } from '../../../OrRichTextEditorV3-
|
|
1
|
+
export { C as default } from '../../../OrRichTextEditorV3-46b9246b.js';
|
|
2
2
|
import '../../../OrCode-46b1b8aa.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CodeMirrorView } from '../../../OrRichTextEditorV3-
|
|
1
|
+
export { C as CodeMirrorView } from '../../../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../../OrCode-46b1b8aa.js';
|
|
2
2
|
import '../../../../hooks/useTheme.js';
|
|
3
|
-
export { g as color, t as default, h as orCodeHighlightStyle, o as orCodeTheme } from '../../../OrRichTextEditorV3-
|
|
3
|
+
export { g as color, t as default, h as orCodeHighlightStyle, o as orCodeTheme } from '../../../OrRichTextEditorV3-46b9246b.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as deserialize, a as serialize } from '../../OrRichTextEditorV3-
|
|
1
|
+
export { d as deserialize, a as serialize } from '../../OrRichTextEditorV3-46b9246b.js';
|
package/dist/bundled/v3/components/{OrRichTextEditorV3-243f2ed9.js → OrRichTextEditorV3-46b9246b.js}
RENAMED
|
@@ -27283,11 +27283,12 @@ var script = defineComponent({
|
|
|
27283
27283
|
proxyModelValue.value = markdownOutput.value;
|
|
27284
27284
|
};
|
|
27285
27285
|
const handleToolbarClick = (item, level) => {
|
|
27286
|
-
var _a, _b;
|
|
27286
|
+
var _a, _b, _c, _d;
|
|
27287
27287
|
switch (item) {
|
|
27288
27288
|
case 'source':
|
|
27289
27289
|
disableMarkdown.value = !disableMarkdown.value;
|
|
27290
27290
|
sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
27291
|
+
(_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('height', `${((_b = editorRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 88}px`);
|
|
27291
27292
|
nextTick(() => {
|
|
27292
27293
|
var _a;
|
|
27293
27294
|
return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -27305,15 +27306,15 @@ var script = defineComponent({
|
|
|
27305
27306
|
to,
|
|
27306
27307
|
empty
|
|
27307
27308
|
} = editor.state.selection;
|
|
27308
|
-
const isLink = (
|
|
27309
|
-
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((
|
|
27309
|
+
const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
|
|
27310
|
+
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_d = editor.view.state.doc.nodeAt(cursorPosition)) === null || _d === void 0 ? void 0 : _d.text) || '' : '';
|
|
27310
27311
|
text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
|
|
27311
27312
|
link.value = editor.getAttributes('link').href || '';
|
|
27312
27313
|
}
|
|
27313
27314
|
isOpenLinkModal.value = !isOpenLinkModal.value;
|
|
27314
27315
|
break;
|
|
27315
27316
|
case 'blockquote':
|
|
27316
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
27317
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
|
|
27317
27318
|
break;
|
|
27318
27319
|
case 'codeBlock':
|
|
27319
27320
|
if (!isActive.value['codeBlock']) {
|
|
@@ -27334,7 +27335,6 @@ var script = defineComponent({
|
|
|
27334
27335
|
level: level
|
|
27335
27336
|
});
|
|
27336
27337
|
}
|
|
27337
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
27338
27338
|
break;
|
|
27339
27339
|
case 'undo':
|
|
27340
27340
|
case 'redo':
|
|
@@ -27344,7 +27344,7 @@ var script = defineComponent({
|
|
|
27344
27344
|
context.emit('file-upload');
|
|
27345
27345
|
break;
|
|
27346
27346
|
default:
|
|
27347
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
27347
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
|
|
27348
27348
|
break;
|
|
27349
27349
|
}
|
|
27350
27350
|
};
|
|
@@ -27463,7 +27463,8 @@ var script = defineComponent({
|
|
|
27463
27463
|
handleInput,
|
|
27464
27464
|
proxyModelValue,
|
|
27465
27465
|
disableMarkdown,
|
|
27466
|
-
sourceValue
|
|
27466
|
+
sourceValue,
|
|
27467
|
+
activeHeadingLevel
|
|
27467
27468
|
};
|
|
27468
27469
|
}
|
|
27469
27470
|
});
|
|
@@ -27531,7 +27532,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
27531
27532
|
variant: 'inherit',
|
|
27532
27533
|
size: 'm'
|
|
27533
27534
|
},
|
|
27534
|
-
onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.
|
|
27535
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.toggle())
|
|
27535
27536
|
}, null, 8 /* PROPS */, ["selected", "disabled", "tooltip", "icon"])) : _ctx.isVisible(item) ? (openBlock(), createBlock(_component_or_icon_button, {
|
|
27536
27537
|
key: 1,
|
|
27537
27538
|
tooltip: {
|
|
@@ -27609,19 +27610,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
27609
27610
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.headingLevels, heading => {
|
|
27610
27611
|
return openBlock(), createBlock(_component_or_menu_item, {
|
|
27611
27612
|
key: heading,
|
|
27613
|
+
selected: _ctx.activeHeadingLevel === heading,
|
|
27612
27614
|
onClick: $event => _ctx.handleToolbarClick('heading', heading)
|
|
27613
27615
|
}, {
|
|
27614
27616
|
default: withCtx(() => [createTextVNode(" Heading " + toDisplayString(heading), 1 /* TEXT */)]),
|
|
27615
27617
|
|
|
27616
27618
|
_: 2 /* DYNAMIC */
|
|
27617
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
|
|
27619
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
|
|
27618
27620
|
}), 128 /* KEYED_FRAGMENT */)), createVNode(_component_or_menu_item, {
|
|
27621
|
+
selected: !_ctx.activeHeadingLevel,
|
|
27619
27622
|
onClick: _cache[5] || (_cache[5] = $event => _ctx.handleToolbarClick('heading'))
|
|
27620
27623
|
}, {
|
|
27621
27624
|
default: withCtx(() => [createTextVNode(" None ")]),
|
|
27622
27625
|
_: 1 /* STABLE */
|
|
27623
|
-
})]),
|
|
27624
|
-
|
|
27626
|
+
}, 8 /* PROPS */, ["selected"])]),
|
|
27625
27627
|
_: 1 /* STABLE */
|
|
27626
27628
|
}, 8 /* PROPS */, ["trigger"])) : createCommentVNode("v-if", true), createVNode(_component_or_modal, {
|
|
27627
27629
|
"is-open": _ctx.isOpenLinkModal,
|
|
@@ -80,7 +80,7 @@ export { s as OrRangeSliderV3 } from './OrRangeSliderV3-f8024c15.js';
|
|
|
80
80
|
export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSliderV3-b69331d1.js';
|
|
81
81
|
export { s as OrRatingV3 } from './OrRatingV3-b6b47938.js';
|
|
82
82
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanelV3-39bf5dc7.js';
|
|
83
|
-
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditorV3-
|
|
83
|
+
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditorV3-46b9246b.js';
|
|
84
84
|
export { default as OrSearch } from './OrSearch/OrSearch.js';
|
|
85
85
|
export { OrSearchV3 } from './OrSearchV3/index.js';
|
|
86
86
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControlV3-56862f95.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -42,7 +42,7 @@ export { default as OrRadioGroup } from './components/OrRadioGroup/OrRadioGroup.
|
|
|
42
42
|
export { default as OrRadioGroupV3 } from './components/OrRadioGroupV3/OrRadioGroup.js';
|
|
43
43
|
export { s as OrRangeSliderV3 } from './components/OrRangeSliderV3-f8024c15.js';
|
|
44
44
|
export { s as OrRatingV3 } from './components/OrRatingV3-b6b47938.js';
|
|
45
|
-
export { F as Formats, s as OrRichTextEditorV3 } from './components/OrRichTextEditorV3-
|
|
45
|
+
export { F as Formats, s as OrRichTextEditorV3 } from './components/OrRichTextEditorV3-46b9246b.js';
|
|
46
46
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './components/OrSegmentedControlV3-56862f95.js';
|
|
47
47
|
export { s as OrSelect } from './components/OrSelect-ab9e3084.js';
|
|
48
48
|
export { s as OrSelectV3 } from './components/OrSelectV3-c604ca91.js';
|
|
@@ -527,11 +527,12 @@ var script = defineComponent({
|
|
|
527
527
|
proxyModelValue.value = markdownOutput.value;
|
|
528
528
|
};
|
|
529
529
|
const handleToolbarClick = (item, level) => {
|
|
530
|
-
var _a, _b;
|
|
530
|
+
var _a, _b, _c, _d;
|
|
531
531
|
switch (item) {
|
|
532
532
|
case 'source':
|
|
533
533
|
disableMarkdown.value = !disableMarkdown.value;
|
|
534
534
|
sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
535
|
+
(_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('height', `${((_b = editorRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 88}px`);
|
|
535
536
|
nextTick(() => {
|
|
536
537
|
var _a;
|
|
537
538
|
return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -549,15 +550,15 @@ var script = defineComponent({
|
|
|
549
550
|
to,
|
|
550
551
|
empty
|
|
551
552
|
} = editor.state.selection;
|
|
552
|
-
const isLink = (
|
|
553
|
-
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((
|
|
553
|
+
const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
|
|
554
|
+
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_d = editor.view.state.doc.nodeAt(cursorPosition)) === null || _d === void 0 ? void 0 : _d.text) || '' : '';
|
|
554
555
|
text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
|
|
555
556
|
link.value = editor.getAttributes('link').href || '';
|
|
556
557
|
}
|
|
557
558
|
isOpenLinkModal.value = !isOpenLinkModal.value;
|
|
558
559
|
break;
|
|
559
560
|
case 'blockquote':
|
|
560
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
561
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
|
|
561
562
|
break;
|
|
562
563
|
case 'codeBlock':
|
|
563
564
|
if (!isActive.value['codeBlock']) {
|
|
@@ -578,7 +579,6 @@ var script = defineComponent({
|
|
|
578
579
|
level: level
|
|
579
580
|
});
|
|
580
581
|
}
|
|
581
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
582
582
|
break;
|
|
583
583
|
case 'undo':
|
|
584
584
|
case 'redo':
|
|
@@ -588,7 +588,7 @@ var script = defineComponent({
|
|
|
588
588
|
context.emit('file-upload');
|
|
589
589
|
break;
|
|
590
590
|
default:
|
|
591
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
591
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
594
594
|
};
|
|
@@ -707,7 +707,8 @@ var script = defineComponent({
|
|
|
707
707
|
handleInput,
|
|
708
708
|
proxyModelValue,
|
|
709
709
|
disableMarkdown,
|
|
710
|
-
sourceValue
|
|
710
|
+
sourceValue,
|
|
711
|
+
activeHeadingLevel
|
|
711
712
|
};
|
|
712
713
|
}
|
|
713
714
|
});
|
|
@@ -766,7 +767,7 @@ var __vue_render__ = function () {
|
|
|
766
767
|
},
|
|
767
768
|
on: {
|
|
768
769
|
"click": function ($event) {
|
|
769
|
-
return _vm.menuRef.
|
|
770
|
+
return _vm.menuRef.toggle();
|
|
770
771
|
}
|
|
771
772
|
}
|
|
772
773
|
}) : _vm.isVisible(item) ? _c('or-icon-button', {
|
|
@@ -887,6 +888,9 @@ var __vue_render__ = function () {
|
|
|
887
888
|
}, [_vm._l(_vm.headingLevels, function (heading) {
|
|
888
889
|
return _c('or-menu-item', {
|
|
889
890
|
key: heading,
|
|
891
|
+
attrs: {
|
|
892
|
+
"selected": _vm.activeHeadingLevel === heading
|
|
893
|
+
},
|
|
890
894
|
on: {
|
|
891
895
|
"click": function ($event) {
|
|
892
896
|
return _vm.handleToolbarClick('heading', heading);
|
|
@@ -894,6 +898,9 @@ var __vue_render__ = function () {
|
|
|
894
898
|
}
|
|
895
899
|
}, [_vm._v("\n Heading " + _vm._s(heading) + "\n ")]);
|
|
896
900
|
}), _vm._v(" "), _c('or-menu-item', {
|
|
901
|
+
attrs: {
|
|
902
|
+
"selected": !_vm.activeHeadingLevel
|
|
903
|
+
},
|
|
897
904
|
on: {
|
|
898
905
|
"click": function ($event) {
|
|
899
906
|
return _vm.handleToolbarClick('heading');
|
|
@@ -97,7 +97,7 @@ export { _ as OrSliderV3 } from '../OrSlider-dd60a4a1.js';
|
|
|
97
97
|
export { S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from '../OrSlider.vue_rollup-plugin-vue_script-eadc5fc6.js';
|
|
98
98
|
export { _ as OrRatingV3 } from '../OrRating-abf1b609.js';
|
|
99
99
|
export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from '../OrResizeablePanel-037600c1.js';
|
|
100
|
-
export { F as Formats, _ as OrRichTextEditorV3 } from '../OrRichTextEditor-
|
|
100
|
+
export { F as Formats, _ as OrRichTextEditorV3 } from '../OrRichTextEditor-8b4d1d64.js';
|
|
101
101
|
export { _ as OrSearch } from '../OrSearch-ddf244e6.js';
|
|
102
102
|
export { _ as OrSearchV3 } from '../OrSearch-b357d036.js';
|
|
103
103
|
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-00583234.js';
|
|
@@ -53,6 +53,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
53
53
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
54
54
|
disableMarkdown: import("@vue/composition-api").Ref<boolean>;
|
|
55
55
|
sourceValue: import("@vue/composition-api").Ref<string>;
|
|
56
|
+
activeHeadingLevel: import("@vue/composition-api").Ref<number>;
|
|
56
57
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
57
58
|
modelValue: {
|
|
58
59
|
type: StringConstructor;
|
|
@@ -172,6 +173,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
172
173
|
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
173
174
|
disableMarkdown: import("@vue/composition-api").Ref<boolean>;
|
|
174
175
|
sourceValue: import("@vue/composition-api").Ref<string>;
|
|
176
|
+
activeHeadingLevel: import("@vue/composition-api").Ref<number>;
|
|
175
177
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
176
178
|
modelValue: string;
|
|
177
179
|
toolbar: Tools;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as Formats, _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-
|
|
1
|
+
export { F as Formats, _ as OrRichTextEditorV3 } from '../../OrRichTextEditor-8b4d1d64.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '@vueuse/integrations/useFocusTrap';
|
|
4
4
|
import '@vueuse/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
2
2
|
inputRef: import("@vue/composition-api").Ref<HTMLTextAreaElement | undefined>;
|
|
3
3
|
}> & {
|
|
4
4
|
reqAF: any;
|
|
@@ -106,7 +106,7 @@ declare const _default: import("vue2").ComponentOptions<import("vue2").default,
|
|
|
106
106
|
isDisabled: BooleanConstructor;
|
|
107
107
|
isReadonly: BooleanConstructor;
|
|
108
108
|
isInvalid: BooleanConstructor;
|
|
109
|
-
}>> & Omit<import("
|
|
109
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
110
110
|
modelValue: string;
|
|
111
111
|
isSmall: boolean;
|
|
112
112
|
isRequired: boolean;
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -97,7 +97,7 @@ export { _ as OrSliderV3 } from './OrSlider-dd60a4a1.js';
|
|
|
97
97
|
export { S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSlider.vue_rollup-plugin-vue_script-eadc5fc6.js';
|
|
98
98
|
export { _ as OrRatingV3 } from './OrRating-abf1b609.js';
|
|
99
99
|
export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanel-037600c1.js';
|
|
100
|
-
export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditor-
|
|
100
|
+
export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditor-8b4d1d64.js';
|
|
101
101
|
export { _ as OrSearch } from './OrSearch-ddf244e6.js';
|
|
102
102
|
export { _ as OrSearchV3 } from './OrSearch-b357d036.js';
|
|
103
103
|
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-00583234.js';
|
|
@@ -526,11 +526,12 @@ var script = defineComponent({
|
|
|
526
526
|
proxyModelValue.value = markdownOutput.value;
|
|
527
527
|
};
|
|
528
528
|
const handleToolbarClick = (item, level) => {
|
|
529
|
-
var _a, _b;
|
|
529
|
+
var _a, _b, _c, _d;
|
|
530
530
|
switch (item) {
|
|
531
531
|
case 'source':
|
|
532
532
|
disableMarkdown.value = !disableMarkdown.value;
|
|
533
533
|
sourceValue.value = serialize(editor === null || editor === void 0 ? void 0 : editor.schema, editor === null || editor === void 0 ? void 0 : editor.getJSON());
|
|
534
|
+
(_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('height', `${((_b = editorRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 88}px`);
|
|
534
535
|
nextTick(() => {
|
|
535
536
|
var _a;
|
|
536
537
|
return (_a = textareaRef.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -548,15 +549,15 @@ var script = defineComponent({
|
|
|
548
549
|
to,
|
|
549
550
|
empty
|
|
550
551
|
} = editor.state.selection;
|
|
551
|
-
const isLink = (
|
|
552
|
-
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((
|
|
552
|
+
const isLink = (_c = editor.view.state.doc.nodeAt(cursorPosition)) === null || _c === void 0 ? void 0 : _c.marks.filter(mark => mark.type.name === 'link');
|
|
553
|
+
const existedText = (isLink === null || isLink === void 0 ? void 0 : isLink.length) ? ((_d = editor.view.state.doc.nodeAt(cursorPosition)) === null || _d === void 0 ? void 0 : _d.text) || '' : '';
|
|
553
554
|
text.value = empty ? existedText : editor.state.doc.textBetween(from, to, ' ');
|
|
554
555
|
link.value = editor.getAttributes('link').href || '';
|
|
555
556
|
}
|
|
556
557
|
isOpenLinkModal.value = !isOpenLinkModal.value;
|
|
557
558
|
break;
|
|
558
559
|
case 'blockquote':
|
|
559
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
560
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleBlockquote().run();
|
|
560
561
|
break;
|
|
561
562
|
case 'codeBlock':
|
|
562
563
|
if (!isActive.value['codeBlock']) {
|
|
@@ -577,7 +578,6 @@ var script = defineComponent({
|
|
|
577
578
|
level: level
|
|
578
579
|
});
|
|
579
580
|
}
|
|
580
|
-
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
581
581
|
break;
|
|
582
582
|
case 'undo':
|
|
583
583
|
case 'redo':
|
|
@@ -587,7 +587,7 @@ var script = defineComponent({
|
|
|
587
587
|
context.emit('file-upload');
|
|
588
588
|
break;
|
|
589
589
|
default:
|
|
590
|
-
editor === null || editor === void 0 ? void 0 : editor.chain().
|
|
590
|
+
editor === null || editor === void 0 ? void 0 : editor.chain().toggleMark(item).run();
|
|
591
591
|
break;
|
|
592
592
|
}
|
|
593
593
|
};
|
|
@@ -706,7 +706,8 @@ var script = defineComponent({
|
|
|
706
706
|
handleInput,
|
|
707
707
|
proxyModelValue,
|
|
708
708
|
disableMarkdown,
|
|
709
|
-
sourceValue
|
|
709
|
+
sourceValue,
|
|
710
|
+
activeHeadingLevel
|
|
710
711
|
};
|
|
711
712
|
}
|
|
712
713
|
});
|
|
@@ -774,7 +775,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
774
775
|
variant: 'inherit',
|
|
775
776
|
size: 'm'
|
|
776
777
|
},
|
|
777
|
-
onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.
|
|
778
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.toggle())
|
|
778
779
|
}, null, 8 /* PROPS */, ["selected", "disabled", "tooltip", "icon"])) : _ctx.isVisible(item) ? (openBlock(), createBlock(_component_or_icon_button, {
|
|
779
780
|
key: 1,
|
|
780
781
|
tooltip: {
|
|
@@ -852,19 +853,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
852
853
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.headingLevels, heading => {
|
|
853
854
|
return openBlock(), createBlock(_component_or_menu_item, {
|
|
854
855
|
key: heading,
|
|
856
|
+
selected: _ctx.activeHeadingLevel === heading,
|
|
855
857
|
onClick: $event => _ctx.handleToolbarClick('heading', heading)
|
|
856
858
|
}, {
|
|
857
859
|
default: withCtx(() => [createTextVNode(" Heading " + toDisplayString(heading), 1 /* TEXT */)]),
|
|
858
860
|
|
|
859
861
|
_: 2 /* DYNAMIC */
|
|
860
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
|
|
862
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
|
|
861
863
|
}), 128 /* KEYED_FRAGMENT */)), createVNode(_component_or_menu_item, {
|
|
864
|
+
selected: !_ctx.activeHeadingLevel,
|
|
862
865
|
onClick: _cache[5] || (_cache[5] = $event => _ctx.handleToolbarClick('heading'))
|
|
863
866
|
}, {
|
|
864
867
|
default: withCtx(() => [createTextVNode(" None ")]),
|
|
865
868
|
_: 1 /* STABLE */
|
|
866
|
-
})]),
|
|
867
|
-
|
|
869
|
+
}, 8 /* PROPS */, ["selected"])]),
|
|
868
870
|
_: 1 /* STABLE */
|
|
869
871
|
}, 8 /* PROPS */, ["trigger"])) : createCommentVNode("v-if", true), createVNode(_component_or_modal, {
|
|
870
872
|
"is-open": _ctx.isOpenLinkModal,
|
|
@@ -93,7 +93,7 @@ export { s as OrRangeSliderV3 } from '../OrRangeSlider-1c6ff524.js';
|
|
|
93
93
|
export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from '../OrSlider-654bd19f.js';
|
|
94
94
|
export { s as OrRatingV3 } from '../OrRating-ec9462c5.js';
|
|
95
95
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from '../OrResizeablePanel-ae6a014f.js';
|
|
96
|
-
export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditor-
|
|
96
|
+
export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditor-06c85acf.js';
|
|
97
97
|
export { s as OrSearch } from '../OrSearch-aa57d4e8.js';
|
|
98
98
|
export { s as OrSearchV3 } from '../OrSearch-e56db8af.js';
|
|
99
99
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-adbf7f4e.js';
|
|
@@ -74,6 +74,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
74
|
proxyModelValue: import("vue-demi").WritableComputedRef<string | undefined>;
|
|
75
75
|
disableMarkdown: import("vue-demi").Ref<boolean>;
|
|
76
76
|
sourceValue: import("vue-demi").Ref<string>;
|
|
77
|
+
activeHeadingLevel: import("vue-demi").Ref<number>;
|
|
77
78
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("update:modelValue" | "input" | "file-upload")[], "update:modelValue" | "input" | "file-upload", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
78
79
|
modelValue: {
|
|
79
80
|
type: StringConstructor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as Formats, s as OrRichTextEditorV3 } from '../../OrRichTextEditor-
|
|
1
|
+
export { F as Formats, s as OrRichTextEditorV3 } from '../../OrRichTextEditor-06c85acf.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '@vueuse/integrations/useFocusTrap';
|
|
4
4
|
import '@vueuse/core';
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -93,7 +93,7 @@ export { s as OrRangeSliderV3 } from './OrRangeSlider-1c6ff524.js';
|
|
|
93
93
|
export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSlider-654bd19f.js';
|
|
94
94
|
export { s as OrRatingV3 } from './OrRating-ec9462c5.js';
|
|
95
95
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanel-ae6a014f.js';
|
|
96
|
-
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditor-
|
|
96
|
+
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditor-06c85acf.js';
|
|
97
97
|
export { s as OrSearch } from './OrSearch-aa57d4e8.js';
|
|
98
98
|
export { s as OrSearchV3 } from './OrSearch-e56db8af.js';
|
|
99
99
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-adbf7f4e.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.2",
|
|
4
4
|
"npmUnpacked": "4.15.2",
|
|
5
5
|
"description": "Vue components library for v2/3",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -177,5 +177,5 @@
|
|
|
177
177
|
},
|
|
178
178
|
"./package.json": "./package.json"
|
|
179
179
|
},
|
|
180
|
-
"gitHead": "
|
|
180
|
+
"gitHead": "8eff017c18472e1b3ce98802808076581c8af06f"
|
|
181
181
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
:disabled="!isFocused"
|
|
33
33
|
:tooltip="{content: item, placement: 'top'}"
|
|
34
34
|
:icon="{icon: headingIcon, variant: 'inherit', size: 'm'}"
|
|
35
|
-
@click="menuRef.
|
|
35
|
+
@click="menuRef.toggle()"
|
|
36
36
|
/>
|
|
37
37
|
<or-icon-button
|
|
38
38
|
v-else-if="isVisible(item)"
|
|
@@ -98,11 +98,13 @@
|
|
|
98
98
|
<or-menu-item
|
|
99
99
|
v-for="heading in headingLevels"
|
|
100
100
|
:key="heading"
|
|
101
|
+
:selected="activeHeadingLevel === heading"
|
|
101
102
|
@click="handleToolbarClick('heading', heading)"
|
|
102
103
|
>
|
|
103
104
|
Heading {{ heading }}
|
|
104
105
|
</or-menu-item>
|
|
105
106
|
<or-menu-item
|
|
107
|
+
:selected="!activeHeadingLevel"
|
|
106
108
|
@click="handleToolbarClick('heading')"
|
|
107
109
|
>
|
|
108
110
|
None
|
|
@@ -524,6 +526,8 @@ export default defineComponent({
|
|
|
524
526
|
disableMarkdown.value = !disableMarkdown.value;
|
|
525
527
|
sourceValue.value = serialize(editor?.schema, editor?.getJSON());
|
|
526
528
|
|
|
529
|
+
textareaRef.value?.style.setProperty('height', `${editorRef.value?.offsetHeight || 88}px`);
|
|
530
|
+
|
|
527
531
|
nextTick(() => textareaRef.value?.focus());
|
|
528
532
|
break;
|
|
529
533
|
case 'bulletList':
|
|
@@ -543,7 +547,7 @@ export default defineComponent({
|
|
|
543
547
|
isOpenLinkModal.value = !isOpenLinkModal.value;
|
|
544
548
|
break;
|
|
545
549
|
case 'blockquote':
|
|
546
|
-
editor?.chain().
|
|
550
|
+
editor?.chain().toggleBlockquote().run();
|
|
547
551
|
break;
|
|
548
552
|
case 'codeBlock':
|
|
549
553
|
if (!isActive.value['codeBlock']) {
|
|
@@ -560,7 +564,6 @@ export default defineComponent({
|
|
|
560
564
|
activeHeadingLevel.value = level;
|
|
561
565
|
editor?.commands.toggleHeading({ level: level as Level });
|
|
562
566
|
}
|
|
563
|
-
editor?.commands.focus();
|
|
564
567
|
break;
|
|
565
568
|
case 'undo':
|
|
566
569
|
case 'redo':
|
|
@@ -570,7 +573,7 @@ export default defineComponent({
|
|
|
570
573
|
context.emit('file-upload');
|
|
571
574
|
break;
|
|
572
575
|
default:
|
|
573
|
-
editor?.chain().
|
|
576
|
+
editor?.chain().toggleMark(item).run();
|
|
574
577
|
break;
|
|
575
578
|
}
|
|
576
579
|
};
|
|
@@ -726,6 +729,7 @@ export default defineComponent({
|
|
|
726
729
|
proxyModelValue,
|
|
727
730
|
disableMarkdown,
|
|
728
731
|
sourceValue,
|
|
732
|
+
activeHeadingLevel,
|
|
729
733
|
};
|
|
730
734
|
},
|
|
731
735
|
});
|