@threadlabs/looma 0.28.6 → 0.28.7

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 (105) hide show
  1. package/components/ui-editor-block-actions/ui-editor-block-actions.html +20 -0
  2. package/components/ui-editor-block-actions/ui-editor-block-actions.js +14 -0
  3. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.html +7 -6
  4. package/components/ui-editor-image-toolbar/ui-editor-image-toolbar.js +2 -1
  5. package/components/ui-editor-link-card/ui-editor-link-card.html +57 -0
  6. package/components/ui-editor-link-card/ui-editor-link-card.js +27 -0
  7. package/dist/index.js +36 -34
  8. package/package.json +1 -1
  9. package/styles/ui-editor-block-actions.css +1 -0
  10. package/styles/ui-editor-link-card.css +1 -0
  11. package/vanilla/UiEditorBlockActions.d.ts +16 -0
  12. package/vanilla/UiEditorBlockActions.js +41 -0
  13. package/vanilla/UiEditorImageToolbar.js +1 -1
  14. package/vanilla/UiEditorLinkCard.d.ts +20 -0
  15. package/vanilla/UiEditorLinkCard.js +153 -0
  16. package/vanilla/index.js +2 -0
  17. package/vue/UiEditorBlockActions.d.ts +33 -0
  18. package/vue/UiEditorBlockActions.js +2 -0
  19. package/vue/UiEditorBlockActions.vue +125 -0
  20. package/vue/UiEditorImageToolbar.vue +5 -6
  21. package/vue/UiEditorLinkCard.d.ts +58 -0
  22. package/vue/UiEditorLinkCard.js +2 -0
  23. package/vue/UiEditorLinkCard.vue +319 -0
  24. package/vue/chunks/UiAffordanceScope.js +1 -1
  25. package/vue/chunks/UiAvatar.js +1 -1
  26. package/vue/chunks/UiAvatarGroup.js +1 -1
  27. package/vue/chunks/UiBadge.js +1 -1
  28. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  29. package/vue/chunks/UiBreadcrumbs.js +1 -1
  30. package/vue/chunks/UiButton.js +1 -1
  31. package/vue/chunks/UiCallout.js +1 -1
  32. package/vue/chunks/UiCard.js +1 -1
  33. package/vue/chunks/UiCheckbox.js +1 -1
  34. package/vue/chunks/UiCluster.js +1 -1
  35. package/vue/chunks/UiCombobox.js +1 -1
  36. package/vue/chunks/UiContainer.js +1 -1
  37. package/vue/chunks/UiContextMenu.js +1 -1
  38. package/vue/chunks/UiCover.js +1 -1
  39. package/vue/chunks/UiDescriptionItem.js +1 -1
  40. package/vue/chunks/UiDescriptionList.js +1 -1
  41. package/vue/chunks/UiDialog.js +1 -1
  42. package/vue/chunks/UiDisclosure.js +1 -1
  43. package/vue/chunks/UiEditable.js +1 -1
  44. package/vue/chunks/UiEditorBlockActions.js +127 -0
  45. package/vue/chunks/UiEditorImageToolbar.js +7 -25
  46. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  47. package/vue/chunks/UiEditorLinkCard.js +356 -0
  48. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  49. package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
  50. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  51. package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
  52. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  53. package/vue/chunks/UiEditorSurface.js +1 -1
  54. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  55. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  56. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  57. package/vue/chunks/UiEditorToolbar.js +1 -1
  58. package/vue/chunks/UiFloatingActionButton.js +1 -1
  59. package/vue/chunks/UiFormField.js +1 -1
  60. package/vue/chunks/UiGrid.js +1 -1
  61. package/vue/chunks/UiIcon.js +1 -1
  62. package/vue/chunks/UiIconButton.js +1 -1
  63. package/vue/chunks/UiImage.js +1 -1
  64. package/vue/chunks/UiInput.js +1 -1
  65. package/vue/chunks/UiInputGroup.js +1 -1
  66. package/vue/chunks/UiList.js +1 -1
  67. package/vue/chunks/UiListItem.js +1 -1
  68. package/vue/chunks/UiListbox.js +1 -1
  69. package/vue/chunks/UiMenu.js +1 -1
  70. package/vue/chunks/UiMenuGroup.js +1 -1
  71. package/vue/chunks/UiMenuItem.js +1 -1
  72. package/vue/chunks/UiMeter.js +1 -1
  73. package/vue/chunks/UiNavItem.js +1 -1
  74. package/vue/chunks/UiPageHeader.js +1 -1
  75. package/vue/chunks/UiPopover.js +1 -1
  76. package/vue/chunks/UiRadio.js +1 -1
  77. package/vue/chunks/UiRadioGroup.js +1 -1
  78. package/vue/chunks/UiReel.js +1 -1
  79. package/vue/chunks/UiScrollArea.js +1 -1
  80. package/vue/chunks/UiSearchResultRow.js +1 -1
  81. package/vue/chunks/UiSearchShell.js +1 -1
  82. package/vue/chunks/UiSection.js +1 -1
  83. package/vue/chunks/UiSelect.js +1 -1
  84. package/vue/chunks/UiSeparator.js +1 -1
  85. package/vue/chunks/UiSidebar.js +1 -1
  86. package/vue/chunks/UiSpinner.js +1 -1
  87. package/vue/chunks/UiStack.js +1 -1
  88. package/vue/chunks/UiStatusMessage.js +1 -1
  89. package/vue/chunks/UiSwitch.js +1 -1
  90. package/vue/chunks/UiSwitcher.js +1 -1
  91. package/vue/chunks/UiTable.js +1 -1
  92. package/vue/chunks/UiTabs.js +1 -1
  93. package/vue/chunks/UiText.js +1 -1
  94. package/vue/chunks/UiTextarea.js +1 -1
  95. package/vue/chunks/UiToast.js +1 -1
  96. package/vue/chunks/UiToastRegion.js +1 -1
  97. package/vue/chunks/UiTooltip.js +1 -1
  98. package/vue/chunks/UiTree.js +1 -1
  99. package/vue/chunks/UiTreeItem.js +1 -1
  100. package/vue/chunks/_plugin-vue_export-helper.js +1 -1
  101. package/vue/components.css +1176 -1176
  102. package/vue/editor/index.js +29 -94
  103. package/vue/editor/primitives.d.ts +8 -2
  104. package/vue/index.d.ts +2 -0
  105. package/vue/index.js +5 -3
@@ -0,0 +1,319 @@
1
+ <!-- Generated by HTML Next 1.0.0-alpha.51 for Vue 3.5. Do not edit. -->
2
+ <script setup lang="ts">
3
+ import { computed, getCurrentInstance, provide, ref, watchSyncEffect } from 'vue'
4
+ import type { PropType } from 'vue'
5
+ import {
6
+ checkHydratedRoot,
7
+ concat,
8
+ createDispatch,
9
+ cycleCheckedComputed,
10
+ nativeAttrs,
11
+ text,
12
+ useComponentHost,
13
+ useReflectedProp,
14
+ } from './host'
15
+ import { acceptsControllerWrite } from './props'
16
+ import { checkedProp, propValidityState, vPropValidity } from './props'
17
+ import UiButton from './UiButton.vue'
18
+ import UiCard from './UiCard.vue'
19
+ import UiCluster from './UiCluster.vue'
20
+ import UiIcon from './UiIcon.vue'
21
+ import UiIconButton from './UiIconButton.vue'
22
+ import UiStack from './UiStack.vue'
23
+ import UiText from './UiText.vue'
24
+ import UiTooltip from './UiTooltip.vue'
25
+
26
+ defineOptions({ inheritAttrs: false })
27
+
28
+ const propValidityContract = {
29
+ props: {
30
+ detail: {
31
+ type: { kind: 'terminal', name: 'string' },
32
+ required: false,
33
+ target: { attribute: 'detail' },
34
+ description: 'A second line under the label, such as where the destination lives.',
35
+ default: '',
36
+ },
37
+ href: {
38
+ type: { kind: 'terminal', name: 'string' },
39
+ required: false,
40
+ target: { attribute: 'title' },
41
+ description: 'The link\'s destination, shown when there is no label.',
42
+ default: '',
43
+ },
44
+ label: {
45
+ type: { kind: 'terminal', name: 'string' },
46
+ required: false,
47
+ target: { attribute: 'label' },
48
+ description:
49
+ 'The resolved destination\'s name, such as a page title, shown in place of the address.',
50
+ default: '',
51
+ },
52
+ openHref: {
53
+ type: { kind: 'terminal', name: 'string' },
54
+ required: false,
55
+ target: { attribute: 'href' },
56
+ description:
57
+ 'The address Open link opens in a new tab; without it the card offers no Open link. The editor passes the destination only when it is an http, https,\n mailto, tel, or relative address.',
58
+ default: '',
59
+ },
60
+ targetLabel: {
61
+ type: { kind: 'terminal', name: 'string' },
62
+ required: false,
63
+ target: { attribute: 'targetlabel' },
64
+ description:
65
+ 'What a resolved destination is called, as in "Page: Guide" for a screen reader.',
66
+ default: 'Item',
67
+ },
68
+ },
69
+ } as const
70
+ const props = defineProps({
71
+ detail: { type: null as unknown as PropType<string | null>, default: '' },
72
+ href: { type: null as unknown as PropType<string | null>, default: '' },
73
+ label: { type: null as unknown as PropType<string | null>, default: '' },
74
+ openHref: { type: null as unknown as PropType<string | null>, default: '' },
75
+ targetLabel: { type: null as unknown as PropType<string | null>, default: 'Item' },
76
+ })
77
+ const acceptedProps: Record<string, unknown> = {
78
+ detail: '',
79
+ href: '',
80
+ label: '',
81
+ openHref: '',
82
+ targetLabel: 'Item',
83
+ }
84
+ const checkedProps = computed(() => ({
85
+ detail: checkedProp<string>(
86
+ props['detail'],
87
+ { kind: 'terminal', name: 'string' },
88
+ false,
89
+ 'detail',
90
+ acceptedProps,
91
+ ) as string,
92
+ href: checkedProp<string>(
93
+ props['href'],
94
+ { kind: 'terminal', name: 'string' },
95
+ false,
96
+ 'href',
97
+ acceptedProps,
98
+ ) as string,
99
+ label: checkedProp<string>(
100
+ props['label'],
101
+ { kind: 'terminal', name: 'string' },
102
+ false,
103
+ 'label',
104
+ acceptedProps,
105
+ ) as string,
106
+ openHref: checkedProp<string>(
107
+ props['openHref'],
108
+ { kind: 'terminal', name: 'string' },
109
+ false,
110
+ 'openHref',
111
+ acceptedProps,
112
+ ) as string,
113
+ targetLabel: checkedProp<string>(
114
+ props['targetLabel'],
115
+ { kind: 'terminal', name: 'string' },
116
+ false,
117
+ 'targetLabel',
118
+ acceptedProps,
119
+ ) as string,
120
+ }))
121
+ void checkedProps.value
122
+ watchSyncEffect(() => {
123
+ void checkedProps.value
124
+ })
125
+ const reflectedProp = useReflectedProp()
126
+ const hydrationInstance = getCurrentInstance()
127
+ const emit = defineEmits<{
128
+ edit: [event: CustomEvent<Readonly<Record<string, unknown>>>]
129
+ remove: [event: CustomEvent<Readonly<Record<string, unknown>>>]
130
+ }>()
131
+
132
+ const root = ref<HTMLElement | null>(null)
133
+ const base = ref('ui-editor-link-card')
134
+ const resolved = cycleCheckedComputed(() => checkedProps.value.label !== '')
135
+ let shownPrevious: any = null
136
+ const shown = cycleCheckedComputed(() => {
137
+ const next: any = ((objectValue: any, indexValue: any) =>
138
+ objectValue === Symbol.for('html-next.invalid-result')
139
+ || indexValue === Symbol.for('html-next.invalid-result')
140
+ ? Symbol.for('html-next.invalid-result')
141
+ : objectValue[indexValue])(
142
+ { true: checkedProps.value.label, false: checkedProps.value.href },
143
+ concat(resolved.value),
144
+ )
145
+ if (next === Symbol.for('html-next.invalid-result')) {
146
+ return shownPrevious
147
+ }
148
+ return shownPrevious = next
149
+ })
150
+ let guardedPrevious: any = null
151
+ const guarded = computed(() => {
152
+ const candidate: any = ((objectValue: any, indexValue: any) =>
153
+ objectValue === Symbol.for('html-next.invalid-result')
154
+ || indexValue === Symbol.for('html-next.invalid-result')
155
+ ? Symbol.for('html-next.invalid-result')
156
+ : objectValue[indexValue])({ true: 'file-text', false: 'link' }, concat(resolved.value))
157
+ if (candidate === Symbol.for('html-next.invalid-result')) {
158
+ return guardedPrevious
159
+ }
160
+ return guardedPrevious = candidate
161
+ })
162
+ let guardedBindingPrevious: any = null
163
+ const guardedBinding = computed(() => {
164
+ const candidate: any = concat(
165
+ ((objectValue: any, indexValue: any) =>
166
+ objectValue === Symbol.for('html-next.invalid-result')
167
+ || indexValue === Symbol.for('html-next.invalid-result')
168
+ ? Symbol.for('html-next.invalid-result')
169
+ : objectValue[indexValue])(
170
+ { true: checkedProps.value.targetLabel, false: 'URL' },
171
+ concat(resolved.value),
172
+ ),
173
+ ': ',
174
+ shown.value,
175
+ )
176
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBindingPrevious
177
+ return guardedBindingPrevious = candidate
178
+ })
179
+ let guardedBinding2Previous: any = null
180
+ const guardedBinding2 = computed(() => {
181
+ const candidate: any = concat(base.value, '-open')
182
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding2Previous
183
+ return guardedBinding2Previous = candidate
184
+ })
185
+ let guardedBinding3Previous: any = null
186
+ const guardedBinding3 = computed(() => {
187
+ const candidate: any = concat(base.value, '-open')
188
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding3Previous
189
+ return guardedBinding3Previous = candidate
190
+ })
191
+ let guardedBinding4Previous: any = null
192
+ const guardedBinding4 = computed(() => {
193
+ const candidate: any = concat(base.value, '-edit')
194
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding4Previous
195
+ return guardedBinding4Previous = candidate
196
+ })
197
+ let guardedBinding5Previous: any = null
198
+ const guardedBinding5 = computed(() => {
199
+ const candidate: any = concat(base.value, '-edit')
200
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding5Previous
201
+ return guardedBinding5Previous = candidate
202
+ })
203
+ let guardedBinding6Previous: any = null
204
+ const guardedBinding6 = computed(() => {
205
+ const candidate: any = concat(base.value, '-remove')
206
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding6Previous
207
+ return guardedBinding6Previous = candidate
208
+ })
209
+ let guardedBinding7Previous: any = null
210
+ const guardedBinding7 = computed(() => {
211
+ const candidate: any = concat(base.value, '-remove')
212
+ if (candidate === Symbol.for('html-next.invalid-result')) return guardedBinding7Previous
213
+ return guardedBinding7Previous = candidate
214
+ })
215
+ provide('html-next:ui-editor-link-card:base', base)
216
+ checkHydratedRoot('div', 'ui-editor-link-card')
217
+
218
+ const isEditDetail = (
219
+ detail: unknown,
220
+ ): boolean => (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
221
+ && Object.values(detail as object).every((item: unknown) => true))
222
+ const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
223
+ checks: {
224
+ edit: isEditDetail,
225
+ remove: isEditDetail,
226
+ },
227
+ })
228
+
229
+ useComponentHost(() => import('../components/ui-editor-link-card/ui-editor-link-card.js'), {
230
+ root,
231
+ dispatch,
232
+ acceptsState: (name: string, keys: readonly string[], value: unknown) =>
233
+ acceptsControllerWrite(
234
+ value,
235
+ ({ base: { kind: 'terminal', name: 'string' } } as Record<string, any>)[name],
236
+ keys,
237
+ ),
238
+ controllerSource: {
239
+ specifier: '../components/ui-editor-link-card/ui-editor-link-card.js',
240
+ definition: './components/ui-editor-link-card/ui-editor-link-card.html',
241
+ },
242
+ props: checkedProps,
243
+ propInputs: (name: string) => {
244
+ const incoming = hydrationInstance?.vnode.props
245
+ const kebab = name.replace(/[A-Z]/g, (letter) => '-' + letter.toLowerCase())
246
+ return incoming !== null && incoming !== undefined
247
+ ? (incoming[name] ?? incoming[kebab] ?? null)
248
+ : null
249
+ },
250
+ propNames: ['detail', 'href', 'label', 'openHref', 'targetLabel'],
251
+ propValidity: (name: string) =>
252
+ propValidityState({ contract: propValidityContract, values: { ...props } }, name),
253
+ state: { base },
254
+ computed: { resolved, shown },
255
+ })
256
+ </script>
257
+
258
+ <template>
259
+ <div
260
+ v-bind="nativeAttrs($attrs)"
261
+ v-prop-validity="{ contract: propValidityContract, values: { ...props } }"
262
+ :data-detail="reflectedProp('detail', 'detail', checkedProps.detail, undefined, false)"
263
+ :data-href="reflectedProp('href', 'href', checkedProps.href, undefined, false)"
264
+ :data-label="reflectedProp('label', 'label', checkedProps.label, undefined, false)"
265
+ :data-open-href="reflectedProp('openHref', 'open-href', checkedProps.openHref, undefined, false)"
266
+ :data-target-label="reflectedProp('targetLabel', 'target-label', checkedProps.targetLabel, undefined, false)"
267
+ ref="root"
268
+ >
269
+ <UiCard variant="elevated" padding="xs" size="content"><UiCluster
270
+ gap="xs"
271
+ wrap="nowrap"
272
+ role="group"
273
+ aria-label="Link actions"
274
+ ><UiIcon :name="guarded" />
275
+ <UiStack gap="none" :title="checkedProps.href" :aria-label="guardedBinding"><UiText
276
+ as="strong"
277
+ size="sm"
278
+ weight="medium"
279
+ font="sans"
280
+ wrap="anywhere"
281
+ >{{ text(shown) }}</UiText>
282
+ <UiText
283
+ v-if="checkedProps.detail !== ''"
284
+ as="small"
285
+ size="xs"
286
+ tone="secondary"
287
+ font="sans"
288
+ >{{ checkedProps.detail }}</UiText></UiStack>
289
+ <template v-if="checkedProps.openHref !== ''"><UiButton
290
+ as="a"
291
+ variant="ghost"
292
+ tone="neutral"
293
+ size="sm"
294
+ target="_blank"
295
+ rel="noopener noreferrer"
296
+ aria-label="Open link"
297
+ :id="guardedBinding2"
298
+ :href="checkedProps.openHref"
299
+ ><UiCluster gap="xs" wrap="nowrap"><UiIcon name="external-link" />Open
300
+ link</UiCluster></UiButton>
301
+ <UiTooltip :for="guardedBinding3">Open link</UiTooltip></template>
302
+ <UiIconButton
303
+ label="Edit link"
304
+ variant="ghost"
305
+ size="sm"
306
+ data-link-action="edit"
307
+ :id="guardedBinding4"
308
+ ><UiIcon name="pencil" /></UiIconButton>
309
+ <UiTooltip :for="guardedBinding5">Edit link</UiTooltip>
310
+ <UiIconButton
311
+ label="Remove link"
312
+ variant="ghost"
313
+ size="sm"
314
+ data-link-action="remove"
315
+ :id="guardedBinding6"
316
+ ><UiIcon name="unlink" /></UiIconButton>
317
+ <UiTooltip :for="guardedBinding7">Remove link</UiTooltip></UiCluster></UiCard>
318
+ </div>
319
+ </template>
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiAffordanceScope.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { t as UiIcon_default } from "./UiIcon.js";
4
4
  import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiAvatarGroup.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiBadge.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { a as concat, i as checkHydratedRoot, p as nativeAttrs, r as attribute, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { a as concat, i as checkHydratedRoot, p as nativeAttrs, r as attribute, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { t as UiIcon_default } from "./UiIcon.js";
4
4
  import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiBreadcrumbs.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, a as concat, h as preserveRootFocus, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, r as attribute, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { a as concat, h as preserveRootFocus, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, r as attribute, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState } from "./props.js";
3
3
  import { t as UiIcon_default } from "./UiIcon.js";
4
4
  import { t as UiSpinner_default } from "./UiSpinner.js";
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiCallout.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { h as preserveRootFocus, i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { h as preserveRootFocus, i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiCard.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { r as vBindControl } from "./control.js";
4
4
  import { computed, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiCluster.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, a as concat, g as uniqueKeys, i as checkHydratedRoot, n as KeyedBoundary, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp, y as warnUnless } from "./_plugin-vue_export-helper.js";
1
+ import { _ as uniqueKeys, a as concat, b as warnUnless, i as checkHydratedRoot, n as KeyedBoundary, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { t as UiBadge_default } from "./UiBadge.js";
4
4
  import { r as vBindControl } from "./control.js";
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiContainer.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiContextMenu.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiCover.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, toDisplayString, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiDescriptionItem.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, p as nativeAttrs, t as _plugin_vue_export_helper_default, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp } from "./props.js";
3
3
  import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiDescriptionList.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { t as UiScrollArea_default } from "./UiScrollArea.js";
4
4
  import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withCtx, withDirectives } from "vue";
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp, y as warnUnless } from "./_plugin-vue_export-helper.js";
1
+ import { b as warnUnless, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { computed, createElementBlock, createElementVNode, createTextVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderSlot, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
4
4
  //#region .build/vue/UiDisclosure.vue?vue&type=script&setup=true&lang.ts
@@ -1,4 +1,4 @@
1
- import { _ as useComponentHost, i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useReflectedProp } from "./_plugin-vue_export-helper.js";
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, t as _plugin_vue_export_helper_default, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
2
  import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
3
3
  import { r as vBindControl } from "./control.js";
4
4
  import { computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, toDisplayString, unref, useTemplateRef, watchSyncEffect, withDirectives } from "vue";
@@ -0,0 +1,127 @@
1
+ import { i as checkHydratedRoot, o as createDispatch, p as nativeAttrs, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
2
+ import { a as vPropValidity, n as checkedProp, r as propValidityState } from "./props.js";
3
+ import { t as UiMenu_default } from "./UiMenu.js";
4
+ import { t as UiMenuItem_default } from "./UiMenuItem.js";
5
+ import { computed, createElementBlock, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, ref, unref, watchSyncEffect, withCtx, withDirectives } from "vue";
6
+ //#region .build/vue/UiEditorBlockActions.vue?vue&type=script&setup=true&lang.ts
7
+ var _hoisted_1 = ["data-for", "data-placement"];
8
+ //#endregion
9
+ //#region .build/vue/UiEditorBlockActions.vue
10
+ var UiEditorBlockActions_default = /* @__PURE__ */ defineComponent({
11
+ inheritAttrs: false,
12
+ __name: "UiEditorBlockActions",
13
+ props: {
14
+ for: {
15
+ type: null,
16
+ default: ""
17
+ },
18
+ placement: {
19
+ type: null,
20
+ default: "bottom-start"
21
+ }
22
+ },
23
+ emits: ["action"],
24
+ setup(__props, { emit: __emit }) {
25
+ const propValidityContract = { props: {
26
+ for: {
27
+ type: {
28
+ kind: "terminal",
29
+ name: "string"
30
+ },
31
+ required: false,
32
+ target: { attribute: "for" },
33
+ description: "The id of the button that opens the menu and anchors it.",
34
+ default: ""
35
+ },
36
+ placement: {
37
+ type: {
38
+ kind: "terminal",
39
+ name: "keyword"
40
+ },
41
+ required: false,
42
+ target: { attribute: "placement" },
43
+ description: "Where the menu opens beside its button; top-start suits a toolbar docked at the bottom of the screen.",
44
+ values: ["bottom-start", "top-start"],
45
+ default: "bottom-start"
46
+ }
47
+ } };
48
+ const props = __props;
49
+ const acceptedProps = {
50
+ for: "",
51
+ placement: "bottom-start"
52
+ };
53
+ const checkedProps = computed(() => ({
54
+ for: checkedProp(props["for"], {
55
+ kind: "terminal",
56
+ name: "string"
57
+ }, false, "for", acceptedProps),
58
+ placement: checkedProp(props["placement"], {
59
+ kind: "terminal",
60
+ name: "keyword"
61
+ }, false, "placement", acceptedProps)
62
+ }));
63
+ checkedProps.value;
64
+ watchSyncEffect(() => {
65
+ checkedProps.value;
66
+ });
67
+ const reflectedProp = useReflectedProp();
68
+ const hydrationInstance = getCurrentInstance();
69
+ const emit = __emit;
70
+ const root = ref(null);
71
+ checkHydratedRoot("div", "ui-editor-block-actions");
72
+ const isActionDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && (detail["action"] === "insert-below" || detail["action"] === "duplicate" || detail["action"] === "delete") && Object.keys(detail).every((key) => ["action"].includes(key));
73
+ const dispatch = createDispatch(root, emit, { checks: { action: isActionDetail } });
74
+ useComponentHost(() => import("@threadlabs/looma/components/ui-editor-block-actions/ui-editor-block-actions.js"), {
75
+ root,
76
+ dispatch,
77
+ controllerSource: {
78
+ specifier: "../components/ui-editor-block-actions/ui-editor-block-actions.js",
79
+ definition: "./components/ui-editor-block-actions/ui-editor-block-actions.html"
80
+ },
81
+ props: checkedProps,
82
+ propInputs: (name) => {
83
+ const incoming = hydrationInstance?.vnode.props;
84
+ const kebab = name.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
85
+ return incoming !== null && incoming !== void 0 ? incoming[name] ?? incoming[kebab] ?? null : null;
86
+ },
87
+ propNames: ["for", "placement"],
88
+ propValidity: (name) => propValidityState({
89
+ contract: propValidityContract,
90
+ values: { ...props }
91
+ }, name)
92
+ });
93
+ return (_ctx, _cache) => {
94
+ return withDirectives((openBlock(), createElementBlock("div", mergeProps(unref(nativeAttrs)(_ctx.$attrs), {
95
+ "data-for": unref(reflectedProp)("for", "for", checkedProps.value.for, void 0, false),
96
+ "data-placement": unref(reflectedProp)("placement", "placement", checkedProps.value.placement, void 0, false),
97
+ ref_key: "root",
98
+ ref: root
99
+ }), [createVNode(UiMenu_default, {
100
+ "aria-label": "Block actions",
101
+ for: checkedProps.value.for,
102
+ placement: checkedProps.value.placement
103
+ }, {
104
+ default: withCtx(() => [
105
+ createVNode(UiMenuItem_default, { value: "insert-below" }, {
106
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Insert paragraph below", -1)])]),
107
+ _: 1
108
+ }),
109
+ createVNode(UiMenuItem_default, { value: "duplicate" }, {
110
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Duplicate block", -1)])]),
111
+ _: 1
112
+ }),
113
+ createVNode(UiMenuItem_default, { value: "delete" }, {
114
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Delete block", -1)])]),
115
+ _: 1
116
+ })
117
+ ]),
118
+ _: 1
119
+ }, 8, ["for", "placement"])], 16, _hoisted_1)), [[unref(vPropValidity), {
120
+ contract: propValidityContract,
121
+ values: { ...props }
122
+ }]]);
123
+ };
124
+ }
125
+ });
126
+ //#endregion
127
+ export { UiEditorBlockActions_default as t };