@vonage/vivid 4.19.0-preview.0 → 4.20.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/custom-elements.json +1616 -313
- package/index.cjs +5 -0
- package/index.d.ts +1 -0
- package/index.js +2 -2
- package/lib/accordion-item/accordion-item.d.ts +332 -5
- package/lib/action-group/action-group.d.ts +3 -120
- package/lib/alert/alert.d.ts +654 -6
- package/lib/audio-player/audio-player.d.ts +330 -5
- package/lib/avatar/avatar.d.ts +5 -4
- package/lib/badge/badge.d.ts +334 -7
- package/lib/banner/banner.d.ts +662 -133
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +0 -118
- package/lib/button/button.d.ts +335 -8
- package/lib/calendar-event/calendar-event.d.ts +3 -2
- package/lib/card/card.d.ts +2 -1
- package/lib/checkbox/checkbox.d.ts +2 -119
- package/lib/combobox/combobox.d.ts +335 -6
- package/lib/date-picker/date-picker.d.ts +12 -484
- package/lib/date-range-picker/date-range-picker.d.ts +6 -242
- package/lib/date-time-picker/date-time-picker.d.ts +12 -484
- package/lib/date-time-picker/definition.d.ts +2 -0
- package/lib/dial-pad/dial-pad.d.ts +328 -4
- package/lib/dialog/dialog.d.ts +326 -122
- package/lib/divider/divider.d.ts +0 -118
- package/lib/empty-state/empty-state.d.ts +3 -2
- package/lib/fab/fab.d.ts +333 -6
- package/lib/file-picker/file-picker.d.ts +334 -4
- package/lib/icon/icon.d.ts +2 -1
- package/lib/layout/layout.d.ts +6 -5
- package/lib/menu/menu.d.ts +0 -236
- package/lib/menu-item/menu-item.d.ts +332 -10
- package/lib/nav-disclosure/nav-disclosure.d.ts +330 -124
- package/lib/nav-item/nav-item.d.ts +329 -4
- package/lib/note/note.d.ts +329 -4
- package/lib/number-field/number-field.d.ts +658 -124
- package/lib/option/option.d.ts +332 -7
- package/lib/pagination/pagination.d.ts +4 -2
- package/lib/progress/progress.d.ts +0 -118
- package/lib/progress-ring/progress-ring.d.ts +0 -118
- package/lib/radio/radio.d.ts +2 -1
- package/lib/range-slider/range-slider.d.ts +330 -3
- package/lib/rich-text-editor/definition.d.ts +2 -0
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +3 -2
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +2 -0
- package/lib/rich-text-editor/menubar/definition.d.ts +2 -0
- package/lib/rich-text-editor/menubar/menubar.d.ts +4 -0
- package/lib/rich-text-editor/menubar/menubar.template.d.ts +4 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +8 -0
- package/lib/searchable-select/locale.d.ts +1 -0
- package/lib/searchable-select/option-tag.d.ts +330 -5
- package/lib/searchable-select/searchable-select.d.ts +661 -6
- package/lib/select/select.d.ts +336 -6
- package/lib/selectable-box/selectable-box.d.ts +0 -118
- package/lib/slider/slider.d.ts +326 -122
- package/lib/split-button/split-button.d.ts +667 -138
- package/lib/switch/switch.d.ts +0 -118
- package/lib/tab/tab.d.ts +658 -7
- package/lib/tabs/tabs.d.ts +2 -1
- package/lib/tag/tag.d.ts +333 -7
- package/lib/tag-group/tag-group.d.ts +0 -118
- package/lib/tag-name-map.d.ts +73 -0
- package/lib/text-anchor/text-anchor.d.ts +331 -123
- package/lib/text-area/text-area.d.ts +0 -118
- package/lib/text-field/text-field.d.ts +333 -124
- package/lib/time-picker/time-picker.d.ts +6 -242
- package/lib/toggletip/toggletip.d.ts +0 -118
- package/lib/tooltip/tooltip.d.ts +0 -118
- package/lib/tree-item/tree-item.d.ts +329 -4
- package/lib/video-player/video-player.d.ts +328 -4
- package/locales/de-DE.cjs +1 -0
- package/locales/de-DE.js +1 -0
- package/locales/en-GB.cjs +1 -0
- package/locales/en-GB.js +1 -0
- package/locales/en-US.cjs +1 -0
- package/locales/en-US.js +1 -0
- package/locales/ja-JP.cjs +1 -0
- package/locales/ja-JP.js +1 -0
- package/locales/zh-CN.cjs +1 -0
- package/locales/zh-CN.js +1 -0
- package/package.json +1 -1
- package/shared/_has.cjs +0 -4
- package/shared/_has.js +0 -4
- package/shared/affix.cjs +25 -19
- package/shared/affix.js +26 -20
- package/shared/apply-mixins.js +1 -1
- package/shared/aria/delegates-aria.d.ts +0 -118
- package/shared/calendar-picker.template.cjs +1 -1
- package/shared/calendar-picker.template.js +1 -1
- package/shared/children.js +1 -1
- package/shared/definition.cjs +2 -4
- package/shared/definition.js +2 -4
- package/shared/definition11.cjs +2 -4
- package/shared/definition11.js +2 -4
- package/shared/definition13.cjs +85 -159
- package/shared/definition13.js +85 -159
- package/shared/definition15.cjs +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.cjs +2 -3
- package/shared/definition16.js +2 -3
- package/shared/definition17.cjs +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition20.cjs +10 -10
- package/shared/definition20.js +1 -1
- package/shared/definition21.cjs +2 -4
- package/shared/definition21.js +2 -4
- package/shared/definition22.cjs +2 -4
- package/shared/definition22.js +2 -4
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +3 -3
- package/shared/definition26.js +3 -3
- package/shared/definition28.cjs +27 -38
- package/shared/definition28.js +27 -38
- package/shared/definition30.cjs +4 -11
- package/shared/definition30.js +4 -11
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +2 -4
- package/shared/definition32.js +2 -4
- package/shared/definition34.cjs +1 -3
- package/shared/definition34.js +1 -3
- package/shared/definition35.cjs +6 -6
- package/shared/definition35.js +6 -6
- package/shared/definition36.cjs +7 -7
- package/shared/definition36.js +7 -7
- package/shared/definition37.cjs +20 -2
- package/shared/definition37.js +20 -2
- package/shared/definition4.cjs +14 -19
- package/shared/definition4.js +14 -19
- package/shared/definition41.cjs +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.cjs +3 -5
- package/shared/definition42.js +3 -5
- package/shared/definition43.cjs +419 -19
- package/shared/definition43.js +420 -21
- package/shared/definition44.cjs +43 -48
- package/shared/definition44.js +43 -48
- package/shared/definition45.cjs +3 -4
- package/shared/definition45.js +3 -4
- package/shared/definition46.cjs +1 -1
- package/shared/definition46.js +1 -1
- package/shared/definition48.cjs +3 -5
- package/shared/definition48.js +3 -5
- package/shared/definition49.cjs +4 -7
- package/shared/definition49.js +4 -7
- package/shared/definition5.cjs +1 -3
- package/shared/definition5.js +2 -4
- package/shared/definition50.cjs +1 -1
- package/shared/definition50.js +1 -1
- package/shared/definition52.cjs +2 -5
- package/shared/definition52.js +2 -5
- package/shared/definition55.cjs +2 -4
- package/shared/definition55.js +2 -4
- package/shared/definition56.cjs +1 -1
- package/shared/definition56.js +1 -1
- package/shared/definition57.cjs +3 -2
- package/shared/definition57.js +3 -2
- package/shared/definition61.cjs +2 -4
- package/shared/definition61.js +2 -4
- package/shared/definition63.cjs +233 -160
- package/shared/definition63.js +233 -160
- package/shared/definition7.cjs +1 -3
- package/shared/definition7.js +1 -3
- package/shared/definition8.cjs +2 -5
- package/shared/definition8.js +2 -5
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/form-associated.js +1 -1
- package/shared/foundation/button/button.d.ts +0 -118
- package/shared/localized.cjs +10 -4
- package/shared/localized.js +10 -4
- package/shared/option.cjs +17 -22
- package/shared/option.js +18 -23
- package/shared/patterns/affix.d.ts +659 -7
- package/shared/patterns/anchored.d.ts +0 -236
- package/shared/patterns/localized.d.ts +328 -3
- package/shared/patterns/trapped-focus.d.ts +329 -6
- package/shared/picker-field/mixins/calendar-picker.d.ts +3 -121
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +3 -121
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +328 -4
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +6 -242
- package/shared/picker-field/mixins/single-date-picker.d.ts +9 -363
- package/shared/picker-field/mixins/single-value-picker.d.ts +3 -121
- package/shared/picker-field/mixins/time-selection-picker.d.ts +6 -242
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +6 -242
- package/shared/picker-field/picker-field.d.ts +655 -3
- package/shared/picker-field.template.cjs +33 -35
- package/shared/picker-field.template.js +34 -36
- package/shared/ref.js +1 -1
- package/shared/slotted.js +1 -1
- package/shared/text-anchor.cjs +2 -2
- package/shared/text-anchor.js +2 -2
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/time-selection-picker.template.cjs +3 -5
- package/shared/time-selection-picker.template.js +4 -6
- package/shared/utils/enums.d.ts +1 -0
- package/shared/vivid-element.cjs +1 -1
- package/shared/vivid-element.js +2 -2
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +1265 -1364
package/shared/definition43.js
CHANGED
|
@@ -1,7 +1,182 @@
|
|
|
1
|
-
import { V as VividElement, a as attr,
|
|
1
|
+
import { V as VividElement, a as attr, h as html, f as defineVividComponent, n as nullableNumberConverter, d as createRegisterFunction } from './vivid-element.js';
|
|
2
|
+
import { B as Button, b as buttonDefinition } from './definition11.js';
|
|
3
|
+
import { e as Menu, M as MenuItem, c as menuDefinition, m as menuItemDefinition } from './definition30.js';
|
|
4
|
+
import { D as Divider, d as dividerDefinition } from './definition23.js';
|
|
5
|
+
import { T as Tooltip, t as tooltipDefinition } from './definition60.js';
|
|
2
6
|
import { c as classNames } from './class-names.js';
|
|
7
|
+
import { r as repeat } from './repeat.js';
|
|
3
8
|
|
|
4
|
-
const styles = "@charset \"UTF-8\"
|
|
9
|
+
const styles$1 = "@charset \"UTF-8\";.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;inset:-2px -2px -2px -32px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-menu{margin:0 -4px;line-height:1}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.ProseMirror-menuitem{margin-right:3px;display:inline-block}.ProseMirror-menuseparator{border-right:1px solid #ddd;margin-right:3px}.ProseMirror-menu-dropdown,.ProseMirror-menu-dropdown-menu{font-size:90%;white-space:nowrap}.ProseMirror-menu-dropdown{vertical-align:1px;cursor:pointer;position:relative;padding-right:15px}.ProseMirror-menu-dropdown-wrap{padding:1px 0 1px 4px;display:inline-block;position:relative}.ProseMirror-menu-dropdown:after{content:\"\";border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid currentColor;opacity:.6;position:absolute;right:4px;top:calc(50% - 2px)}.ProseMirror-menu-dropdown-menu,.ProseMirror-menu-submenu{position:absolute;background:#fff;color:#666;border:1px solid #aaa;padding:2px}.ProseMirror-menu-dropdown-menu{z-index:15;min-width:6em}.ProseMirror-menu-dropdown-item{cursor:pointer;padding:2px 8px 2px 4px}.ProseMirror-menu-dropdown-item:hover{background:#f2f2f2}.ProseMirror-menu-submenu-wrap{position:relative;margin-right:-4px}.ProseMirror-menu-submenu-label:after{content:\"\";border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid currentColor;opacity:.6;position:absolute;right:4px;top:calc(50% - 4px)}.ProseMirror-menu-submenu{display:none;min-width:4em;left:100%;top:-3px}.ProseMirror-menu-active{background:#eee;border-radius:4px}.ProseMirror-menu-disabled{opacity:.3}.ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu,.ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu{display:block}.ProseMirror-menubar{border-top-left-radius:inherit;border-top-right-radius:inherit;position:relative;min-height:1em;color:#666;padding:1px 6px;top:0;left:0;right:0;border-bottom:1px solid silver;background:#fff;z-index:10;-moz-box-sizing:border-box;box-sizing:border-box;overflow:visible}.ProseMirror-icon{display:inline-block;line-height:.8;vertical-align:-2px;padding:2px 8px;cursor:pointer}.ProseMirror-menu-disabled.ProseMirror-icon{cursor:default}.ProseMirror-icon svg{fill:currentColor;height:1em}.ProseMirror-icon span{vertical-align:text-top}.ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute}.ProseMirror-gapcursor:after{content:\"\";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid black;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.ProseMirror-example-setup-style hr{padding:2px 10px;border:none;margin:1em 0}.ProseMirror-example-setup-style hr:after{content:\"\";display:block;height:1px;background-color:silver;line-height:2px}.ProseMirror ul,.ProseMirror ol{padding-left:30px}.ProseMirror blockquote{padding-left:1em;border-left:3px solid #eee;margin-left:0;margin-right:0}.ProseMirror-example-setup-style img{cursor:default}.ProseMirror-prompt{background:#fff;padding:5px 10px 5px 15px;border:1px solid silver;position:fixed;border-radius:3px;z-index:11;box-shadow:-.5px 2px 5px #0003}.ProseMirror-prompt h5{margin:0;font-weight:400;font-size:100%;color:#444}.ProseMirror-prompt input[type=text],.ProseMirror-prompt textarea{background:#eee;border:none;outline:none}.ProseMirror-prompt input[type=text]{padding:0 4px}.ProseMirror-prompt-close{position:absolute;left:2px;top:1px;color:#666;border:none;background:transparent;padding:0}.ProseMirror-prompt-close:after{content:\"✕\";font-size:12px}.ProseMirror-invalid{background:#ffc;border:1px solid #cc7;border-radius:4px;padding:5px 10px;position:absolute;min-width:10em}.ProseMirror-prompt-buttons{margin-top:5px;display:none}.editor{box-sizing:border-box;background:var(--vvd-color-canvas);background-clip:padding-box;color:var(--vvd-color-canvas-text)}.ProseMirror{position:relative;box-sizing:border-box;padding:10px 16px;block-size:120px;font:var(--vvd-typography-base);font-feature-settings:\"liga\" 0;font-variant-ligatures:none;line-height:1.2;outline:none;overflow-y:auto;white-space:break-spaces;word-wrap:break-word}.ProseMirror pre{white-space:pre-wrap}.ProseMirror p{margin-bottom:1em}.ProseMirror p:first-child,.ProseMirror h1:first-child,.ProseMirror h2:first-child,.ProseMirror h3:first-child,.ProseMirror h4:first-child,.ProseMirror h5:first-child,.ProseMirror h6:first-child{margin-top:10px}h2{font:var(--vvd-typography-heading-4)}h3{font:var(--vvd-typography-base-extended)}p{font:var(--vvd-typography-base)}";
|
|
10
|
+
|
|
11
|
+
const styles = ":host{display:flex;align-items:center;padding:8px;background-color:var(--vvd-color-neutral-50);gap:4px}:host .hide-menubar{display:none}.title{--_text-primary-custom-size: var(--vvd-typography-heading-4)}.subtitle{--_text-primary-custom-size: var(--vvd-typography-base-extended)}.body{--_text-primary-custom-size: var(--vvd-typography-base)}.divider{align-self:stretch}";
|
|
12
|
+
|
|
13
|
+
var __defProp$1 = Object.defineProperty;
|
|
14
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
15
|
+
var result = void 0 ;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (decorator(target, key, result) ) || result;
|
|
19
|
+
if (result) __defProp$1(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
class MenuBar extends VividElement {
|
|
23
|
+
}
|
|
24
|
+
__decorateClass$1([
|
|
25
|
+
attr({ attribute: "menu-items" })
|
|
26
|
+
], MenuBar.prototype, "menuItems");
|
|
27
|
+
|
|
28
|
+
function notifyMenuBarChange(menuBar, eventName, payload) {
|
|
29
|
+
menuBar.$emit(eventName, payload, { bubbles: false, composed: false });
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
const TEXT_DECORATION_ITEMS = [
|
|
33
|
+
{
|
|
34
|
+
text: "Bold",
|
|
35
|
+
icon: "bold-line",
|
|
36
|
+
value: "bold"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: "Italic",
|
|
40
|
+
icon: "italic-line",
|
|
41
|
+
value: "italics"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: "Underline",
|
|
45
|
+
icon: "underline-line",
|
|
46
|
+
value: "underline"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
text: "Strikethrough",
|
|
50
|
+
icon: "strikethrough-line",
|
|
51
|
+
value: "strikethrough"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
text: "Monospace",
|
|
55
|
+
icon: "monospace-line",
|
|
56
|
+
value: "monospace"
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
const MENU_BAR_ITEMS = {
|
|
60
|
+
textSize: function(context) {
|
|
61
|
+
const buttonTag = context.tagFor(Button);
|
|
62
|
+
const menuTag = context.tagFor(Menu);
|
|
63
|
+
const menuItemTag = context.tagFor(MenuItem);
|
|
64
|
+
const tooltipTag = context.tagFor(Tooltip);
|
|
65
|
+
return html`
|
|
66
|
+
<${menuTag}
|
|
67
|
+
trigger="auto"
|
|
68
|
+
id="text-size"
|
|
69
|
+
aria-label="Text Size"
|
|
70
|
+
placement="bottom-end"
|
|
71
|
+
>
|
|
72
|
+
<${tooltipTag} slot="anchor" text="Text Size" placement="top">
|
|
73
|
+
<${buttonTag}
|
|
74
|
+
slot="anchor"
|
|
75
|
+
aria-label="Open text size menu"
|
|
76
|
+
size="super-condensed"
|
|
77
|
+
appearance="ghost-light"
|
|
78
|
+
shape="pill"
|
|
79
|
+
icon="text-size-line"
|
|
80
|
+
></${buttonTag}>
|
|
81
|
+
</${tooltipTag}>
|
|
82
|
+
<${menuItemTag}
|
|
83
|
+
text="Title"
|
|
84
|
+
value="title"
|
|
85
|
+
internal-part
|
|
86
|
+
class="title"
|
|
87
|
+
connotation="cta"
|
|
88
|
+
@click="${(_, { parent }) => notifyMenuBarChange(parent, "text-size-selected", "title")}"
|
|
89
|
+
></${menuItemTag}>
|
|
90
|
+
<${menuItemTag}
|
|
91
|
+
text="Subtitle"
|
|
92
|
+
value="subtitle"
|
|
93
|
+
internal-part
|
|
94
|
+
class="subtitle"
|
|
95
|
+
connotation="cta"
|
|
96
|
+
@click="${(_, { parent }) => notifyMenuBarChange(parent, "text-size-selected", "subtitle")}"
|
|
97
|
+
></${menuItemTag}>
|
|
98
|
+
<${menuItemTag}
|
|
99
|
+
text="Body"
|
|
100
|
+
value="body"
|
|
101
|
+
internal-part
|
|
102
|
+
class="body"
|
|
103
|
+
connotation="cta"
|
|
104
|
+
@click="${(_, { parent }) => notifyMenuBarChange(parent, "text-size-selected", "body")}"
|
|
105
|
+
></${menuItemTag}>
|
|
106
|
+
</${menuTag}>
|
|
107
|
+
`;
|
|
108
|
+
},
|
|
109
|
+
textDecoration: function(context) {
|
|
110
|
+
const buttonTag = context.tagFor(Button);
|
|
111
|
+
const dividerTag = context.tagFor(Divider);
|
|
112
|
+
const tooltipTag = context.tagFor(Tooltip);
|
|
113
|
+
return html`
|
|
114
|
+
<${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
|
|
115
|
+
${repeat(
|
|
116
|
+
(_) => TEXT_DECORATION_ITEMS,
|
|
117
|
+
html`
|
|
118
|
+
<${tooltipTag} text="${(x) => x.text}" placement="top">
|
|
119
|
+
<${buttonTag}
|
|
120
|
+
slot="anchor"
|
|
121
|
+
aria-label="${(x) => x.text}"
|
|
122
|
+
size="super-condensed"
|
|
123
|
+
appearance="ghost-light"
|
|
124
|
+
shape="pill"
|
|
125
|
+
icon="${(x) => x.icon}"
|
|
126
|
+
@click="${(x, c) => notifyMenuBarChange(
|
|
127
|
+
c.parentContext.parent,
|
|
128
|
+
"text-decoration-selected",
|
|
129
|
+
x.value
|
|
130
|
+
)}"')}"
|
|
131
|
+
></${buttonTag}>
|
|
132
|
+
</${tooltipTag}>
|
|
133
|
+
`
|
|
134
|
+
)}
|
|
135
|
+
<${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const getClasses$1 = (menuBar) => classNames("control", [
|
|
140
|
+
"hide-menubar",
|
|
141
|
+
getValidMenuItems(menuBar).length === 0
|
|
142
|
+
]);
|
|
143
|
+
const validItems = ["textSize", "textDecoration"];
|
|
144
|
+
function createMenuItem(item) {
|
|
145
|
+
return MENU_BAR_ITEMS[item];
|
|
146
|
+
}
|
|
147
|
+
function getValidMenuItems({ menuItems }) {
|
|
148
|
+
return menuItems ? menuItems.split(" ").filter((item) => validItems.includes(item)) : [];
|
|
149
|
+
}
|
|
150
|
+
function renderMenuItems(context) {
|
|
151
|
+
return () => html`${repeat(
|
|
152
|
+
getValidMenuItems,
|
|
153
|
+
html`${(menuItemName) => createMenuItem(menuItemName)(context)}`
|
|
154
|
+
)}`;
|
|
155
|
+
}
|
|
156
|
+
const MenuBarTemplate = (context) => {
|
|
157
|
+
return html`<template class="${getClasses$1}">
|
|
158
|
+
${renderMenuItems(context)}
|
|
159
|
+
</template>`;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const menuBarDefinition = defineVividComponent(
|
|
163
|
+
"menubar",
|
|
164
|
+
MenuBar,
|
|
165
|
+
MenuBarTemplate,
|
|
166
|
+
[
|
|
167
|
+
buttonDefinition,
|
|
168
|
+
menuDefinition,
|
|
169
|
+
menuItemDefinition,
|
|
170
|
+
dividerDefinition,
|
|
171
|
+
tooltipDefinition
|
|
172
|
+
],
|
|
173
|
+
{
|
|
174
|
+
styles,
|
|
175
|
+
shadowOptions: {
|
|
176
|
+
delegatesFocus: true
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
);
|
|
5
180
|
|
|
6
181
|
// ::- Persistent data structure representing an ordered mapping from
|
|
7
182
|
// strings to values, with some convenient update methods.
|
|
@@ -1289,7 +1464,7 @@ structure between the old and new data as much as possible, which a
|
|
|
1289
1464
|
tree shape like this (without back pointers) makes easy.
|
|
1290
1465
|
|
|
1291
1466
|
**Do not** directly mutate the properties of a `Node` object. See
|
|
1292
|
-
[the guide](/docs/guide/#doc) for more information.
|
|
1467
|
+
[the guide](https://prosemirror.net/docs/guide/#doc) for more information.
|
|
1293
1468
|
*/
|
|
1294
1469
|
class Node {
|
|
1295
1470
|
/**
|
|
@@ -1324,7 +1499,7 @@ class Node {
|
|
|
1324
1499
|
get children() { return this.content.content; }
|
|
1325
1500
|
/**
|
|
1326
1501
|
The size of this node, as defined by the integer-based [indexing
|
|
1327
|
-
scheme](/docs/guide/#doc.indexing). For text nodes, this is the
|
|
1502
|
+
scheme](https://prosemirror.net/docs/guide/#doc.indexing). For text nodes, this is the
|
|
1328
1503
|
amount of characters. For other leaf nodes, it is one. For
|
|
1329
1504
|
non-leaf nodes, it is the size of the content plus two (the
|
|
1330
1505
|
start and end token).
|
|
@@ -6850,11 +7025,13 @@ function clientRect(node) {
|
|
|
6850
7025
|
function scrollRectIntoView(view, rect, startDOM) {
|
|
6851
7026
|
let scrollThreshold = view.someProp("scrollThreshold") || 0, scrollMargin = view.someProp("scrollMargin") || 5;
|
|
6852
7027
|
let doc = view.dom.ownerDocument;
|
|
6853
|
-
for (let parent = startDOM || view.dom;;
|
|
7028
|
+
for (let parent = startDOM || view.dom;;) {
|
|
6854
7029
|
if (!parent)
|
|
6855
7030
|
break;
|
|
6856
|
-
if (parent.nodeType != 1)
|
|
7031
|
+
if (parent.nodeType != 1) {
|
|
7032
|
+
parent = parentNode(parent);
|
|
6857
7033
|
continue;
|
|
7034
|
+
}
|
|
6858
7035
|
let elt = parent;
|
|
6859
7036
|
let atTop = elt == doc.body;
|
|
6860
7037
|
let bounding = atTop ? windowRect(doc) : clientRect(elt);
|
|
@@ -6883,8 +7060,10 @@ function scrollRectIntoView(view, rect, startDOM) {
|
|
|
6883
7060
|
rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };
|
|
6884
7061
|
}
|
|
6885
7062
|
}
|
|
6886
|
-
|
|
7063
|
+
let pos = atTop ? "fixed" : getComputedStyle(parent).position;
|
|
7064
|
+
if (/^(fixed|sticky)$/.test(pos))
|
|
6887
7065
|
break;
|
|
7066
|
+
parent = pos == "absolute" ? parent.offsetParent : parentNode(parent);
|
|
6888
7067
|
}
|
|
6889
7068
|
}
|
|
6890
7069
|
// Store the scroll position of the editor's parent nodes, along with
|
|
@@ -11353,6 +11532,7 @@ class DOMObserver {
|
|
|
11353
11532
|
view.input.lastFocus = 0;
|
|
11354
11533
|
selectionToDOM(view);
|
|
11355
11534
|
this.currentSelection.set(sel);
|
|
11535
|
+
view.scrollToSelection();
|
|
11356
11536
|
}
|
|
11357
11537
|
else if (from > -1 || newSel) {
|
|
11358
11538
|
if (from > -1) {
|
|
@@ -13120,6 +13300,68 @@ const selectTextblockStart = selectTextblockSide(-1);
|
|
|
13120
13300
|
Moves the cursor to the end of current text block.
|
|
13121
13301
|
*/
|
|
13122
13302
|
const selectTextblockEnd = selectTextblockSide(1);
|
|
13303
|
+
function markApplies(doc, ranges, type, enterAtoms) {
|
|
13304
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
13305
|
+
let { $from, $to } = ranges[i];
|
|
13306
|
+
let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;
|
|
13307
|
+
doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
|
|
13308
|
+
if (can || false)
|
|
13309
|
+
return false;
|
|
13310
|
+
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
13311
|
+
});
|
|
13312
|
+
if (can)
|
|
13313
|
+
return true;
|
|
13314
|
+
}
|
|
13315
|
+
return false;
|
|
13316
|
+
}
|
|
13317
|
+
/**
|
|
13318
|
+
Create a command function that toggles the given mark with the
|
|
13319
|
+
given attributes. Will return `false` when the current selection
|
|
13320
|
+
doesn't support that mark. This will remove the mark if any marks
|
|
13321
|
+
of that type exist in the selection, or add it otherwise. If the
|
|
13322
|
+
selection is empty, this applies to the [stored
|
|
13323
|
+
marks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the
|
|
13324
|
+
document.
|
|
13325
|
+
*/
|
|
13326
|
+
function toggleMark(markType, attrs = null, options) {
|
|
13327
|
+
return function (state, dispatch) {
|
|
13328
|
+
let { empty, $cursor, ranges } = state.selection;
|
|
13329
|
+
if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType))
|
|
13330
|
+
return false;
|
|
13331
|
+
if (dispatch) {
|
|
13332
|
+
if ($cursor) {
|
|
13333
|
+
if (markType.isInSet(state.storedMarks || $cursor.marks()))
|
|
13334
|
+
dispatch(state.tr.removeStoredMark(markType));
|
|
13335
|
+
else
|
|
13336
|
+
dispatch(state.tr.addStoredMark(markType.create(attrs)));
|
|
13337
|
+
}
|
|
13338
|
+
else {
|
|
13339
|
+
let add, tr = state.tr;
|
|
13340
|
+
{
|
|
13341
|
+
add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));
|
|
13342
|
+
}
|
|
13343
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
13344
|
+
let { $from, $to } = ranges[i];
|
|
13345
|
+
if (!add) {
|
|
13346
|
+
tr.removeMark($from.pos, $to.pos, markType);
|
|
13347
|
+
}
|
|
13348
|
+
else {
|
|
13349
|
+
let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;
|
|
13350
|
+
let spaceStart = start && start.isText ? /^\s*/.exec(start.text)[0].length : 0;
|
|
13351
|
+
let spaceEnd = end && end.isText ? /\s*$/.exec(end.text)[0].length : 0;
|
|
13352
|
+
if (from + spaceStart < to) {
|
|
13353
|
+
from += spaceStart;
|
|
13354
|
+
to -= spaceEnd;
|
|
13355
|
+
}
|
|
13356
|
+
tr.addMark(from, to, markType.create(attrs));
|
|
13357
|
+
}
|
|
13358
|
+
}
|
|
13359
|
+
dispatch(tr.scrollIntoView());
|
|
13360
|
+
}
|
|
13361
|
+
}
|
|
13362
|
+
return true;
|
|
13363
|
+
};
|
|
13364
|
+
}
|
|
13123
13365
|
/**
|
|
13124
13366
|
Combine a number of command functions into a single function (which
|
|
13125
13367
|
calls them one by one until one returns true).
|
|
@@ -13348,6 +13590,7 @@ const marks = {
|
|
|
13348
13590
|
Code font mark. Represented as a `<code>` element.
|
|
13349
13591
|
*/
|
|
13350
13592
|
code: {
|
|
13593
|
+
code: true,
|
|
13351
13594
|
parseDOM: [{ tag: "code" }],
|
|
13352
13595
|
toDOM() { return codeDOM; }
|
|
13353
13596
|
}
|
|
@@ -13363,10 +13606,58 @@ To reuse elements from this schema, extend or read from its
|
|
|
13363
13606
|
*/
|
|
13364
13607
|
const schema = new Schema({ nodes, marks });
|
|
13365
13608
|
|
|
13609
|
+
const customMarks = {
|
|
13610
|
+
u: {
|
|
13611
|
+
parseDOM: [{ tag: "u" }],
|
|
13612
|
+
toDOM() {
|
|
13613
|
+
return ["u", 0];
|
|
13614
|
+
}
|
|
13615
|
+
},
|
|
13616
|
+
s: {
|
|
13617
|
+
parseDOM: [{ tag: "s" }, { tag: "del" }],
|
|
13618
|
+
toDOM() {
|
|
13619
|
+
return ["s", 0];
|
|
13620
|
+
}
|
|
13621
|
+
},
|
|
13622
|
+
tt: {
|
|
13623
|
+
parseDOM: [{ tag: "tt" }, { tag: "code" }],
|
|
13624
|
+
toDOM() {
|
|
13625
|
+
return ["tt", 0];
|
|
13626
|
+
}
|
|
13627
|
+
}
|
|
13628
|
+
};
|
|
13629
|
+
const extendedSchema = new Schema({
|
|
13630
|
+
nodes: schema.spec.nodes,
|
|
13631
|
+
marks: {
|
|
13632
|
+
...schema.spec.marks.toObject(),
|
|
13633
|
+
...customMarks
|
|
13634
|
+
}
|
|
13635
|
+
});
|
|
13636
|
+
|
|
13366
13637
|
const NEGATIVE_SELECTION = {
|
|
13367
13638
|
start: -1,
|
|
13368
13639
|
end: -1
|
|
13369
13640
|
};
|
|
13641
|
+
class TagToSchemaMap {
|
|
13642
|
+
static get h2() {
|
|
13643
|
+
return {
|
|
13644
|
+
type: "heading",
|
|
13645
|
+
attrs: { level: 2 }
|
|
13646
|
+
};
|
|
13647
|
+
}
|
|
13648
|
+
static get h3() {
|
|
13649
|
+
return {
|
|
13650
|
+
type: "heading",
|
|
13651
|
+
attrs: { level: 3 }
|
|
13652
|
+
};
|
|
13653
|
+
}
|
|
13654
|
+
static get p() {
|
|
13655
|
+
return {
|
|
13656
|
+
type: "paragraph",
|
|
13657
|
+
attrs: {}
|
|
13658
|
+
};
|
|
13659
|
+
}
|
|
13660
|
+
}
|
|
13370
13661
|
function createSelectionChangePlugin(onSelectionChange) {
|
|
13371
13662
|
return new Plugin({
|
|
13372
13663
|
view: () => ({
|
|
@@ -13392,13 +13683,22 @@ function convertSelectionToVividFormat({
|
|
|
13392
13683
|
class ProseMirrorFacade {
|
|
13393
13684
|
#userContentChange = false;
|
|
13394
13685
|
#view;
|
|
13686
|
+
#verifyViewInitiation() {
|
|
13687
|
+
if (!this.#view) {
|
|
13688
|
+
throw new Error(
|
|
13689
|
+
"ProseMirror was not initiated. Please use the `init` method first."
|
|
13690
|
+
);
|
|
13691
|
+
}
|
|
13692
|
+
}
|
|
13395
13693
|
#onSelectionChange = () => {
|
|
13396
13694
|
this.#dispatchEvent("selection-changed");
|
|
13397
13695
|
};
|
|
13398
|
-
#handleInputEvent = () => {
|
|
13696
|
+
#handleInputEvent = (e) => {
|
|
13697
|
+
e.stopPropagation();
|
|
13399
13698
|
this.#userContentChange = true;
|
|
13699
|
+
this.#dispatchEvent("input");
|
|
13400
13700
|
};
|
|
13401
|
-
#
|
|
13701
|
+
#handleChangeEvent = () => {
|
|
13402
13702
|
if (!this.#userContentChange) {
|
|
13403
13703
|
return;
|
|
13404
13704
|
}
|
|
@@ -13415,20 +13715,16 @@ class ProseMirrorFacade {
|
|
|
13415
13715
|
keymap(baseKeymap)
|
|
13416
13716
|
];
|
|
13417
13717
|
const state = EditorState.create({
|
|
13418
|
-
schema:
|
|
13718
|
+
schema: extendedSchema,
|
|
13419
13719
|
plugins
|
|
13420
13720
|
});
|
|
13421
13721
|
this.#view = new EditorView(element, { state });
|
|
13422
13722
|
this.#view.dom.addEventListener("input", this.#handleInputEvent);
|
|
13423
|
-
this.#view.dom.addEventListener("blur", this.#
|
|
13723
|
+
this.#view.dom.addEventListener("blur", this.#handleChangeEvent);
|
|
13424
13724
|
}
|
|
13425
13725
|
replaceContent(content) {
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
"ProseMirror was not initiated. Please use the `init` method first."
|
|
13429
|
-
);
|
|
13430
|
-
}
|
|
13431
|
-
const parser = DOMParser.fromSchema(schema);
|
|
13726
|
+
this.#verifyViewInitiation();
|
|
13727
|
+
const parser = DOMParser.fromSchema(extendedSchema);
|
|
13432
13728
|
const doc = parser.parse(
|
|
13433
13729
|
new window.DOMParser().parseFromString(content, "text/html").body
|
|
13434
13730
|
);
|
|
@@ -13455,6 +13751,43 @@ class ProseMirrorFacade {
|
|
|
13455
13751
|
#dispatchEvent = (eventName, detail) => {
|
|
13456
13752
|
this.#eventHandler.dispatchEvent(new CustomEvent(eventName, { detail }));
|
|
13457
13753
|
};
|
|
13754
|
+
setSelectionTag(tag) {
|
|
13755
|
+
this.#verifyViewInitiation();
|
|
13756
|
+
const nodeDefinitions = TagToSchemaMap[tag] ?? {
|
|
13757
|
+
type: tag
|
|
13758
|
+
};
|
|
13759
|
+
const { state, dispatch } = this.#view;
|
|
13760
|
+
const { from, to } = state.selection;
|
|
13761
|
+
const tr = state.tr;
|
|
13762
|
+
state.doc.nodesBetween(from, to, (node) => {
|
|
13763
|
+
const nodeType = state.schema.nodes[nodeDefinitions.type];
|
|
13764
|
+
if (!nodeType) {
|
|
13765
|
+
throw new Error("Node type tag does not exist in the schema");
|
|
13766
|
+
}
|
|
13767
|
+
if (node.type === nodeType) {
|
|
13768
|
+
return;
|
|
13769
|
+
}
|
|
13770
|
+
tr.setBlockType(from, to, nodeType, nodeDefinitions.attrs);
|
|
13771
|
+
});
|
|
13772
|
+
dispatch(tr);
|
|
13773
|
+
}
|
|
13774
|
+
setSelectionDecoration(decoration) {
|
|
13775
|
+
const SUPPORTED_DECORATIONS = {
|
|
13776
|
+
bold: "strong",
|
|
13777
|
+
italics: "em",
|
|
13778
|
+
underline: "u",
|
|
13779
|
+
strikethrough: "s",
|
|
13780
|
+
monospace: "tt"
|
|
13781
|
+
};
|
|
13782
|
+
this.#verifyViewInitiation();
|
|
13783
|
+
const { state, dispatch } = this.#view;
|
|
13784
|
+
const decorationKey = decoration;
|
|
13785
|
+
const markType = state.schema.marks[SUPPORTED_DECORATIONS[decorationKey]];
|
|
13786
|
+
if (!markType) {
|
|
13787
|
+
throw new Error(`${decoration} is not a supported decoration`);
|
|
13788
|
+
}
|
|
13789
|
+
toggleMark(markType)(state, dispatch);
|
|
13790
|
+
}
|
|
13458
13791
|
}
|
|
13459
13792
|
|
|
13460
13793
|
var __defProp = Object.defineProperty;
|
|
@@ -13466,6 +13799,11 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13466
13799
|
if (result) __defProp(target, key, result);
|
|
13467
13800
|
return result;
|
|
13468
13801
|
};
|
|
13802
|
+
const RichTextEditorTextSizes = {
|
|
13803
|
+
title: "h2",
|
|
13804
|
+
subtitle: "h3",
|
|
13805
|
+
body: "p"
|
|
13806
|
+
};
|
|
13469
13807
|
class RichTextEditor extends VividElement {
|
|
13470
13808
|
constructor() {
|
|
13471
13809
|
super();
|
|
@@ -13481,11 +13819,13 @@ class RichTextEditor extends VividElement {
|
|
|
13481
13819
|
}
|
|
13482
13820
|
};
|
|
13483
13821
|
this.selectionEnd = null;
|
|
13822
|
+
this.#selectionChangedByUser = false;
|
|
13484
13823
|
this.#handleSelectionChange = () => {
|
|
13485
13824
|
if (!this.#editor.selection()) {
|
|
13486
13825
|
return;
|
|
13487
13826
|
}
|
|
13488
13827
|
const { start, end } = this.#editor.selection();
|
|
13828
|
+
this.#selectionChangedByUser = true;
|
|
13489
13829
|
this.selectionStart = start;
|
|
13490
13830
|
this.selectionEnd = end;
|
|
13491
13831
|
this.$emit("selection-changed");
|
|
@@ -13493,6 +13833,9 @@ class RichTextEditor extends VividElement {
|
|
|
13493
13833
|
this.#handleChange = () => {
|
|
13494
13834
|
this.$emit("change");
|
|
13495
13835
|
};
|
|
13836
|
+
this.#handleInput = () => {
|
|
13837
|
+
this.$emit("input");
|
|
13838
|
+
};
|
|
13496
13839
|
}
|
|
13497
13840
|
/**
|
|
13498
13841
|
* Indicates the rich text editor's value.
|
|
@@ -13514,6 +13857,9 @@ class RichTextEditor extends VividElement {
|
|
|
13514
13857
|
return this.shadowRoot.querySelector("#editor");
|
|
13515
13858
|
}
|
|
13516
13859
|
selectionStartChanged() {
|
|
13860
|
+
if (this.#selectionChangedByUser) {
|
|
13861
|
+
return;
|
|
13862
|
+
}
|
|
13517
13863
|
if (!this.selectionStart || this.selectionEnd && this.selectionStart > this.selectionEnd) {
|
|
13518
13864
|
return;
|
|
13519
13865
|
}
|
|
@@ -13521,13 +13867,19 @@ class RichTextEditor extends VividElement {
|
|
|
13521
13867
|
}
|
|
13522
13868
|
#updateEditorSelection;
|
|
13523
13869
|
selectionEndChanged() {
|
|
13870
|
+
if (this.#selectionChangedByUser) {
|
|
13871
|
+
this.#selectionChangedByUser = false;
|
|
13872
|
+
return;
|
|
13873
|
+
}
|
|
13524
13874
|
if (this.selectionEnd && !this.selectionStart) {
|
|
13525
13875
|
this.selectionStart = 1;
|
|
13526
13876
|
}
|
|
13527
13877
|
this.#updateEditorSelection();
|
|
13528
13878
|
}
|
|
13879
|
+
#selectionChangedByUser;
|
|
13529
13880
|
#handleSelectionChange;
|
|
13530
13881
|
#handleChange;
|
|
13882
|
+
#handleInput;
|
|
13531
13883
|
connectedCallback() {
|
|
13532
13884
|
super.connectedCallback();
|
|
13533
13885
|
if (!this.#editor) {
|
|
@@ -13538,6 +13890,21 @@ class RichTextEditor extends VividElement {
|
|
|
13538
13890
|
this.#handleSelectionChange
|
|
13539
13891
|
);
|
|
13540
13892
|
this.#editor.addEventListener("change", this.#handleChange);
|
|
13893
|
+
this.#editor.addEventListener("input", this.#handleInput);
|
|
13894
|
+
}
|
|
13895
|
+
}
|
|
13896
|
+
setTextSize(size) {
|
|
13897
|
+
try {
|
|
13898
|
+
this.#editor?.setSelectionTag(RichTextEditorTextSizes[size]);
|
|
13899
|
+
} catch (e) {
|
|
13900
|
+
console.warn(`Invalid text size: ${size}`);
|
|
13901
|
+
}
|
|
13902
|
+
}
|
|
13903
|
+
setSelectionDecoration(decoration) {
|
|
13904
|
+
try {
|
|
13905
|
+
this.#editor?.setSelectionDecoration(decoration);
|
|
13906
|
+
} catch (e) {
|
|
13907
|
+
console.warn(`Invalid decoration: ${decoration}`);
|
|
13541
13908
|
}
|
|
13542
13909
|
}
|
|
13543
13910
|
}
|
|
@@ -13549,9 +13916,41 @@ __decorateClass([
|
|
|
13549
13916
|
], RichTextEditor.prototype, "selectionEnd");
|
|
13550
13917
|
|
|
13551
13918
|
const getClasses = (_) => classNames("control");
|
|
13919
|
+
const VALID_MENU_ELEMEMENT_SUFFIX = "menubar";
|
|
13920
|
+
function textSizeSelectedHandler(event) {
|
|
13921
|
+
this.setTextSize(event.detail);
|
|
13922
|
+
}
|
|
13923
|
+
function selectionDecorationSelectedHandler(event) {
|
|
13924
|
+
this.setSelectionDecoration(event.detail);
|
|
13925
|
+
}
|
|
13926
|
+
function handleMenuBarSlotChange(richTextEditor, { event }) {
|
|
13927
|
+
const slot = event.target;
|
|
13928
|
+
const assignedElements = slot.assignedElements({ flatten: true });
|
|
13929
|
+
const menuBar = assignedElements.find(
|
|
13930
|
+
(element) => element.tagName.toLowerCase().endsWith(VALID_MENU_ELEMEMENT_SUFFIX)
|
|
13931
|
+
);
|
|
13932
|
+
assignedElements.forEach((element) => {
|
|
13933
|
+
if (element === menuBar) {
|
|
13934
|
+
element.style.removeProperty("display");
|
|
13935
|
+
} else {
|
|
13936
|
+
element.style.display = "none";
|
|
13937
|
+
}
|
|
13938
|
+
});
|
|
13939
|
+
if (menuBar) {
|
|
13940
|
+
menuBar.addEventListener(
|
|
13941
|
+
"text-size-selected",
|
|
13942
|
+
textSizeSelectedHandler.bind(richTextEditor)
|
|
13943
|
+
);
|
|
13944
|
+
menuBar.addEventListener(
|
|
13945
|
+
"text-decoration-selected",
|
|
13946
|
+
selectionDecorationSelectedHandler.bind(richTextEditor)
|
|
13947
|
+
);
|
|
13948
|
+
}
|
|
13949
|
+
}
|
|
13552
13950
|
const RichTextEditorTemplate = (_) => {
|
|
13553
13951
|
return html`<template class="${getClasses}">
|
|
13554
|
-
<div id="editor"></div>
|
|
13952
|
+
<div id="editor" class="editor"></div>
|
|
13953
|
+
<slot name="menu-bar" @slotchange="${handleMenuBarSlotChange}"></slot>
|
|
13555
13954
|
</template>`;
|
|
13556
13955
|
};
|
|
13557
13956
|
|
|
@@ -13559,9 +13958,9 @@ const richTextEditorDefinition = defineVividComponent(
|
|
|
13559
13958
|
"rich-text-editor",
|
|
13560
13959
|
RichTextEditor,
|
|
13561
13960
|
RichTextEditorTemplate,
|
|
13562
|
-
[],
|
|
13961
|
+
[menuBarDefinition],
|
|
13563
13962
|
{
|
|
13564
|
-
styles,
|
|
13963
|
+
styles: styles$1,
|
|
13565
13964
|
shadowOptions: {
|
|
13566
13965
|
delegatesFocus: true
|
|
13567
13966
|
}
|
|
@@ -13571,4 +13970,4 @@ const registerRichTextEditor = createRegisterFunction(
|
|
|
13571
13970
|
richTextEditorDefinition
|
|
13572
13971
|
);
|
|
13573
13972
|
|
|
13574
|
-
export { registerRichTextEditor as a, richTextEditorDefinition as r };
|
|
13973
|
+
export { RichTextEditor as R, registerRichTextEditor as a, richTextEditorDefinition as r };
|