@onereach/ui-components 2.68.0-beta.2001.0 → 2.68.0-beta.2003.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.
Files changed (63) hide show
  1. package/dist/bundled/v2/{OrCode-0cd991a1.js → OrCode-edc7a1f5.js} +114 -1
  2. package/dist/bundled/v2/components/index.js +1 -2
  3. package/dist/bundled/v2/components/or-code/index.js +1 -2
  4. package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +39 -0
  5. package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +109 -0
  6. package/dist/bundled/v2/components/or-empty-state-v3/index.d.ts +2 -0
  7. package/dist/bundled/v2/components/or-empty-state-v3/index.js +131 -0
  8. package/dist/bundled/v2/components/or-empty-state-v3/types.d.ts +2 -0
  9. package/dist/bundled/v2/index.js +2 -3
  10. package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-6c5f94a6.js → OrCode.vue_vue_type_script_lang-ef5e7f04.js} +114 -1
  11. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-2fdbd2f2.js → OrTabs.vue_vue_type_script_lang-ca57f9d9.js} +36 -10
  12. package/dist/bundled/v3/components/index.js +2 -4
  13. package/dist/bundled/v3/components/or-code/index.js +1 -2
  14. package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +39 -0
  15. package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +109 -0
  16. package/dist/bundled/v3/components/or-empty-state-v3/index.d.ts +2 -0
  17. package/dist/bundled/v3/components/or-empty-state-v3/index.js +111 -0
  18. package/dist/bundled/v3/components/or-empty-state-v3/types.d.ts +2 -0
  19. package/dist/bundled/v3/components/or-tabs-v3/index.js +1 -2
  20. package/dist/bundled/v3/index.js +5 -7
  21. package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +39 -0
  22. package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +109 -0
  23. package/dist/esm/v2/components/or-empty-state-v3/index.d.ts +2 -0
  24. package/dist/esm/v2/components/or-empty-state-v3/index.js +129 -0
  25. package/dist/esm/v2/components/or-empty-state-v3/types.d.ts +2 -0
  26. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +39 -0
  27. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +109 -0
  28. package/dist/esm/v3/components/or-empty-state-v3/index.d.ts +2 -0
  29. package/dist/esm/v3/components/or-empty-state-v3/index.js +111 -0
  30. package/dist/esm/v3/components/or-empty-state-v3/types.d.ts +2 -0
  31. package/package.json +1 -19
  32. package/src/components/or-empty-state-v3/OrEmptyState.stories3.ts +203 -0
  33. package/src/components/or-empty-state-v3/OrEmptyState.vue +101 -0
  34. package/src/components/or-empty-state-v3/index.ts +2 -0
  35. package/src/components/or-empty-state-v3/types.ts +3 -0
  36. package/dist/bundled/v2/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts +0 -12
  37. package/dist/bundled/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -149
  38. package/dist/bundled/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
  39. package/dist/bundled/v2/components/or-rich-text-editor-v3/index.js +0 -36840
  40. package/dist/bundled/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  41. package/dist/bundled/v2/index.es-3f39f316.js +0 -115
  42. package/dist/bundled/v3/OrMenu-08aa60de.js +0 -29
  43. package/dist/bundled/v3/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts +0 -12
  44. package/dist/bundled/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -149
  45. package/dist/bundled/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
  46. package/dist/bundled/v3/components/or-rich-text-editor-v3/index.js +0 -36811
  47. package/dist/bundled/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  48. package/dist/bundled/v3/index.es-3f39f316.js +0 -115
  49. package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts +0 -12
  50. package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -149
  51. package/dist/esm/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
  52. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +0 -524
  53. package/dist/esm/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  54. package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts +0 -12
  55. package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -149
  56. package/dist/esm/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
  57. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +0 -493
  58. package/dist/esm/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  59. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +0 -16
  60. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +0 -62
  61. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +0 -520
  62. package/src/components/or-rich-text-editor-v3/index.ts +0 -1
  63. package/src/components/or-rich-text-editor-v3/styles.ts +0 -65
@@ -1 +0,0 @@
1
- export { default as OrRichTextEditor } from './OrRichTextEditor.vue';
@@ -1,493 +0,0 @@
1
- import { defineComponent, ref, onMounted, onBeforeUnmount, computed, watch } from 'vue-demi';
2
- import { u as useClassAttribute } from '../../useClassAttribute-47fdb016.js';
3
- import '@vueuse/core';
4
- import { defaultMarkdownSerializer, MarkdownSerializer } from 'prosemirror-markdown';
5
- import { DOMParser as DOMParser$1 } from 'prosemirror-model';
6
- import { marked } from 'marked';
7
- import { s as script$1 } from '../../OrIconButton-85abafab.js';
8
- import { s as script$2 } from '../../OrLabel-7d4fe80b.js';
9
- import { s as script$4 } from '../../OrMenu-d9e12030.js';
10
- import '../../OrPopover-94a8f21d.js';
11
- import { s as script$3 } from '../../OrMenuItem-d001f0f6.js';
12
- import { Editor, mergeAttributes } from '@tiptap/core';
13
- import StarterKit from '@tiptap/starter-kit';
14
- import Underline from '@tiptap/extension-underline';
15
- import Link from '@tiptap/extension-link';
16
- import Highlight from '@tiptap/extension-highlight';
17
- import Heading from '@tiptap/extension-heading';
18
- import Placeholder from '@tiptap/extension-placeholder';
19
- import Paragraph from '@tiptap/extension-paragraph';
20
- import BulletList from '@tiptap/extension-bullet-list';
21
- import ListItem from '@tiptap/extension-list-item';
22
- import OrderedList from '@tiptap/extension-ordered-list';
23
- import Strike from '@tiptap/extension-strike';
24
- import Italic from '@tiptap/extension-italic';
25
- import Bold from '@tiptap/extension-bold';
26
- import { resolveComponent, openBlock, createElementBlock, mergeProps, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, normalizeClass, Fragment, renderList, createBlock, createCommentVNode } from 'vue';
27
- import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
28
- import '../../OrIcon-e2fa4cf8.js';
29
- import '../../OrTooltip-1500a1cd.js';
30
- import '@floating-ui/dom';
31
- import '../../useElevation-31bfe1f6.js';
32
- import '../../useResponsive-a02e95b7.js';
33
- import '../../OrBottomSheet-0eb33b18.js';
34
- import '../../OrOverlay-738a44d5.js';
35
- import '../../OrTeleport.vue3-8099178c.js';
36
-
37
- const EditorContainer = [
38
- // Colors
39
- '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',
40
- // Sizing
41
- 'border-1', 'rounded-md'];
42
- const ToolbarContainer = [
43
- // Layout
44
- 'flex',
45
- //Spacing
46
- 'py-sm',
47
- //Sizing
48
- 'border-b-1',
49
- //Colors
50
- 'border-b-outline', 'dark:border-b-outline-dark'];
51
- const Toolbar = [
52
- // Layout
53
- 'flex',
54
- // Spacing
55
- 'px-sm', 'gap-md',
56
- // Sizing
57
- 'border-r-1',
58
- //Colors
59
- 'border-r-disabled', 'dark:border-r-outline-dark',
60
- // Last child
61
- 'last-of-type:border-none'];
62
- const ToolbarButton = [
63
- // Typography
64
- 'text-on-disabled', 'dark:text-outline-dark'];
65
- const ToolbarButtonActive = [
66
- // Typography
67
- 'text-on-background', 'dark:text-on-background-dark'];
68
- const EditorInput = [
69
- // Spacing
70
- 'p-sm',
71
- // Typography
72
- 'typography-body-2-regular', 'text-on-background', 'dark:text-on-background-dark',
73
- // Sizing
74
- 'min-h-[88px]'];
75
-
76
- var script = defineComponent({
77
- name: 'OrRichTextEditor',
78
- components: {
79
- OrIconButton: script$1,
80
- OrLabel: script$2,
81
- OrMenuItem: script$3,
82
- OrMenu: script$4
83
- },
84
- inheritAttrs: false,
85
- props: {
86
- modelValue: {
87
- type: String,
88
- default: '',
89
- required: false
90
- },
91
- toolbar: {
92
- type: Array,
93
- default: () => [['heading'], ['bold', 'italic', 'strike'], ['underline', 'highlight'], ['link'], ['bulletList', 'orderedList'], ['undo', 'redo']]
94
- },
95
- description: {
96
- type: String,
97
- default: 'Description'
98
- },
99
- placeholder: {
100
- type: String,
101
- default: 'Write something...'
102
- },
103
- autofocus: {
104
- type: Boolean,
105
- default: false
106
- },
107
- markdown: {
108
- type: Boolean,
109
- default: true
110
- }
111
- },
112
- emits: ['update:modelValue'],
113
- setup(props, {
114
- emit
115
- }) {
116
- // Refs
117
- let editor = null;
118
- const editorRef = ref();
119
- const containerRef = ref();
120
- const toolbarButtonRef = ref();
121
- const menuRef = ref();
122
- const isActive = ref({});
123
- const headingLevels = [1, 2, 3, 4];
124
- const previousHeadingLevel = ref();
125
- const activeHeadingLevel = ref(0);
126
- const markdownOutput = ref('');
127
- const iconsEnum = ref({
128
- bold: 'format_bold',
129
- italic: 'format_italic',
130
- underline: 'format_underlined',
131
- strike: 'format_strikethrough',
132
- bulletList: 'format_list_bulleted',
133
- orderedList: 'format_list_numbered',
134
- link: 'link',
135
- highlight: 'highlight',
136
- redo: 'redo',
137
- undo: 'undo'
138
- });
139
- const iconTooltipsEnum = ref({
140
- bold: 'Bold',
141
- italic: 'Italic',
142
- underline: 'Underline',
143
- strike: 'Strike',
144
- bulletList: 'Bulleted List',
145
- orderedList: 'Numbered List',
146
- link: 'Link',
147
- highlight: 'Highlight',
148
- redo: 'Redo',
149
- undo: 'Undo'
150
- });
151
- const serializerMarks = {
152
- ...defaultMarkdownSerializer.marks,
153
- [Bold.name]: defaultMarkdownSerializer.marks.strong,
154
- [Strike.name]: {
155
- open: '~~',
156
- close: '~~',
157
- mixable: true,
158
- expelEnclosingWhitespace: true
159
- },
160
- [Italic.name]: {
161
- open: '_',
162
- close: '_',
163
- mixable: true,
164
- expelEnclosingWhitespace: true
165
- },
166
- [Highlight.name]: {
167
- open: '==',
168
- close: '==',
169
- mixable: true,
170
- expelEnclosingWhitespace: true
171
- },
172
- [Link.name]: {
173
- open(state, mark, parent, index) {
174
- return isPlainURL(mark, parent, index, 1) ? '<' : '[';
175
- },
176
- close(state, mark, parent, index) {
177
- const href = mark.attrs.canonicalSrc || mark.attrs.href;
178
- return isPlainURL(mark, parent, index, -1) ? '>' : `](${state.esc(href)}${mark.attrs.title ? ` ${state.quote(mark.attrs.title)}` : ''})`;
179
- }
180
- }
181
- };
182
- const serializerNodes = {
183
- ...defaultMarkdownSerializer.nodes,
184
- [Paragraph.name]: defaultMarkdownSerializer.nodes.paragraph,
185
- [BulletList.name]: defaultMarkdownSerializer.nodes.bullet_list,
186
- [ListItem.name]: defaultMarkdownSerializer.nodes.list_item,
187
- [OrderedList.name]: defaultMarkdownSerializer.nodes.ordered_list
188
- // [HardBreak.name]: //TODO: add hard break
189
- };
190
-
191
- onMounted(() => {
192
- editor = new Editor({
193
- onUpdate: ({
194
- editor
195
- }) => {
196
- setActiveFormats();
197
- const html = editor.getHTML();
198
- const text = editor.getText();
199
- if (props.markdown) {
200
- const markdown = markdownOutput.value = serialize(editor.schema, editor.getJSON());
201
- emit('update:modelValue', markdown);
202
- } else {
203
- emit('update:modelValue', text === '' ? text : html);
204
- }
205
- },
206
- onCreate: ({
207
- editor
208
- }) => {
209
- if (props.markdown) {
210
- const deserialized = deserialize(editor.schema, props.modelValue);
211
- editor.commands.setContent(deserialized);
212
- } else {
213
- editor.commands.setContent(props.modelValue);
214
- }
215
- },
216
- element: editorRef.value,
217
- autofocus: props.autofocus,
218
- extensions: [StarterKit.configure({
219
- heading: false
220
- }), Heading.configure({
221
- levels: headingLevels
222
- }).extend({
223
- levels: headingLevels,
224
- renderHTML({
225
- node,
226
- HTMLAttributes
227
- }) {
228
- return ['h' + node.attrs.level, mergeAttributes(HTMLAttributes, {
229
- class: `typography-headline-${node.attrs.level}`
230
- }), 0];
231
- }
232
- }), Underline, Link.configure({
233
- openOnClick: true,
234
- linkOnPaste: true,
235
- autolink: false,
236
- protocols: ['ftp', 'mailto', 'http', 'https'],
237
- validate: href => /^https?:\/\//.test(href),
238
- HTMLAttributes: {
239
- class: 'text-primary cursor-pointer'
240
- }
241
- }), Highlight, Placeholder.configure({
242
- placeholder: props.placeholder,
243
- emptyEditorClass: 'is-editor-empty text-outline'
244
- })],
245
- editorProps: {
246
- attributes: {
247
- class: 'focus:outline-none'
248
- }
249
- }
250
- });
251
- setActiveFormats();
252
- });
253
- onBeforeUnmount(() => {
254
- editor === null || editor === void 0 ? void 0 : editor.destroy();
255
- });
256
- // Computed
257
- const getIndexOfHeading = computed(() => {
258
- return props.toolbar.flat().indexOf('heading');
259
- });
260
- const headingIcon = computed(() => {
261
- if (activeHeadingLevel.value && isActive.value.heading) {
262
- return `format_h${activeHeadingLevel.value}`;
263
- }
264
- return 'format_paragraph';
265
- });
266
- // Methods
267
- const handleEditorClick = () => {
268
- setActiveFormats();
269
- editor === null || editor === void 0 ? void 0 : editor.commands.focus();
270
- };
271
- const handleToolbarClick = (item, level) => {
272
- if (item === 'bulletList' || item === 'orderedList') {
273
- item === 'bulletList' ? editor === null || editor === void 0 ? void 0 : editor.commands.toggleBulletList() : editor === null || editor === void 0 ? void 0 : editor.commands.toggleOrderedList();
274
- } else if (item === 'link') {
275
- setLink();
276
- } else if (item === 'heading') {
277
- if (!level) {
278
- editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
279
- level: previousHeadingLevel.value
280
- });
281
- activeHeadingLevel.value = 0;
282
- } else {
283
- activeHeadingLevel.value = level;
284
- previousHeadingLevel.value = level;
285
- editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
286
- level: level
287
- });
288
- }
289
- editor === null || editor === void 0 ? void 0 : editor.commands.focus();
290
- } else if (item === 'undo' || item === 'redo') {
291
- item === 'undo' ? editor === null || editor === void 0 ? void 0 : editor.commands.undo() : editor === null || editor === void 0 ? void 0 : editor.commands.redo();
292
- } else {
293
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().toggleMark(item).run();
294
- }
295
- };
296
- const setLink = () => {
297
- const previousUrl = editor === null || editor === void 0 ? void 0 : editor.getAttributes('link').href;
298
- const url = window.prompt('URL', previousUrl);
299
- // cancelled
300
- if (url === null) {
301
- return;
302
- }
303
- // empty
304
- if (url === '') {
305
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().extendMarkRange('link').unsetLink().run();
306
- return;
307
- }
308
- // update link
309
- editor === null || editor === void 0 ? void 0 : editor.chain().focus().extendMarkRange('link').setLink({
310
- href: url
311
- }).run();
312
- };
313
- const setActiveFormats = () => {
314
- const toolbarList = props.toolbar.flat();
315
- toolbarList.forEach(item => {
316
- isActive.value[item] = (editor === null || editor === void 0 ? void 0 : editor.isActive(item)) || false;
317
- });
318
- };
319
- // Styles
320
- const classAttribute = useClassAttribute();
321
- const rootStyles = computed(() => {
322
- return ['or-rich-text-editor', classAttribute.value];
323
- });
324
- const containerStyles = computed(() => {
325
- return [...EditorContainer];
326
- });
327
- const toolbarContainerStyles = computed(() => {
328
- return [...ToolbarContainer];
329
- });
330
- const toolbarStyles = computed(() => {
331
- return [...Toolbar];
332
- });
333
- const editorInputStyles = computed(() => {
334
- return ['tiptap-editor', ...EditorInput];
335
- });
336
- const toolbarButtonStyles = item => {
337
- return [
338
- // Layout
339
- 'flex',
340
- // Spacing
341
- 'gap-md', ...(isActive.value[item] ? ToolbarButtonActive : ToolbarButton)];
342
- };
343
- const isPlainURL = (link, parent, index, side) => {
344
- if (link.attrs.title || !/^\w+:/.test(link.attrs.href)) return false;
345
- const content = parent.child(index + (side < 0 ? -1 : 0));
346
- if (!content.isText || content.text !== link.attrs.href || content.marks[content.marks.length - 1] !== link) return false;
347
- if (index === (side < 0 ? 1 : parent.childCount - 1)) return true;
348
- const next = parent.child(index + (side < 0 ? -2 : 1));
349
- return !link.isInSet(next.marks);
350
- };
351
- const serialize = (schema, content) => {
352
- const proseMirrorDocument = schema.nodeFromJSON(content);
353
- const serializer = new MarkdownSerializer(serializerNodes, serializerMarks);
354
- return serializer.serialize(proseMirrorDocument, {
355
- tightLists: true
356
- });
357
- };
358
- const deserialize = (schema, content) => {
359
- const html = marked.parse(content);
360
- if (!html) return null;
361
- const parser = new DOMParser();
362
- const {
363
- body
364
- } = parser.parseFromString(html, 'text/html');
365
- // append original source as a comment that nodes can access
366
- body.append(document.createComment(content));
367
- const state = DOMParser$1.fromSchema(schema).parse(body);
368
- return state.toJSON();
369
- };
370
- //Effects
371
- watch(() => props.modelValue, value => {
372
- if (value !== (editor === null || editor === void 0 ? void 0 : editor.getHTML()) && !props.markdown) {
373
- editor === null || editor === void 0 ? void 0 : editor.commands.setContent(value);
374
- }
375
- if (props.markdown && value !== markdownOutput.value) {
376
- editor === null || editor === void 0 ? void 0 : editor.commands.setContent(markdownOutput.value);
377
- }
378
- });
379
- return {
380
- editor,
381
- editorRef,
382
- containerRef,
383
- toolbarButtonRef,
384
- menuRef,
385
- iconsEnum,
386
- handleToolbarClick,
387
- handleEditorClick,
388
- isActive,
389
- iconTooltipsEnum,
390
- containerStyles,
391
- toolbarContainerStyles,
392
- toolbarStyles,
393
- rootStyles,
394
- toolbarButtonStyles,
395
- editorInputStyles,
396
- getIndexOfHeading,
397
- headingLevels,
398
- headingIcon
399
- };
400
- }
401
- });
402
-
403
- function render(_ctx, _cache, $props, $setup, $data, $options) {
404
- const _component_or_label = resolveComponent("or-label");
405
- const _component_or_icon_button = resolveComponent("or-icon-button");
406
- const _component_or_menu_item = resolveComponent("or-menu-item");
407
- const _component_or_menu = resolveComponent("or-menu");
408
- return openBlock(), createElementBlock("div", mergeProps({
409
- ref: "root"
410
- }, _ctx.$attrs, {
411
- class: _ctx.rootStyles
412
- }), [createVNode(_component_or_label, null, {
413
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.description), 1 /* TEXT */)]),
414
-
415
- _: 1 /* STABLE */
416
- }), createElementVNode("div", {
417
- ref: "containerRef",
418
- class: normalizeClass(_ctx.containerStyles),
419
- onClick: _cache[1] || (_cache[1] = $event => _ctx.handleEditorClick())
420
- }, [createElementVNode("div", {
421
- class: normalizeClass(_ctx.toolbarContainerStyles)
422
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.toolbar, tool => {
423
- return openBlock(), createElementBlock("div", {
424
- key: tool,
425
- class: normalizeClass(_ctx.toolbarStyles)
426
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(tool, item => {
427
- return openBlock(), createElementBlock("div", {
428
- key: item,
429
- class: normalizeClass([_ctx.toolbarButtonStyles(item), "-my-xs"])
430
- }, [item === 'heading' ? (openBlock(), createBlock(_component_or_icon_button, {
431
- key: 0,
432
- ref_for: true,
433
- ref: "toolbarButtonRef",
434
- tooltip: {
435
- text: item,
436
- placement: 'top'
437
- },
438
- icon: {
439
- icon: _ctx.headingIcon,
440
- variant: 'inherit',
441
- size: 'm'
442
- },
443
- onClick: _cache[0] || (_cache[0] = $event => _ctx.menuRef.open())
444
- }, null, 8 /* PROPS */, ["tooltip", "icon"])) : (openBlock(), createBlock(_component_or_icon_button, {
445
- key: 1,
446
- tooltip: {
447
- text: _ctx.iconTooltipsEnum[item],
448
- placement: 'top'
449
- },
450
- icon: {
451
- icon: _ctx.iconsEnum[item],
452
- variant: 'inherit',
453
- size: 'm'
454
- },
455
- onClick: $event => _ctx.handleToolbarClick(item)
456
- }, null, 8 /* PROPS */, ["tooltip", "icon", "onClick"]))], 2 /* CLASS */);
457
- }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */);
458
- }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */), createElementVNode("div", {
459
- ref: "editorRef",
460
- class: normalizeClass(_ctx.editorInputStyles)
461
- }, null, 2 /* CLASS */)], 2 /* CLASS */), _ctx.toolbarButtonRef ? (openBlock(), createBlock(_component_or_menu, {
462
- key: 0,
463
- ref: "menuRef",
464
- trigger: _ctx.toolbarButtonRef[_ctx.getIndexOfHeading].root,
465
- placement: "bottom-start"
466
- }, {
467
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.headingLevels, heading => {
468
- return openBlock(), createBlock(_component_or_menu_item, {
469
- key: heading,
470
- onClick: $event => _ctx.handleToolbarClick('heading', heading)
471
- }, {
472
- default: withCtx(() => [createTextVNode(" Heading " + toDisplayString(heading), 1 /* TEXT */)]),
473
-
474
- _: 2 /* DYNAMIC */
475
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
476
- }), 128 /* KEYED_FRAGMENT */)), createVNode(_component_or_menu_item, {
477
- onClick: _cache[2] || (_cache[2] = $event => _ctx.handleToolbarClick('heading'))
478
- }, {
479
- default: withCtx(() => [createTextVNode(" None ")]),
480
- _: 1 /* STABLE */
481
- })]),
482
-
483
- _: 1 /* STABLE */
484
- }, 8 /* PROPS */, ["trigger"])) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */);
485
- }
486
-
487
- 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: initial;\n}\n.tiptap-editor .is-editor-empty::before {\n content: attr(data-placeholder);\n height: 0;\n pointer-events: none;\n float: left;\n}";
488
- styleInject(css_248z);
489
-
490
- script.render = render;
491
- script.__file = "src/components/or-rich-text-editor-v3/OrRichTextEditor.vue";
492
-
493
- export { script as OrRichTextEditor };
@@ -1,6 +0,0 @@
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 ToolbarButtonActive: string[];
6
- export declare const EditorInput: string[];
@@ -1,16 +0,0 @@
1
- import {
2
- Title,
3
- Subtitle,
4
- Description,
5
- Primary,
6
- ArgsTable,
7
- Stories,
8
- PRIMARY_STORY
9
- } from '@storybook/addon-docs';
10
-
11
- <Title />
12
- <Subtitle />
13
- <Description />
14
- <Primary />
15
- <ArgsTable story={PRIMARY_STORY} />
16
- <Stories />
@@ -1,62 +0,0 @@
1
- import { Meta, StoryFn } from '@storybook/vue3';
2
- import { ref } from 'vue-demi';
3
- import OrRichTextEditorDocs from './OrRichTextEditor.docs.mdx';
4
- import OrRichTextEditor from './OrRichTextEditor.vue';
5
-
6
- export default {
7
- title: 'Experimental/OrRichTextEditor',
8
- component: OrRichTextEditor,
9
-
10
- argTypes: {
11
- // Props
12
- description: {
13
- control: { type: 'text' },
14
- },
15
- placeholder: {
16
- control: { type: 'text' },
17
- },
18
- modelValue: {
19
- control: { type: 'text' },
20
- },
21
- markdown: {
22
- control: { type: 'boolean' },
23
- },
24
- },
25
-
26
- parameters: {
27
- docs: {
28
- page: OrRichTextEditorDocs,
29
- },
30
-
31
- design: {
32
- type: 'figma',
33
- url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=608%3A2926',
34
- },
35
- },
36
- } as Meta<typeof OrRichTextEditor>;
37
-
38
- const Template: StoryFn<typeof OrRichTextEditor> = (args) => ({
39
- components: {
40
- OrRichTextEditor,
41
- },
42
-
43
- setup() {
44
- // Refs
45
- const text = ref('');
46
- return {
47
- args,
48
- text,
49
- };
50
- },
51
-
52
- template: `
53
- <div class="p-md">
54
- <OrRichTextEditor
55
- v-bind="args"
56
- v-model="text"
57
- />
58
- </div>
59
- `,
60
- });
61
-
62
- export const RichTextEditor = Template.bind({});