@stll/folio-vue 0.32.1 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/FindReplaceDialog-CfcTl2Ra.cjs +1 -0
  2. package/dist/FindReplaceDialog-DEWjhuOw.js +168 -0
  3. package/dist/HorizontalRuler-Cuk0l4Us.cjs +1 -0
  4. package/dist/HorizontalRuler-TM9dg--R.js +341 -0
  5. package/dist/HyperlinkDialog-BEse_y7R.js +175 -0
  6. package/dist/HyperlinkDialog-Cs1y6aol.cjs +1 -0
  7. package/dist/ImagePropertiesDialog-CTbX2GrE.cjs +1 -0
  8. package/dist/ImagePropertiesDialog-mrJ8S3sl.js +186 -0
  9. package/dist/ImageSelectionOverlay-DULrvfOJ.js +386 -0
  10. package/dist/ImageSelectionOverlay-Dr0lg9WZ.cjs +1 -0
  11. package/dist/InsertSymbolDialog-BjB-Q9EO.js +93 -0
  12. package/dist/InsertSymbolDialog-BsjgPYM-.cjs +1 -0
  13. package/dist/PageSetupDialog-CZ5fE9rz.cjs +1 -0
  14. package/dist/PageSetupDialog-DNNSezj3.js +208 -0
  15. package/dist/SetNumberingValueDialog-ClCYr37D.cjs +1 -0
  16. package/dist/SetNumberingValueDialog-CwLHfO7f.js +54 -0
  17. package/dist/SplitCellDialog-Bfuo5WCO.cjs +1 -0
  18. package/dist/SplitCellDialog-HIg4ZEqt.js +1031 -0
  19. package/dist/StylePicker-BnGGlXOX.cjs +4 -0
  20. package/dist/{StylePicker-DmTN56Yg.js → StylePicker-F3cLPvRE.js} +593 -1100
  21. package/dist/TablePropertiesDialog-CRX9Xgdr.js +102 -0
  22. package/dist/TablePropertiesDialog-ClJSuB0F.cjs +1 -0
  23. package/dist/VerticalRuler-D973NTMv.js +178 -0
  24. package/dist/VerticalRuler-DVi2P_TO.cjs +1 -0
  25. package/dist/WatermarkDialog-BYyBTlDK.cjs +1 -0
  26. package/dist/WatermarkDialog-BoAdQ-qK.js +161 -0
  27. package/dist/components/DocxEditor/types.d.ts +1 -1
  28. package/dist/components/dialogs/recentSymbols.d.ts +7 -0
  29. package/dist/composables/useDocxEditor.d.ts +4 -1
  30. package/dist/composables/useTrackedChanges.d.ts +5 -2
  31. package/dist/composables.cjs +1 -1
  32. package/dist/composables.js +1 -1
  33. package/dist/dialogs.cjs +1 -1
  34. package/dist/dialogs.js +9 -1
  35. package/dist/{SplitCellDialog-BczVYfpm.js → folio-ui-ctJdVP-s.js} +678 -2753
  36. package/dist/folio-ui-u7h3WXUO.cjs +15 -0
  37. package/dist/folio-vue.css +1 -1
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.d.ts +1 -2
  40. package/dist/index.js +1666 -2064
  41. package/dist/messages/ar.cjs +1 -1
  42. package/dist/messages/cs.cjs +1 -1
  43. package/dist/messages/de.cjs +1 -1
  44. package/dist/messages/en.cjs +1 -1
  45. package/dist/messages/es.cjs +1 -1
  46. package/dist/messages/et.cjs +1 -1
  47. package/dist/messages/fr.cjs +1 -1
  48. package/dist/messages/he.cjs +1 -1
  49. package/dist/messages/hi.cjs +1 -1
  50. package/dist/messages/hu.cjs +1 -1
  51. package/dist/messages/lt.cjs +1 -1
  52. package/dist/messages/lv.cjs +1 -1
  53. package/dist/messages/pl.cjs +1 -1
  54. package/dist/messages/pt-BR.cjs +1 -1
  55. package/dist/messages/sk.cjs +1 -1
  56. package/dist/messages/tr.cjs +1 -1
  57. package/dist/messages/zh-CN.cjs +1 -1
  58. package/dist/rolldown-runtime-DbbDpzbe.cjs +1 -0
  59. package/dist/ui.cjs +1 -1
  60. package/dist/ui.js +28 -18
  61. package/dist/useZoom-BKM59EqE.js +1013 -0
  62. package/dist/useZoom-C0dkG1Q4.cjs +1 -0
  63. package/dist/utils/comments.d.ts +1 -1
  64. package/package.json +2 -2
  65. package/dist/SplitCellDialog-CrLHwVLc.cjs +0 -15
  66. package/dist/StylePicker-C0iEQnw6.cjs +0 -4
  67. package/dist/rolldown-runtime-5iZMYShA.cjs +0 -1
  68. package/dist/useZoom-1kmdkmJ4.js +0 -1006
  69. package/dist/useZoom-Bj5B9uT1.cjs +0 -1
@@ -0,0 +1,175 @@
1
+ import { C as e, S as t, g as n } from "./folio-ui-ctJdVP-s.js";
2
+ import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, vModelSelect as g, vModelText as _, watch as v, withDirectives as y, withKeys as b, withModifiers as x } from "vue";
3
+ // src/components/dialogs/HyperlinkDialog.vue?vue&type=script&setup=true&lang.ts
4
+ var ee = { class: "dialog__header" }, te = { class: "dialog__title" }, ne = ["aria-label"], re = { class: "dialog__body" }, ie = {
5
+ key: 0,
6
+ class: "link-tabs",
7
+ role: "tablist"
8
+ }, ae = ["aria-selected"], oe = ["aria-selected"], se = {
9
+ key: 1,
10
+ class: "field"
11
+ }, S = { class: "field__label" }, C = [
12
+ "placeholder",
13
+ "aria-invalid",
14
+ "onKeydown"
15
+ ], w = {
16
+ key: 0,
17
+ class: "field__error"
18
+ }, T = {
19
+ key: 1,
20
+ class: "field__hint"
21
+ }, E = {
22
+ key: 2,
23
+ class: "field"
24
+ }, ce = { class: "field__label" }, le = ["onKeydown"], D = { value: "" }, O = ["value"], k = { class: "field" }, A = { class: "field__label" }, j = ["placeholder"], M = { class: "field__hint" }, N = { class: "field" }, P = { class: "field__label" }, F = ["placeholder"], I = { class: "dialog__actions" }, L = ["disabled"], R = /*@__PURE__*/ c({
25
+ __name: "HyperlinkDialog",
26
+ props: {
27
+ isOpen: { type: Boolean },
28
+ view: {},
29
+ bookmarks: {}
30
+ },
31
+ emits: [
32
+ "close",
33
+ "submit",
34
+ "remove"
35
+ ],
36
+ setup(e, { emit: n }) {
37
+ let { t: c } = t(), R = e, z = n, B = f(null), V = f(null), H = f("url"), U = f(""), W = f(""), G = f(""), K = f(""), q = f(!1), J = f(""), Y = f(!1), X = i(() => R.bookmarks ?? []), ue = i(() => H.value === "bookmark" ? !!W.value : !!U.value.trim() && !J.value);
38
+ v(U, () => {
39
+ J.value &&= "";
40
+ });
41
+ function Z(e) {
42
+ let t = e.trim();
43
+ if (!t) return !1;
44
+ if (/^(mailto:|tel:)/i.test(t)) return t.replace(/^(mailto:|tel:)/i, "").length > 0;
45
+ if (/^ftp:\/\//i.test(t)) return t.length > 6;
46
+ try {
47
+ let e = new URL(/^https?:\/\//i.test(t) ? t : `https://${t}`);
48
+ return e.protocol === "http:" || e.protocol === "https:";
49
+ } catch {
50
+ return !1;
51
+ }
52
+ }
53
+ function de(e) {
54
+ let t = e.trim();
55
+ return /^(https?:\/\/|mailto:|tel:|ftp:\/\/)/i.test(t) ? t : `https://${t}`;
56
+ }
57
+ v(() => R.isOpen, async (e) => {
58
+ if (e) {
59
+ let e = R.view;
60
+ if (e) {
61
+ let { $from: t, empty: n, from: r, to: i } = e.state.selection, a = (e.state.storedMarks || t.marks()).find((e) => e.type.name === "hyperlink");
62
+ if (a) {
63
+ let e = a.attrs.href || "";
64
+ e.startsWith("#") ? (H.value = "bookmark", W.value = e.slice(1), U.value = "") : (H.value = "url", U.value = e, W.value = ""), K.value = a.attrs.tooltip || "", q.value = !0;
65
+ } else H.value = "url", U.value = "", W.value = "", K.value = "", q.value = !1;
66
+ n ? G.value = "" : G.value = e.state.doc.textBetween(r, i);
67
+ }
68
+ await l(), H.value === "bookmark" ? V.value?.focus() : B.value?.focus();
69
+ } else Y.value = !1, J.value = "";
70
+ }, { immediate: !0 });
71
+ function Q() {
72
+ z("close");
73
+ }
74
+ function $() {
75
+ if (H.value === "bookmark") {
76
+ if (!W.value) return;
77
+ z("submit", {
78
+ bookmark: W.value,
79
+ displayText: G.value,
80
+ tooltip: K.value
81
+ }), Q();
82
+ } else Y.value = !0, Z(U.value) ? (z("submit", {
83
+ url: de(U.value),
84
+ displayText: G.value,
85
+ tooltip: K.value
86
+ }), Q()) : J.value = U.value.trim() ? c("dialogs.hyperlink.invalidUrl") : c("dialogs.hyperlink.urlRequired");
87
+ }
88
+ function fe() {
89
+ H.value === "url" && (Y.value = !0, U.value.trim() ? J.value = Z(U.value) ? "" : c("dialogs.hyperlink.invalidUrl") : J.value = "");
90
+ }
91
+ function pe() {
92
+ z("remove"), Q();
93
+ }
94
+ return (t, n) => e.isOpen ? (d(), o("div", {
95
+ key: 0,
96
+ class: "dialog-overlay",
97
+ onMousedown: x(Q, ["self"])
98
+ }, [s("div", {
99
+ class: "dialog",
100
+ onMousedown: n[6] ||= x(() => {}, ["stop"]),
101
+ onKeydown: n[7] ||= x(() => {}, ["stop"])
102
+ }, [s("div", ee, [s("span", te, m(q.value ? h(c)("dialogs.hyperlink.titleEdit") : h(c)("dialogs.hyperlink.titleInsert")), 1), s("button", {
103
+ class: "dialog__close",
104
+ "aria-label": h(c)("common.closeDialog"),
105
+ onClick: Q
106
+ }, " ✕ ", 8, ne)]), s("div", re, [
107
+ X.value.length > 0 ? (d(), o("div", ie, [s("button", {
108
+ class: u(["link-tab", { active: H.value === "url" }]),
109
+ role: "tab",
110
+ "aria-selected": H.value === "url",
111
+ onMousedown: n[0] ||= x((e) => H.value = "url", ["prevent"])
112
+ }, m(h(c)("dialogs.hyperlink.tabWebAddress")), 43, ae), s("button", {
113
+ class: u(["link-tab", { active: H.value === "bookmark" }]),
114
+ role: "tab",
115
+ "aria-selected": H.value === "bookmark",
116
+ onMousedown: n[1] ||= x((e) => H.value = "bookmark", ["prevent"])
117
+ }, m(h(c)("dialogs.hyperlink.tabBookmark")), 43, oe)])) : a("", !0),
118
+ H.value === "url" ? (d(), o("div", se, [
119
+ s("label", S, m(h(c)("dialogs.hyperlink.urlLabel")), 1),
120
+ y(s("input", {
121
+ ref_key: "urlInputRef",
122
+ ref: B,
123
+ "onUpdate:modelValue": n[2] ||= (e) => U.value = e,
124
+ class: u(["field__input", { "field__input--error": Y.value && !!J.value }]),
125
+ placeholder: h(c)("dialogs.hyperlink.urlPlaceholder"),
126
+ "aria-invalid": Y.value && !!J.value,
127
+ onKeydown: b(x($, ["prevent"]), ["enter"]),
128
+ onBlur: fe
129
+ }, null, 42, C), [[_, U.value]]),
130
+ Y.value && J.value ? (d(), o("div", w, m(J.value), 1)) : (d(), o("div", T, m(h(c)("dialogs.hyperlink.urlHint")), 1))
131
+ ])) : (d(), o("div", E, [s("label", ce, m(h(c)("dialogs.hyperlink.bookmarkLabel")), 1), y(s("select", {
132
+ ref_key: "bookmarkSelectRef",
133
+ ref: V,
134
+ "onUpdate:modelValue": n[3] ||= (e) => W.value = e,
135
+ class: "field__input",
136
+ onKeydown: b(x($, ["prevent"]), ["enter"])
137
+ }, [s("option", D, m(h(c)("dialogs.hyperlink.bookmarkPlaceholder")), 1), (d(!0), o(r, null, p(X.value, (e) => (d(), o("option", {
138
+ key: e.name,
139
+ value: e.name
140
+ }, m(e.label || e.name), 9, O))), 128))], 40, le), [[g, W.value]])])),
141
+ s("div", k, [
142
+ s("label", A, m(h(c)("dialogs.hyperlink.displayTextLabel")), 1),
143
+ y(s("input", {
144
+ "onUpdate:modelValue": n[4] ||= (e) => G.value = e,
145
+ class: "field__input",
146
+ placeholder: h(c)("dialogs.hyperlink.displayTextPlaceholder")
147
+ }, null, 8, j), [[_, G.value]]),
148
+ s("div", M, m(h(c)("dialogs.hyperlink.displayTextHint")), 1)
149
+ ]),
150
+ s("div", N, [s("label", P, m(h(c)("dialogs.hyperlink.tooltipLabel")), 1), y(s("input", {
151
+ "onUpdate:modelValue": n[5] ||= (e) => K.value = e,
152
+ class: "field__input",
153
+ placeholder: h(c)("dialogs.hyperlink.tooltipPlaceholder")
154
+ }, null, 8, F), [[_, K.value]])]),
155
+ s("div", I, [
156
+ q.value ? (d(), o("button", {
157
+ key: 0,
158
+ class: "dialog__btn dialog__btn--danger",
159
+ onMousedown: x(pe, ["prevent"])
160
+ }, m(h(c)("dialogs.hyperlink.removeLink")), 33)) : a("", !0),
161
+ n[8] ||= s("div", { style: { flex: "1" } }, null, -1),
162
+ s("button", {
163
+ class: "dialog__btn",
164
+ onClick: Q
165
+ }, m(h(c)("common.cancel")), 1),
166
+ s("button", {
167
+ class: "dialog__btn dialog__btn--primary",
168
+ onMousedown: x($, ["prevent"]),
169
+ disabled: !ue.value
170
+ }, m(q.value ? h(c)("common.update") : h(c)("common.insert")), 41, L)
171
+ ])
172
+ ])], 32)], 32)) : a("", !0);
173
+ }
174
+ }), z = /* @__PURE__ */ e({ default: () => B }), B = /*#__PURE__*/ n(R, [["__scopeId", "data-v-ff29f94a"]]);
175
+ export { z as n, B as t };
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./folio-ui-u7h3WXUO.cjs");let n=require("vue");var r={class:`dialog__header`},i={class:`dialog__title`},a=[`aria-label`],o={class:`dialog__body`},s={key:0,class:`link-tabs`,role:`tablist`},c=[`aria-selected`],l=[`aria-selected`],u={key:1,class:`field`},d={class:`field__label`},f=[`placeholder`,`aria-invalid`,`onKeydown`],p={key:0,class:`field__error`},m={key:1,class:`field__hint`},h={key:2,class:`field`},g={class:`field__label`},_=[`onKeydown`],v={value:``},y=[`value`],b={class:`field`},x={class:`field__label`},S=[`placeholder`],C={class:`field__hint`},w={class:`field`},T={class:`field__label`},E=[`placeholder`],D={class:`dialog__actions`},O=[`disabled`],k=(0,n.defineComponent)({__name:`HyperlinkDialog`,props:{isOpen:{type:Boolean},view:{},bookmarks:{}},emits:[`close`,`submit`,`remove`],setup(e,{emit:k}){let{t:A}=t.S(),j=e,M=k,N=(0,n.ref)(null),P=(0,n.ref)(null),F=(0,n.ref)(`url`),I=(0,n.ref)(``),L=(0,n.ref)(``),R=(0,n.ref)(``),z=(0,n.ref)(``),B=(0,n.ref)(!1),V=(0,n.ref)(``),H=(0,n.ref)(!1),U=(0,n.computed)(()=>j.bookmarks??[]),W=(0,n.computed)(()=>F.value===`bookmark`?!!L.value:!!I.value.trim()&&!V.value);(0,n.watch)(I,()=>{V.value&&=``});function G(e){let t=e.trim();if(!t)return!1;if(/^(mailto:|tel:)/i.test(t))return t.replace(/^(mailto:|tel:)/i,``).length>0;if(/^ftp:\/\//i.test(t))return t.length>6;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.protocol===`http:`||e.protocol===`https:`}catch{return!1}}function K(e){let t=e.trim();return/^(https?:\/\/|mailto:|tel:|ftp:\/\/)/i.test(t)?t:`https://${t}`}(0,n.watch)(()=>j.isOpen,async e=>{if(e){let e=j.view;if(e){let{$from:t,empty:n,from:r,to:i}=e.state.selection,a=(e.state.storedMarks||t.marks()).find(e=>e.type.name===`hyperlink`);if(a){let e=a.attrs.href||``;e.startsWith(`#`)?(F.value=`bookmark`,L.value=e.slice(1),I.value=``):(F.value=`url`,I.value=e,L.value=``),z.value=a.attrs.tooltip||``,B.value=!0}else F.value=`url`,I.value=``,L.value=``,z.value=``,B.value=!1;n?R.value=``:R.value=e.state.doc.textBetween(r,i)}await(0,n.nextTick)(),F.value===`bookmark`?P.value?.focus():N.value?.focus()}else H.value=!1,V.value=``},{immediate:!0});function q(){M(`close`)}function J(){if(F.value===`bookmark`){if(!L.value)return;M(`submit`,{bookmark:L.value,displayText:R.value,tooltip:z.value}),q()}else H.value=!0,G(I.value)?(M(`submit`,{url:K(I.value),displayText:R.value,tooltip:z.value}),q()):V.value=I.value.trim()?A(`dialogs.hyperlink.invalidUrl`):A(`dialogs.hyperlink.urlRequired`)}function Y(){F.value===`url`&&(H.value=!0,I.value.trim()?V.value=G(I.value)?``:A(`dialogs.hyperlink.invalidUrl`):V.value=``)}function X(){M(`remove`),q()}return(t,k)=>e.isOpen?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,class:`dialog-overlay`,onMousedown:(0,n.withModifiers)(q,[`self`])},[(0,n.createElementVNode)(`div`,{class:`dialog`,onMousedown:k[6]||=(0,n.withModifiers)(()=>{},[`stop`]),onKeydown:k[7]||=(0,n.withModifiers)(()=>{},[`stop`])},[(0,n.createElementVNode)(`div`,r,[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)(B.value?(0,n.unref)(A)(`dialogs.hyperlink.titleEdit`):(0,n.unref)(A)(`dialogs.hyperlink.titleInsert`)),1),(0,n.createElementVNode)(`button`,{class:`dialog__close`,"aria-label":(0,n.unref)(A)(`common.closeDialog`),onClick:q},` ✕ `,8,a)]),(0,n.createElementVNode)(`div`,o,[U.value.length>0?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,s,[(0,n.createElementVNode)(`button`,{class:(0,n.normalizeClass)([`link-tab`,{active:F.value===`url`}]),role:`tab`,"aria-selected":F.value===`url`,onMousedown:k[0]||=(0,n.withModifiers)(e=>F.value=`url`,[`prevent`])},(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.tabWebAddress`)),43,c),(0,n.createElementVNode)(`button`,{class:(0,n.normalizeClass)([`link-tab`,{active:F.value===`bookmark`}]),role:`tab`,"aria-selected":F.value===`bookmark`,onMousedown:k[1]||=(0,n.withModifiers)(e=>F.value=`bookmark`,[`prevent`])},(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.tabBookmark`)),43,l)])):(0,n.createCommentVNode)(``,!0),F.value===`url`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[(0,n.createElementVNode)(`label`,d,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.urlLabel`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{ref_key:`urlInputRef`,ref:N,"onUpdate:modelValue":k[2]||=e=>I.value=e,class:(0,n.normalizeClass)([`field__input`,{"field__input--error":H.value&&!!V.value}]),placeholder:(0,n.unref)(A)(`dialogs.hyperlink.urlPlaceholder`),"aria-invalid":H.value&&!!V.value,onKeydown:(0,n.withKeys)((0,n.withModifiers)(J,[`prevent`]),[`enter`]),onBlur:Y},null,42,f),[[n.vModelText,I.value]]),H.value&&V.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,p,(0,n.toDisplayString)(V.value),1)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,m,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.urlHint`)),1))])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,h,[(0,n.createElementVNode)(`label`,g,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.bookmarkLabel`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`select`,{ref_key:`bookmarkSelectRef`,ref:P,"onUpdate:modelValue":k[3]||=e=>L.value=e,class:`field__input`,onKeydown:(0,n.withKeys)((0,n.withModifiers)(J,[`prevent`]),[`enter`])},[(0,n.createElementVNode)(`option`,v,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.bookmarkPlaceholder`)),1),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(U.value,e=>((0,n.openBlock)(),(0,n.createElementBlock)(`option`,{key:e.name,value:e.name},(0,n.toDisplayString)(e.label||e.name),9,y))),128))],40,_),[[n.vModelSelect,L.value]])])),(0,n.createElementVNode)(`div`,b,[(0,n.createElementVNode)(`label`,x,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.displayTextLabel`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{"onUpdate:modelValue":k[4]||=e=>R.value=e,class:`field__input`,placeholder:(0,n.unref)(A)(`dialogs.hyperlink.displayTextPlaceholder`)},null,8,S),[[n.vModelText,R.value]]),(0,n.createElementVNode)(`div`,C,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.displayTextHint`)),1)]),(0,n.createElementVNode)(`div`,w,[(0,n.createElementVNode)(`label`,T,(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.tooltipLabel`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{"onUpdate:modelValue":k[5]||=e=>z.value=e,class:`field__input`,placeholder:(0,n.unref)(A)(`dialogs.hyperlink.tooltipPlaceholder`)},null,8,E),[[n.vModelText,z.value]])]),(0,n.createElementVNode)(`div`,D,[B.value?((0,n.openBlock)(),(0,n.createElementBlock)(`button`,{key:0,class:`dialog__btn dialog__btn--danger`,onMousedown:(0,n.withModifiers)(X,[`prevent`])},(0,n.toDisplayString)((0,n.unref)(A)(`dialogs.hyperlink.removeLink`)),33)):(0,n.createCommentVNode)(``,!0),k[8]||=(0,n.createElementVNode)(`div`,{style:{flex:`1`}},null,-1),(0,n.createElementVNode)(`button`,{class:`dialog__btn`,onClick:q},(0,n.toDisplayString)((0,n.unref)(A)(`common.cancel`)),1),(0,n.createElementVNode)(`button`,{class:`dialog__btn dialog__btn--primary`,onMousedown:(0,n.withModifiers)(J,[`prevent`]),disabled:!W.value},(0,n.toDisplayString)(B.value?(0,n.unref)(A)(`common.update`):(0,n.unref)(A)(`common.insert`)),41,O)])])],32)],32)):(0,n.createCommentVNode)(``,!0)}}),A=e.n({default:()=>j}),j=t.g(k,[[`__scopeId`,`data-v-ff29f94a`]]);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return j}});
@@ -0,0 +1 @@
1
+ const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./folio-ui-u7h3WXUO.cjs");let n=require("vue");var r={class:`dialog__header`},i={class:`dialog__title`},a=[`aria-label`],o={class:`dialog__body`},s={class:`field`},c={class:`field__label`},l=[`placeholder`],u={class:`field`},d={class:`field__label`},f={value:`inline`},p={value:`wrapRight`},m={value:`wrapLeft`},h={value:`topAndBottom`},g={value:`behind`},_={value:`inFront`},v={class:`field`},y={class:`field__label`},b={class:`field-row`},x={value:`solid`},S={value:`dashed`},C={value:`dotted`},w={value:`double`},T={class:`field`},E={class:`field__label`},D={class:`field-row`},O=[`value`],k=[`value`],A={class:`field__checkbox`},j={class:`dialog__actions`},M=(0,n.defineComponent)({__name:`ImagePropertiesDialog`,props:{isOpen:{type:Boolean},view:{},pmPos:{}},emits:[`close`],setup(e,{emit:M}){let{t:N}=t.S(),{Dialog:P}=t.a(),F=e,I=M,L=(0,n.ref)(``),R=(0,n.ref)(`inline`),z=(0,n.ref)(0),B=(0,n.ref)(`solid`),V=(0,n.ref)(`#000000`),H=(0,n.ref)(200),U=(0,n.ref)(150),W=(0,n.ref)(!0),G=1;(0,n.watch)(()=>F.isOpen,e=>{if(e&&F.view&&F.pmPos!==null)try{let e=F.view.state.doc.nodeAt(F.pmPos);if(e&&e.type.name===`image`){let t=e.attrs;L.value=t.alt||``,z.value=t.borderWidth||0,B.value=t.borderStyle||`solid`,V.value=t.borderColor||`#000000`,H.value=t.width||200,U.value=t.height||150,G=H.value/(U.value||1),W.value=!0;let n=t.displayMode,r=t.cssFloat,i=t.wrapType;n===`float`&&r===`left`?R.value=`wrapRight`:n===`float`&&r===`right`?R.value=`wrapLeft`:n===`block`?R.value=`topAndBottom`:i===`behind`?R.value=`behind`:i===`inFront`?R.value=`inFront`:R.value=`inline`}}catch{}},{immediate:!0});function K(e){if(!(e.target instanceof HTMLInputElement))return;let t=Number(e.target.value);isNaN(t)||t<1||(H.value=t,W.value&&G>0&&(U.value=Math.round(t/G)))}function q(e){if(!(e.target instanceof HTMLInputElement))return;let t=Number(e.target.value);isNaN(t)||t<1||(U.value=t,W.value&&G>0&&(H.value=Math.round(t*G)))}function J(){I(`close`)}function Y(){let e=F.view;if(e&&F.pmPos!==null){try{let t=e.state.doc.nodeAt(F.pmPos);if(!t||t.type.name!==`image`)return;let n=`inline`,r=null,i=`inline`;switch(R.value){case`wrapRight`:n=`float`,r=`left`,i=`square`;break;case`wrapLeft`:n=`float`,r=`right`,i=`square`;break;case`topAndBottom`:n=`block`,i=`topAndBottom`;break;case`behind`:n=`float`,r=`none`,i=`behind`;break;case`inFront`:n=`float`,r=`none`,i=`inFront`;break;default:n=`inline`,i=`inline`}let a=e.state.tr.setNodeMarkup(F.pmPos,void 0,{...t.attrs,alt:L.value,width:H.value,height:U.value,borderWidth:z.value||void 0,borderStyle:z.value>0?B.value:void 0,borderColor:z.value>0?V.value:void 0,displayMode:n,cssFloat:r,wrapType:i});e.dispatch(a)}catch{}J()}}return(t,M)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(P),{open:e.isOpen,"aria-label":(0,n.unref)(N)(`dialogs.imageProperties.title`),style:{minWidth:`400px`,maxWidth:`90vw`},onClose:J},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,r,[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.title`)),1),(0,n.createElementVNode)(`button`,{class:`dialog__close`,"aria-label":(0,n.unref)(N)(`common.closeDialog`),onClick:J},` ✕ `,8,a)]),(0,n.createElementVNode)(`div`,o,[(0,n.createElementVNode)(`div`,s,[(0,n.createElementVNode)(`label`,c,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.altText`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`textarea`,{"onUpdate:modelValue":M[0]||=e=>L.value=e,class:`field__textarea`,placeholder:(0,n.unref)(N)(`dialogs.imageProperties.altTextPlaceholder`),rows:`2`},null,8,l),[[n.vModelText,L.value]])]),(0,n.createElementVNode)(`div`,u,[(0,n.createElementVNode)(`label`,d,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.textWrapping`)),1),(0,n.withDirectives)((0,n.createElementVNode)(`select`,{"onUpdate:modelValue":M[1]||=e=>R.value=e,class:`field__select`},[(0,n.createElementVNode)(`option`,f,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.inline`)),1),(0,n.createElementVNode)(`option`,p,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.wrapRight`)),1),(0,n.createElementVNode)(`option`,m,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.wrapLeft`)),1),(0,n.createElementVNode)(`option`,h,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.topAndBottom`)),1),(0,n.createElementVNode)(`option`,g,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.behind`)),1),(0,n.createElementVNode)(`option`,_,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.wrapOptions.inFront`)),1)],512),[[n.vModelSelect,R.value]])]),(0,n.createElementVNode)(`div`,v,[(0,n.createElementVNode)(`label`,y,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.border`)),1),(0,n.createElementVNode)(`div`,b,[(0,n.createElementVNode)(`label`,null,[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.width`))+`: `,1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{"onUpdate:modelValue":M[2]||=e=>z.value=e,type:`number`,min:`0`,max:`20`,step:`0.5`,class:`field__input--small`},null,512),[[n.vModelText,z.value,void 0,{number:!0}]]),(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`common.px`)),1)]),(0,n.createElementVNode)(`label`,null,[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.style`))+`: `,1),(0,n.withDirectives)((0,n.createElementVNode)(`select`,{"onUpdate:modelValue":M[3]||=e=>B.value=e,class:`field__select--small`},[(0,n.createElementVNode)(`option`,x,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.borderStyles.solid`)),1),(0,n.createElementVNode)(`option`,S,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.borderStyles.dashed`)),1),(0,n.createElementVNode)(`option`,C,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.borderStyles.dotted`)),1),(0,n.createElementVNode)(`option`,w,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.borderStyles.double`)),1)],512),[[n.vModelSelect,B.value]])]),(0,n.createElementVNode)(`label`,null,[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.color`))+`: `,1),(0,n.withDirectives)((0,n.createElementVNode)(`input`,{"onUpdate:modelValue":M[4]||=e=>V.value=e,type:`color`,class:`field__color`},null,512),[[n.vModelText,V.value]])])])]),(0,n.createElementVNode)(`div`,T,[(0,n.createElementVNode)(`label`,E,(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.dimensions`)),1),(0,n.createElementVNode)(`div`,D,[(0,n.createElementVNode)(`label`,null,[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.widthLabel`))+` `,1),(0,n.createElementVNode)(`input`,{value:H.value,type:`number`,min:`1`,max:`2000`,class:`field__input--small`,onInput:K},null,40,O),(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`common.px`)),1)]),(0,n.createElementVNode)(`label`,null,[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.heightLabel`))+` `,1),(0,n.createElementVNode)(`input`,{value:U.value,type:`number`,min:`1`,max:`2000`,class:`field__input--small`,onInput:q},null,40,k),(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(N)(`common.px`)),1)])]),(0,n.createElementVNode)(`label`,A,[(0,n.withDirectives)((0,n.createElementVNode)(`input`,{"onUpdate:modelValue":M[5]||=e=>W.value=e,type:`checkbox`},null,512),[[n.vModelCheckbox,W.value]]),(0,n.createTextVNode)(` `+(0,n.toDisplayString)((0,n.unref)(N)(`dialogs.imageProperties.lockAspectRatio`)),1)])]),(0,n.createElementVNode)(`div`,j,[(0,n.createElementVNode)(`button`,{class:`dialog__btn`,onClick:J},(0,n.toDisplayString)((0,n.unref)(N)(`common.cancel`)),1),(0,n.createElementVNode)(`button`,{class:`dialog__btn dialog__btn--primary`,onMousedown:(0,n.withModifiers)(Y,[`prevent`])},(0,n.toDisplayString)((0,n.unref)(N)(`common.apply`)),33)])])]),_:1},8,[`open`,`aria-label`]))}}),N=e.n({default:()=>P}),P=t.g(M,[[`__scopeId`,`data-v-3b445d26`]]);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
@@ -0,0 +1,186 @@
1
+ import { C as e, S as t, a as n, g as r } from "./folio-ui-ctJdVP-s.js";
2
+ import { createBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, openBlock as c, ref as l, toDisplayString as u, unref as d, vModelCheckbox as f, vModelSelect as p, vModelText as m, watch as h, withCtx as g, withDirectives as _, withModifiers as v } from "vue";
3
+ // src/components/dialogs/ImagePropertiesDialog.vue?vue&type=script&setup=true&lang.ts
4
+ var y = { class: "dialog__header" }, b = { class: "dialog__title" }, ee = ["aria-label"], te = { class: "dialog__body" }, ne = { class: "field" }, re = { class: "field__label" }, ie = ["placeholder"], ae = { class: "field" }, oe = { class: "field__label" }, x = { value: "inline" }, S = { value: "wrapRight" }, C = { value: "wrapLeft" }, w = { value: "topAndBottom" }, T = { value: "behind" }, E = { value: "inFront" }, D = { class: "field" }, O = { class: "field__label" }, k = { class: "field-row" }, A = { value: "solid" }, j = { value: "dashed" }, M = { value: "dotted" }, N = { value: "double" }, P = { class: "field" }, F = { class: "field__label" }, I = { class: "field-row" }, se = ["value"], L = ["value"], R = { class: "field__checkbox" }, z = { class: "dialog__actions" }, B = /*@__PURE__*/ s({
5
+ __name: "ImagePropertiesDialog",
6
+ props: {
7
+ isOpen: { type: Boolean },
8
+ view: {},
9
+ pmPos: {}
10
+ },
11
+ emits: ["close"],
12
+ setup(e, { emit: r }) {
13
+ let { t: s } = t(), { Dialog: B } = n(), V = e, H = r, U = l(""), W = l("inline"), G = l(0), K = l("solid"), q = l("#000000"), J = l(200), Y = l(150), X = l(!0), Z = 1;
14
+ h(() => V.isOpen, (e) => {
15
+ if (e && V.view && V.pmPos !== null) try {
16
+ let e = V.view.state.doc.nodeAt(V.pmPos);
17
+ if (e && e.type.name === "image") {
18
+ let t = e.attrs;
19
+ U.value = t.alt || "", G.value = t.borderWidth || 0, K.value = t.borderStyle || "solid", q.value = t.borderColor || "#000000", J.value = t.width || 200, Y.value = t.height || 150, Z = J.value / (Y.value || 1), X.value = !0;
20
+ let n = t.displayMode, r = t.cssFloat, i = t.wrapType;
21
+ n === "float" && r === "left" ? W.value = "wrapRight" : n === "float" && r === "right" ? W.value = "wrapLeft" : n === "block" ? W.value = "topAndBottom" : i === "behind" ? W.value = "behind" : i === "inFront" ? W.value = "inFront" : W.value = "inline";
22
+ }
23
+ } catch {}
24
+ }, { immediate: !0 });
25
+ function ce(e) {
26
+ if (!(e.target instanceof HTMLInputElement)) return;
27
+ let t = Number(e.target.value);
28
+ isNaN(t) || t < 1 || (J.value = t, X.value && Z > 0 && (Y.value = Math.round(t / Z)));
29
+ }
30
+ function le(e) {
31
+ if (!(e.target instanceof HTMLInputElement)) return;
32
+ let t = Number(e.target.value);
33
+ isNaN(t) || t < 1 || (Y.value = t, X.value && Z > 0 && (J.value = Math.round(t * Z)));
34
+ }
35
+ function Q() {
36
+ H("close");
37
+ }
38
+ function $() {
39
+ let e = V.view;
40
+ if (e && V.pmPos !== null) {
41
+ try {
42
+ let t = e.state.doc.nodeAt(V.pmPos);
43
+ if (!t || t.type.name !== "image") return;
44
+ let n = "inline", r = null, i = "inline";
45
+ switch (W.value) {
46
+ case "wrapRight":
47
+ n = "float", r = "left", i = "square";
48
+ break;
49
+ case "wrapLeft":
50
+ n = "float", r = "right", i = "square";
51
+ break;
52
+ case "topAndBottom":
53
+ n = "block", i = "topAndBottom";
54
+ break;
55
+ case "behind":
56
+ n = "float", r = "none", i = "behind";
57
+ break;
58
+ case "inFront":
59
+ n = "float", r = "none", i = "inFront";
60
+ break;
61
+ default: n = "inline", i = "inline";
62
+ }
63
+ let a = e.state.tr.setNodeMarkup(V.pmPos, void 0, {
64
+ ...t.attrs,
65
+ alt: U.value,
66
+ width: J.value,
67
+ height: Y.value,
68
+ borderWidth: G.value || void 0,
69
+ borderStyle: G.value > 0 ? K.value : void 0,
70
+ borderColor: G.value > 0 ? q.value : void 0,
71
+ displayMode: n,
72
+ cssFloat: r,
73
+ wrapType: i
74
+ });
75
+ e.dispatch(a);
76
+ } catch {}
77
+ Q();
78
+ }
79
+ }
80
+ return (t, n) => (c(), i(d(B), {
81
+ open: e.isOpen,
82
+ "aria-label": d(s)("dialogs.imageProperties.title"),
83
+ style: {
84
+ minWidth: "400px",
85
+ maxWidth: "90vw"
86
+ },
87
+ onClose: Q
88
+ }, {
89
+ default: g(() => [a("div", y, [a("span", b, u(d(s)("dialogs.imageProperties.title")), 1), a("button", {
90
+ class: "dialog__close",
91
+ "aria-label": d(s)("common.closeDialog"),
92
+ onClick: Q
93
+ }, " ✕ ", 8, ee)]), a("div", te, [
94
+ a("div", ne, [a("label", re, u(d(s)("dialogs.imageProperties.altText")), 1), _(a("textarea", {
95
+ "onUpdate:modelValue": n[0] ||= (e) => U.value = e,
96
+ class: "field__textarea",
97
+ placeholder: d(s)("dialogs.imageProperties.altTextPlaceholder"),
98
+ rows: "2"
99
+ }, null, 8, ie), [[m, U.value]])]),
100
+ a("div", ae, [a("label", oe, u(d(s)("dialogs.imageProperties.textWrapping")), 1), _(a("select", {
101
+ "onUpdate:modelValue": n[1] ||= (e) => W.value = e,
102
+ class: "field__select"
103
+ }, [
104
+ a("option", x, u(d(s)("dialogs.imageProperties.wrapOptions.inline")), 1),
105
+ a("option", S, u(d(s)("dialogs.imageProperties.wrapOptions.wrapRight")), 1),
106
+ a("option", C, u(d(s)("dialogs.imageProperties.wrapOptions.wrapLeft")), 1),
107
+ a("option", w, u(d(s)("dialogs.imageProperties.wrapOptions.topAndBottom")), 1),
108
+ a("option", T, u(d(s)("dialogs.imageProperties.wrapOptions.behind")), 1),
109
+ a("option", E, u(d(s)("dialogs.imageProperties.wrapOptions.inFront")), 1)
110
+ ], 512), [[p, W.value]])]),
111
+ a("div", D, [a("label", O, u(d(s)("dialogs.imageProperties.border")), 1), a("div", k, [
112
+ a("label", null, [
113
+ o(u(d(s)("dialogs.imageProperties.width")) + ": ", 1),
114
+ _(a("input", {
115
+ "onUpdate:modelValue": n[2] ||= (e) => G.value = e,
116
+ type: "number",
117
+ min: "0",
118
+ max: "20",
119
+ step: "0.5",
120
+ class: "field__input--small"
121
+ }, null, 512), [[
122
+ m,
123
+ G.value,
124
+ void 0,
125
+ { number: !0 }
126
+ ]]),
127
+ o(u(d(s)("common.px")), 1)
128
+ ]),
129
+ a("label", null, [o(u(d(s)("dialogs.imageProperties.style")) + ": ", 1), _(a("select", {
130
+ "onUpdate:modelValue": n[3] ||= (e) => K.value = e,
131
+ class: "field__select--small"
132
+ }, [
133
+ a("option", A, u(d(s)("dialogs.imageProperties.borderStyles.solid")), 1),
134
+ a("option", j, u(d(s)("dialogs.imageProperties.borderStyles.dashed")), 1),
135
+ a("option", M, u(d(s)("dialogs.imageProperties.borderStyles.dotted")), 1),
136
+ a("option", N, u(d(s)("dialogs.imageProperties.borderStyles.double")), 1)
137
+ ], 512), [[p, K.value]])]),
138
+ a("label", null, [o(u(d(s)("dialogs.imageProperties.color")) + ": ", 1), _(a("input", {
139
+ "onUpdate:modelValue": n[4] ||= (e) => q.value = e,
140
+ type: "color",
141
+ class: "field__color"
142
+ }, null, 512), [[m, q.value]])])
143
+ ])]),
144
+ a("div", P, [
145
+ a("label", F, u(d(s)("dialogs.imageProperties.dimensions")), 1),
146
+ a("div", I, [a("label", null, [
147
+ o(u(d(s)("dialogs.imageProperties.widthLabel")) + " ", 1),
148
+ a("input", {
149
+ value: J.value,
150
+ type: "number",
151
+ min: "1",
152
+ max: "2000",
153
+ class: "field__input--small",
154
+ onInput: ce
155
+ }, null, 40, se),
156
+ o(u(d(s)("common.px")), 1)
157
+ ]), a("label", null, [
158
+ o(u(d(s)("dialogs.imageProperties.heightLabel")) + " ", 1),
159
+ a("input", {
160
+ value: Y.value,
161
+ type: "number",
162
+ min: "1",
163
+ max: "2000",
164
+ class: "field__input--small",
165
+ onInput: le
166
+ }, null, 40, L),
167
+ o(u(d(s)("common.px")), 1)
168
+ ])]),
169
+ a("label", R, [_(a("input", {
170
+ "onUpdate:modelValue": n[5] ||= (e) => X.value = e,
171
+ type: "checkbox"
172
+ }, null, 512), [[f, X.value]]), o(" " + u(d(s)("dialogs.imageProperties.lockAspectRatio")), 1)])
173
+ ]),
174
+ a("div", z, [a("button", {
175
+ class: "dialog__btn",
176
+ onClick: Q
177
+ }, u(d(s)("common.cancel")), 1), a("button", {
178
+ class: "dialog__btn dialog__btn--primary",
179
+ onMousedown: v($, ["prevent"])
180
+ }, u(d(s)("common.apply")), 33)])
181
+ ])]),
182
+ _: 1
183
+ }, 8, ["open", "aria-label"]));
184
+ }
185
+ }), V = /* @__PURE__ */ e({ default: () => H }), H = /*#__PURE__*/ r(B, [["__scopeId", "data-v-3b445d26"]]);
186
+ export { V as n, H as t };