@stll/folio-vue 0.2.0 → 0.3.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.
@@ -46,6 +46,111 @@ export type FolioPopoverProps = {
46
46
  placement?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
47
47
  closeOnScroll?: boolean;
48
48
  };
49
+ /**
50
+ * The Dialog prop subset folio's chrome relies on. Mirrors the Vue
51
+ * `ui/Dialog.vue` surface: `open` controls the modal's visibility (the default
52
+ * teleports to `document.body`, shows a click-to-close backdrop, and closes on
53
+ * Escape); `ariaLabel` is applied to the popup's `role="dialog"` element.
54
+ * `className` / `backdropClass` extend the popup/backdrop classes so a
55
+ * dialog-specific stylesheet still applies over the shared default. Consumers
56
+ * emit `update:open` / `close` (mirroring `Popover`'s `update:open` + `close`
57
+ * pair) and render the dialog body through the default slot. A design-system
58
+ * Dialog accepting a superset stays assignable as an override.
59
+ */
60
+ export type FolioDialogProps = {
61
+ open: boolean;
62
+ ariaLabel?: string;
63
+ className?: string;
64
+ backdropClass?: string;
65
+ /** Close on backdrop mousedown (default true). */
66
+ closeOnBackdrop?: boolean;
67
+ };
68
+ /** One option in a folio Select. Mirrors the flat, data-driven shape the Vue
69
+ * contract already uses for {@link FolioMenuItem}. */
70
+ export type FolioSelectItem = {
71
+ value: string;
72
+ label: string;
73
+ disabled?: boolean;
74
+ };
75
+ /**
76
+ * The Select prop subset folio's chrome relies on. Mirrors the Vue
77
+ * `ui/Select.vue` surface: a single native-`<select>`-backed component driven
78
+ * by a flat `items` array (no listbox/positioner sub-parts, no `<optgroup>`
79
+ * grouping — chrome consumers that need grouping, e.g. the font picker, stay
80
+ * on a native `<select>` and are out of this contract's scope). `value` is the
81
+ * selected item's `value`; the component emits `change` with the new value.
82
+ */
83
+ export type FolioSelectProps = {
84
+ value?: string;
85
+ items: FolioSelectItem[];
86
+ disabled?: boolean;
87
+ placeholder?: string;
88
+ className?: string;
89
+ };
90
+ /**
91
+ * The Input prop subset folio's chrome relies on: a thin wrapper over a native
92
+ * `<input>` supporting `v-model`. `className` / `size` are folio's shorthand
93
+ * (mirroring React's `FolioInputProps`); every other native `<input>`
94
+ * attribute (`type`, `placeholder`, `aria-*`, `min`/`max`/`step`, ...) falls
95
+ * through Vue's attribute inheritance and is not re-declared.
96
+ *
97
+ * A chrome consumer that needs imperative access (e.g. FindReplaceDialog's
98
+ * focus-and-select-on-open) does so through a template `ref`, which resolves
99
+ * to the component instance — so an override, like the default, should
100
+ * `defineExpose({ focus, select })` if it wants that behavior to keep working.
101
+ */
102
+ export type FolioInputProps = {
103
+ className?: string;
104
+ size?: "sm" | "default" | "lg";
105
+ };
106
+ /**
107
+ * The Checkbox prop subset folio's chrome relies on. Mirrors React's
108
+ * `FolioCheckboxProps` (`checked` + a change callback): `checked` is the
109
+ * current state, and the component emits `update:checked` so a host uses
110
+ * `v-model:checked`. `className` extends the default indicator's classes.
111
+ */
112
+ export type FolioCheckboxProps = {
113
+ checked?: boolean;
114
+ className?: string;
115
+ };
116
+ /**
117
+ * The DatePickerPopover prop subset folio's chrome relies on. Mirrors React's
118
+ * `FolioDatePickerPopoverProps`: `value` accepts an ISO string, a `Date`, or
119
+ * `null`; the component emits `change` with an ISO `yyyy-mm-dd` string (or
120
+ * `null` when cleared). See the module docblock — no Vue chrome consumer
121
+ * renders this yet (content-control widgets are not ported to Vue).
122
+ */
123
+ export type FolioDatePickerPopoverProps = {
124
+ value: string | Date | null;
125
+ clearLabel?: string;
126
+ defaultOpen?: boolean;
127
+ showIcon?: boolean;
128
+ };
129
+ /**
130
+ * The OutlineRail prop subset folio's chrome relies on. Mirrors React's
131
+ * `FolioOutlineRailProps`, adapted to Vue's idiom for sharing a mutable DOM
132
+ * ref across a prop boundary: a `getScrollContainer` getter (the same
133
+ * `() => HTMLElement | null` shape `DecorationLayer.vue`'s
134
+ * `getPagesContainer` already uses) rather than a raw `Ref` — Vue's template
135
+ * compiler auto-unwraps a bare `Ref` referenced in a binding expression (even
136
+ * inside an inline arrow function), so passing the ref object itself across a
137
+ * prop is not the idiom here; a getter defers the read to click-time. The
138
+ * rail resolves each item's vertical position via `resolvePct` and navigates
139
+ * via `onJump` (both receive the resolved scroll container, as plain function
140
+ * props — the same idiom the existing {@link FolioMenuItem}`.onSelect` uses).
141
+ * `activeId` controls the highlighted entry. A design-system rail accepting a
142
+ * superset stays assignable as an override.
143
+ */
144
+ export type FolioOutlineRailProps = {
145
+ items: OutlineItem[];
146
+ getScrollContainer: () => HTMLElement | null;
147
+ resolvePct?: (id: string, container: HTMLElement) => number | null;
148
+ onJump: (id: string, container: HTMLElement) => void;
149
+ activeId?: string | null;
150
+ topOffset?: number;
151
+ panelWidth?: number;
152
+ ariaLabel?: string;
153
+ };
49
154
  /**
50
155
  * One entry in a folio menu. Mirrors the Vue `ui/MenuDropdown.vue` `MenuEntry`
51
156
  * shape so an external Menu stays assignable as an override.
@@ -65,9 +170,7 @@ export type FolioMenuProps = {
65
170
  };
66
171
  /**
67
172
  * One entry in the document outline. Mirrors the React contract's item shape so
68
- * a cross-framework design system can share it. The Vue adapter does not yet
69
- * inject an OutlineRail primitive (no Vue default exists); the type is exported
70
- * for parity with the React surface.
173
+ * a cross-framework design system can share it.
71
174
  */
72
175
  export type OutlineItem = {
73
176
  id: string;
@@ -88,15 +191,24 @@ export type OutlineItem = {
88
191
  * (unlike React's contravariant `ComponentType<P>`), so a default or override
89
192
  * accepting a *superset* of props would not be assignable to a prop-parameterized
90
193
  * slot. The per-primitive prop contract a host implements is documented by the
91
- * exported `Folio*Props` types ({@link FolioButtonProps},
92
- * {@link FolioColorPickerProps}, {@link FolioPopoverProps}, {@link FolioMenuProps});
93
- * consumers render the resolved component and pass those props at the call site.
194
+ * exported `Folio*Props` types ({@link FolioButtonProps}, {@link FolioDialogProps},
195
+ * {@link FolioSelectProps}, {@link FolioMenuProps}, {@link FolioPopoverProps},
196
+ * {@link FolioInputProps}, {@link FolioCheckboxProps},
197
+ * {@link FolioColorPickerProps}, {@link FolioDatePickerPopoverProps},
198
+ * {@link FolioOutlineRailProps}); consumers render the resolved component and
199
+ * pass those props at the call site.
94
200
  */
95
201
  export type FolioUIComponents = {
96
202
  Button: Component;
97
- ColorPicker: Component;
98
- Popover: Component;
203
+ Dialog: Component;
204
+ Select: Component;
99
205
  Menu: Component;
206
+ Popover: Component;
207
+ Input: Component;
208
+ Checkbox: Component;
209
+ ColorPicker: Component;
210
+ DatePickerPopover: Component;
211
+ OutlineRail: Component;
100
212
  };
101
213
  export declare const DEFAULT_COMPONENTS: FolioUIComponents;
102
214
  /**
package/dist/ui.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PageSetupDialog-CGBaBVzo.cjs"),t=require("./ListButtons-D-zMJ7rl.cjs"),n=require("./TablePropertiesDialog-A-1Pm1f9.cjs");let r=require("vue");require("@stll/folio-core/utils/units");var i={class:`docx-editor-toolbar`},a={class:`docx-editor-toolbar__title-row`},o={class:`docx-editor-toolbar__title-left`},s={class:`docx-editor-toolbar__title-center`},c={class:`docx-editor-toolbar__title-right`},l=(0,r.defineComponent)({inheritAttrs:!1,__name:`EditorToolbar`,props:{showMenuBar:{type:Boolean,default:!0}},emits:[`menu-action`],setup(e){return(n,l)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,i,[(0,r.renderSlot)(n.$slots,`title-bar`,{},()=>[(0,r.createElementVNode)(`div`,a,[(0,r.createElementVNode)(`div`,o,[(0,r.renderSlot)(n.$slots,`title-bar-left`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,s,[(0,r.renderSlot)(n.$slots,`document-name`,{},void 0,!0),e.showMenuBar?((0,r.openBlock)(),(0,r.createBlock)(t.A,{key:0,onAction:l[0]||=e=>n.$emit(`menu-action`,e)})):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,c,[(0,r.renderSlot)(n.$slots,`title-bar-right`,{},void 0,!0)])])],!0),(0,r.renderSlot)(n.$slots,`toolbar`,{},()=>[(0,r.createVNode)(t.b,(0,r.normalizeProps)((0,r.guardReactiveProps)(n.$attrs)),null,16)],!0)]))}}),u=e.u(l,[[`__scopeId`,`data-v-f2023632`]]),d={},f={class:`docx-title-bar`},p={class:`docx-title-bar__left`},m={class:`docx-title-bar__center`},h={class:`docx-title-bar__right`};function g(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,f,[(0,r.createElementVNode)(`div`,p,[(0,r.renderSlot)(e.$slots,`left`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,m,[(0,r.renderSlot)(e.$slots,`default`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,h,[(0,r.renderSlot)(e.$slots,`right`,{},void 0,!0)])])}var _=e.u(d,[[`render`,g],[`__scopeId`,`data-v-ae11d49f`]]);function v(e){let t=e.trim();if(!t)return``;let n=null,r=``;for(let e of t){if((e===`"`||e===`'`)&&n===null){n=e,r+=e;continue}if(e===n){n=null,r+=e;continue}if(e===`,`&&n===null)break;r+=e}return r.trim().replace(/^['"]|['"]$/g,``)}var y=[`value`,`disabled`],b={key:0,label:`Sans-serif`},x=[`value`],S={key:1,label:`Serif`},C=[`value`],w={key:2,label:`Monospace`},T=[`value`],E={key:3,label:`Other`},D=[`value`],O=(0,r.defineComponent)({__name:`FontPicker`,props:{value:{},fonts:{},disabled:{type:Boolean,default:!1},className:{},placeholder:{default:`Font`},showPreview:{type:Boolean,default:!0}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[{name:`Arial`,fontFamily:`Arial, Helvetica, sans-serif`,category:`sans-serif`},{name:`Calibri`,fontFamily:`"Calibri", Arial, sans-serif`,category:`sans-serif`},{name:`Helvetica`,fontFamily:`Helvetica, Arial, sans-serif`,category:`sans-serif`},{name:`Verdana`,fontFamily:`Verdana, Geneva, sans-serif`,category:`sans-serif`},{name:`Open Sans`,fontFamily:`"Open Sans", sans-serif`,category:`sans-serif`},{name:`Roboto`,fontFamily:`Roboto, sans-serif`,category:`sans-serif`},{name:`Times New Roman`,fontFamily:`"Times New Roman", Times, serif`,category:`serif`},{name:`Georgia`,fontFamily:`Georgia, serif`,category:`serif`},{name:`Cambria`,fontFamily:`Cambria, Georgia, serif`,category:`serif`},{name:`Garamond`,fontFamily:`Garamond, serif`,category:`serif`},{name:`Courier New`,fontFamily:`"Courier New", monospace`,category:`monospace`},{name:`Consolas`,fontFamily:`Consolas, monospace`,category:`monospace`}],o=(0,r.computed)(()=>n.fonts??a),s=(0,r.computed)(()=>{let e={"sans-serif":[],serif:[],monospace:[],other:[]};for(let t of o.value)e[t.category??`other`].push(t);return e}),c=(0,r.computed)(()=>{let e=n.value;if(!e)return n.placeholder;let t=e.toLowerCase();return o.value.find(n=>n.fontFamily===e||n.name.toLowerCase()===t||v(n.fontFamily).toLowerCase()===t)?.name??e});function l(e){if(!(e.target instanceof HTMLSelectElement))return;let t=e.target.value,n=o.value.find(e=>e.name===t);i(`change`,n?v(n.fontFamily)||n.name:t)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`select`,{class:(0,r.normalizeClass)([`docx-font-picker`,e.className]),value:c.value,disabled:e.disabled,"aria-label":`Font family`,onChange:l},[s.value[`sans-serif`].length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,b,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value[`sans-serif`],t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,x))),128))])):(0,r.createCommentVNode)(``,!0),s.value.serif.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,S,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.serif,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,C))),128))])):(0,r.createCommentVNode)(``,!0),s.value.monospace.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,w,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.monospace,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,T))),128))])):(0,r.createCommentVNode)(``,!0),s.value.other.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,E,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.other,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,D))),128))])):(0,r.createCommentVNode)(``,!0)],42,y))}}),k=e.u(O,[[`__scopeId`,`data-v-1a9a9f88`]]),A={class:`docx-font-size`},j=[`disabled`],M=[`value`,`disabled`,`placeholder`],N=[`disabled`],P=(0,r.defineComponent)({__name:`FontSizePicker`,props:{value:{},sizes:{},disabled:{type:Boolean,default:!1},minSize:{default:1},maxSize:{default:1638},placeholder:{default:`11`}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],o=(0,r.computed)(()=>n.sizes??a),s=(0,r.computed)(()=>n.value??parseInt(n.placeholder,10)??11),c=(0,r.computed)(()=>n.value===void 0?n.placeholder:String(n.value));function l(e){return o.value.find(t=>t>e)??Math.min(e+1,n.maxSize)}function u(e){return[...o.value].reverse().find(t=>t<e)??Math.max(e-1,n.minSize)}function d(){n.disabled||i(`change`,u(s.value))}function f(){n.disabled||i(`change`,l(s.value))}function p(e){if(!(e.target instanceof HTMLInputElement))return;let t=parseFloat(e.target.value);!isNaN(t)&&t>=n.minSize&&t<=n.maxSize&&i(`change`,Math.round(t*2)/2)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,A,[(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-font-size__btn`,disabled:e.disabled||s.value<=e.minSize,title:`Decrease font size`,onClick:(0,r.withModifiers)(d,[`prevent`])},`−`,8,j),(0,r.createElementVNode)(`input`,{class:`docx-font-size__input`,type:`text`,value:c.value,disabled:e.disabled,placeholder:e.placeholder,onKeydown:[n[0]||=(0,r.withKeys)((0,r.withModifiers)(e=>{d(),e.stopPropagation()},[`prevent`]),[`up`]),n[1]||=(0,r.withKeys)((0,r.withModifiers)(e=>{f(),e.stopPropagation()},[`prevent`]),[`down`]),n[2]||=(0,r.withKeys)((0,r.withModifiers)(e=>p(e),[`prevent`]),[`enter`])],onBlur:n[3]||=e=>p(e)},null,40,M),(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-font-size__btn`,disabled:e.disabled||s.value>=e.maxSize,title:`Increase font size`,onClick:(0,r.withModifiers)(f,[`prevent`])},`+`,8,N)]))}}),F=e.u(P,[[`__scopeId`,`data-v-4e8ada55`]]),I=[`value`,`disabled`],L=[`value`],R=(0,r.defineComponent)({__name:`LineSpacingPicker`,props:{value:{},options:{},disabled:{type:Boolean,default:!1},className:{}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[{label:`Single`,value:1,twipsValue:240},{label:`1.15`,value:1.15,twipsValue:276},{label:`1.5`,value:1.5,twipsValue:360},{label:`Double`,value:2,twipsValue:480}],o=(0,r.computed)(()=>n.options??a),s=(0,r.computed)(()=>n.value??o.value[0]?.twipsValue??240);function c(e){if(!(e.target instanceof HTMLSelectElement))return;let t=parseInt(e.target.value,10);isNaN(t)||i(`change`,t)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`select`,{class:(0,r.normalizeClass)([`docx-line-spacing`,e.className]),value:String(s.value),disabled:e.disabled,"aria-label":`Line spacing`,onChange:c},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(o.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:e.twipsValue,value:String(e.twipsValue)},(0,r.toDisplayString)(e.label),9,L))),128))],42,I))}}),z=e.u(R,[[`__scopeId`,`data-v-fcda8ecc`]]),B=[`disabled`,`aria-expanded`,`title`,`onClick`],V={class:`docx-table-grid__panel`},H={class:`docx-table-grid__label`},U=[`onMouseenter`,`onClick`],W=(0,r.defineComponent)({__name:`TableGridPicker`,props:{disabled:{type:Boolean,default:!1},gridRows:{default:5},gridColumns:{default:5},tooltip:{default:`Insert table`}},emits:[`insert`],setup(e,{emit:n}){let i=e,a=n,o=(0,r.ref)(!1),s=(0,r.ref)({rows:1,cols:1}),c=(0,r.computed)(()=>{let e=[];for(let t=1;t<=i.gridRows;t++)for(let n=1;n<=i.gridColumns;n++)e.push({r:t,c:n});return e});function l(e,t){a(`insert`,e,t),o.value=!1}function u(){o.value=!1,s.value={rows:1,cols:1}}return(n,i)=>((0,r.openBlock)(),(0,r.createBlock)(t.N,{open:o.value,"onUpdate:open":i[0]||=e=>o.value=e,onClose:u},{trigger:(0,r.withCtx)(({toggle:n})=>[(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-table-grid__btn`,disabled:e.disabled,"aria-expanded":o.value,"aria-haspopup":`grid`,title:e.tooltip,onClick:(0,r.withModifiers)(n,[`prevent`])},[(0,r.createVNode)(t.I,{name:`grid_on`,size:20})],8,B)]),panel:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,V,[(0,r.createElementVNode)(`div`,H,(0,r.toDisplayString)(s.value.rows)+` × `+(0,r.toDisplayString)(s.value.cols),1),(0,r.createElementVNode)(`div`,{class:`docx-table-grid__grid`,style:(0,r.normalizeStyle)({gridTemplateColumns:`repeat(${e.gridColumns}, 18px)`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(c.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:`${e.r}-${e.c}`,class:(0,r.normalizeClass)([`docx-table-grid__cell`,{"docx-table-grid__cell--active":e.r<=s.value.rows&&e.c<=s.value.cols}]),onMouseenter:t=>s.value={rows:e.r,cols:e.c},onClick:(0,r.withModifiers)(t=>l(e.r,e.c),[`prevent`])},null,42,U))),128))],4)])]),_:1},8,[`open`]))}}),G=e.u(W,[[`__scopeId`,`data-v-34f6875c`]]),K=[`disabled`,`title`],q={key:0,class:`print-btn__icon`},J=(0,r.defineComponent)({__name:`PrintButton`,props:{disabled:{type:Boolean,default:!1},label:{default:`Print`},compact:{type:Boolean,default:!1}},emits:[`print`],setup(e,{emit:t}){let n=e,i=t;function a(){n.disabled||(i(`print`),window.print())}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{class:`print-btn`,disabled:e.disabled,title:e.label,onMousedown:(0,r.withModifiers)(a,[`prevent`])},[(0,r.createTextVNode)((0,r.toDisplayString)(e.compact?``:e.label)+` `,1),e.compact?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,q,`🖨`)):(0,r.createCommentVNode)(``,!0)],40,K))}}),Y=e.u(J,[[`__scopeId`,`data-v-3e413c06`]]),X={padding:`8px 10px`,borderRadius:8,backgroundColor:`var(--doc-card)`,cursor:`pointer`,boxShadow:`var(--doc-card-shadow)`},Z={padding:`10px 12px`,borderRadius:8,backgroundColor:`var(--doc-surface)`,cursor:`pointer`,boxShadow:`var(--doc-card-shadow-strong)`};exports.AddCommentCard=t.o,exports.AlignmentButtons=t.r,exports.Button=t.T,exports.CARD_STYLE_COLLAPSED=X,exports.CARD_STYLE_EXPANDED=Z,exports.ColorPicker=t.w,exports.CommentCard=t.l,exports.CommentMarginMarkers=t.F,exports.DocumentName=t.P,exports.EditingModeDropdown=t.E,exports.EditorToolbar=u,exports.FindReplaceDialog=e.a,exports.FontPicker=k,exports.FontSizePicker=F,exports.FootnotePropertiesDialog=n.i,exports.HorizontalRuler=t.y,exports.HyperlinkDialog=e.i,exports.IconGridDropdown=t.k,exports.ImagePositionDialog=n.r,exports.ImagePropertiesDialog=e.r,exports.ImageTransformDropdown=t.D,exports.ImageWrapDropdown=t.O,exports.InsertSymbolDialog=e.n,exports.InsertTableDialog=n.n,exports.LineSpacingPicker=z,exports.ListButtons=t.t,exports.MenuBar=t.A,exports.MenuDropdown=t.M,exports.PageSetupDialog=e.t,exports.Popover=t.N,exports.PrintButton=Y,exports.ReplyInput=t.u,exports.ReplyThread=t.d,exports.ResolvedCommentMarker=t.c,exports.StylePicker=t.i,exports.TableBorderColorPicker=t._,exports.TableBorderPicker=t.v,exports.TableBorderWidthPicker=t.g,exports.TableCellFillPicker=t.h,exports.TableGridInline=t.j,exports.TableGridPicker=G,exports.TableMoreDropdown=t.m,exports.TablePropertiesDialog=n.t,exports.TableStyleGallery=n.a,exports.TableToolbar=t.p,exports.TitleBar=_,exports.Toolbar=t.b,exports.TrackedChangeCard=t.s,exports.UnifiedSidebar=t.a,exports.VerticalRuler=t.f;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./PageSetupDialog-GGWMpoe-.cjs"),t=require("./ListButtons-3UeVXRAK.cjs"),n=require("./TablePropertiesDialog-DYbjwevC.cjs");let r=require("vue");require("@stll/folio-core/utils/units");var i={class:`docx-editor-toolbar`},a={class:`docx-editor-toolbar__title-row`},o={class:`docx-editor-toolbar__title-left`},s={class:`docx-editor-toolbar__title-center`},c={class:`docx-editor-toolbar__title-right`},l=(0,r.defineComponent)({inheritAttrs:!1,__name:`EditorToolbar`,props:{showMenuBar:{type:Boolean,default:!0}},emits:[`menu-action`],setup(e){return(n,l)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,i,[(0,r.renderSlot)(n.$slots,`title-bar`,{},()=>[(0,r.createElementVNode)(`div`,a,[(0,r.createElementVNode)(`div`,o,[(0,r.renderSlot)(n.$slots,`title-bar-left`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,s,[(0,r.renderSlot)(n.$slots,`document-name`,{},void 0,!0),e.showMenuBar?((0,r.openBlock)(),(0,r.createBlock)(t.T,{key:0,onAction:l[0]||=e=>n.$emit(`menu-action`,e)})):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,c,[(0,r.renderSlot)(n.$slots,`title-bar-right`,{},void 0,!0)])])],!0),(0,r.renderSlot)(n.$slots,`toolbar`,{},()=>[(0,r.createVNode)(t.b,(0,r.normalizeProps)((0,r.guardReactiveProps)(n.$attrs)),null,16)],!0)]))}}),u=e.E(l,[[`__scopeId`,`data-v-f2023632`]]),d={},f={class:`docx-title-bar`},p={class:`docx-title-bar__left`},m={class:`docx-title-bar__center`},h={class:`docx-title-bar__right`};function g(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,f,[(0,r.createElementVNode)(`div`,p,[(0,r.renderSlot)(e.$slots,`left`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,m,[(0,r.renderSlot)(e.$slots,`default`,{},void 0,!0)]),(0,r.createElementVNode)(`div`,h,[(0,r.renderSlot)(e.$slots,`right`,{},void 0,!0)])])}var _=e.E(d,[[`render`,g],[`__scopeId`,`data-v-ae11d49f`]]);function v(e){let t=e.trim();if(!t)return``;let n=null,r=``;for(let e of t){if((e===`"`||e===`'`)&&n===null){n=e,r+=e;continue}if(e===n){n=null,r+=e;continue}if(e===`,`&&n===null)break;r+=e}return r.trim().replace(/^['"]|['"]$/g,``)}var y=[`value`,`disabled`],b={key:0,label:`Sans-serif`},x=[`value`],S={key:1,label:`Serif`},C=[`value`],w={key:2,label:`Monospace`},T=[`value`],E={key:3,label:`Other`},D=[`value`],O=(0,r.defineComponent)({__name:`FontPicker`,props:{value:{},fonts:{},disabled:{type:Boolean,default:!1},className:{},placeholder:{default:`Font`},showPreview:{type:Boolean,default:!0}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[{name:`Arial`,fontFamily:`Arial, Helvetica, sans-serif`,category:`sans-serif`},{name:`Calibri`,fontFamily:`"Calibri", Arial, sans-serif`,category:`sans-serif`},{name:`Helvetica`,fontFamily:`Helvetica, Arial, sans-serif`,category:`sans-serif`},{name:`Verdana`,fontFamily:`Verdana, Geneva, sans-serif`,category:`sans-serif`},{name:`Open Sans`,fontFamily:`"Open Sans", sans-serif`,category:`sans-serif`},{name:`Roboto`,fontFamily:`Roboto, sans-serif`,category:`sans-serif`},{name:`Times New Roman`,fontFamily:`"Times New Roman", Times, serif`,category:`serif`},{name:`Georgia`,fontFamily:`Georgia, serif`,category:`serif`},{name:`Cambria`,fontFamily:`Cambria, Georgia, serif`,category:`serif`},{name:`Garamond`,fontFamily:`Garamond, serif`,category:`serif`},{name:`Courier New`,fontFamily:`"Courier New", monospace`,category:`monospace`},{name:`Consolas`,fontFamily:`Consolas, monospace`,category:`monospace`}],o=(0,r.computed)(()=>n.fonts??a),s=(0,r.computed)(()=>{let e={"sans-serif":[],serif:[],monospace:[],other:[]};for(let t of o.value)e[t.category??`other`].push(t);return e}),c=(0,r.computed)(()=>{let e=n.value;if(!e)return n.placeholder;let t=e.toLowerCase();return o.value.find(n=>n.fontFamily===e||n.name.toLowerCase()===t||v(n.fontFamily).toLowerCase()===t)?.name??e});function l(e){if(!(e.target instanceof HTMLSelectElement))return;let t=e.target.value,n=o.value.find(e=>e.name===t);i(`change`,n?v(n.fontFamily)||n.name:t)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`select`,{class:(0,r.normalizeClass)([`docx-font-picker`,e.className]),value:c.value,disabled:e.disabled,"aria-label":`Font family`,onChange:l},[s.value[`sans-serif`].length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,b,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value[`sans-serif`],t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,x))),128))])):(0,r.createCommentVNode)(``,!0),s.value.serif.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,S,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.serif,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,C))),128))])):(0,r.createCommentVNode)(``,!0),s.value.monospace.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,w,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.monospace,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,T))),128))])):(0,r.createCommentVNode)(``,!0),s.value.other.length?((0,r.openBlock)(),(0,r.createElementBlock)(`optgroup`,E,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value.other,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:t.name,value:t.name,style:(0,r.normalizeStyle)(e.showPreview?{fontFamily:t.fontFamily}:void 0)},(0,r.toDisplayString)(t.name),13,D))),128))])):(0,r.createCommentVNode)(``,!0)],42,y))}}),k=e.E(O,[[`__scopeId`,`data-v-1a9a9f88`]]),A={class:`docx-font-size`},j=[`disabled`],M=[`value`,`disabled`,`placeholder`],N=[`disabled`],P=(0,r.defineComponent)({__name:`FontSizePicker`,props:{value:{},sizes:{},disabled:{type:Boolean,default:!1},minSize:{default:1},maxSize:{default:1638},placeholder:{default:`11`}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],o=(0,r.computed)(()=>n.sizes??a),s=(0,r.computed)(()=>n.value??parseInt(n.placeholder,10)??11),c=(0,r.computed)(()=>n.value===void 0?n.placeholder:String(n.value));function l(e){return o.value.find(t=>t>e)??Math.min(e+1,n.maxSize)}function u(e){return[...o.value].reverse().find(t=>t<e)??Math.max(e-1,n.minSize)}function d(){n.disabled||i(`change`,u(s.value))}function f(){n.disabled||i(`change`,l(s.value))}function p(e){if(!(e.target instanceof HTMLInputElement))return;let t=parseFloat(e.target.value);!isNaN(t)&&t>=n.minSize&&t<=n.maxSize&&i(`change`,Math.round(t*2)/2)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,A,[(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-font-size__btn`,disabled:e.disabled||s.value<=e.minSize,title:`Decrease font size`,onClick:(0,r.withModifiers)(d,[`prevent`])},`−`,8,j),(0,r.createElementVNode)(`input`,{class:`docx-font-size__input`,type:`text`,value:c.value,disabled:e.disabled,placeholder:e.placeholder,onKeydown:[n[0]||=(0,r.withKeys)((0,r.withModifiers)(e=>{d(),e.stopPropagation()},[`prevent`]),[`up`]),n[1]||=(0,r.withKeys)((0,r.withModifiers)(e=>{f(),e.stopPropagation()},[`prevent`]),[`down`]),n[2]||=(0,r.withKeys)((0,r.withModifiers)(e=>p(e),[`prevent`]),[`enter`])],onBlur:n[3]||=e=>p(e)},null,40,M),(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-font-size__btn`,disabled:e.disabled||s.value>=e.maxSize,title:`Increase font size`,onClick:(0,r.withModifiers)(f,[`prevent`])},`+`,8,N)]))}}),F=e.E(P,[[`__scopeId`,`data-v-4e8ada55`]]),I=[`value`,`disabled`],L=[`value`],R=(0,r.defineComponent)({__name:`LineSpacingPicker`,props:{value:{},options:{},disabled:{type:Boolean,default:!1},className:{}},emits:[`change`],setup(e,{emit:t}){let n=e,i=t,a=[{label:`Single`,value:1,twipsValue:240},{label:`1.15`,value:1.15,twipsValue:276},{label:`1.5`,value:1.5,twipsValue:360},{label:`Double`,value:2,twipsValue:480}],o=(0,r.computed)(()=>n.options??a),s=(0,r.computed)(()=>n.value??o.value[0]?.twipsValue??240);function c(e){if(!(e.target instanceof HTMLSelectElement))return;let t=parseInt(e.target.value,10);isNaN(t)||i(`change`,t)}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`select`,{class:(0,r.normalizeClass)([`docx-line-spacing`,e.className]),value:String(s.value),disabled:e.disabled,"aria-label":`Line spacing`,onChange:c},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(o.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`option`,{key:e.twipsValue,value:String(e.twipsValue)},(0,r.toDisplayString)(e.label),9,L))),128))],42,I))}}),z=e.E(R,[[`__scopeId`,`data-v-fcda8ecc`]]),B=[`disabled`,`aria-expanded`,`title`,`onClick`],V={class:`docx-table-grid__panel`},H={class:`docx-table-grid__label`},U=[`onMouseenter`,`onClick`],W=(0,r.defineComponent)({__name:`TableGridPicker`,props:{disabled:{type:Boolean,default:!1},gridRows:{default:5},gridColumns:{default:5},tooltip:{default:`Insert table`}},emits:[`insert`],setup(t,{emit:n}){let{Popover:i}=e.u(),a=t,o=n,s=(0,r.ref)(!1),c=(0,r.ref)({rows:1,cols:1}),l=(0,r.computed)(()=>{let e=[];for(let t=1;t<=a.gridRows;t++)for(let n=1;n<=a.gridColumns;n++)e.push({r:t,c:n});return e});function u(e,t){o(`insert`,e,t),s.value=!1}function d(){s.value=!1,c.value={rows:1,cols:1}}return(n,a)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i),{open:s.value,"onUpdate:open":a[0]||=e=>s.value=e,onClose:d},{trigger:(0,r.withCtx)(({toggle:n})=>[(0,r.createElementVNode)(`button`,{type:`button`,class:`docx-table-grid__btn`,disabled:t.disabled,"aria-expanded":s.value,"aria-haspopup":`grid`,title:t.tooltip,onClick:(0,r.withModifiers)(n,[`prevent`])},[(0,r.createVNode)(e.T,{name:`grid_on`,size:20})],8,B)]),panel:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,V,[(0,r.createElementVNode)(`div`,H,(0,r.toDisplayString)(c.value.rows)+` × `+(0,r.toDisplayString)(c.value.cols),1),(0,r.createElementVNode)(`div`,{class:`docx-table-grid__grid`,style:(0,r.normalizeStyle)({gridTemplateColumns:`repeat(${t.gridColumns}, 18px)`})},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(l.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:`${e.r}-${e.c}`,class:(0,r.normalizeClass)([`docx-table-grid__cell`,{"docx-table-grid__cell--active":e.r<=c.value.rows&&e.c<=c.value.cols}]),onMouseenter:t=>c.value={rows:e.r,cols:e.c},onClick:(0,r.withModifiers)(t=>u(e.r,e.c),[`prevent`])},null,42,U))),128))],4)])]),_:1},8,[`open`]))}}),G=e.E(W,[[`__scopeId`,`data-v-444ca123`]]),K=[`disabled`,`title`],q={key:0,class:`print-btn__icon`},J=(0,r.defineComponent)({__name:`PrintButton`,props:{disabled:{type:Boolean,default:!1},label:{default:`Print`},compact:{type:Boolean,default:!1}},emits:[`print`],setup(e,{emit:t}){let n=e,i=t;function a(){n.disabled||(i(`print`),window.print())}return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{class:`print-btn`,disabled:e.disabled,title:e.label,onMousedown:(0,r.withModifiers)(a,[`prevent`])},[(0,r.createTextVNode)((0,r.toDisplayString)(e.compact?``:e.label)+` `,1),e.compact?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,q,`🖨`)):(0,r.createCommentVNode)(``,!0)],40,K))}}),Y=e.E(J,[[`__scopeId`,`data-v-3e413c06`]]),X={padding:`8px 10px`,borderRadius:8,backgroundColor:`var(--doc-card)`,cursor:`pointer`,boxShadow:`var(--doc-card-shadow)`},Z={padding:`10px 12px`,borderRadius:8,backgroundColor:`var(--doc-surface)`,cursor:`pointer`,boxShadow:`var(--doc-card-shadow-strong)`};exports.AddCommentCard=t.o,exports.AlignmentButtons=t.r,exports.Button=e.w,exports.CARD_STYLE_COLLAPSED=X,exports.CARD_STYLE_EXPANDED=Z,exports.Checkbox=e.C,exports.ColorPicker=e.v,exports.CommentCard=t.l,exports.CommentMarginMarkers=t.O,exports.DEFAULT_COMPONENTS=e.o,exports.DatePickerPopover=e._,exports.Dialog=e.g,exports.DocumentName=t.D,exports.EditingModeDropdown=t.x,exports.EditorToolbar=u,exports.FindReplaceDialog=e.a,exports.FontPicker=k,exports.FontSizePicker=F,exports.FootnotePropertiesDialog=n.i,exports.HorizontalRuler=t.y,exports.HyperlinkDialog=e.i,exports.IconGridDropdown=t.w,exports.ImagePositionDialog=n.r,exports.ImagePropertiesDialog=e.r,exports.ImageTransformDropdown=t.S,exports.ImageWrapDropdown=t.C,exports.Input=e.h,exports.InsertSymbolDialog=e.n,exports.InsertTableDialog=n.n,exports.LineSpacingPicker=z,exports.ListButtons=t.t,exports.MenuBar=t.T,exports.MenuDropdown=e.p,exports.OutlineRail=e.f,exports.PageSetupDialog=e.t,exports.Popover=e.m,exports.PrintButton=Y,exports.ReplyInput=t.u,exports.ReplyThread=t.d,exports.ResolvedCommentMarker=t.c,exports.Select=e.d,exports.StylePicker=t.i,exports.TableBorderColorPicker=t._,exports.TableBorderPicker=t.v,exports.TableBorderWidthPicker=t.g,exports.TableCellFillPicker=t.h,exports.TableGridInline=t.E,exports.TableGridPicker=G,exports.TableMoreDropdown=t.m,exports.TablePropertiesDialog=n.t,exports.TableStyleGallery=n.a,exports.TableToolbar=t.p,exports.TitleBar=_,exports.Toolbar=t.b,exports.TrackedChangeCard=t.s,exports.UnifiedSidebar=t.a,exports.VerticalRuler=t.f,exports.provideFolioUI=e.c,exports.resolveFolioComponents=e.l,exports.useFolioUI=e.u;
package/dist/ui.d.ts CHANGED
@@ -65,3 +65,11 @@ export { default as PrintButton } from './components/PrintButton.vue';
65
65
  export { default as HorizontalRuler } from './components/ui/HorizontalRuler.vue';
66
66
  export { default as VerticalRuler } from './components/ui/VerticalRuler.vue';
67
67
  export { CARD_STYLE_COLLAPSED, CARD_STYLE_EXPANDED } from './components/sidebar/cardStyles';
68
+ export { default as Dialog } from './components/ui/Dialog.vue';
69
+ export { default as Select } from './components/ui/Select.vue';
70
+ export { default as Input } from './components/ui/Input.vue';
71
+ export { default as Checkbox } from './components/ui/Checkbox.vue';
72
+ export { default as DatePickerPopover } from './components/ui/DatePickerPopover.vue';
73
+ export { default as OutlineRail } from './components/ui/OutlineRail.vue';
74
+ export { DEFAULT_COMPONENTS, provideFolioUI, resolveFolioComponents, useFolioUI, } from './ui/folio-ui';
75
+ export type { FolioCheckboxProps, FolioColorPickerProps, FolioDatePickerPopoverProps, FolioDialogProps, FolioInputProps, FolioMenuItem, FolioMenuProps, FolioOutlineRailProps, FolioPopoverProps, FolioSelectItem, FolioSelectProps, } from './ui/folio-ui';
package/dist/ui.js CHANGED
@@ -1,10 +1,10 @@
1
- import { a as e, i as t, n, r, t as i, u as a } from "./PageSetupDialog-DsjAfJy0.js";
2
- import { A as o, D as s, E as c, F as l, I as u, M as d, N as f, O as ee, P as p, T as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as te, j as ne, k as re, l as ie, m as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as C, w, y as T } from "./ListButtons-B498PX1d.js";
3
- import { a as E, i as D, n as O, r as k, t as A } from "./TablePropertiesDialog-PyXEJC_o.js";
4
- import { Fragment as j, computed as M, createBlock as N, createCommentVNode as P, createElementBlock as F, createElementVNode as I, createTextVNode as L, createVNode as R, defineComponent as z, guardReactiveProps as B, normalizeClass as V, normalizeProps as H, normalizeStyle as U, openBlock as W, ref as G, renderList as K, renderSlot as q, toDisplayString as J, withCtx as Y, withKeys as X, withModifiers as Z } from "vue";
1
+ import { C as e, E as t, T as n, _ as r, a as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as ee, o as te, p as ne, r as re, t as ie, u as p, v as ae, w as oe } from "./PageSetupDialog-Djs8aW5A.js";
2
+ import { C as se, D as m, E as ce, O as le, S as ue, T as h, _ as g, a as _, b as v, c as de, d as fe, f as pe, g as me, h as he, i as ge, l as _e, m as y, o as b, p as x, r as S, s as C, t as w, u as T, v as E, w as D, x as O, y as k } from "./ListButtons-CDkmhg3v.js";
3
+ import { a as A, i as j, n as M, r as N, t as P } from "./TablePropertiesDialog-B399kZgL.js";
4
+ import { Fragment as F, computed as I, createBlock as L, createCommentVNode as R, createElementBlock as z, createElementVNode as B, createTextVNode as ve, createVNode as V, defineComponent as H, guardReactiveProps as ye, normalizeClass as U, normalizeProps as be, normalizeStyle as W, openBlock as G, ref as K, renderList as q, renderSlot as J, toDisplayString as Y, unref as xe, withCtx as X, withKeys as Z, withModifiers as Q } from "vue";
5
5
  import "@stll/folio-core/utils/units";
6
6
  //#region src/components/EditorToolbar.vue?vue&type=script&setup=true&lang.ts
7
- var fe = { class: "docx-editor-toolbar" }, pe = { class: "docx-editor-toolbar__title-row" }, me = { class: "docx-editor-toolbar__title-left" }, he = { class: "docx-editor-toolbar__title-center" }, ge = { class: "docx-editor-toolbar__title-right" }, _e = /*#__PURE__*/ a(/* @__PURE__ */ z({
7
+ var Se = { class: "docx-editor-toolbar" }, Ce = { class: "docx-editor-toolbar__title-row" }, we = { class: "docx-editor-toolbar__title-left" }, Te = { class: "docx-editor-toolbar__title-center" }, Ee = { class: "docx-editor-toolbar__title-right" }, De = /*#__PURE__*/ t(/* @__PURE__ */ H({
8
8
  inheritAttrs: !1,
9
9
  __name: "EditorToolbar",
10
10
  props: { showMenuBar: {
@@ -13,27 +13,27 @@ var fe = { class: "docx-editor-toolbar" }, pe = { class: "docx-editor-toolbar__t
13
13
  } },
14
14
  emits: ["menu-action"],
15
15
  setup(e) {
16
- return (t, n) => (W(), F("div", fe, [q(t.$slots, "title-bar", {}, () => [I("div", pe, [
17
- I("div", me, [q(t.$slots, "title-bar-left", {}, void 0, !0)]),
18
- I("div", he, [q(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (W(), N(o, {
16
+ return (t, n) => (G(), z("div", Se, [J(t.$slots, "title-bar", {}, () => [B("div", Ce, [
17
+ B("div", we, [J(t.$slots, "title-bar-left", {}, void 0, !0)]),
18
+ B("div", Te, [J(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (G(), L(h, {
19
19
  key: 0,
20
20
  onAction: n[0] ||= (e) => t.$emit("menu-action", e)
21
- })) : P("", !0)]),
22
- I("div", ge, [q(t.$slots, "title-bar-right", {}, void 0, !0)])
23
- ])], !0), q(t.$slots, "toolbar", {}, () => [R(_, H(B(t.$attrs)), null, 16)], !0)]));
21
+ })) : R("", !0)]),
22
+ B("div", Ee, [J(t.$slots, "title-bar-right", {}, void 0, !0)])
23
+ ])], !0), J(t.$slots, "toolbar", {}, () => [V(v, be(ye(t.$attrs)), null, 16)], !0)]));
24
24
  }
25
- }), [["__scopeId", "data-v-f2023632"]]), ve = {}, ye = { class: "docx-title-bar" }, be = { class: "docx-title-bar__left" }, xe = { class: "docx-title-bar__center" }, Se = { class: "docx-title-bar__right" };
26
- function Ce(e, t) {
27
- return W(), F("div", ye, [
28
- I("div", be, [q(e.$slots, "left", {}, void 0, !0)]),
29
- I("div", xe, [q(e.$slots, "default", {}, void 0, !0)]),
30
- I("div", Se, [q(e.$slots, "right", {}, void 0, !0)])
25
+ }), [["__scopeId", "data-v-f2023632"]]), Oe = {}, ke = { class: "docx-title-bar" }, Ae = { class: "docx-title-bar__left" }, je = { class: "docx-title-bar__center" }, Me = { class: "docx-title-bar__right" };
26
+ function Ne(e, t) {
27
+ return G(), z("div", ke, [
28
+ B("div", Ae, [J(e.$slots, "left", {}, void 0, !0)]),
29
+ B("div", je, [J(e.$slots, "default", {}, void 0, !0)]),
30
+ B("div", Me, [J(e.$slots, "right", {}, void 0, !0)])
31
31
  ]);
32
32
  }
33
- var we = /*#__PURE__*/ a(ve, [["render", Ce], ["__scopeId", "data-v-ae11d49f"]]);
33
+ var Pe = /*#__PURE__*/ t(Oe, [["render", Ne], ["__scopeId", "data-v-ae11d49f"]]);
34
34
  //#endregion
35
35
  //#region src/components/ui/fontPickerValue.ts
36
- function Q(e) {
36
+ function $(e) {
37
37
  let t = e.trim();
38
38
  if (!t) return "";
39
39
  let n = null, r = "";
@@ -53,19 +53,19 @@ function Q(e) {
53
53
  }
54
54
  //#endregion
55
55
  //#region src/components/ui/FontPicker.vue?vue&type=script&setup=true&lang.ts
56
- var Te = ["value", "disabled"], Ee = {
56
+ var Fe = ["value", "disabled"], Ie = {
57
57
  key: 0,
58
58
  label: "Sans-serif"
59
- }, De = ["value"], Oe = {
59
+ }, Le = ["value"], Re = {
60
60
  key: 1,
61
61
  label: "Serif"
62
- }, ke = ["value"], Ae = {
62
+ }, ze = ["value"], Be = {
63
63
  key: 2,
64
64
  label: "Monospace"
65
- }, je = ["value"], Me = {
65
+ }, Ve = ["value"], He = {
66
66
  key: 3,
67
67
  label: "Other"
68
- }, Ne = ["value"], Pe = /*#__PURE__*/ a(/* @__PURE__ */ z({
68
+ }, Ue = ["value"], We = /*#__PURE__*/ t(/* @__PURE__ */ H({
69
69
  __name: "FontPicker",
70
70
  props: {
71
71
  value: {},
@@ -144,7 +144,7 @@ var Te = ["value", "disabled"], Ee = {
144
144
  fontFamily: "Consolas, monospace",
145
145
  category: "monospace"
146
146
  }
147
- ], a = M(() => n.fonts ?? i), o = M(() => {
147
+ ], a = I(() => n.fonts ?? i), o = I(() => {
148
148
  let e = {
149
149
  "sans-serif": [],
150
150
  serif: [],
@@ -153,51 +153,51 @@ var Te = ["value", "disabled"], Ee = {
153
153
  };
154
154
  for (let t of a.value) e[t.category ?? "other"].push(t);
155
155
  return e;
156
- }), s = M(() => {
156
+ }), s = I(() => {
157
157
  let e = n.value;
158
158
  if (!e) return n.placeholder;
159
159
  let t = e.toLowerCase();
160
- return a.value.find((n) => n.fontFamily === e || n.name.toLowerCase() === t || Q(n.fontFamily).toLowerCase() === t)?.name ?? e;
160
+ return a.value.find((n) => n.fontFamily === e || n.name.toLowerCase() === t || $(n.fontFamily).toLowerCase() === t)?.name ?? e;
161
161
  });
162
162
  function c(e) {
163
163
  if (!(e.target instanceof HTMLSelectElement)) return;
164
164
  let t = e.target.value, n = a.value.find((e) => e.name === t);
165
- r("change", n ? Q(n.fontFamily) || n.name : t);
165
+ r("change", n ? $(n.fontFamily) || n.name : t);
166
166
  }
167
- return (t, n) => (W(), F("select", {
168
- class: V(["docx-font-picker", e.className]),
167
+ return (t, n) => (G(), z("select", {
168
+ class: U(["docx-font-picker", e.className]),
169
169
  value: s.value,
170
170
  disabled: e.disabled,
171
171
  "aria-label": "Font family",
172
172
  onChange: c
173
173
  }, [
174
- o.value["sans-serif"].length ? (W(), F("optgroup", Ee, [(W(!0), F(j, null, K(o.value["sans-serif"], (t) => (W(), F("option", {
174
+ o.value["sans-serif"].length ? (G(), z("optgroup", Ie, [(G(!0), z(F, null, q(o.value["sans-serif"], (t) => (G(), z("option", {
175
175
  key: t.name,
176
176
  value: t.name,
177
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
178
- }, J(t.name), 13, De))), 128))])) : P("", !0),
179
- o.value.serif.length ? (W(), F("optgroup", Oe, [(W(!0), F(j, null, K(o.value.serif, (t) => (W(), F("option", {
177
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
178
+ }, Y(t.name), 13, Le))), 128))])) : R("", !0),
179
+ o.value.serif.length ? (G(), z("optgroup", Re, [(G(!0), z(F, null, q(o.value.serif, (t) => (G(), z("option", {
180
180
  key: t.name,
181
181
  value: t.name,
182
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
183
- }, J(t.name), 13, ke))), 128))])) : P("", !0),
184
- o.value.monospace.length ? (W(), F("optgroup", Ae, [(W(!0), F(j, null, K(o.value.monospace, (t) => (W(), F("option", {
182
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
183
+ }, Y(t.name), 13, ze))), 128))])) : R("", !0),
184
+ o.value.monospace.length ? (G(), z("optgroup", Be, [(G(!0), z(F, null, q(o.value.monospace, (t) => (G(), z("option", {
185
185
  key: t.name,
186
186
  value: t.name,
187
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
188
- }, J(t.name), 13, je))), 128))])) : P("", !0),
189
- o.value.other.length ? (W(), F("optgroup", Me, [(W(!0), F(j, null, K(o.value.other, (t) => (W(), F("option", {
187
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
188
+ }, Y(t.name), 13, Ve))), 128))])) : R("", !0),
189
+ o.value.other.length ? (G(), z("optgroup", He, [(G(!0), z(F, null, q(o.value.other, (t) => (G(), z("option", {
190
190
  key: t.name,
191
191
  value: t.name,
192
- style: U(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
193
- }, J(t.name), 13, Ne))), 128))])) : P("", !0)
194
- ], 42, Te));
192
+ style: W(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
193
+ }, Y(t.name), 13, Ue))), 128))])) : R("", !0)
194
+ ], 42, Fe));
195
195
  }
196
- }), [["__scopeId", "data-v-1a9a9f88"]]), Fe = { class: "docx-font-size" }, Ie = ["disabled"], Le = [
196
+ }), [["__scopeId", "data-v-1a9a9f88"]]), Ge = { class: "docx-font-size" }, Ke = ["disabled"], qe = [
197
197
  "value",
198
198
  "disabled",
199
199
  "placeholder"
200
- ], Re = ["disabled"], ze = /*#__PURE__*/ a(/* @__PURE__ */ z({
200
+ ], Je = ["disabled"], Ye = /*#__PURE__*/ t(/* @__PURE__ */ H({
201
201
  __name: "FontSizePicker",
202
202
  props: {
203
203
  value: {},
@@ -227,7 +227,7 @@ var Te = ["value", "disabled"], Ee = {
227
227
  36,
228
228
  48,
229
229
  72
230
- ], a = M(() => n.sizes ?? i), o = M(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = M(() => n.value === void 0 ? n.placeholder : String(n.value));
230
+ ], a = I(() => n.sizes ?? i), o = I(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = I(() => n.value === void 0 ? n.placeholder : String(n.value));
231
231
  function c(e) {
232
232
  return a.value.find((t) => t > e) ?? Math.min(e + 1, n.maxSize);
233
233
  }
@@ -245,41 +245,41 @@ var Te = ["value", "disabled"], Ee = {
245
245
  let t = parseFloat(e.target.value);
246
246
  !isNaN(t) && t >= n.minSize && t <= n.maxSize && r("change", Math.round(t * 2) / 2);
247
247
  }
248
- return (t, n) => (W(), F("div", Fe, [
249
- I("button", {
248
+ return (t, n) => (G(), z("div", Ge, [
249
+ B("button", {
250
250
  type: "button",
251
251
  class: "docx-font-size__btn",
252
252
  disabled: e.disabled || o.value <= e.minSize,
253
253
  title: "Decrease font size",
254
- onClick: Z(u, ["prevent"])
255
- }, "−", 8, Ie),
256
- I("input", {
254
+ onClick: Q(u, ["prevent"])
255
+ }, "−", 8, Ke),
256
+ B("input", {
257
257
  class: "docx-font-size__input",
258
258
  type: "text",
259
259
  value: s.value,
260
260
  disabled: e.disabled,
261
261
  placeholder: e.placeholder,
262
262
  onKeydown: [
263
- n[0] ||= X(Z((e) => {
263
+ n[0] ||= Z(Q((e) => {
264
264
  u(), e.stopPropagation();
265
265
  }, ["prevent"]), ["up"]),
266
- n[1] ||= X(Z((e) => {
266
+ n[1] ||= Z(Q((e) => {
267
267
  d(), e.stopPropagation();
268
268
  }, ["prevent"]), ["down"]),
269
- n[2] ||= X(Z((e) => f(e), ["prevent"]), ["enter"])
269
+ n[2] ||= Z(Q((e) => f(e), ["prevent"]), ["enter"])
270
270
  ],
271
271
  onBlur: n[3] ||= (e) => f(e)
272
- }, null, 40, Le),
273
- I("button", {
272
+ }, null, 40, qe),
273
+ B("button", {
274
274
  type: "button",
275
275
  class: "docx-font-size__btn",
276
276
  disabled: e.disabled || o.value >= e.maxSize,
277
277
  title: "Increase font size",
278
- onClick: Z(d, ["prevent"])
279
- }, "+", 8, Re)
278
+ onClick: Q(d, ["prevent"])
279
+ }, "+", 8, Je)
280
280
  ]));
281
281
  }
282
- }), [["__scopeId", "data-v-4e8ada55"]]), $ = ["value", "disabled"], Be = ["value"], Ve = /*#__PURE__*/ a(/* @__PURE__ */ z({
282
+ }), [["__scopeId", "data-v-4e8ada55"]]), Xe = ["value", "disabled"], Ze = ["value"], Qe = /*#__PURE__*/ t(/* @__PURE__ */ H({
283
283
  __name: "LineSpacingPicker",
284
284
  props: {
285
285
  value: {},
@@ -313,29 +313,29 @@ var Te = ["value", "disabled"], Ee = {
313
313
  value: 2,
314
314
  twipsValue: 480
315
315
  }
316
- ], a = M(() => n.options ?? i), o = M(() => n.value ?? a.value[0]?.twipsValue ?? 240);
316
+ ], a = I(() => n.options ?? i), o = I(() => n.value ?? a.value[0]?.twipsValue ?? 240);
317
317
  function s(e) {
318
318
  if (!(e.target instanceof HTMLSelectElement)) return;
319
319
  let t = parseInt(e.target.value, 10);
320
320
  isNaN(t) || r("change", t);
321
321
  }
322
- return (t, n) => (W(), F("select", {
323
- class: V(["docx-line-spacing", e.className]),
322
+ return (t, n) => (G(), z("select", {
323
+ class: U(["docx-line-spacing", e.className]),
324
324
  value: String(o.value),
325
325
  disabled: e.disabled,
326
326
  "aria-label": "Line spacing",
327
327
  onChange: s
328
- }, [(W(!0), F(j, null, K(a.value, (e) => (W(), F("option", {
328
+ }, [(G(!0), z(F, null, q(a.value, (e) => (G(), z("option", {
329
329
  key: e.twipsValue,
330
330
  value: String(e.twipsValue)
331
- }, J(e.label), 9, Be))), 128))], 42, $));
331
+ }, Y(e.label), 9, Ze))), 128))], 42, Xe));
332
332
  }
333
- }), [["__scopeId", "data-v-fcda8ecc"]]), He = [
333
+ }), [["__scopeId", "data-v-fcda8ecc"]]), $e = [
334
334
  "disabled",
335
335
  "aria-expanded",
336
336
  "title",
337
337
  "onClick"
338
- ], Ue = { class: "docx-table-grid__panel" }, We = { class: "docx-table-grid__label" }, Ge = ["onMouseenter", "onClick"], Ke = /*#__PURE__*/ a(/* @__PURE__ */ z({
338
+ ], et = { class: "docx-table-grid__panel" }, tt = { class: "docx-table-grid__label" }, nt = ["onMouseenter", "onClick"], rt = /*#__PURE__*/ t(/* @__PURE__ */ H({
339
339
  __name: "TableGridPicker",
340
340
  props: {
341
341
  disabled: {
@@ -348,62 +348,62 @@ var Te = ["value", "disabled"], Ee = {
348
348
  },
349
349
  emits: ["insert"],
350
350
  setup(e, { emit: t }) {
351
- let n = e, r = t, i = G(!1), a = G({
351
+ let { Popover: r } = p(), i = e, a = t, o = K(!1), s = K({
352
352
  rows: 1,
353
353
  cols: 1
354
- }), o = M(() => {
354
+ }), c = I(() => {
355
355
  let e = [];
356
- for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
356
+ for (let t = 1; t <= i.gridRows; t++) for (let n = 1; n <= i.gridColumns; n++) e.push({
357
357
  r: t,
358
- c: r
358
+ c: n
359
359
  });
360
360
  return e;
361
361
  });
362
- function s(e, t) {
363
- r("insert", e, t), i.value = !1;
362
+ function l(e, t) {
363
+ a("insert", e, t), o.value = !1;
364
364
  }
365
- function c() {
366
- i.value = !1, a.value = {
365
+ function u() {
366
+ o.value = !1, s.value = {
367
367
  rows: 1,
368
368
  cols: 1
369
369
  };
370
370
  }
371
- return (t, n) => (W(), N(f, {
372
- open: i.value,
373
- "onUpdate:open": n[0] ||= (e) => i.value = e,
374
- onClose: c
371
+ return (t, i) => (G(), L(xe(r), {
372
+ open: o.value,
373
+ "onUpdate:open": i[0] ||= (e) => o.value = e,
374
+ onClose: u
375
375
  }, {
376
- trigger: Y(({ toggle: t }) => [I("button", {
376
+ trigger: X(({ toggle: t }) => [B("button", {
377
377
  type: "button",
378
378
  class: "docx-table-grid__btn",
379
379
  disabled: e.disabled,
380
- "aria-expanded": i.value,
380
+ "aria-expanded": o.value,
381
381
  "aria-haspopup": "grid",
382
382
  title: e.tooltip,
383
- onClick: Z(t, ["prevent"])
384
- }, [R(u, {
383
+ onClick: Q(t, ["prevent"])
384
+ }, [V(n, {
385
385
  name: "grid_on",
386
386
  size: 20
387
- })], 8, He)]),
388
- panel: Y(() => [I("div", Ue, [I("div", We, J(a.value.rows) + " × " + J(a.value.cols), 1), I("div", {
387
+ })], 8, $e)]),
388
+ panel: X(() => [B("div", et, [B("div", tt, Y(s.value.rows) + " × " + Y(s.value.cols), 1), B("div", {
389
389
  class: "docx-table-grid__grid",
390
- style: U({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
391
- }, [(W(!0), F(j, null, K(o.value, (e) => (W(), F("button", {
390
+ style: W({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
391
+ }, [(G(!0), z(F, null, q(c.value, (e) => (G(), z("button", {
392
392
  key: `${e.r}-${e.c}`,
393
- class: V(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= a.value.rows && e.c <= a.value.cols }]),
394
- onMouseenter: (t) => a.value = {
393
+ class: U(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= s.value.rows && e.c <= s.value.cols }]),
394
+ onMouseenter: (t) => s.value = {
395
395
  rows: e.r,
396
396
  cols: e.c
397
397
  },
398
- onClick: Z((t) => s(e.r, e.c), ["prevent"])
399
- }, null, 42, Ge))), 128))], 4)])]),
398
+ onClick: Q((t) => l(e.r, e.c), ["prevent"])
399
+ }, null, 42, nt))), 128))], 4)])]),
400
400
  _: 1
401
401
  }, 8, ["open"]));
402
402
  }
403
- }), [["__scopeId", "data-v-34f6875c"]]), qe = ["disabled", "title"], Je = {
403
+ }), [["__scopeId", "data-v-444ca123"]]), it = ["disabled", "title"], at = {
404
404
  key: 0,
405
405
  class: "print-btn__icon"
406
- }, Ye = /*#__PURE__*/ a(/* @__PURE__ */ z({
406
+ }, ot = /*#__PURE__*/ t(/* @__PURE__ */ H({
407
407
  __name: "PrintButton",
408
408
  props: {
409
409
  disabled: {
@@ -422,20 +422,20 @@ var Te = ["value", "disabled"], Ee = {
422
422
  function i() {
423
423
  n.disabled || (r("print"), window.print());
424
424
  }
425
- return (t, n) => (W(), F("button", {
425
+ return (t, n) => (G(), z("button", {
426
426
  class: "print-btn",
427
427
  disabled: e.disabled,
428
428
  title: e.label,
429
- onMousedown: Z(i, ["prevent"])
430
- }, [L(J(e.compact ? "" : e.label) + " ", 1), e.compact ? (W(), F("span", Je, "🖨")) : P("", !0)], 40, qe));
429
+ onMousedown: Q(i, ["prevent"])
430
+ }, [ve(Y(e.compact ? "" : e.label) + " ", 1), e.compact ? (G(), z("span", at, "🖨")) : R("", !0)], 40, it));
431
431
  }
432
- }), [["__scopeId", "data-v-3e413c06"]]), Xe = {
432
+ }), [["__scopeId", "data-v-3e413c06"]]), st = {
433
433
  padding: "8px 10px",
434
434
  borderRadius: 8,
435
435
  backgroundColor: "var(--doc-card)",
436
436
  cursor: "pointer",
437
437
  boxShadow: "var(--doc-card-shadow)"
438
- }, Ze = {
438
+ }, ct = {
439
439
  padding: "10px 12px",
440
440
  borderRadius: 8,
441
441
  backgroundColor: "var(--doc-surface)",
@@ -443,4 +443,4 @@ var Te = ["value", "disabled"], Ee = {
443
443
  boxShadow: "var(--doc-card-shadow-strong)"
444
444
  };
445
445
  //#endregion
446
- export { oe as AddCommentCard, ce as AlignmentButtons, m as Button, Xe as CARD_STYLE_COLLAPSED, Ze as CARD_STYLE_EXPANDED, w as ColorPicker, ie as CommentCard, l as CommentMarginMarkers, p as DocumentName, c as EditingModeDropdown, _e as EditorToolbar, e as FindReplaceDialog, Pe as FontPicker, ze as FontSizePicker, D as FootnotePropertiesDialog, T as HorizontalRuler, t as HyperlinkDialog, re as IconGridDropdown, k as ImagePositionDialog, r as ImagePropertiesDialog, s as ImageTransformDropdown, ee as ImageWrapDropdown, n as InsertSymbolDialog, O as InsertTableDialog, Ve as LineSpacingPicker, ue as ListButtons, o as MenuBar, d as MenuDropdown, i as PageSetupDialog, f as Popover, Ye as PrintButton, de as ReplyInput, y as ReplyThread, v as ResolvedCommentMarker, te as StylePicker, h as TableBorderColorPicker, C as TableBorderPicker, x as TableBorderWidthPicker, S as TableCellFillPicker, ne as TableGridInline, Ke as TableGridPicker, ae as TableMoreDropdown, A as TablePropertiesDialog, E as TableStyleGallery, se as TableToolbar, we as TitleBar, _ as Toolbar, le as TrackedChangeCard, g as UnifiedSidebar, b as VerticalRuler };
446
+ export { b as AddCommentCard, S as AlignmentButtons, oe as Button, st as CARD_STYLE_COLLAPSED, ct as CARD_STYLE_EXPANDED, e as Checkbox, ae as ColorPicker, _e as CommentCard, le as CommentMarginMarkers, te as DEFAULT_COMPONENTS, r as DatePickerPopover, c as Dialog, m as DocumentName, O as EditingModeDropdown, De as EditorToolbar, i as FindReplaceDialog, We as FontPicker, Ye as FontSizePicker, j as FootnotePropertiesDialog, k as HorizontalRuler, u as HyperlinkDialog, D as IconGridDropdown, N as ImagePositionDialog, re as ImagePropertiesDialog, ue as ImageTransformDropdown, se as ImageWrapDropdown, l as Input, ee as InsertSymbolDialog, M as InsertTableDialog, Qe as LineSpacingPicker, w as ListButtons, h as MenuBar, ne as MenuDropdown, s as OutlineRail, ie as PageSetupDialog, f as Popover, ot as PrintButton, T as ReplyInput, fe as ReplyThread, de as ResolvedCommentMarker, o as Select, ge as StylePicker, g as TableBorderColorPicker, E as TableBorderPicker, me as TableBorderWidthPicker, he as TableCellFillPicker, ce as TableGridInline, rt as TableGridPicker, y as TableMoreDropdown, P as TablePropertiesDialog, A as TableStyleGallery, x as TableToolbar, Pe as TitleBar, v as Toolbar, C as TrackedChangeCard, _ as UnifiedSidebar, pe as VerticalRuler, a as provideFolioUI, d as resolveFolioComponents, p as useFolioUI };