@threadlabs/looma 0.43.2 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui-callout/ui-callout.html +4 -4
- package/components/ui-dialog/ui-dialog.html +0 -4
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.html +4 -50
- package/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js +10 -31
- package/dist/index.js +1 -1
- package/docs/README.md +19 -3
- package/docs/card.html +1 -1
- package/docs/catalog-view.js +11 -5
- package/docs/catalog-view.mjs +4 -3
- package/docs/catalog.json +73 -109
- package/docs/catalog.mjs +1 -1
- package/docs/customizer-render.mjs +9 -8
- package/docs/customizer.js +8 -8
- package/docs/documentation.css +2 -2
- package/docs/examples/ui-editor-footnote-editor/examples/01-note.behavior.js +9 -0
- package/docs/fonts.mjs +1 -1
- package/docs/index.mjs +1 -1
- package/docs/render.mjs +1 -1
- package/docs/site.mjs +14 -5
- package/docs/theme.mjs +96 -16
- package/editor/chunks/extensions.js +10 -0
- package/editor/extensions/footnote.d.ts +1 -0
- package/editor/footnote-editing.d.ts +16 -27
- package/package.json +2 -2
- package/styles/ui-callout.css +4 -4
- package/styles/ui-dialog.css +0 -8
- package/theme-dark.css +9 -9
- package/theme-high-contrast.css +4 -0
- package/theme-light.css +6 -6
- package/tokens.css +20 -18
- package/vanilla/UiEditorFootnoteEditor.d.ts +0 -5
- package/vanilla/UiEditorFootnoteEditor.js +20 -68
- package/vue/UiCallout.vue +4 -4
- package/vue/UiDialog.vue +0 -7
- package/vue/UiEditorFootnoteEditor.d.ts +11 -29
- package/vue/UiEditorFootnoteEditor.vue +21 -173
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiEditorFootnoteEditor.js +34 -226
- package/vue/chunks/UiEditorImageToolbar.js +1 -1
- package/vue/chunks/UiEditorLinkForm.js +1 -1
- package/vue/chunks/compact.js +565 -0
- package/vue/components.css +320 -327
- package/vue/editor/LoomaEditor.d.ts +2 -2
- package/vue/editor/compact/index.js +1 -562
- package/vue/editor/index.js +173 -80
- package/vue/index.js +2 -2
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
<!-- Generated by HTML Next 1.0.0-alpha.69 for Vue 3.5. Do not edit. -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { computed, getCurrentInstance,
|
|
3
|
+
import { computed, getCurrentInstance, ref, watchSyncEffect } from 'vue'
|
|
4
4
|
import type { PropType } from 'vue'
|
|
5
5
|
import {
|
|
6
6
|
checkHydratedRoot,
|
|
7
|
-
concat,
|
|
8
7
|
createDispatch,
|
|
9
8
|
nativeAttrs,
|
|
10
9
|
useComponentHost,
|
|
11
10
|
useReflectedProp,
|
|
12
11
|
} from './host'
|
|
13
|
-
import { acceptsControllerWrite } from './props'
|
|
14
12
|
import {
|
|
15
13
|
BINDING_INPUTS_PROP,
|
|
16
14
|
checkedProp,
|
|
17
15
|
checkPropInput,
|
|
18
|
-
evaluateInput,
|
|
19
16
|
type InputBindings,
|
|
20
|
-
inputDefault,
|
|
21
|
-
inputRead,
|
|
22
17
|
propValidityState,
|
|
23
18
|
READY_INPUT,
|
|
24
19
|
requireInputStatus,
|
|
@@ -26,72 +21,29 @@ import {
|
|
|
26
21
|
vPropValidity,
|
|
27
22
|
vuePropInputs,
|
|
28
23
|
} from './props'
|
|
29
|
-
import UiButton from './UiButton.vue'
|
|
30
|
-
import UiFormField from './UiFormField.vue'
|
|
31
|
-
import UiInput from './UiInput.vue'
|
|
32
|
-
import UiInputGroup from './UiInputGroup.vue'
|
|
33
|
-
import UiStack from './UiStack.vue'
|
|
34
24
|
import UiTextarea from './UiTextarea.vue'
|
|
35
25
|
|
|
36
26
|
defineOptions({ inheritAttrs: false })
|
|
37
27
|
|
|
38
28
|
const propValidityContract = {
|
|
39
29
|
props: {
|
|
40
|
-
editable: {
|
|
41
|
-
type: { kind: 'terminal', name: 'boolean' },
|
|
42
|
-
required: false,
|
|
43
|
-
target: { attribute: 'editable' },
|
|
44
|
-
description:
|
|
45
|
-
'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.',
|
|
46
|
-
default: false,
|
|
47
|
-
},
|
|
48
|
-
error: {
|
|
49
|
-
type: { kind: 'terminal', name: 'string' },
|
|
50
|
-
required: false,
|
|
51
|
-
target: { attribute: 'error' },
|
|
52
|
-
description:
|
|
53
|
-
'Why the label field\'s label was not used. While set, the field is invalid and shows it.',
|
|
54
|
-
default: '',
|
|
55
|
-
},
|
|
56
|
-
label: {
|
|
57
|
-
type: { kind: 'terminal', name: 'string' },
|
|
58
|
-
required: false,
|
|
59
|
-
target: { attribute: 'value' },
|
|
60
|
-
description:
|
|
61
|
-
'The footnote\'s label, which its references and its note share, shown between [^ and ].',
|
|
62
|
-
default: '',
|
|
63
|
-
},
|
|
64
30
|
note: {
|
|
65
31
|
type: { kind: 'terminal', name: 'string' },
|
|
66
32
|
required: false,
|
|
67
|
-
target: { attribute: '
|
|
33
|
+
target: { attribute: 'note' },
|
|
68
34
|
description:
|
|
69
|
-
'
|
|
35
|
+
'Content for the default plain-text field. Supply rich editing content through the default slot.',
|
|
70
36
|
default: '',
|
|
71
37
|
},
|
|
72
38
|
},
|
|
73
39
|
} as const
|
|
74
40
|
const props = defineProps({
|
|
75
|
-
editable: { type: null as unknown as PropType<boolean | null> },
|
|
76
|
-
error: { type: null as unknown as PropType<string | null> },
|
|
77
|
-
label: { type: null as unknown as PropType<string | null> },
|
|
78
41
|
note: { type: null as unknown as PropType<string | null> },
|
|
79
42
|
[BINDING_INPUTS_PROP]: { type: null as unknown as PropType<InputBindings> },
|
|
80
43
|
})
|
|
81
|
-
const acceptedProps: Record<string, unknown> = {
|
|
82
|
-
const inputTracking = vuePropInputs(acceptedProps, {
|
|
83
|
-
editable: false,
|
|
84
|
-
error: '',
|
|
85
|
-
label: '',
|
|
86
|
-
note: '',
|
|
87
|
-
}, (name, value, source, values) => {
|
|
44
|
+
const acceptedProps: Record<string, unknown> = { note: '' }
|
|
45
|
+
const inputTracking = vuePropInputs(acceptedProps, { note: '' }, (name, value, source, values) => {
|
|
88
46
|
switch (name) {
|
|
89
|
-
case 'editable':
|
|
90
|
-
return checkPropInput(value, { kind: 'terminal', name: 'boolean' }, true, true)
|
|
91
|
-
case 'error':
|
|
92
|
-
return checkPropInput(value, { kind: 'terminal', name: 'string' }, true, true)
|
|
93
|
-
case 'label':
|
|
94
|
-
return checkPropInput(value, { kind: 'terminal', name: 'string' }, true, true)
|
|
95
47
|
case 'note':
|
|
96
48
|
return checkPropInput(value, { kind: 'terminal', name: 'string' }, true, true)
|
|
97
49
|
default:
|
|
@@ -104,21 +56,6 @@ const propInputs = inputTracking.inputs
|
|
|
104
56
|
const checkedProps = computed(() => {
|
|
105
57
|
void inputTracking.version.value
|
|
106
58
|
return ({
|
|
107
|
-
editable: propInputs.value<boolean | null>(
|
|
108
|
-
'editable',
|
|
109
|
-
props['editable'],
|
|
110
|
-
props[BINDING_INPUTS_PROP],
|
|
111
|
-
) as boolean,
|
|
112
|
-
error: propInputs.value<string | null>(
|
|
113
|
-
'error',
|
|
114
|
-
props['error'],
|
|
115
|
-
props[BINDING_INPUTS_PROP],
|
|
116
|
-
) as string,
|
|
117
|
-
label: propInputs.value<string | null>(
|
|
118
|
-
'label',
|
|
119
|
-
props['label'],
|
|
120
|
-
props[BINDING_INPUTS_PROP],
|
|
121
|
-
) as string,
|
|
122
59
|
note: propInputs.value<string | null>(
|
|
123
60
|
'note',
|
|
124
61
|
props['note'],
|
|
@@ -138,40 +75,11 @@ watchSyncEffect(() => {
|
|
|
138
75
|
const reflectedProp = useReflectedProp()
|
|
139
76
|
const hydrationInstance = getCurrentInstance()
|
|
140
77
|
const emit = defineEmits<{
|
|
141
|
-
'update:label': [value: string]
|
|
142
78
|
text: [event: CustomEvent<{ readonly text: string }>]
|
|
143
|
-
label: [event: CustomEvent<{ readonly label: string }>]
|
|
144
|
-
go: [event: CustomEvent<Readonly<Record<string, unknown>>>]
|
|
145
79
|
done: [event: CustomEvent<Readonly<Record<string, unknown>>>]
|
|
146
80
|
}>()
|
|
147
81
|
|
|
148
82
|
const root = ref<HTMLElement | null>(null)
|
|
149
|
-
const base = ref('ui-editor-footnote-editor')
|
|
150
|
-
let guardedPrevious: any = null
|
|
151
|
-
const guarded = computed(() => {
|
|
152
|
-
const candidate: any = concat(base.value, '-label')
|
|
153
|
-
if (candidate === Symbol.for('html-next.invalid-result')) return guardedPrevious
|
|
154
|
-
return guardedPrevious = candidate
|
|
155
|
-
})
|
|
156
|
-
let guardedBindingPrevious: any = null
|
|
157
|
-
const guardedBinding = computed(() => {
|
|
158
|
-
const candidate: any = concat(base.value, '-label')
|
|
159
|
-
if (candidate === Symbol.for('html-next.invalid-result')) return guardedBindingPrevious
|
|
160
|
-
return guardedBindingPrevious = candidate
|
|
161
|
-
})
|
|
162
|
-
let guardedBinding2Previous: any = null
|
|
163
|
-
const guardedBinding2 = computed(() => {
|
|
164
|
-
const candidate: any = concat(base.value, '-note')
|
|
165
|
-
if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding2Previous
|
|
166
|
-
return guardedBinding2Previous = candidate
|
|
167
|
-
})
|
|
168
|
-
let guardedBinding3Previous: any = null
|
|
169
|
-
const guardedBinding3 = computed(() => {
|
|
170
|
-
const candidate: any = concat(base.value, '-note')
|
|
171
|
-
if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding3Previous
|
|
172
|
-
return guardedBinding3Previous = candidate
|
|
173
|
-
})
|
|
174
|
-
provide('html-next:ui-editor-footnote-editor:base', base)
|
|
175
83
|
checkHydratedRoot('div', 'ui-editor-footnote-editor')
|
|
176
84
|
|
|
177
85
|
const isTextDetail = (
|
|
@@ -179,23 +87,15 @@ const isTextDetail = (
|
|
|
179
87
|
): boolean => (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
180
88
|
&& typeof (detail as Record<string, unknown>)['text'] === 'string'
|
|
181
89
|
&& Object.keys(detail as object).every((key) => ['text'].includes(key)))
|
|
182
|
-
const
|
|
183
|
-
detail: unknown,
|
|
184
|
-
): boolean => (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
185
|
-
&& typeof (detail as Record<string, unknown>)['label'] === 'string'
|
|
186
|
-
&& Object.keys(detail as object).every((key) => ['label'].includes(key)))
|
|
187
|
-
const isGoDetail = (
|
|
90
|
+
const isDoneDetail = (
|
|
188
91
|
detail: unknown,
|
|
189
92
|
): boolean => (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
190
93
|
&& Object.values(detail as object).every((item: unknown) => true))
|
|
191
94
|
const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
|
|
192
95
|
checks: {
|
|
193
96
|
text: isTextDetail,
|
|
194
|
-
|
|
195
|
-
go: isGoDetail,
|
|
196
|
-
done: isGoDetail,
|
|
97
|
+
done: isDoneDetail,
|
|
197
98
|
},
|
|
198
|
-
modeled: ['label'],
|
|
199
99
|
})
|
|
200
100
|
|
|
201
101
|
useComponentHost(
|
|
@@ -204,13 +104,6 @@ useComponentHost(
|
|
|
204
104
|
root,
|
|
205
105
|
module: true,
|
|
206
106
|
dispatch,
|
|
207
|
-
acceptsState: (name: string, keys: readonly string[], value: unknown) =>
|
|
208
|
-
acceptsControllerWrite(
|
|
209
|
-
value,
|
|
210
|
-
({ base: { kind: 'terminal', name: 'string' } } as Record<string, any>)[name],
|
|
211
|
-
keys,
|
|
212
|
-
),
|
|
213
|
-
initials: { base: 'ui-editor-footnote-editor' },
|
|
214
107
|
controllerSource: {
|
|
215
108
|
specifier: '../components/ui-editor-footnote-editor/ui-editor-footnote-editor.js',
|
|
216
109
|
definition: './components/ui-editor-footnote-editor/ui-editor-footnote-editor.html',
|
|
@@ -225,10 +118,9 @@ useComponentHost(
|
|
|
225
118
|
? (incoming[name] ?? incoming[kebab] ?? null)
|
|
226
119
|
: null
|
|
227
120
|
},
|
|
228
|
-
propNames: ['
|
|
121
|
+
propNames: ['note'],
|
|
229
122
|
propValidity: (name: string) =>
|
|
230
123
|
propValidityState({ contract: propValidityContract, values: { ...props } }, name),
|
|
231
|
-
state: { base },
|
|
232
124
|
},
|
|
233
125
|
)
|
|
234
126
|
</script>
|
|
@@ -240,65 +132,21 @@ useComponentHost(
|
|
|
240
132
|
v-bind="nativeAttrs($attrs)"
|
|
241
133
|
data-hn
|
|
242
134
|
v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
|
|
243
|
-
:data-ui-editor-footnote-editor-prop-editable="reflectedProp('editable', 'editable', checkedProps.editable, undefined, false)"
|
|
244
|
-
:data-ui-editor-footnote-editor-prop-error="reflectedProp('error', 'error', checkedProps.error, undefined, false)"
|
|
245
|
-
:data-ui-editor-footnote-editor-prop-label="reflectedProp('label', 'label', checkedProps.label, undefined, false)"
|
|
246
135
|
:data-ui-editor-footnote-editor-prop-note="reflectedProp('note', 'note', checkedProps.note, undefined, false)"
|
|
247
136
|
ref="root"
|
|
248
137
|
>
|
|
249
|
-
<
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
:value="checkedProps.label"
|
|
263
|
-
v-bind="{
|
|
264
|
-
[BINDING_INPUTS_PROP]: {
|
|
265
|
-
value: () => ({ value: checkedProps.label, status: inputStatus('label', true) }),
|
|
266
|
-
},
|
|
267
|
-
}"
|
|
268
|
-
/>
|
|
269
|
-
<template #prefix><span slot="prefix">[^</span></template>
|
|
270
|
-
<template #suffix><span slot="suffix">]</span></template></UiInputGroup>
|
|
271
|
-
<template #label><label slot="label" :for="guarded">Label</label></template>
|
|
272
|
-
<template #error><span slot="error">{{
|
|
273
|
-
checkedProps.error
|
|
274
|
-
}}</span></template></UiFormField></template>{{ ' ' }}<UiFormField><UiInputGroup
|
|
275
|
-
:multiline="true"
|
|
276
|
-
><template
|
|
277
|
-
v-for="boundInputSnapshot in [evaluateInput(
|
|
278
|
-
() => (!inputRead(checkedProps.editable, inputStatus('editable', true))) as any,
|
|
279
|
-
READY_INPUT,
|
|
280
|
-
)]"
|
|
281
|
-
><UiTextarea
|
|
282
|
-
data-footnote-note=""
|
|
283
|
-
size="sm"
|
|
284
|
-
:rows="2"
|
|
285
|
-
:autosize="true"
|
|
286
|
-
placeholder="Write the note"
|
|
287
|
-
:id="guardedBinding3"
|
|
288
|
-
:readonly="boundInputSnapshot.value"
|
|
289
|
-
:value="checkedProps.note"
|
|
290
|
-
v-bind="{
|
|
291
|
-
[BINDING_INPUTS_PROP]: {
|
|
292
|
-
readonly: () => boundInputSnapshot,
|
|
293
|
-
value: () => ({ value: checkedProps.note, status: inputStatus('note', true) }),
|
|
294
|
-
},
|
|
295
|
-
}"
|
|
296
|
-
/></template>
|
|
297
|
-
<template #action><UiButton slot="action" size="sm" data-footnote-go=""
|
|
298
|
-
>Go to note</UiButton></template></UiInputGroup>
|
|
299
|
-
<template #label><label slot="label" :for="guardedBinding2">Note</label></template>
|
|
300
|
-
<template #help><span v-if="!checkedProps.editable" slot="help"
|
|
301
|
-
>This note has formatting, so it is edited in the
|
|
302
|
-
document.</span></template></UiFormField></UiStack>
|
|
138
|
+
<slot><UiTextarea
|
|
139
|
+
data-footnote-note=""
|
|
140
|
+
aria-label="Footnote"
|
|
141
|
+
:rows="3"
|
|
142
|
+
:autosize="true"
|
|
143
|
+
placeholder="Write the note"
|
|
144
|
+
:value="checkedProps.note"
|
|
145
|
+
v-bind="{
|
|
146
|
+
[BINDING_INPUTS_PROP]: {
|
|
147
|
+
value: () => ({ value: checkedProps.note, status: inputStatus('note', true) }),
|
|
148
|
+
},
|
|
149
|
+
}"
|
|
150
|
+
/></slot>
|
|
303
151
|
</div>
|
|
304
152
|
</template>
|
package/vue/chunks/UiCallout.js
CHANGED
package/vue/chunks/UiDialog.js
CHANGED
|
@@ -1,113 +1,33 @@
|
|
|
1
|
-
import { C as useReflectedProp, S as useComponentHost, _ as nativeAttrs, a as checkHydratedRoot,
|
|
2
|
-
import { d as propValidityState, f as requireInputStatus, h as vuePropInputs, i as checkPropInput, m as vPropValidity,
|
|
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";
|
|
1
|
+
import { C as useReflectedProp, S as useComponentHost, _ as nativeAttrs, a as checkHydratedRoot, s as createDispatch } from "./_plugin-vue_export-helper.js";
|
|
2
|
+
import { d as propValidityState, f as requireInputStatus, h as vuePropInputs, i as checkPropInput, m as vPropValidity, t as BINDING_INPUTS_PROP } from "./props.js";
|
|
8
3
|
import { t as UiTextarea_default } from "./UiTextarea.js";
|
|
9
|
-
import {
|
|
4
|
+
import { computed, createElementBlock, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, ref, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
|
|
10
5
|
//#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
|
-
};
|
|
6
|
+
var _hoisted_1 = ["data-ui-editor-footnote-editor-prop-note"];
|
|
24
7
|
//#endregion
|
|
25
8
|
//#region .build/vue/UiEditorFootnoteEditor.vue
|
|
26
9
|
var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
|
|
27
10
|
inheritAttrs: false,
|
|
28
11
|
__name: "UiEditorFootnoteEditor",
|
|
29
12
|
props: {
|
|
30
|
-
editable: { type: null },
|
|
31
|
-
error: { type: null },
|
|
32
|
-
label: { type: null },
|
|
33
13
|
note: { type: null },
|
|
34
14
|
[BINDING_INPUTS_PROP]: { type: null }
|
|
35
15
|
},
|
|
36
|
-
emits: [
|
|
37
|
-
"update:label",
|
|
38
|
-
"text",
|
|
39
|
-
"label",
|
|
40
|
-
"go",
|
|
41
|
-
"done"
|
|
42
|
-
],
|
|
16
|
+
emits: ["text", "done"],
|
|
43
17
|
setup(__props, { emit: __emit }) {
|
|
44
|
-
const propValidityContract = { props: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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: ""
|
|
18
|
+
const propValidityContract = { props: { note: {
|
|
19
|
+
type: {
|
|
20
|
+
kind: "terminal",
|
|
21
|
+
name: "string"
|
|
74
22
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
} };
|
|
23
|
+
required: false,
|
|
24
|
+
target: { attribute: "note" },
|
|
25
|
+
description: "Content for the default plain-text field. Supply rich editing content through the default slot.",
|
|
26
|
+
default: ""
|
|
27
|
+
} } };
|
|
86
28
|
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) => {
|
|
29
|
+
const inputTracking = vuePropInputs({ note: "" }, { note: "" }, (name, value, source, values) => {
|
|
98
30
|
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
31
|
case "note": return checkPropInput(value, {
|
|
112
32
|
kind: "terminal",
|
|
113
33
|
name: "string"
|
|
@@ -120,12 +40,7 @@ var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
|
|
|
120
40
|
const propInputs = inputTracking.inputs;
|
|
121
41
|
const checkedProps = computed(() => {
|
|
122
42
|
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
|
-
};
|
|
43
|
+
return { note: propInputs.value("note", props["note"], props[BINDING_INPUTS_PROP]) };
|
|
129
44
|
});
|
|
130
45
|
const inputStatus = (name, handlesError) => {
|
|
131
46
|
checkedProps.value;
|
|
@@ -140,54 +55,17 @@ var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
|
|
|
140
55
|
const hydrationInstance = getCurrentInstance();
|
|
141
56
|
const emit = __emit;
|
|
142
57
|
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
58
|
checkHydratedRoot("div", "ui-editor-footnote-editor");
|
|
170
59
|
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
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
label: isLabelDetail,
|
|
177
|
-
go: isGoDetail,
|
|
178
|
-
done: isGoDetail
|
|
179
|
-
},
|
|
180
|
-
modeled: ["label"]
|
|
181
|
-
});
|
|
60
|
+
const isDoneDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && Object.values(detail).every((item) => true);
|
|
61
|
+
const dispatch = createDispatch(root, emit, { checks: {
|
|
62
|
+
text: isTextDetail,
|
|
63
|
+
done: isDoneDetail
|
|
64
|
+
} });
|
|
182
65
|
useComponentHost(() => import("@threadlabs/looma/components/ui-editor-footnote-editor/ui-editor-footnote-editor.js"), {
|
|
183
66
|
root,
|
|
184
67
|
module: true,
|
|
185
68
|
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
69
|
controllerSource: {
|
|
192
70
|
specifier: "../components/ui-editor-footnote-editor/ui-editor-footnote-editor.js",
|
|
193
71
|
definition: "./components/ui-editor-footnote-editor/ui-editor-footnote-editor.html"
|
|
@@ -200,17 +78,11 @@ var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
|
|
|
200
78
|
const kebab = name.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
|
|
201
79
|
return incoming !== null && incoming !== void 0 ? incoming[name] ?? incoming[kebab] ?? null : null;
|
|
202
80
|
},
|
|
203
|
-
propNames: [
|
|
204
|
-
"editable",
|
|
205
|
-
"error",
|
|
206
|
-
"label",
|
|
207
|
-
"note"
|
|
208
|
-
],
|
|
81
|
+
propNames: ["note"],
|
|
209
82
|
propValidity: (name) => propValidityState({
|
|
210
83
|
contract: propValidityContract,
|
|
211
84
|
values: { ...props }
|
|
212
|
-
}, name)
|
|
213
|
-
state: { base }
|
|
85
|
+
}, name)
|
|
214
86
|
});
|
|
215
87
|
return (_ctx, _cache) => {
|
|
216
88
|
return withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
@@ -218,84 +90,20 @@ var UiEditorFootnoteEditor_default = /* @__PURE__ */ defineComponent({
|
|
|
218
90
|
"aria-label": "Edit footnote"
|
|
219
91
|
}, unref(nativeAttrs)(_ctx.$attrs), {
|
|
220
92
|
"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
93
|
"data-ui-editor-footnote-editor-prop-note": unref(reflectedProp)("note", "note", checkedProps.value.note, void 0, false),
|
|
225
94
|
ref_key: "root",
|
|
226
95
|
ref: root
|
|
227
|
-
}), [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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), {
|
|
96
|
+
}), [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(UiTextarea_default, mergeProps({
|
|
97
|
+
"data-footnote-note": "",
|
|
98
|
+
"aria-label": "Footnote",
|
|
99
|
+
rows: 3,
|
|
100
|
+
autosize: true,
|
|
101
|
+
placeholder: "Write the note",
|
|
102
|
+
value: checkedProps.value.note
|
|
103
|
+
}, { [unref(BINDING_INPUTS_PROP)]: { value: () => ({
|
|
104
|
+
value: checkedProps.value.note,
|
|
105
|
+
status: inputStatus("note", true)
|
|
106
|
+
}) } }), null, 16, ["value"])])], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
299
107
|
contract: propValidityContract,
|
|
300
108
|
values: { ...props }
|
|
301
109
|
}]]);
|
|
@@ -7,8 +7,8 @@ import { t as UiInput_default } from "./UiInput.js";
|
|
|
7
7
|
import { t as UiTooltip_default } from "./UiTooltip.js";
|
|
8
8
|
import { t as UiIconButton_default } from "./UiIconButton.js";
|
|
9
9
|
import { t as UiStack_default } from "./UiStack.js";
|
|
10
|
-
import { t as UiFormField_default } from "./UiFormField.js";
|
|
11
10
|
import { t as UiEditorToolbar_default } from "./UiEditorToolbar.js";
|
|
11
|
+
import { t as UiFormField_default } from "./UiFormField.js";
|
|
12
12
|
import { t as UiPopover_default } from "./UiPopover.js";
|
|
13
13
|
import { t as UiText_default } from "./UiText.js";
|
|
14
14
|
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderList, toDisplayString, unref, useTemplateRef, watchSyncEffect, withCtx, withDirectives } from "vue";
|
|
@@ -7,8 +7,8 @@ import { t as UiIconButton_default } from "./UiIconButton.js";
|
|
|
7
7
|
import { t as UiScrollArea_default } from "./UiScrollArea.js";
|
|
8
8
|
import { t as UiStack_default } from "./UiStack.js";
|
|
9
9
|
import { t as UiFormField_default } from "./UiFormField.js";
|
|
10
|
-
import { t as UiInputGroup_default } from "./UiInputGroup.js";
|
|
11
10
|
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
|