@threadlabs/looma 0.31.0 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vue/UiIcon.vue CHANGED
@@ -409,6 +409,10 @@ const shapes: ReturnType<typeof inputComputed<any>> = inputComputed<any>(
409
409
  tag: 'path',
410
410
  d: 'M14 12a4 4 0 0 1 0 8H6',
411
411
  }, { tag: 'line', x1: '4', x2: '20', y1: '12', y2: '12' }],
412
+ superscript: [{ tag: 'path', d: 'm4 19 8-8' }, { tag: 'path', d: 'm12 19-8-8' }, {
413
+ tag: 'path',
414
+ d: 'M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06',
415
+ }],
412
416
  table: [{
413
417
  tag: 'path',
414
418
  d: 'M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18',
@@ -0,0 +1,306 @@
1
+ import { a as concat, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
+ import { c as inputRead, f as vPropValidity, i as checkPropInput, l as propValidityState, n as READY_INPUT, o as evaluateInput, p as vuePropInputs, r as acceptsControllerWrite, t as BINDING_INPUTS_PROP, u as requireInputStatus } from "./props.js";
3
+ import { t as UiButton_default } from "./UiButton.js";
4
+ import { t as UiInput_default } from "./UiInput.js";
5
+ import { t as UiStack_default } from "./UiStack.js";
6
+ import { t as UiFormField_default } from "./UiFormField.js";
7
+ import { t as UiInputGroup_default } from "./UiInputGroup.js";
8
+ import { t as UiTextarea_default } from "./UiTextarea.js";
9
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderList, toDisplayString, unref, watchSyncEffect, withCtx, withDirectives } from "vue";
10
+ //#region .build/vue/UiEditorFootnoteEditor.vue?vue&type=script&setup=true&lang.ts
11
+ var _hoisted_1 = [
12
+ "data-ui-editor-footnote-editor-prop-editable",
13
+ "data-ui-editor-footnote-editor-prop-error",
14
+ "data-ui-editor-footnote-editor-prop-label",
15
+ "data-ui-editor-footnote-editor-prop-note"
16
+ ];
17
+ var _hoisted_2 = ["for"];
18
+ var _hoisted_3 = { slot: "error" };
19
+ var _hoisted_4 = ["for"];
20
+ var _hoisted_5 = {
21
+ key: 0,
22
+ slot: "help"
23
+ };
24
+ //#endregion
25
+ //#region .build/vue/UiEditorFootnoteEditor.vue
26
+ var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
27
+ inheritAttrs: false,
28
+ __name: "UiEditorFootnoteEditor",
29
+ props: {
30
+ editable: { type: null },
31
+ error: { type: null },
32
+ label: { type: null },
33
+ note: { type: null },
34
+ [BINDING_INPUTS_PROP]: { type: null }
35
+ },
36
+ emits: [
37
+ "update:label",
38
+ "text",
39
+ "label",
40
+ "go",
41
+ "done"
42
+ ],
43
+ setup(__props, { emit: __emit }) {
44
+ const propValidityContract = { props: {
45
+ editable: {
46
+ type: {
47
+ kind: "terminal",
48
+ name: "boolean"
49
+ },
50
+ required: false,
51
+ target: { attribute: "editable" },
52
+ description: "Whether the note's text can be edited here. A note with formatting or more than one block shows its text read-only; Go to note edits it in the\n document.",
53
+ default: false
54
+ },
55
+ error: {
56
+ type: {
57
+ kind: "terminal",
58
+ name: "string"
59
+ },
60
+ required: false,
61
+ target: { attribute: "error" },
62
+ description: "Why the label field's label was not used. While set, the field is invalid and shows it.",
63
+ default: ""
64
+ },
65
+ label: {
66
+ type: {
67
+ kind: "terminal",
68
+ name: "string"
69
+ },
70
+ required: false,
71
+ target: { attribute: "value" },
72
+ description: "The footnote's label, which its references and its note share, shown between [^ and ].",
73
+ default: ""
74
+ },
75
+ note: {
76
+ type: {
77
+ kind: "terminal",
78
+ name: "string"
79
+ },
80
+ required: false,
81
+ target: { attribute: "value" },
82
+ description: "The note's text, shown in the note field, with each block of a longer note on its own line.",
83
+ default: ""
84
+ }
85
+ } };
86
+ const props = __props;
87
+ const inputTracking = vuePropInputs({
88
+ editable: false,
89
+ error: "",
90
+ label: "",
91
+ note: ""
92
+ }, {
93
+ editable: false,
94
+ error: "",
95
+ label: "",
96
+ note: ""
97
+ }, (name, value, source, values) => {
98
+ switch (name) {
99
+ case "editable": return checkPropInput(value, {
100
+ kind: "terminal",
101
+ name: "boolean"
102
+ }, true, true);
103
+ case "error": return checkPropInput(value, {
104
+ kind: "terminal",
105
+ name: "string"
106
+ }, true, true);
107
+ case "label": return checkPropInput(value, {
108
+ kind: "terminal",
109
+ name: "string"
110
+ }, true, true);
111
+ case "note": return checkPropInput(value, {
112
+ kind: "terminal",
113
+ name: "string"
114
+ }, true, true);
115
+ default: return { ok: false };
116
+ }
117
+ }, () => {
118
+ checkedProps.value;
119
+ });
120
+ const propInputs = inputTracking.inputs;
121
+ const checkedProps = computed(() => {
122
+ inputTracking.version.value;
123
+ return {
124
+ editable: propInputs.value("editable", props["editable"], props[BINDING_INPUTS_PROP]),
125
+ error: propInputs.value("error", props["error"], props[BINDING_INPUTS_PROP]),
126
+ label: propInputs.value("label", props["label"], props[BINDING_INPUTS_PROP]),
127
+ note: propInputs.value("note", props["note"], props[BINDING_INPUTS_PROP])
128
+ };
129
+ });
130
+ const inputStatus = (name, handlesError) => {
131
+ checkedProps.value;
132
+ inputTracking.version.value;
133
+ return requireInputStatus(propInputs.status(name), handlesError);
134
+ };
135
+ checkedProps.value;
136
+ watchSyncEffect(() => {
137
+ checkedProps.value;
138
+ });
139
+ const reflectedProp = useReflectedProp();
140
+ const hydrationInstance = getCurrentInstance();
141
+ const emit = __emit;
142
+ const root = ref(null);
143
+ const base = ref("ui-editor-footnote-editor");
144
+ let guardedPrevious = null;
145
+ const guarded = computed(() => {
146
+ const candidate = concat(base.value, "-label");
147
+ if (candidate === Symbol.for("html-next.invalid-result")) return guardedPrevious;
148
+ return guardedPrevious = candidate;
149
+ });
150
+ let guardedBindingPrevious = null;
151
+ const guardedBinding = computed(() => {
152
+ const candidate = concat(base.value, "-label");
153
+ if (candidate === Symbol.for("html-next.invalid-result")) return guardedBindingPrevious;
154
+ return guardedBindingPrevious = candidate;
155
+ });
156
+ let guardedBinding2Previous = null;
157
+ const guardedBinding2 = computed(() => {
158
+ const candidate = concat(base.value, "-note");
159
+ if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding2Previous;
160
+ return guardedBinding2Previous = candidate;
161
+ });
162
+ let guardedBinding3Previous = null;
163
+ const guardedBinding3 = computed(() => {
164
+ const candidate = concat(base.value, "-note");
165
+ if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding3Previous;
166
+ return guardedBinding3Previous = candidate;
167
+ });
168
+ provide("html-next:ui-editor-footnote-editor:base", base);
169
+ checkHydratedRoot("div", "ui-editor-footnote-editor");
170
+ const isTextDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["text"] === "string" && Object.keys(detail).every((key) => ["text"].includes(key));
171
+ const isLabelDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["label"] === "string" && Object.keys(detail).every((key) => ["label"].includes(key));
172
+ const isGoDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && Object.values(detail).every((item) => true);
173
+ const dispatch = createDispatch(root, emit, {
174
+ checks: {
175
+ text: isTextDetail,
176
+ label: isLabelDetail,
177
+ go: isGoDetail,
178
+ done: isGoDetail
179
+ },
180
+ modeled: ["label"]
181
+ });
182
+ useComponentHost(() => import("@threadlabs/looma/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js"), {
183
+ root,
184
+ module: true,
185
+ dispatch,
186
+ acceptsState: (name, keys, value) => acceptsControllerWrite(value, { base: {
187
+ kind: "terminal",
188
+ name: "string"
189
+ } }[name], keys),
190
+ initials: { base: "ui-editor-footnote-editor" },
191
+ controllerSource: {
192
+ specifier: "../components/ui-editor-footnote-editor/ui-editor-footnote-editor.js",
193
+ definition: "./components/ui-editor-footnote-editor/ui-editor-footnote-editor.html"
194
+ },
195
+ props: checkedProps,
196
+ inputs: propInputs,
197
+ inputTracking,
198
+ propInputs: (name) => {
199
+ const incoming = hydrationInstance?.vnode.props;
200
+ const kebab = name.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
201
+ return incoming !== null && incoming !== void 0 ? incoming[name] ?? incoming[kebab] ?? null : null;
202
+ },
203
+ propNames: [
204
+ "editable",
205
+ "error",
206
+ "label",
207
+ "note"
208
+ ],
209
+ propValidity: (name) => propValidityState({
210
+ contract: propValidityContract,
211
+ values: { ...props }
212
+ }, name),
213
+ state: { base }
214
+ });
215
+ return (_ctx, _cache) => {
216
+ return withDirectives((openBlock(), createElementBlock("div", mergeProps({
217
+ role: "dialog",
218
+ "aria-label": "Edit footnote"
219
+ }, unref(nativeAttrs)(_ctx.$attrs), {
220
+ "data-hn": "",
221
+ "data-ui-editor-footnote-editor-prop-editable": unref(reflectedProp)("editable", "editable", checkedProps.value.editable, void 0, false),
222
+ "data-ui-editor-footnote-editor-prop-error": unref(reflectedProp)("error", "error", checkedProps.value.error, void 0, false),
223
+ "data-ui-editor-footnote-editor-prop-label": unref(reflectedProp)("label", "label", checkedProps.value.label, void 0, false),
224
+ "data-ui-editor-footnote-editor-prop-note": unref(reflectedProp)("note", "note", checkedProps.value.note, void 0, false),
225
+ ref_key: "root",
226
+ ref: root
227
+ }), [createVNode(UiStack_default, { gap: "s" }, {
228
+ default: withCtx(() => [
229
+ (openBlock(true), createElementBlock(Fragment, null, renderList([unref(evaluateInput)(() => unref(inputRead)(checkedProps.value.error, inputStatus("error", true)) !== "", unref(READY_INPUT))], (boundInput) => {
230
+ return openBlock(), createBlock(UiFormField_default, mergeProps({ invalid: boundInput.value }, { ref_for: true }, { [unref(BINDING_INPUTS_PROP)]: { invalid: () => boundInput } }), {
231
+ label: withCtx(() => [createElementVNode("label", {
232
+ slot: "label",
233
+ for: guarded.value
234
+ }, "Label", 8, _hoisted_2)]),
235
+ error: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(checkedProps.value.error), 1)]),
236
+ default: withCtx(() => [createVNode(UiInputGroup_default, null, {
237
+ prefix: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("span", { slot: "prefix" }, "[^", -1)])]),
238
+ suffix: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("span", { slot: "suffix" }, "]", -1)])]),
239
+ default: withCtx(() => [createVNode(UiInput_default, mergeProps({
240
+ "data-footnote-label": "",
241
+ size: "sm",
242
+ autocomplete: "off",
243
+ id: guardedBinding.value,
244
+ value: checkedProps.value.label
245
+ }, { ref_for: true }, { [unref(BINDING_INPUTS_PROP)]: { value: () => ({
246
+ value: checkedProps.value.label,
247
+ status: inputStatus("label", true)
248
+ }) } }), null, 16, ["id", "value"])]),
249
+ _: 1
250
+ })]),
251
+ _: 1
252
+ }, 16, ["invalid"]);
253
+ }), 256)),
254
+ _cache[3] || (_cache[3] = createTextVNode(toDisplayString(" "), -1)),
255
+ createVNode(UiFormField_default, null, {
256
+ label: withCtx(() => [createElementVNode("label", {
257
+ slot: "label",
258
+ for: guardedBinding2.value
259
+ }, "Note", 8, _hoisted_4)]),
260
+ help: withCtx(() => [!checkedProps.value.editable ? (openBlock(), createElementBlock("span", _hoisted_5, "This note has formatting, so it is edited in the document.")) : createCommentVNode("v-if", true)]),
261
+ default: withCtx(() => [createVNode(UiInputGroup_default, { multiline: true }, {
262
+ action: withCtx(() => [createVNode(UiButton_default, {
263
+ slot: "action",
264
+ size: "sm",
265
+ "data-footnote-go": ""
266
+ }, {
267
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Go to note", -1)])]),
268
+ _: 1
269
+ })]),
270
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList([unref(evaluateInput)(() => !unref(inputRead)(checkedProps.value.editable, inputStatus("editable", true)), unref(READY_INPUT))], (boundInputSnapshot) => {
271
+ return openBlock(), createBlock(UiTextarea_default, mergeProps({
272
+ "data-footnote-note": "",
273
+ size: "sm",
274
+ rows: 2,
275
+ autosize: true,
276
+ placeholder: "Write the note",
277
+ id: guardedBinding3.value,
278
+ readonly: boundInputSnapshot.value,
279
+ value: checkedProps.value.note
280
+ }, { ref_for: true }, { [unref(BINDING_INPUTS_PROP)]: {
281
+ readonly: () => boundInputSnapshot,
282
+ value: () => ({
283
+ value: checkedProps.value.note,
284
+ status: inputStatus("note", true)
285
+ })
286
+ } }), null, 16, [
287
+ "id",
288
+ "readonly",
289
+ "value"
290
+ ]);
291
+ }), 256))]),
292
+ _: 1
293
+ })]),
294
+ _: 1
295
+ })
296
+ ]),
297
+ _: 1
298
+ })], 16, _hoisted_1)), [[unref(vPropValidity), {
299
+ contract: propValidityContract,
300
+ values: { ...props }
301
+ }]]);
302
+ };
303
+ }
304
+ });
305
+ //#endregion
306
+ export { UiEditorFootnoteEditor_default as t };
@@ -6,8 +6,8 @@ import { t as UiCluster_default } from "./UiCluster.js";
6
6
  import { t as UiTooltip_default } from "./UiTooltip.js";
7
7
  import { t as UiInput_default } from "./UiInput.js";
8
8
  import { t as UiStack_default } from "./UiStack.js";
9
- import { t as UiEditorToolbar_default } from "./UiEditorToolbar.js";
10
9
  import { t as UiFormField_default } from "./UiFormField.js";
10
+ import { t as UiEditorToolbar_default } from "./UiEditorToolbar.js";
11
11
  import { t as UiIconButton_default } from "./UiIconButton.js";
12
12
  import { t as UiPopover_default } from "./UiPopover.js";
13
13
  import { t as UiText_default } from "./UiText.js";
@@ -6,9 +6,9 @@ import { t as UiScrollArea_default } from "./UiScrollArea.js";
6
6
  import { t as UiInput_default } from "./UiInput.js";
7
7
  import { t as UiStack_default } from "./UiStack.js";
8
8
  import { t as UiFormField_default } from "./UiFormField.js";
9
+ import { t as UiInputGroup_default } from "./UiInputGroup.js";
9
10
  import { t as UiIconButton_default } from "./UiIconButton.js";
10
11
  import { t as UiText_default } from "./UiText.js";
11
- import { t as UiInputGroup_default } from "./UiInputGroup.js";
12
12
  import { t as UiSearchResultRow_default } from "./UiSearchResultRow.js";
13
13
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderList, toDisplayString, unref, watchSyncEffect, withCtx, withDirectives } from "vue";
14
14
  //#region .build/vue/UiEditorLinkForm.vue?vue&type=script&setup=true&lang.ts
@@ -1034,6 +1034,20 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
1034
1034
  y2: "12"
1035
1035
  }
1036
1036
  ],
1037
+ superscript: [
1038
+ {
1039
+ tag: "path",
1040
+ d: "m4 19 8-8"
1041
+ },
1042
+ {
1043
+ tag: "path",
1044
+ d: "m12 19-8-8"
1045
+ },
1046
+ {
1047
+ tag: "path",
1048
+ d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"
1049
+ }
1050
+ ],
1037
1051
  table: [{
1038
1052
  tag: "path",
1039
1053
  d: "M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"
@@ -1252,6 +1266,6 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
1252
1266
  }]]);
1253
1267
  };
1254
1268
  }
1255
- }), [["__scopeId", "data-v-37fb8577"]]);
1269
+ }), [["__scopeId", "data-v-efb2c459"]]);
1256
1270
  //#endregion
1257
1271
  export { UiIcon_default as t };