@onereach/ui-components 4.0.2 → 4.1.0-beta.2508.0
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/OrCode/OrCode.js +6 -3727
- package/dist/bundled/v2/components/OrCode/index.js +6 -2
- package/dist/bundled/v2/components/OrCode/lang.js +3898 -3
- package/dist/bundled/v2/components/OrCode/theme.js +3 -1
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +2033 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +181 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +67 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/styles.d.ts +7 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/styles.js +43 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +3 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +45 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +27 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +183 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +1 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.js +4 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +19 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/types.js +1 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.d.ts +3 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.js +5 -0
- package/dist/bundled/v2/components/index.d.ts +1 -0
- package/dist/bundled/v2/components/index.js +14 -2
- package/dist/bundled/v2/index-62c3221b.js +6956 -0
- package/dist/bundled/v2/index-62e39ec2.js +4534 -0
- package/dist/bundled/{v3/OrCode.vue_vue_type_script_lang-c5a9adb7.js → v2/index-92e69736.js} +15 -234
- package/dist/bundled/v2/{index-6976c52a.js → index-c76372bb.js} +16 -4659
- package/dist/bundled/{v3/lang-02d2bb2d.js → v2/index-db5e8c99.js} +74 -3965
- package/dist/bundled/v2/index.es-3f39f316.js +115 -0
- package/dist/bundled/v2/index.js +17 -5
- package/dist/bundled/v2/markdown-00716a39.js +18683 -0
- package/dist/bundled/v2/tiptap-core.esm-f85402b1.js +9360 -0
- package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-0c5e41b0.js +236 -0
- package/dist/bundled/v3/OrRichTextEditor.vue_vue_type_script_lang-33b56bd6.js +1815 -0
- package/dist/bundled/v3/components/OrCode/OrCode.js +9 -5
- package/dist/bundled/v3/components/OrCode/index.js +7 -3
- package/dist/bundled/v3/components/OrCode/lang.js +3898 -3
- package/dist/bundled/v3/components/OrCode/theme.js +3 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +219 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +181 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +83 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.d.ts +7 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +43 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +3 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +45 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +27 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +183 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +1 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +4 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +19 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/types.js +1 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.d.ts +3 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +5 -0
- package/dist/bundled/v3/components/index.d.ts +1 -0
- package/dist/bundled/v3/components/index.js +16 -3
- package/dist/bundled/v3/index-62c3221b.js +6956 -0
- package/dist/bundled/v3/index-62e39ec2.js +4534 -0
- package/dist/bundled/v3/index-92e69736.js +3741 -0
- package/dist/bundled/v3/{index-6976c52a.js → index-c76372bb.js} +16 -4659
- package/dist/bundled/{v2/lang-02d2bb2d.js → v3/index-db5e8c99.js} +74 -3965
- package/dist/bundled/v3/index.es-3f39f316.js +115 -0
- package/dist/bundled/v3/index.js +20 -7
- package/dist/bundled/v3/markdown-00716a39.js +18683 -0
- package/dist/bundled/v3/tiptap-core.esm-f85402b1.js +9360 -0
- package/dist/esm/v2/OrRichTextEditor-45fb1867.js +718 -0
- package/dist/esm/v2/codemirrorView-2e87c938.js +184 -0
- package/dist/esm/v2/components/index.d.ts +1 -0
- package/dist/esm/v2/components/index.js +24 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +181 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.d.ts +1 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +56 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/styles.d.ts +7 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +27 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +5 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/markdown.d.ts +3 -0
- package/dist/esm/v2/index.js +24 -0
- package/dist/esm/v3/OrRichTextEditor-4c0b6030.js +680 -0
- package/dist/esm/v3/codemirrorView-2e87c938.js +184 -0
- package/dist/esm/v3/components/index.d.ts +1 -0
- package/dist/esm/v3/components/index.js +24 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +181 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.d.ts +1 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +54 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/styles.d.ts +7 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +27 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +5 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/markdown.d.ts +3 -0
- package/dist/esm/v3/index.js +24 -0
- package/package.json +25 -5
- package/src/components/index.ts +1 -0
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +7 -0
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +79 -0
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +622 -0
- package/src/components/or-rich-text-editor-v3/index.ts +1 -0
- package/src/components/or-rich-text-editor-v3/styles.ts +72 -0
- package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.ts +40 -0
- package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.ts +252 -0
- package/src/components/or-rich-text-editor-v3/utils/codemirror/index.ts +1 -0
- package/src/components/or-rich-text-editor-v3/utils/codemirror/types.ts +22 -0
- package/src/components/or-rich-text-editor-v3/utils/markdown.ts +110 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { E as EditorView
|
|
1
|
+
import { E as EditorView } from '../../index-c76372bb.js';
|
|
2
|
+
import { H as HighlightStyle, t as tags, d as syntaxHighlighting } from '../../index-62e39ec2.js';
|
|
3
|
+
import '../../index.es-3f39f316.js';
|
|
2
4
|
|
|
3
5
|
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
4
6
|
const chalky = 'var(--c-warning-darken-20)',
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { s as script } from '../../OrRichTextEditor.vue_vue_type_script_lang-33b56bd6.js';
|
|
2
|
+
export { s as default } from '../../OrRichTextEditor.vue_vue_type_script_lang-33b56bd6.js';
|
|
3
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, createBlock, createCommentVNode } from 'vue';
|
|
4
|
+
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
5
|
+
import 'vue-demi';
|
|
6
|
+
import '@vueuse/core';
|
|
7
|
+
import '../../markdown-00716a39.js';
|
|
8
|
+
import '../../index-62c3221b.js';
|
|
9
|
+
import 'node:punycode';
|
|
10
|
+
import '../../tiptap-core.esm-f85402b1.js';
|
|
11
|
+
import '../../index.es-3f39f316.js';
|
|
12
|
+
import './styles.js';
|
|
13
|
+
import './utils/codemirror/codemirrorNode.js';
|
|
14
|
+
import './utils/codemirror/codemirrorView.js';
|
|
15
|
+
import '../../index-c76372bb.js';
|
|
16
|
+
import '../../index-92e69736.js';
|
|
17
|
+
import '../../index-62e39ec2.js';
|
|
18
|
+
import '../../index-db5e8c99.js';
|
|
19
|
+
import '../OrIconButtonV3/OrIconButton.js';
|
|
20
|
+
import '../../OrIconButton.vue_vue_type_script_lang-42a8285c.js';
|
|
21
|
+
import '../OrIconButtonV3/props.js';
|
|
22
|
+
import '../OrIconV3/props.js';
|
|
23
|
+
import '../OrIconButtonV3/styles.js';
|
|
24
|
+
import '../OrIconV3/OrIcon.js';
|
|
25
|
+
import '../../OrIcon.vue_vue_type_script_lang-73f9cc63.js';
|
|
26
|
+
import '../OrIconV3/styles.js';
|
|
27
|
+
import '../OrTooltipV3/OrTooltip.js';
|
|
28
|
+
import '../../OrTooltip.vue_vue_type_script_lang-703eaacb.js';
|
|
29
|
+
import '../OrTooltipV3/styles.js';
|
|
30
|
+
import '../OrPopoverV3/OrPopover.js';
|
|
31
|
+
import '../../OrPopover.vue_vue_type_script_lang-a9419b58.js';
|
|
32
|
+
import '../../floating-ui.dom.esm-83eba816.js';
|
|
33
|
+
import '../OrPopoverV3/props.js';
|
|
34
|
+
import '../OrPopoverV3/styles.js';
|
|
35
|
+
import '../OrBottomSheetV3/OrBottomSheet.js';
|
|
36
|
+
import '../../OrBottomSheet.vue_vue_type_script_lang-1489a97d.js';
|
|
37
|
+
import '../OrBottomSheetV3/styles.js';
|
|
38
|
+
import '../OrOverlayV3/OrOverlay.js';
|
|
39
|
+
import '../../OrOverlay.vue_vue_type_script_lang-30f62546.js';
|
|
40
|
+
import '../OrOverlayV3/styles.js';
|
|
41
|
+
import '../OrTeleportV3/OrTeleport.js';
|
|
42
|
+
import '../../OrTeleport.vue3.vue_vue_type_script_lang-a6ce162e.js';
|
|
43
|
+
import '../../hooks/useElevation.js';
|
|
44
|
+
import '../../utils/isVisible.js';
|
|
45
|
+
import '../../hooks/useResponsive/useResponsive.js';
|
|
46
|
+
import '../OrLabelV3/OrLabel.js';
|
|
47
|
+
import '../../OrLabel.vue_vue_type_script_lang-3e11ab8a.js';
|
|
48
|
+
import '../OrLabelV3/props.js';
|
|
49
|
+
import '../OrLabelV3/styles.js';
|
|
50
|
+
import '../OrMenuItemV3/OrMenuItem.js';
|
|
51
|
+
import '../../OrMenuItem.vue_vue_type_script_lang-b338d68a.js';
|
|
52
|
+
import '../OrMenuItemV3/styles.js';
|
|
53
|
+
import '../OrMenuV3/OrMenu.js';
|
|
54
|
+
import '../../OrMenu.vue_vue_type_script_lang-2676b9cc.js';
|
|
55
|
+
import '../OrMenuV3/styles.js';
|
|
56
|
+
import '../OrModalV3/OrModal.js';
|
|
57
|
+
import '../../OrModal.vue_vue_type_script_lang-9ed0d5c2.js';
|
|
58
|
+
import '../OrModalV3/props.js';
|
|
59
|
+
import '../OrModalV3/styles.js';
|
|
60
|
+
import '../OrInputV3/OrInput.js';
|
|
61
|
+
import '../../OrInput.vue_vue_type_script_lang-60b49ebd.js';
|
|
62
|
+
import '../OrInputV3/props.js';
|
|
63
|
+
import '../OrInputBoxV3/props.js';
|
|
64
|
+
import '../OrInputV3/styles.js';
|
|
65
|
+
import '../OrErrorV3/OrError.js';
|
|
66
|
+
import '../../OrError.vue_vue_type_script_lang-df7b5e32.js';
|
|
67
|
+
import '../OrErrorV3/styles.js';
|
|
68
|
+
import '../OrHintV3/OrHint.js';
|
|
69
|
+
import '../../OrHint.vue_vue_type_script_lang-0f5e8377.js';
|
|
70
|
+
import '../OrHintV3/styles.js';
|
|
71
|
+
import '../OrInputBoxV3/OrInputBox.js';
|
|
72
|
+
import '../../OrInputBox.vue_vue_type_script_lang-e3bba923.js';
|
|
73
|
+
import '../OrInputBoxV3/styles.js';
|
|
74
|
+
import '../OrLoaderV3/OrLoader.js';
|
|
75
|
+
import '../../OrLoader.vue_vue_type_script_lang-49907820.js';
|
|
76
|
+
import '../OrLoaderV3/props.js';
|
|
77
|
+
import '../OrLoaderV3/styles.js';
|
|
78
|
+
import '../../hooks/useIdAttribute.js';
|
|
79
|
+
import '../../hooks/useControlAttributes.js';
|
|
80
|
+
import '../../hooks/useValidationAttributes.js';
|
|
81
|
+
import '../OrButtonV3/OrButton.js';
|
|
82
|
+
import '../../OrButton.vue_vue_type_script_lang-fe412ca5.js';
|
|
83
|
+
import '../OrButtonV3/props.js';
|
|
84
|
+
import '../OrButtonV3/styles.js';
|
|
85
|
+
|
|
86
|
+
const _hoisted_1 = /*#__PURE__*/createElementVNode("p", {
|
|
87
|
+
class: "text-headline-2"
|
|
88
|
+
}, " Add Link ", -1 /* HOISTED */);
|
|
89
|
+
const _hoisted_2 = {
|
|
90
|
+
class: "flex ml-auto gap-md"
|
|
91
|
+
};
|
|
92
|
+
const _hoisted_3 = /*#__PURE__*/createElementVNode("p", null, "Cancel", -1 /* HOISTED */);
|
|
93
|
+
const _hoisted_4 = /*#__PURE__*/createElementVNode("p", null, "Save", -1 /* HOISTED */);
|
|
94
|
+
|
|
95
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
96
|
+
const _component_or_label = resolveComponent("or-label");
|
|
97
|
+
const _component_or_icon_button = resolveComponent("or-icon-button");
|
|
98
|
+
const _component_or_menu_item = resolveComponent("or-menu-item");
|
|
99
|
+
const _component_or_menu = resolveComponent("or-menu");
|
|
100
|
+
const _component_or_input = resolveComponent("or-input");
|
|
101
|
+
const _component_or_button = resolveComponent("or-button");
|
|
102
|
+
const _component_or_modal = resolveComponent("or-modal");
|
|
103
|
+
return openBlock(), createElementBlock("div", {
|
|
104
|
+
ref: "root",
|
|
105
|
+
class: normalizeClass(_ctx.rootStyles)
|
|
106
|
+
}, [createVNode(_component_or_label, null, {
|
|
107
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.description), 1 /* TEXT */)]),
|
|
108
|
+
|
|
109
|
+
_: 1 /* STABLE */
|
|
110
|
+
}), createElementVNode("div", {
|
|
111
|
+
ref: "containerRef",
|
|
112
|
+
class: normalizeClass(_ctx.containerStyles),
|
|
113
|
+
onClick: _cache[1] || (_cache[1] = $event => _ctx.handleEditorClick())
|
|
114
|
+
}, [createElementVNode("div", {
|
|
115
|
+
class: normalizeClass(_ctx.toolbarContainerStyles)
|
|
116
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.toolbar, (tool, index) => {
|
|
117
|
+
return openBlock(), createElementBlock("div", {
|
|
118
|
+
key: index,
|
|
119
|
+
class: normalizeClass(_ctx.toolbarStyles)
|
|
120
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(tool, item => {
|
|
121
|
+
return openBlock(), createElementBlock("div", {
|
|
122
|
+
key: item,
|
|
123
|
+
class: normalizeClass([_ctx.toolbarButtonStyles(item), "-my-xs"])
|
|
124
|
+
}, [item === 'heading' ? (openBlock(), createBlock(_component_or_icon_button, {
|
|
125
|
+
key: 0,
|
|
126
|
+
ref_for: true,
|
|
127
|
+
ref: "toolbarButtonRef",
|
|
128
|
+
tooltip: {
|
|
129
|
+
text: item,
|
|
130
|
+
placement: 'top'
|
|
131
|
+
},
|
|
132
|
+
icon: {
|
|
133
|
+
icon: _ctx.headingIcon,
|
|
134
|
+
variant: 'inherit',
|
|
135
|
+
size: 'm'
|
|
136
|
+
},
|
|
137
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.open())
|
|
138
|
+
}, null, 8 /* PROPS */, ["tooltip", "icon"])) : (openBlock(), createBlock(_component_or_icon_button, {
|
|
139
|
+
key: 1,
|
|
140
|
+
tooltip: {
|
|
141
|
+
text: _ctx.iconTooltipsEnum[item],
|
|
142
|
+
placement: 'top'
|
|
143
|
+
},
|
|
144
|
+
icon: {
|
|
145
|
+
icon: _ctx.iconsEnum[item],
|
|
146
|
+
variant: 'inherit',
|
|
147
|
+
size: 'm'
|
|
148
|
+
},
|
|
149
|
+
onClick: $event => _ctx.handleToolbarClick(item)
|
|
150
|
+
}, null, 8 /* PROPS */, ["tooltip", "icon", "onClick"]))], 2 /* CLASS */);
|
|
151
|
+
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */);
|
|
152
|
+
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */), createElementVNode("div", {
|
|
153
|
+
ref: "editorRef",
|
|
154
|
+
class: normalizeClass(_ctx.editorInputStyles)
|
|
155
|
+
}, null, 2 /* CLASS */)], 2 /* CLASS */), _ctx.toolbarButtonRef ? (openBlock(), createBlock(_component_or_menu, {
|
|
156
|
+
key: 0,
|
|
157
|
+
ref: "menuRef",
|
|
158
|
+
trigger: _ctx.toolbarButtonRef[_ctx.getIndexOfHeading].root,
|
|
159
|
+
placement: "bottom-start"
|
|
160
|
+
}, {
|
|
161
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.headingLevels, heading => {
|
|
162
|
+
return openBlock(), createBlock(_component_or_menu_item, {
|
|
163
|
+
key: heading,
|
|
164
|
+
onClick: $event => _ctx.handleToolbarClick('heading', heading)
|
|
165
|
+
}, {
|
|
166
|
+
default: withCtx(() => [createTextVNode(" Heading " + toDisplayString(heading), 1 /* TEXT */)]),
|
|
167
|
+
|
|
168
|
+
_: 2 /* DYNAMIC */
|
|
169
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
|
|
170
|
+
}), 128 /* KEYED_FRAGMENT */)), createVNode(_component_or_menu_item, {
|
|
171
|
+
onClick: _cache[2] || (_cache[2] = $event => _ctx.handleToolbarClick('heading'))
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [createTextVNode(" None ")]),
|
|
174
|
+
_: 1 /* STABLE */
|
|
175
|
+
})]),
|
|
176
|
+
|
|
177
|
+
_: 1 /* STABLE */
|
|
178
|
+
}, 8 /* PROPS */, ["trigger"])) : createCommentVNode("v-if", true), createVNode(_component_or_modal, {
|
|
179
|
+
"is-open": _ctx.isOpenLinkModal,
|
|
180
|
+
size: "s"
|
|
181
|
+
}, {
|
|
182
|
+
header: withCtx(() => [_hoisted_1]),
|
|
183
|
+
footer: withCtx(() => [createElementVNode("div", _hoisted_2, [createVNode(_component_or_button, {
|
|
184
|
+
variant: "outlined",
|
|
185
|
+
onClick: _ctx.discardLink
|
|
186
|
+
}, {
|
|
187
|
+
default: withCtx(() => [_hoisted_3]),
|
|
188
|
+
_: 1 /* STABLE */
|
|
189
|
+
}, 8 /* PROPS */, ["onClick"]), createVNode(_component_or_button, {
|
|
190
|
+
onClick: _ctx.attachLink
|
|
191
|
+
}, {
|
|
192
|
+
default: withCtx(() => [_hoisted_4]),
|
|
193
|
+
_: 1 /* STABLE */
|
|
194
|
+
}, 8 /* PROPS */, ["onClick"])])]),
|
|
195
|
+
default: withCtx(() => [createElementVNode("div", null, [createVNode(_component_or_label, null, {
|
|
196
|
+
default: withCtx(() => [createTextVNode(" Text ")]),
|
|
197
|
+
_: 1 /* STABLE */
|
|
198
|
+
}), createVNode(_component_or_input, {
|
|
199
|
+
modelValue: _ctx.text,
|
|
200
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = $event => _ctx.text = $event),
|
|
201
|
+
placeholder: "Placeholder",
|
|
202
|
+
class: "pb-md"
|
|
203
|
+
}, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_or_label, null, {
|
|
204
|
+
default: withCtx(() => [createTextVNode(" Link ")]),
|
|
205
|
+
_: 1 /* STABLE */
|
|
206
|
+
}), createVNode(_component_or_input, {
|
|
207
|
+
modelValue: _ctx.link,
|
|
208
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.link = $event),
|
|
209
|
+
placeholder: "Placeholder"
|
|
210
|
+
}, null, 8 /* PROPS */, ["modelValue"])])]),
|
|
211
|
+
_: 1 /* STABLE */
|
|
212
|
+
}, 8 /* PROPS */, ["is-open"])], 2 /* CLASS */);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
var css_248z = ".tiptap-editor ol {\n margin: 0 24px;\n list-style: decimal;\n}\n.tiptap-editor ul {\n margin: 0 24px;\n list-style: disc outside none;\n list-style: initial;\n}\n.tiptap-editor pre {\n background-color: rgba(186, 209, 236, 0.3);\n padding: 4px 8px;\n margin: 4px 0;\n width: 100%;\n border-radius: 4px;\n}\n.tiptap-editor blockquote {\n margin: 8px 24px;\n padding: 0 24px;\n border-left: 4px solid #bad1ec;\n}\n.tiptap-editor .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}\n.tiptap-editor .cm-editor {\n border: none;\n border-radius: 4px;\n}\n.tiptap-editor .cm-editor .cm-scroller {\n border-radius: 4px;\n}\n.tiptap-editor .cm-editor.cm-focused {\n outline: none;\n}\n.tiptap-editor .cm-editor .cm-gutters {\n background-color: rgba(0, 95, 177, 0.08);\n border: none;\n}\n.tiptap-editor .cm-editor .cm-gutters .cm-gutterElement {\n padding: 0 10px;\n}\n.tiptap-editor .cm-editor .cm-gutters .cm-gutterElement.cm-activeLineGutter {\n background-color: rgba(0, 95, 177, 0.07);\n}";
|
|
216
|
+
styleInject(css_248z);
|
|
217
|
+
|
|
218
|
+
script.render = render;
|
|
219
|
+
script.__file = "src/components/or-rich-text-editor-v3/OrRichTextEditor.vue";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { Level } from '@tiptap/extension-heading';
|
|
3
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
|
+
editor: Editor | null;
|
|
5
|
+
editorRef: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
6
|
+
containerRef: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
7
|
+
toolbarButtonRef: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
8
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
9
|
+
} | string[], {} & {}, {
|
|
10
|
+
[x: number]: string;
|
|
11
|
+
} | {}, true> | undefined>;
|
|
12
|
+
menuRef: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
13
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
14
|
+
} | string[], {} & {}, {
|
|
15
|
+
[x: number]: string;
|
|
16
|
+
} | {}, true> | undefined>;
|
|
17
|
+
iconsEnum: import("@vue/composition-api").Ref<{
|
|
18
|
+
[x: string]: string;
|
|
19
|
+
}>;
|
|
20
|
+
handleToolbarClick: (item: string, level?: number) => void;
|
|
21
|
+
handleEditorClick: () => void;
|
|
22
|
+
isActive: import("@vue/composition-api").Ref<{
|
|
23
|
+
[x: string]: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
iconTooltipsEnum: import("@vue/composition-api").Ref<{
|
|
26
|
+
[x: string]: string;
|
|
27
|
+
}>;
|
|
28
|
+
containerStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
29
|
+
toolbarContainerStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
30
|
+
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
31
|
+
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
32
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
33
|
+
toolbarButtonStyles: (item: string) => string[];
|
|
34
|
+
editorInputStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
35
|
+
getIndexOfHeading: import("@vue/composition-api").ComputedRef<number>;
|
|
36
|
+
headingLevels: Level[];
|
|
37
|
+
headingIcon: import("@vue/composition-api").ComputedRef<string>;
|
|
38
|
+
attachLink: () => Promise<void>;
|
|
39
|
+
discardLink: () => void;
|
|
40
|
+
isOpenLinkModal: import("@vue/composition-api").Ref<boolean>;
|
|
41
|
+
text: import("@vue/composition-api").Ref<string>;
|
|
42
|
+
link: import("@vue/composition-api").Ref<string>;
|
|
43
|
+
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
44
|
+
modelValue: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
value: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
toolbar: {
|
|
53
|
+
type: ArrayConstructor;
|
|
54
|
+
default: () => string[][];
|
|
55
|
+
};
|
|
56
|
+
description: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
placeholder: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
autofocus: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
markdownFormat: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
72
|
+
fullHeight: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: boolean;
|
|
75
|
+
};
|
|
76
|
+
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
default: undefined;
|
|
80
|
+
};
|
|
81
|
+
value: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
toolbar: {
|
|
86
|
+
type: ArrayConstructor;
|
|
87
|
+
default: () => string[][];
|
|
88
|
+
};
|
|
89
|
+
description: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
placeholder: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
autofocus: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: boolean;
|
|
100
|
+
};
|
|
101
|
+
markdownFormat: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
fullHeight: {
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
default: boolean;
|
|
108
|
+
};
|
|
109
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
110
|
+
modelValue: string;
|
|
111
|
+
value: string;
|
|
112
|
+
toolbar: unknown[];
|
|
113
|
+
description: string;
|
|
114
|
+
placeholder: string;
|
|
115
|
+
autofocus: boolean;
|
|
116
|
+
markdownFormat: boolean;
|
|
117
|
+
fullHeight: boolean;
|
|
118
|
+
} & {} & {
|
|
119
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
120
|
+
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
121
|
+
editor: Editor | null;
|
|
122
|
+
editorRef: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
123
|
+
containerRef: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
|
|
124
|
+
toolbarButtonRef: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
125
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
126
|
+
} | string[], {} & {}, {
|
|
127
|
+
[x: number]: string;
|
|
128
|
+
} | {}, true> | undefined>;
|
|
129
|
+
menuRef: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
130
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
131
|
+
} | string[], {} & {}, {
|
|
132
|
+
[x: number]: string;
|
|
133
|
+
} | {}, true> | undefined>;
|
|
134
|
+
iconsEnum: import("@vue/composition-api").Ref<{
|
|
135
|
+
[x: string]: string;
|
|
136
|
+
}>;
|
|
137
|
+
handleToolbarClick: (item: string, level?: number) => void;
|
|
138
|
+
handleEditorClick: () => void;
|
|
139
|
+
isActive: import("@vue/composition-api").Ref<{
|
|
140
|
+
[x: string]: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
iconTooltipsEnum: import("@vue/composition-api").Ref<{
|
|
143
|
+
[x: string]: string;
|
|
144
|
+
}>;
|
|
145
|
+
containerStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
146
|
+
toolbarContainerStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
147
|
+
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
148
|
+
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
149
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
150
|
+
toolbarButtonStyles: (item: string) => string[];
|
|
151
|
+
editorInputStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
152
|
+
getIndexOfHeading: import("@vue/composition-api").ComputedRef<number>;
|
|
153
|
+
headingLevels: Level[];
|
|
154
|
+
headingIcon: import("@vue/composition-api").ComputedRef<string>;
|
|
155
|
+
attachLink: () => Promise<void>;
|
|
156
|
+
discardLink: () => void;
|
|
157
|
+
isOpenLinkModal: import("@vue/composition-api").Ref<boolean>;
|
|
158
|
+
text: import("@vue/composition-api").Ref<string>;
|
|
159
|
+
link: import("@vue/composition-api").Ref<string>;
|
|
160
|
+
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
161
|
+
modelValue: string;
|
|
162
|
+
value: string;
|
|
163
|
+
toolbar: unknown[];
|
|
164
|
+
description: string;
|
|
165
|
+
placeholder: string;
|
|
166
|
+
autofocus: boolean;
|
|
167
|
+
markdownFormat: boolean;
|
|
168
|
+
fullHeight: boolean;
|
|
169
|
+
} & {} & {
|
|
170
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
modelValue: string;
|
|
173
|
+
value: string;
|
|
174
|
+
toolbar: unknown[];
|
|
175
|
+
description: string;
|
|
176
|
+
placeholder: string;
|
|
177
|
+
autofocus: boolean;
|
|
178
|
+
markdownFormat: boolean;
|
|
179
|
+
fullHeight: boolean;
|
|
180
|
+
}, true>);
|
|
181
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OrRichTextEditorV3 } from './OrRichTextEditor.vue';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export { s as OrRichTextEditorV3 } from '../../OrRichTextEditor.vue_vue_type_script_lang-33b56bd6.js';
|
|
2
|
+
import 'vue-demi';
|
|
3
|
+
import '@vueuse/core';
|
|
4
|
+
import '../../markdown-00716a39.js';
|
|
5
|
+
import '../../index-62c3221b.js';
|
|
6
|
+
import 'node:punycode';
|
|
7
|
+
import '../../tiptap-core.esm-f85402b1.js';
|
|
8
|
+
import '../../index.es-3f39f316.js';
|
|
9
|
+
import './styles.js';
|
|
10
|
+
import './utils/codemirror/codemirrorNode.js';
|
|
11
|
+
import './utils/codemirror/codemirrorView.js';
|
|
12
|
+
import '../../index-c76372bb.js';
|
|
13
|
+
import '../../index-92e69736.js';
|
|
14
|
+
import '../../index-62e39ec2.js';
|
|
15
|
+
import '../../index-db5e8c99.js';
|
|
16
|
+
import '../OrIconButtonV3/OrIconButton.js';
|
|
17
|
+
import '../../OrIconButton.vue_vue_type_script_lang-42a8285c.js';
|
|
18
|
+
import '../OrIconButtonV3/props.js';
|
|
19
|
+
import '../OrIconV3/props.js';
|
|
20
|
+
import '../OrIconButtonV3/styles.js';
|
|
21
|
+
import '../OrIconV3/OrIcon.js';
|
|
22
|
+
import '../../OrIcon.vue_vue_type_script_lang-73f9cc63.js';
|
|
23
|
+
import '../OrIconV3/styles.js';
|
|
24
|
+
import 'vue';
|
|
25
|
+
import '../OrTooltipV3/OrTooltip.js';
|
|
26
|
+
import '../../OrTooltip.vue_vue_type_script_lang-703eaacb.js';
|
|
27
|
+
import '../OrTooltipV3/styles.js';
|
|
28
|
+
import '../OrPopoverV3/OrPopover.js';
|
|
29
|
+
import '../../OrPopover.vue_vue_type_script_lang-a9419b58.js';
|
|
30
|
+
import '../../floating-ui.dom.esm-83eba816.js';
|
|
31
|
+
import '../OrPopoverV3/props.js';
|
|
32
|
+
import '../OrPopoverV3/styles.js';
|
|
33
|
+
import '../OrBottomSheetV3/OrBottomSheet.js';
|
|
34
|
+
import '../../OrBottomSheet.vue_vue_type_script_lang-1489a97d.js';
|
|
35
|
+
import '../OrBottomSheetV3/styles.js';
|
|
36
|
+
import '../OrOverlayV3/OrOverlay.js';
|
|
37
|
+
import '../../OrOverlay.vue_vue_type_script_lang-30f62546.js';
|
|
38
|
+
import '../OrOverlayV3/styles.js';
|
|
39
|
+
import '../OrTeleportV3/OrTeleport.js';
|
|
40
|
+
import '../../OrTeleport.vue3.vue_vue_type_script_lang-a6ce162e.js';
|
|
41
|
+
import '../../hooks/useElevation.js';
|
|
42
|
+
import '../../utils/isVisible.js';
|
|
43
|
+
import '../../hooks/useResponsive/useResponsive.js';
|
|
44
|
+
import '../OrLabelV3/OrLabel.js';
|
|
45
|
+
import '../../OrLabel.vue_vue_type_script_lang-3e11ab8a.js';
|
|
46
|
+
import '../OrLabelV3/props.js';
|
|
47
|
+
import '../OrLabelV3/styles.js';
|
|
48
|
+
import '../OrMenuItemV3/OrMenuItem.js';
|
|
49
|
+
import '../../OrMenuItem.vue_vue_type_script_lang-b338d68a.js';
|
|
50
|
+
import '../OrMenuItemV3/styles.js';
|
|
51
|
+
import '../OrMenuV3/OrMenu.js';
|
|
52
|
+
import '../../OrMenu.vue_vue_type_script_lang-2676b9cc.js';
|
|
53
|
+
import '../OrMenuV3/styles.js';
|
|
54
|
+
import '../OrModalV3/OrModal.js';
|
|
55
|
+
import '../../OrModal.vue_vue_type_script_lang-9ed0d5c2.js';
|
|
56
|
+
import '../OrModalV3/props.js';
|
|
57
|
+
import '../OrModalV3/styles.js';
|
|
58
|
+
import '../OrInputV3/OrInput.js';
|
|
59
|
+
import '../../OrInput.vue_vue_type_script_lang-60b49ebd.js';
|
|
60
|
+
import '../OrInputV3/props.js';
|
|
61
|
+
import '../OrInputBoxV3/props.js';
|
|
62
|
+
import '../OrInputV3/styles.js';
|
|
63
|
+
import '../OrErrorV3/OrError.js';
|
|
64
|
+
import '../../OrError.vue_vue_type_script_lang-df7b5e32.js';
|
|
65
|
+
import '../OrErrorV3/styles.js';
|
|
66
|
+
import '../OrHintV3/OrHint.js';
|
|
67
|
+
import '../../OrHint.vue_vue_type_script_lang-0f5e8377.js';
|
|
68
|
+
import '../OrHintV3/styles.js';
|
|
69
|
+
import '../OrInputBoxV3/OrInputBox.js';
|
|
70
|
+
import '../../OrInputBox.vue_vue_type_script_lang-e3bba923.js';
|
|
71
|
+
import '../OrInputBoxV3/styles.js';
|
|
72
|
+
import '../OrLoaderV3/OrLoader.js';
|
|
73
|
+
import '../../OrLoader.vue_vue_type_script_lang-49907820.js';
|
|
74
|
+
import '../OrLoaderV3/props.js';
|
|
75
|
+
import '../OrLoaderV3/styles.js';
|
|
76
|
+
import '../../hooks/useIdAttribute.js';
|
|
77
|
+
import '../../hooks/useControlAttributes.js';
|
|
78
|
+
import '../../hooks/useValidationAttributes.js';
|
|
79
|
+
import '../../style-inject.es-4c6f2515.js';
|
|
80
|
+
import '../OrButtonV3/OrButton.js';
|
|
81
|
+
import '../../OrButton.vue_vue_type_script_lang-fe412ca5.js';
|
|
82
|
+
import '../OrButtonV3/props.js';
|
|
83
|
+
import '../OrButtonV3/styles.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const EditorContainer: string[];
|
|
2
|
+
export declare const ToolbarContainer: string[];
|
|
3
|
+
export declare const Toolbar: string[];
|
|
4
|
+
export declare const ToolbarButton: string[];
|
|
5
|
+
export declare const ToolbarButtonFocused: string[];
|
|
6
|
+
export declare const ToolbarButtonActive: string[];
|
|
7
|
+
export declare const EditorInput: string[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const EditorContainer = [
|
|
2
|
+
// Colors
|
|
3
|
+
'border-outline', 'dark:border-outline-dark', 'focus-within:theme-border-1-primary', 'dark:focus-within:theme-border-1-primary-dark', 'focus-within:bg-primary-opacity-0-08', 'dark:focus-within:bg-primary-opacity-0-08-dark', 'focus-within:theme-outline-primary', 'dark:focus-within:theme-outline-primary-dark',
|
|
4
|
+
// Sizing
|
|
5
|
+
'border-1', 'rounded-md', 'w-full'];
|
|
6
|
+
const ToolbarContainer = [
|
|
7
|
+
// Layout
|
|
8
|
+
'flex',
|
|
9
|
+
//Spacing
|
|
10
|
+
'py-sm',
|
|
11
|
+
//Sizing
|
|
12
|
+
'border-b-1',
|
|
13
|
+
//Colors
|
|
14
|
+
'border-b-outline', 'dark:border-b-outline-dark'];
|
|
15
|
+
const Toolbar = [
|
|
16
|
+
// Layout
|
|
17
|
+
'flex',
|
|
18
|
+
// Spacing
|
|
19
|
+
'px-sm', 'gap-md',
|
|
20
|
+
// Sizing
|
|
21
|
+
'border-r-1',
|
|
22
|
+
//Colors
|
|
23
|
+
'border-r-disabled', 'dark:border-r-outline-dark',
|
|
24
|
+
// Last child
|
|
25
|
+
'last-of-type:border-none'];
|
|
26
|
+
const ToolbarButton = [
|
|
27
|
+
// Typography
|
|
28
|
+
'text-on-disabled', 'dark:text-on-disabled-dark'];
|
|
29
|
+
const ToolbarButtonFocused = [
|
|
30
|
+
// Typography
|
|
31
|
+
'text-outline', 'dark:text-outline-dark'];
|
|
32
|
+
const ToolbarButtonActive = [
|
|
33
|
+
// Typography
|
|
34
|
+
'text-on-background', 'dark:text-on-background-dark'];
|
|
35
|
+
const EditorInput = [
|
|
36
|
+
// Spacing
|
|
37
|
+
'p-sm',
|
|
38
|
+
// Typography
|
|
39
|
+
'typography-body-2-regular', 'text-on-background', 'dark:text-on-background-dark',
|
|
40
|
+
// Sizing
|
|
41
|
+
'min-h-[88px]'];
|
|
42
|
+
|
|
43
|
+
export { EditorContainer, EditorInput, Toolbar, ToolbarButton, ToolbarButtonActive, ToolbarButtonFocused, ToolbarContainer };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { N as Node } from '../../../../tiptap-core.esm-f85402b1.js';
|
|
2
|
+
import CodeMirrorView from './codemirrorView.js';
|
|
3
|
+
import { m as minimalSetup } from '../../../../index-92e69736.js';
|
|
4
|
+
import { e as javascript } from '../../../../index-db5e8c99.js';
|
|
5
|
+
import '../../../../index-62c3221b.js';
|
|
6
|
+
import '../../../../index.es-3f39f316.js';
|
|
7
|
+
import '../../../../index-c76372bb.js';
|
|
8
|
+
import '../../../../index-62e39ec2.js';
|
|
9
|
+
|
|
10
|
+
var codemirrorNode = Node.create({
|
|
11
|
+
name: 'codeBlock',
|
|
12
|
+
content: 'text*',
|
|
13
|
+
marks: '',
|
|
14
|
+
group: 'block',
|
|
15
|
+
code: true,
|
|
16
|
+
defining: true,
|
|
17
|
+
isolating: true,
|
|
18
|
+
parseHTML() {
|
|
19
|
+
return [{
|
|
20
|
+
tag: 'pre',
|
|
21
|
+
preserveWhitespace: 'full'
|
|
22
|
+
}];
|
|
23
|
+
},
|
|
24
|
+
renderHTML() {
|
|
25
|
+
return ['pre', ['code', 0]];
|
|
26
|
+
},
|
|
27
|
+
addNodeView() {
|
|
28
|
+
return ({
|
|
29
|
+
node,
|
|
30
|
+
editor,
|
|
31
|
+
getPos
|
|
32
|
+
}) => {
|
|
33
|
+
return new CodeMirrorView({
|
|
34
|
+
node,
|
|
35
|
+
view: editor.view,
|
|
36
|
+
getPos: getPos,
|
|
37
|
+
cmOptions: {
|
|
38
|
+
extensions: [minimalSetup, javascript()]
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { codemirrorNode as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TextSelection } from 'prosemirror-state';
|
|
2
|
+
import { EditorView, NodeView } from 'prosemirror-view';
|
|
3
|
+
import { Node as ProsemirrorNode } from 'prosemirror-model';
|
|
4
|
+
import { Transaction as CMTransaction } from '@codemirror/state';
|
|
5
|
+
import { Command, EditorView as CMView } from '@codemirror/view';
|
|
6
|
+
import { CodeMirrorViewOptions } from './types';
|
|
7
|
+
declare class CodeMirrorView implements NodeView {
|
|
8
|
+
name: string;
|
|
9
|
+
node: ProsemirrorNode;
|
|
10
|
+
view: EditorView;
|
|
11
|
+
dom: HTMLElement;
|
|
12
|
+
cm: CMView;
|
|
13
|
+
getPos: () => number;
|
|
14
|
+
updating: boolean;
|
|
15
|
+
constructor(options: CodeMirrorViewOptions);
|
|
16
|
+
forwardSelection(): void;
|
|
17
|
+
asProseMirrorSelection(doc: ProsemirrorNode): TextSelection;
|
|
18
|
+
dispatch(cmTr: CMTransaction): void;
|
|
19
|
+
mayBeEscape(unit: 'char' | 'line', dir: -1 | 1): Command;
|
|
20
|
+
update(node: ProsemirrorNode): boolean;
|
|
21
|
+
setSelection(anchor: number, head: number): void;
|
|
22
|
+
focus(): void;
|
|
23
|
+
selectNode(): void;
|
|
24
|
+
stopEvent(): boolean;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
27
|
+
export default CodeMirrorView;
|