@alfakit/vue 0.1.11 → 0.1.13
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/CHANGELOG.md +12 -0
- package/dist/AlfakitRoot.vue.d.ts.map +1 -1
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js +47 -40
- package/dist/AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/entries/ImageEntryComponent.vue.d.ts.map +1 -1
- package/dist/components/entries/ImageEntryComponent.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/entries/ImageEntryComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/BuilderField.vue.d.ts.map +1 -1
- package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js +114 -114
- package/dist/components/fields/BuilderField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/FileUploadField.vue.d.ts.map +1 -1
- package/dist/components/fields/FileUploadField.vue_vue_type_script_setup_true_lang.js +143 -146
- package/dist/components/fields/FileUploadField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RepeaterField.vue.d.ts.map +1 -1
- package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js +50 -50
- package/dist/components/fields/RepeaterField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/rich-editor-extensions.d.ts.map +1 -1
- package/dist/components/fields/rich-editor-extensions.js +4 -2
- package/dist/components/fields/rich-editor-extensions.js.map +1 -1
- package/dist/components/layout/WizardComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/WizardComponent.vue_vue_type_script_setup_true_lang.js +41 -40
- package/dist/components/layout/WizardComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue.d.ts.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js +103 -102
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/notifications/flash-toasts.d.ts +7 -0
- package/dist/components/notifications/flash-toasts.d.ts.map +1 -1
- package/dist/components/notifications/flash-toasts.js +12 -6
- package/dist/components/notifications/flash-toasts.js.map +1 -1
- package/dist/components/panel/PwaManager.vue.d.ts.map +1 -1
- package/dist/components/panel/PwaManager.vue_vue_type_script_setup_true_lang.js +16 -15
- package/dist/components/panel/PwaManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/PwaMenuItems.vue.d.ts.map +1 -1
- package/dist/components/panel/PwaMenuItems.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/components/panel/PwaMenuItems.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/pwa.d.ts.map +1 -1
- package/dist/components/panel/pwa.js +6 -5
- package/dist/components/panel/pwa.js.map +1 -1
- package/dist/components/table/TableCellContent.vue.d.ts.map +1 -1
- package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js +41 -41
- package/dist/components/table/TableCellContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components.css +19 -0
- package/dist/eject-manifest.json +2 -2
- package/dist/lib/discovery.d.ts.map +1 -1
- package/dist/lib/discovery.js +15 -14
- package/dist/lib/discovery.js.map +1 -1
- package/dist/lib/hydration.d.ts +15 -0
- package/dist/lib/hydration.d.ts.map +1 -1
- package/dist/lib/hydration.js +22 -8
- package/dist/lib/hydration.js.map +1 -1
- package/dist/pages/ContentBlockRenderer.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/pages/ContentBlockRenderer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +34 -30
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/standalone/AlfakitToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/runtime.d.ts +1 -3
- package/dist/standalone/runtime.d.ts.map +1 -1
- package/dist/standalone/runtime.js +26 -34
- package/dist/standalone/runtime.js.map +1 -1
- package/dist/standalone/toaster-claims.d.ts +4 -0
- package/dist/standalone/toaster-claims.d.ts.map +1 -0
- package/dist/standalone/toaster-claims.js +14 -0
- package/dist/standalone/toaster-claims.js.map +1 -0
- package/dist/starter-kit/widgets/WidgetShell.vue.d.ts +2 -2
- package/dist/starter-kit/widgets/WidgetShell.vue.d.ts.map +1 -1
- package/dist/starter-kit/widgets/WidgetShell.vue_vue_type_script_setup_true_lang.js +50 -18
- package/dist/starter-kit/widgets/WidgetShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/package.json +2 -2
- package/src/AlfakitRoot.vue +16 -1
- package/src/components/entries/ImageEntryComponent.vue +2 -0
- package/src/components/fields/BuilderField.vue +7 -2
- package/src/components/fields/FileUploadField.vue +2 -7
- package/src/components/fields/RepeaterField.vue +9 -2
- package/src/components/fields/rich-editor-extensions.ts +9 -5
- package/src/components/layout/WizardComponent.vue +5 -1
- package/src/components/notifications/NotificationsMenu.vue +3 -2
- package/src/components/notifications/flash-toasts.ts +8 -0
- package/src/components/panel/PwaManager.vue +9 -5
- package/src/components/panel/PwaMenuItems.vue +14 -3
- package/src/components/panel/ShortcutsOverlay.vue +1 -1
- package/src/components/panel/pwa.ts +2 -1
- package/src/components/table/TableCellContent.vue +3 -1
- package/src/lib/discovery.ts +6 -0
- package/src/lib/hydration.ts +38 -2
- package/src/pages/ContentBlockRenderer.vue +1 -1
- package/src/standalone/AlfakitComponent.vue +4 -0
- package/src/standalone/runtime.ts +2 -14
- package/src/standalone/toaster-claims.ts +16 -0
- package/src/starter-kit/widgets/WidgetShell.vue +77 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @alfakit/vue
|
|
2
2
|
|
|
3
|
+
## 0.1.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Server rendering: AlfaKit components keep the same generated ids on the server and in the browser (no hydration mismatches on tabs, collapsible sections, filters and the rich editor). Starter kit header components bring a toaster to the app's own pages.
|
|
8
|
+
|
|
9
|
+
## 0.1.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Wizard submit actions run with the form's state; a second custom rich-editor block no longer replaces the first; extra item actions on browser-added repeater items; "+N" no longer overlaps stacked images; PWA and notification toasts in starter kits; infolist blocks follow their `columns()`.
|
|
14
|
+
|
|
3
15
|
## 0.1.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitRoot.vue.d.ts","sourceRoot":"","sources":["../src/AlfakitRoot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitRoot.vue.d.ts","sourceRoot":"","sources":["../src/AlfakitRoot.vue"],"names":[],"mappings":"AA+IA;;;;GAIG;AACH,yGAAyG;AACzG,KAAK,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAoK1C,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAkChD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
import { useAlfakit as e } from "./context.js";
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./components/
|
|
4
|
-
import r from "./components/
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./components/
|
|
7
|
-
import o from "./components/
|
|
8
|
-
import s from "./components/
|
|
9
|
-
import c from "./components/
|
|
10
|
-
import l from "./components/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
import { startIdScope as t } from "./lib/hydration.js";
|
|
3
|
+
import n from "./components/actions/ActionModals.js";
|
|
4
|
+
import r from "./components/ui/TooltipProvider.js";
|
|
5
|
+
import { claimToaster as i } from "./standalone/toaster-claims.js";
|
|
6
|
+
import a from "./components/notifications/FlashToasts.js";
|
|
7
|
+
import o from "./components/notifications/RealtimeNotifications.js";
|
|
8
|
+
import s from "./components/panel/ImpersonationBanner.js";
|
|
9
|
+
import c from "./components/panel/PwaManager.js";
|
|
10
|
+
import l from "./components/ui/Toaster.js";
|
|
11
|
+
import u from "./components/dev-tools/DevToolsSlot.js";
|
|
12
|
+
import d from "./components/panel/SchemaContractGuard.js";
|
|
13
|
+
import { PANEL_TOAST_OFFSET as f, applyDocumentLocale as p, applyPanelTheme as m, overlayPlacementDirection as h, resolveToastPosition as g } from "@alfakit/core";
|
|
14
|
+
import { usePage as _ } from "@inertiajs/vue3";
|
|
15
|
+
import { computed as v, createBlock as y, createCommentVNode as b, createVNode as x, defineComponent as S, onMounted as C, onUnmounted as w, openBlock as T, renderSlot as E, resolveDynamicComponent as D, unref as O, watch as k, withCtx as A } from "vue";
|
|
16
|
+
import { ConfigProvider as j } from "reka-ui";
|
|
15
17
|
//#region src/AlfakitRoot.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
-
var
|
|
18
|
+
var M = /*@__PURE__*/ S({
|
|
17
19
|
__name: "AlfakitRoot",
|
|
18
20
|
props: { toasterId: {} },
|
|
19
|
-
setup(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
setup(S) {
|
|
22
|
+
t();
|
|
23
|
+
let M = _(), { translator: N, registry: P } = e(), F = P.resolve("panel:impersonation-banner") ?? s, I = v(() => M.props.alfakit), L = v(() => I.value?.localization), R = v(() => L.value?.direction ?? "ltr");
|
|
24
|
+
k(() => [I.value?.translations, L.value?.tag], ([e, t]) => {
|
|
25
|
+
I.value && (N.setTranslations(e ?? {}), N.setLocale(t ?? "en"));
|
|
23
26
|
}, {
|
|
24
27
|
immediate: !0,
|
|
25
28
|
flush: "sync"
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
}, { immediate: !0 }),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
}), k(L, (e) => {
|
|
30
|
+
I.value?.starterKit !== !0 && p(e);
|
|
31
|
+
}, { immediate: !0 }), k(I, (e) => m(e), { immediate: !0 });
|
|
32
|
+
let z = null;
|
|
33
|
+
return C(() => {
|
|
34
|
+
z = i();
|
|
35
|
+
}), w(() => z?.()), (e, t) => (T(), y(O(j), { dir: R.value }, {
|
|
36
|
+
default: A(() => [x(r, { "delay-duration": 0 }, {
|
|
37
|
+
default: A(() => [
|
|
38
|
+
x(d, { panel: I.value }, {
|
|
39
|
+
default: A(() => [E(e.$slots, "default")]),
|
|
33
40
|
_: 3
|
|
34
41
|
}, 8, ["panel"]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
x(n),
|
|
43
|
+
x(a),
|
|
44
|
+
x(o),
|
|
45
|
+
x(c),
|
|
46
|
+
x(u),
|
|
47
|
+
I.value?.impersonation ? (T(), y(D(O(F)), {
|
|
41
48
|
key: 0,
|
|
42
|
-
impersonation:
|
|
43
|
-
}, null, 8, ["impersonation"])) :
|
|
44
|
-
|
|
45
|
-
id:
|
|
46
|
-
position:
|
|
47
|
-
offset:
|
|
48
|
-
"mobile-offset":
|
|
49
|
-
dir:
|
|
49
|
+
impersonation: I.value.impersonation
|
|
50
|
+
}, null, 8, ["impersonation"])) : b("", !0),
|
|
51
|
+
x(l, {
|
|
52
|
+
id: S.toasterId,
|
|
53
|
+
position: O(g)(I.value?.toastPosition, O(h)(R.value, I.value?.starterKit)),
|
|
54
|
+
offset: O(f),
|
|
55
|
+
"mobile-offset": O(f),
|
|
56
|
+
dir: R.value,
|
|
50
57
|
"rich-colors": "",
|
|
51
58
|
"close-button": ""
|
|
52
59
|
}, null, 8, [
|
|
@@ -64,6 +71,6 @@ var O = /*@__PURE__*/ b({
|
|
|
64
71
|
}
|
|
65
72
|
});
|
|
66
73
|
//#endregion
|
|
67
|
-
export {
|
|
74
|
+
export { M as default };
|
|
68
75
|
|
|
69
76
|
//# sourceMappingURL=AlfakitRoot.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlfakitRoot.vue_vue_type_script_setup_true_lang.js","names":["ImpersonationBanner","_openBlock","_createBlock","_unref","_withCtx","_createVNode","TooltipProvider","SchemaContractGuard","_renderSlot","ActionModals","FlashToasts","RealtimeNotifications","PwaManager","DevToolsSlot","_resolveDynamicComponent","_createCommentVNode","Toaster","ActionModals_default","TooltipProvider_default","FlashToasts_default","RealtimeNotifications_default","ImpersonationBanner_default","PwaManager_default","Toaster_default","DevToolsSlot_default","SchemaContractGuard_default","AlfakitRoot_vue_vue_type_script_setup_true_lang_default","page","usePage","useAlfakit","impersonationBanner","registry","panel","computed","localization","direction","watch","translations","tag","translator","applyDocumentLocale","value","applyPanelTheme","openBlock","createBlock","unref","ConfigProvider","withCtx","createVNode","renderSlot","_ctx","resolveDynamicComponent","createCommentVNode","__props","resolveToastPosition","overlayPlacementDirection","PANEL_TOAST_OFFSET"],"sources":["../src/AlfakitRoot.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlfakitRoot.vue_vue_type_script_setup_true_lang.js","names":["ImpersonationBanner","_openBlock","_createBlock","_unref","_withCtx","_createVNode","TooltipProvider","SchemaContractGuard","_renderSlot","ActionModals","FlashToasts","RealtimeNotifications","PwaManager","DevToolsSlot","_resolveDynamicComponent","_createCommentVNode","Toaster","ActionModals_default","TooltipProvider_default","FlashToasts_default","RealtimeNotifications_default","ImpersonationBanner_default","PwaManager_default","Toaster_default","DevToolsSlot_default","SchemaContractGuard_default","AlfakitRoot_vue_vue_type_script_setup_true_lang_default","page","usePage","useAlfakit","impersonationBanner","registry","panel","computed","localization","direction","watch","translations","tag","translator","applyDocumentLocale","value","applyPanelTheme","releaseToaster","onMounted","claimToaster","onUnmounted","openBlock","createBlock","unref","ConfigProvider","withCtx","createVNode","renderSlot","_ctx","resolveDynamicComponent","createCommentVNode","__props","resolveToastPosition","overlayPlacementDirection","PANEL_TOAST_OFFSET"],"sources":["../src/AlfakitRoot.vue"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAkCA,EAAa;EAEb,IAAM2B,IAAOC,EAA0B,GACjC,EAAE,eAAY,gBAAaC,EAAW,GAGtCC,IAAsBC,EAAS,QAAQ,4BAA4B,KAAK/B,GAExEgC,IAAQC,QAAeN,EAAK,MAAM,OAAkD,GACpFO,IAAeD,QAAeD,EAAM,OAAO,YAAY,GACvDG,IAAYF,QAAeC,EAAa,OAAO,aAAa,KAAK;EAyBvE,AApBAE,QACQ,CAACJ,EAAM,OAAO,cAAcE,EAAa,OAAO,GAAG,IACxD,CAACG,GAAcC,OAAS;GACvB,AAAKN,EAAM,UAEXO,EAAW,gBAAgBF,KAAgB,CAAC,CAAC,GAC7CE,EAAW,UAAUD,KAAO,IAAI;EAClC,GACA;GAAE,WAAW;GAAM,OAAO;EAAO,CACnC,GAIAF,EACEF,IACC,MAAU;GACT,AAAIF,EAAM,OAAO,eAAe,MAAMQ,EAAoBC,CAAK;EACjE,GACA,EAAE,WAAW,GAAK,CACpB,GACAL,EAAMJ,IAAQ,MAAUU,EAAgBD,CAAK,GAAG,EAAE,WAAW,GAAK,CAAC;EAInE,IAAIE,IAAsC;SAE1CC,QAAgB;GACd,IAAiBC,EAAa;EAChC,CAAC,GAEDC,QAAkBH,IAAiB,CAAC,cAIlC1C,EAAA,GAAAC,EAgCiBC,EAAA+C,CAAA,GAAA,EAhCA,KAAKf,EAAA,MAAS,GAAA;GAC7B,SAAA/B,QA8BkB,CA9BlBC,EA8BkBC,GAAA,EA9BA,kBAAgB,EAAC,GAAA;IACjC,SAAAF,QAEsB;KAFtBC,EAEsBE,GAAA,EAFA,OAAOyB,EAAA,MAAK,GAAA;MAChC,SAAA5B,QAAQ,CAARI,EAAQ8C,EAAA,QAAA,SAAA,CAAA,CAAA;;;KAEVjD,EAAgBI,CAAA;KAChBJ,EAAeK,CAAA;KACfL,EAAyBM,CAAA;KAEzBN,EAAcO,CAAA;KAEdP,EAAgBQ,CAAA;KAGRmB,EAAA,OAAO,iBAFf/B,EAAA,GAAAC,EAIEY,EAHKX,EAAA2B,CAAA,CAAmB,GAAA;;MAEvB,eAAeE,EAAA,MAAM;;KAExB3B,EAaEW,GAAA;MAZC,IAAIyC,EAAA;MACJ,UAAqBtD,EAAAuD,CAAA,CAAoB,CAAc1B,EAAA,OAAO,eAA2B7B,EAAAwD,CAAA,CAAyB,CAACxB,EAAA,OAAWH,EAAA,OAAO,UAAU,CAAA;MAM/I,QAAQ7B,EAAAyD,CAAA;MACR,iBAAezD,EAAAyD,CAAA;MACf,KAAKzB,EAAA;MACN,eAAA;MACA,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEntryComponent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/entries/ImageEntryComponent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageEntryComponent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/entries/ImageEntryComponent.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAQrD,KAAK,WAAW,GAAG;IAAE,SAAS,EAAE,gBAAgB,CAAA;CAAE,CAAC;;AA4HnD,wBAMG"}
|
|
@@ -30,7 +30,7 @@ var x = ["src", "alt"], S = /*@__PURE__*/ p({
|
|
|
30
30
|
}, { ref_for: !0 }, S.component.extraImgAttributes), null, 16, x))), 128)), S.component.limitedRemainingText !== !1 && C.value.length > w.value ? (g(), d("span", {
|
|
31
31
|
key: 0,
|
|
32
32
|
"data-slot": "image-remaining",
|
|
33
|
-
class: h(y(e)("text-muted-foreground", y(i)(S.component.limitedRemainingTextSize)))
|
|
33
|
+
class: h(y(e)("text-muted-foreground", S.component.stacked && O.value && "ms-3", y(i)(S.component.limitedRemainingTextSize)))
|
|
34
34
|
}, "+" + v(C.value.length - w.value), 3)) : u("", !0)], 2)]),
|
|
35
35
|
_: 1
|
|
36
36
|
}, 8, ["entry"]))]),
|
package/dist/components/entries/ImageEntryComponent.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEntryComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","EntryWrapper","_withCtx","EntryPlaceholder","EntryLink","_createElementVNode","_normalizeClass","_unref","_createElementBlock","_Fragment","_renderList","_mergeProps","_toDisplayString","_createCommentVNode","EntryLink_default","EntryPlaceholder_default","EntryWrapper_default","_hoisted_1","ImageEntryComponent_vue_vue_type_script_setup_true_lang_default","props","__props","urls","computed","limit","size","toCss","value","style","defaultImageStack","usesDefaultImageStack","openBlock","createBlock","withCtx","createElementVNode","normalizeClass","unref","cn","createElementBlock","Fragment","renderList","mergeProps","index","url","stackedImageStyle","remainingTextSizeClass","toDisplayString","createCommentVNode"],"sources":["../../../src/components/entries/ImageEntryComponent.vue"],"mappings":";;;;;;;;;;;EASA,IAAMoB,IAAQC,GACRC,IAAOC,QAAeH,EAAM,UAAU,SAAS,CAAC,CAAC,GACjDI,IAAQD,QAAeH,EAAM,UAAU,SAASE,EAAK,MAAM,MAAM,GACjEG,IAAOF,QAAeH,EAAM,UAAU,QAAQ,EAAE,GAChDM,KAAS,MACb,OAAOC,KAAU,WAAW,GAAGA,EAAM,MAAMA,GACvCC,IAAQL,SAAgB;GAC5B,QAAQG,EAAMN,EAAM,UAAU,UAAUK,EAAK,KAAK;GAClD,OAAOC,EACLN,EAAM,UAAU,UACbA,EAAM,UAAU,UAAUA,EAAM,UAAU,WAAWK,EAAK,QAAQ,KAAA,EACvE;EACF,EAAE,GACII,IAAoBN,QAAeO,EAAsBV,EAAM,SAAS,CAAC;oBAI7EpB,EAAA,GAAAC,
|
|
1
|
+
{"version":3,"file":"ImageEntryComponent.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","EntryWrapper","_withCtx","EntryPlaceholder","EntryLink","_createElementVNode","_normalizeClass","_unref","_createElementBlock","_Fragment","_renderList","_mergeProps","_toDisplayString","_createCommentVNode","EntryLink_default","EntryPlaceholder_default","EntryWrapper_default","_hoisted_1","ImageEntryComponent_vue_vue_type_script_setup_true_lang_default","props","__props","urls","computed","limit","size","toCss","value","style","defaultImageStack","usesDefaultImageStack","openBlock","createBlock","withCtx","createElementVNode","normalizeClass","unref","cn","createElementBlock","Fragment","renderList","mergeProps","index","url","stackedImageStyle","remainingTextSizeClass","toDisplayString","createCommentVNode"],"sources":["../../../src/components/entries/ImageEntryComponent.vue"],"mappings":";;;;;;;;;;;EASA,IAAMoB,IAAQC,GACRC,IAAOC,QAAeH,EAAM,UAAU,SAAS,CAAC,CAAC,GACjDI,IAAQD,QAAeH,EAAM,UAAU,SAASE,EAAK,MAAM,MAAM,GACjEG,IAAOF,QAAeH,EAAM,UAAU,QAAQ,EAAE,GAChDM,KAAS,MACb,OAAOC,KAAU,WAAW,GAAGA,EAAM,MAAMA,GACvCC,IAAQL,SAAgB;GAC5B,QAAQG,EAAMN,EAAM,UAAU,UAAUK,EAAK,KAAK;GAClD,OAAOC,EACLN,EAAM,UAAU,UACbA,EAAM,UAAU,UAAUA,EAAM,UAAU,WAAWK,EAAK,QAAQ,KAAA,EACvE;EACF,EAAE,GACII,IAAoBN,QAAeO,EAAsBV,EAAM,SAAS,CAAC;oBAI7EpB,EAAA,GAAAC,EAyCeC,GAAA,EAzCA,OAAOkB,EAAM,UAAA,GAAA;GAC1B,SAAAjB,QAAsE,CAA9CmB,EAAA,MAAK,WAAM,KAAnCtB,EAAA,GAAAC,EAAsEG,GAAA;;IAA1B,OAAOgB,EAAM;GACzDpB,GAAAA,MAAAA,GAAAA,CAAAA,OAAAA,CAAAA,MAAAA,EAAA,GAAAC,EAsCYI,GAAA;;IAtCO,OAAOe,EAAM;;IAC9B,SAAAjB,QAoCM,CApCNG,EAoCM,OAAA,EAnCH,OAAKC,EAAaC,EAAA6B,CAAA,CAAE,CAAA,qBAA+CjB,EAAM,UAAU,UAAUS,EAAA,SAAiB,eAAA,OAAA,CAAA,EAAA,GAAA,EAO/G7B,EAAA,EAAA,GAAAS,EAcEC,GAAA,MAAAC,EAbuBW,EAAA,MAAK,MAAK,GAAIE,EAAA,KAAK,IAAlC,GAAK,OADfxB,EAAA,GAAAS,EAcE,OAdFG,EAcE;KAZC,KAAK8B;KACL,KAAKC;KACL,KAAKvB,EAAM,UAAU,OAAOsB,MAAUtB,EAAM,UAAU,OAAG;KACzD,OAAK,CAAGQ,EAAA,OAAOpB,EAAAoC,CAAA,CAAiB,CAACF,GAAOtB,EAAM,SAAS,CAAA;KACvD,OAAoBZ,EAAA6B,CAAA,CAAE,CAAA,gBAA8CjB,EAAM,UAAU,WAAQ,iBAAA,cAAgDA,EAAM,UAAU,WAAWS,EAAA,SAAiB,wBAAA;IAOjL,GAAA,EAAA,SAAA,GAAA,GAAAT,EAAM,UAAU,kBAAkB,GAAA,MAAA,IAAAF,CAAA,EAGpC,GAAA,GAAA,IAAAE,EAAM,UAAU,yBAAoB,MAAcE,EAAA,MAAK,SAASE,EAAA,SADxExB,EAAA,GAAAS,EAYC,QAAA;;KAVC,aAAU;KACT,OAAKF,EAAeC,EAAA6B,CAAA,CAAE,CAAA,yBAAwIjB,EAAM,UAAU,WAAWS,EAAA,SAAiB,QAA0BrB,EAAAqC,CAAA,CAAsB,CAACzB,EAAM,UAAU,wBAAwB,CAAA,CAAA;IAQnS,GAAA,MAACP,EAAGS,EAAA,MAAK,SAASE,EAAA,KAAK,GAAA,CAAA,KAAAuB,EAAA,IAAA,EAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuilderField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/fields/BuilderField.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuilderField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/fields/BuilderField.vue"],"names":[],"mappings":"AAgdA,OAAO,KAAK,EAAwC,aAAa,EAAE,MAAM,eAAe,CAAA;AA8CxF;;;;GAIG;AACH,KAAK,WAAW,GAAG;IAAE,SAAS,EAAE,aAAa,CAAA;CAAE,CAAC;;AA21BhD,wBAMG"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { useActionRunner as e, useFormatter as t, useOptionalRegistry as n, useT as ee } from "../../context.js";
|
|
2
2
|
import { cn as r } from "../../lib/utils.js";
|
|
3
3
|
import i from "../../lib/Icon.js";
|
|
4
|
-
import
|
|
5
|
-
import { useField as
|
|
6
|
-
import
|
|
7
|
-
import { useScrollToErroredItem as
|
|
8
|
-
import { useFieldActionContext as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useItemActionFallbacks as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { VIRTUAL_ESTIMATES as
|
|
21
|
-
import { Fragment as Ie, computed as
|
|
22
|
-
import { PencilIcon as
|
|
4
|
+
import te from "../ui/Button2.js";
|
|
5
|
+
import { useField as ne, useOptionalFormStore as re } from "../form/form-context.js";
|
|
6
|
+
import ie from "../schema/SchemaRenderer.js";
|
|
7
|
+
import { useScrollToErroredItem as ae, useVirtualList as oe } from "../../composables/use-virtual-list.js";
|
|
8
|
+
import { useFieldActionContext as se } from "../schema/field-actions.js";
|
|
9
|
+
import ce from "../layout/DeferredSchema.js";
|
|
10
|
+
import le from "../schema/FieldWrapper.js";
|
|
11
|
+
import ue from "../ui/Collapsible.js";
|
|
12
|
+
import de from "../ui/CollapsibleContent.js";
|
|
13
|
+
import fe from "./AddActionRow.js";
|
|
14
|
+
import pe from "./CollapseAllActions.js";
|
|
15
|
+
import me from "./ItemHeaderActions.js";
|
|
16
|
+
import { useItemActionFallbacks as he, useItemMoves as ge, useRunItemAction as _e } from "./item-actions.js";
|
|
17
|
+
import ve from "./BuilderBlockActionsMenu.js";
|
|
18
|
+
import ye from "./BuilderBlockPickerPanel.js";
|
|
19
|
+
import be from "./BuilderBlockPicker.js";
|
|
20
|
+
import { VIRTUAL_ESTIMATES as xe, builderItemLabel as a, builderItemSchema as Se, builderItems as Ce, canAddBuilderBlock as we, cloneIndexedState as o, cloneRepeaterItem as Te, fieldIds as Ee, insertBuilderItem as De, isDeferredPlaceholder as Oe, itemActionContext as ke, itemExtraActions as s, moveIndexedState as c, moveRepeaterItem as Ae, removeIndexedState as je, removeRepeaterItem as Me, reorderedItemKeys as Ne, resolveItemAction as Pe, virtualizeOptions as Fe } from "@alfakit/core";
|
|
21
|
+
import { Fragment as Ie, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as Le, createVNode as m, defineComponent as Re, normalizeClass as h, normalizeStyle as ze, openBlock as g, ref as _, renderList as Be, resolveComponent as Ve, resolveDynamicComponent as He, toDisplayString as v, unref as y, withCtx as b, withKeys as x, withModifiers as S } from "vue";
|
|
22
|
+
import { PencilIcon as Ue } from "@lucide/vue";
|
|
23
23
|
//#region src/components/fields/BuilderField.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var
|
|
24
|
+
var We = {
|
|
25
25
|
"aria-live": "polite",
|
|
26
26
|
"aria-atomic": "true",
|
|
27
27
|
class: "sr-only",
|
|
28
28
|
"data-slot": "item-move-status"
|
|
29
|
-
},
|
|
29
|
+
}, Ge = {
|
|
30
30
|
key: 0,
|
|
31
31
|
"data-slot": "builder-empty",
|
|
32
32
|
class: "bg-muted/30 flex flex-col gap-3 rounded-lg border border-dashed p-3 sm:p-4"
|
|
33
|
-
},
|
|
33
|
+
}, Ke = { class: "px-1" }, qe = { class: "text-sm font-medium" }, Je = { class: "text-muted-foreground text-sm" }, Ye = {
|
|
34
34
|
key: 1,
|
|
35
35
|
class: "text-muted-foreground rounded-lg border border-dashed p-4 text-center text-sm"
|
|
36
|
-
},
|
|
36
|
+
}, Xe = [
|
|
37
37
|
"id",
|
|
38
38
|
"aria-labelledby",
|
|
39
39
|
"aria-describedby"
|
|
40
|
-
],
|
|
40
|
+
], Ze = [
|
|
41
41
|
"data-index",
|
|
42
42
|
"aria-setsize",
|
|
43
43
|
"aria-posinset",
|
|
@@ -45,128 +45,128 @@ var Ue = {
|
|
|
45
45
|
"draggable",
|
|
46
46
|
"onDragstart",
|
|
47
47
|
"onDrop"
|
|
48
|
-
],
|
|
48
|
+
], Qe = {
|
|
49
49
|
class: "flex flex-wrap items-center gap-1 border-b px-2 py-1.5",
|
|
50
50
|
"data-slot": "item-header"
|
|
51
|
-
},
|
|
51
|
+
}, $e = ["title"], et = {
|
|
52
52
|
key: 2,
|
|
53
53
|
class: "text-muted-foreground text-xs tabular-nums"
|
|
54
|
-
},
|
|
54
|
+
}, tt = { class: "flex min-w-0 flex-1 items-baseline gap-2" }, nt = {
|
|
55
55
|
key: 0,
|
|
56
56
|
dir: "auto",
|
|
57
57
|
class: "min-w-0 shrink-0 truncate text-sm font-medium sm:max-w-[60%]"
|
|
58
|
-
},
|
|
58
|
+
}, rt = {
|
|
59
59
|
key: 1,
|
|
60
60
|
dir: "auto",
|
|
61
61
|
class: "text-muted-foreground min-w-0 truncate text-sm",
|
|
62
62
|
"data-slot": "builder-item-summary"
|
|
63
|
-
},
|
|
63
|
+
}, it = [
|
|
64
64
|
"role",
|
|
65
65
|
"tabindex",
|
|
66
66
|
"aria-label",
|
|
67
67
|
"onClick",
|
|
68
68
|
"onKeydown"
|
|
69
|
-
],
|
|
69
|
+
], at = ["innerHTML"], ot = {
|
|
70
70
|
key: 1,
|
|
71
71
|
class: "p-4"
|
|
72
|
-
}, C = /*@__PURE__*/
|
|
72
|
+
}, C = /*@__PURE__*/ Re({
|
|
73
73
|
__name: "BuilderField",
|
|
74
74
|
props: { component: {} },
|
|
75
|
-
setup(
|
|
76
|
-
let C =
|
|
75
|
+
setup(Re) {
|
|
76
|
+
let C = Re, w = ee(), st = t(), ct = n(), T = re(), E = se(() => C.component), D = _e(E), lt = he("builder"), O = (e) => {
|
|
77
77
|
let t = C.component.items[e];
|
|
78
78
|
return t && t.type === N.value[e]?.type ? t : void 0;
|
|
79
79
|
}, k = (e, t) => Pe(e, C.component, t === void 0 ? void 0 : O(t), e === "add" ? {
|
|
80
|
-
...
|
|
80
|
+
...lt.add,
|
|
81
81
|
label: C.component.addActionLabel
|
|
82
|
-
} :
|
|
83
|
-
|
|
84
|
-
let
|
|
82
|
+
} : lt[e]), { value: A, setValue: ut, error: dt, id: j, disabled: ft, readOnly: pt, aria: mt } = ne(() => C.component), M = l(() => ft.value || pt.value), N = l(() => Ce(A.value)), P = _({}), F = _({}), I = _(null), L = oe(() => N.value.length, () => Fe(C.component.virtualize, xe.item, 12));
|
|
83
|
+
ae(L, () => C.component.statePath);
|
|
84
|
+
let ht = l(() => L.indexes.value.map((e) => ({
|
|
85
85
|
item: N.value[e],
|
|
86
86
|
index: e
|
|
87
|
-
}))), R = (e) => C.component.blocks.find((t) => t.name === e), z = (e) => P.value[e] ?? C.component.collapsed ?? !1, B =
|
|
87
|
+
}))), R = (e) => C.component.blocks.find((t) => t.name === e), z = (e) => P.value[e] ?? C.component.collapsed ?? !1, B = l(() => C.component.addable && !M.value && (C.component.maxItems == null || N.value.length < C.component.maxItems)), V = l(() => C.component.deletable && !M.value && (C.component.minItems == null || N.value.length > C.component.minItems)), H = (e) => {
|
|
88
88
|
let t = R(e.type);
|
|
89
|
-
return !!(C.component.cloneable && B.value && t &&
|
|
90
|
-
}, U =
|
|
91
|
-
e === "moveUp" ? Y.moveWithButton(t, t - 1) : e === "moveDown" ? Y.moveWithButton(t, t + 1) : e === "clone" ?
|
|
92
|
-
}),
|
|
93
|
-
q(Ae(N.value, e, t)), P.value =
|
|
94
|
-
}, Y =
|
|
89
|
+
return !!(C.component.cloneable && B.value && t && we(C.component, t, N.value));
|
|
90
|
+
}, U = l(() => C.component.reorderable && C.component.reorderableWithDragAndDrop !== !1 && !M.value && k("reorder") !== null), W = l(() => C.component.reorderable && C.component.reorderableWithButtons !== !1 && !M.value), G = l(() => k("add")), gt = l(() => B.value && G.value !== null && !G.value.disabled && C.component.blocks.length > 0), K = l(() => !!C.component.blockActionsMenu && !M.value), _t = e(), vt = (e, t) => D(k(e, t), { item: String(t) }, () => {
|
|
91
|
+
e === "moveUp" ? Y.moveWithButton(t, t - 1) : e === "moveDown" ? Y.moveWithButton(t, t + 1) : e === "clone" ? Ct(t) : e === "delete" && St(t);
|
|
92
|
+
}), yt = (e, t) => void _t.trigger(e, ke(E.value, { item: String(t) })), q = (e) => ut(e), J = (e, t) => {
|
|
93
|
+
q(Ae(N.value, e, t)), P.value = c(P.value, e, t), F.value = c(F.value, e, t);
|
|
94
|
+
}, Y = ge(A, (e, t) => J(e, t), (e) => a(C.component, N.value, e), () => N.value.length), bt = Y.announcement, xt = Y.container, St = (e) => {
|
|
95
95
|
q(Me(N.value, e)), P.value = je(P.value, e), F.value = je(F.value, e);
|
|
96
|
-
},
|
|
97
|
-
q(Te(N.value, e)), P.value =
|
|
98
|
-
},
|
|
96
|
+
}, Ct = (e) => {
|
|
97
|
+
q(Te(N.value, e)), P.value = o(P.value, e), F.value = o(F.value, e);
|
|
98
|
+
}, wt = (e) => D(G.value, { block: e.name }, () => q(De(N.value, e))), Tt = (e) => {
|
|
99
99
|
let t = I.value;
|
|
100
100
|
I.value = null, t !== null && t !== e && D(k("reorder"), { items: Ne(N.value.length, t, e) }, () => J(t, e));
|
|
101
|
-
}, wt = (e) => {
|
|
102
|
-
P.value = Object.fromEntries(N.value.map((t, n) => [n, e])), e && Tt(N.value.map((e, t) => t));
|
|
103
|
-
}, Tt = (e) => {
|
|
104
|
-
e.some((e) => R(N.value[e]?.type ?? "")?.summary) && T?.refresh(C.component.statePath);
|
|
105
101
|
}, Et = (e) => {
|
|
102
|
+
P.value = Object.fromEntries(N.value.map((t, n) => [n, e])), e && Dt(N.value.map((e, t) => t));
|
|
103
|
+
}, Dt = (e) => {
|
|
104
|
+
e.some((e) => R(N.value[e]?.type ?? "")?.summary) && T?.refresh(C.component.statePath);
|
|
105
|
+
}, Ot = (e) => {
|
|
106
106
|
let t = !z(e);
|
|
107
107
|
P.value = {
|
|
108
108
|
...P.value,
|
|
109
109
|
[e]: t
|
|
110
|
-
}, t &&
|
|
111
|
-
},
|
|
110
|
+
}, t && Dt([e]);
|
|
111
|
+
}, X = (e) => {
|
|
112
112
|
let t = O(e)?.previewComponent ?? R(N.value[e]?.type ?? "")?.previewComponent;
|
|
113
|
-
return t ?
|
|
114
|
-
},
|
|
113
|
+
return t ? ct?.resolve(`builder-preview:${t}`) : void 0;
|
|
114
|
+
}, Z = (e) => C.component.blockPreviews === !0 && (X(e) !== void 0 || !!O(e)?.preview), kt = (e) => Z(e) && !F.value[e], At = (e) => {
|
|
115
115
|
let t = !F.value[e];
|
|
116
116
|
F.value = {
|
|
117
117
|
...F.value,
|
|
118
118
|
[e]: t
|
|
119
119
|
}, t || T?.refresh(C.component.statePath);
|
|
120
120
|
}, Q = (e) => {
|
|
121
|
-
M.value ||
|
|
122
|
-
}, $ =
|
|
121
|
+
M.value || At(e);
|
|
122
|
+
}, $ = l(() => !C.component.interactivePreviews && !M.value);
|
|
123
123
|
return (e, t) => {
|
|
124
|
-
let n =
|
|
125
|
-
return y(Oe)(C.component) ? (g(),
|
|
124
|
+
let n = Ve("BuilderField", !0);
|
|
125
|
+
return y(Oe)(C.component) ? (g(), u(ce, {
|
|
126
126
|
key: 0,
|
|
127
127
|
component: C.component
|
|
128
128
|
}, {
|
|
129
|
-
default: b(({ component: e }) => [
|
|
129
|
+
default: b(({ component: e }) => [m(n, { component: e }, null, 8, ["component"])]),
|
|
130
130
|
_: 1
|
|
131
|
-
}, 8, ["component"])) : (g(),
|
|
131
|
+
}, 8, ["component"])) : (g(), u(le, {
|
|
132
132
|
key: 1,
|
|
133
133
|
field: C.component,
|
|
134
134
|
"html-for": y(j),
|
|
135
|
-
error: y(
|
|
135
|
+
error: y(dt)
|
|
136
136
|
}, {
|
|
137
|
-
default: b(() => [
|
|
137
|
+
default: b(() => [p("div", {
|
|
138
138
|
ref_key: "moveContainer",
|
|
139
|
-
ref:
|
|
139
|
+
ref: xt,
|
|
140
140
|
class: "flex flex-col gap-3",
|
|
141
141
|
"data-slot": "builder"
|
|
142
142
|
}, [
|
|
143
|
-
|
|
144
|
-
N.value.length === 0 &&
|
|
143
|
+
p("span", We, v(y(bt)), 1),
|
|
144
|
+
N.value.length === 0 && gt.value ? (g(), f("div", Ge, [p("div", Ke, [p("p", qe, v(y(w)("builder.empty_heading", {}, "Add your first block")), 1), p("p", Je, v(y(w)("builder.empty_description", {}, "Pick one to start. You can add more, reorder and remove them at any time.")), 1)]), m(ye, {
|
|
145
145
|
component: C.component,
|
|
146
146
|
items: N.value,
|
|
147
147
|
class: "bg-card max-h-[28rem] rounded-md border",
|
|
148
|
-
onPick:
|
|
149
|
-
}, null, 8, ["component", "items"])])) : N.value.length === 0 ? (g(),
|
|
150
|
-
C.component.collapsible && N.value.length > 0 ? (g(),
|
|
148
|
+
onPick: wt
|
|
149
|
+
}, null, 8, ["component", "items"])])) : N.value.length === 0 ? (g(), f("p", Ye, v(y(w)("builder.empty", {}, "No blocks yet.")), 1)) : d("", !0),
|
|
150
|
+
C.component.collapsible && N.value.length > 0 ? (g(), u(pe, {
|
|
151
151
|
key: 2,
|
|
152
152
|
context: y(E),
|
|
153
153
|
"collapse-all": k("collapseAll"),
|
|
154
154
|
"expand-all": k("expandAll"),
|
|
155
|
-
onCollapseAll: t[0] ||= (e) =>
|
|
156
|
-
onExpandAll: t[1] ||= (e) =>
|
|
155
|
+
onCollapseAll: t[0] ||= (e) => Et(!0),
|
|
156
|
+
onExpandAll: t[1] ||= (e) => Et(!1)
|
|
157
157
|
}, null, 8, [
|
|
158
158
|
"context",
|
|
159
159
|
"collapse-all",
|
|
160
160
|
"expand-all"
|
|
161
|
-
])) :
|
|
162
|
-
|
|
161
|
+
])) : d("", !0),
|
|
162
|
+
p("ul", {
|
|
163
163
|
id: y(j),
|
|
164
164
|
ref: y(L).attach,
|
|
165
165
|
"aria-labelledby": C.component.label ? y(Ee)(y(j)).label : void 0,
|
|
166
|
-
"aria-describedby": y(
|
|
167
|
-
style:
|
|
166
|
+
"aria-describedby": y(mt)["aria-describedby"],
|
|
167
|
+
style: ze(y(L).style.value),
|
|
168
168
|
class: h(y(r)("grid gap-3", N.value.length === 0 && "hidden"))
|
|
169
|
-
}, [(g(!0),
|
|
169
|
+
}, [(g(!0), f(Ie, null, Be(ht.value, ({ item: e, index: n }) => (g(), f("li", {
|
|
170
170
|
key: n,
|
|
171
171
|
ref_for: !0,
|
|
172
172
|
ref: y(L).item,
|
|
@@ -178,69 +178,69 @@ var Ue = {
|
|
|
178
178
|
class: h(y(r)("bg-card min-w-0 rounded-lg border shadow-xs", I.value === n && "opacity-50")),
|
|
179
179
|
onDragstart: (e) => I.value = n,
|
|
180
180
|
onDragover: t[2] ||= (e) => U.value && e.preventDefault(),
|
|
181
|
-
onDrop: (e) =>
|
|
181
|
+
onDrop: (e) => Tt(n),
|
|
182
182
|
onDragend: t[3] ||= (e) => I.value = null
|
|
183
|
-
}, [
|
|
184
|
-
default: b(() => [
|
|
185
|
-
U.value ? (g(),
|
|
183
|
+
}, [m(ue, { open: !z(n) }, {
|
|
184
|
+
default: b(() => [p("div", Qe, [
|
|
185
|
+
U.value ? (g(), f("span", {
|
|
186
186
|
key: 0,
|
|
187
187
|
class: "text-muted-foreground cursor-grab",
|
|
188
188
|
title: k("reorder")?.label ?? void 0,
|
|
189
189
|
"aria-hidden": "true"
|
|
190
|
-
}, [
|
|
191
|
-
C.component.blockIcons && (R(e.type)?.icon ?? C.component.items[n]?.icon) ? (g(),
|
|
190
|
+
}, [m(y(i), { name: k("reorder")?.icon ?? "grip-vertical" }, null, 8, ["name"])], 8, $e)) : d("", !0),
|
|
191
|
+
C.component.blockIcons && (R(e.type)?.icon ?? C.component.items[n]?.icon) ? (g(), u(y(i), {
|
|
192
192
|
key: 1,
|
|
193
193
|
name: R(e.type)?.icon ?? C.component.items[n]?.icon,
|
|
194
194
|
class: "text-muted-foreground size-4"
|
|
195
|
-
}, null, 8, ["name"])) :
|
|
196
|
-
C.component.blockNumbers ? (g(),
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
}, null, 8, ["name"])) : d("", !0),
|
|
196
|
+
C.component.blockNumbers ? (g(), f("span", et, v(y(st).number(n + 1)), 1)) : d("", !0),
|
|
197
|
+
p("span", tt, [C.component.blockLabels ? (g(), f("span", nt, v(y(a)(C.component, N.value, n)), 1)) : d("", !0), O(n)?.summary ? (g(), f("span", rt, v(O(n)?.summary), 1)) : d("", !0)]),
|
|
198
|
+
m(me, {
|
|
199
199
|
context: y(E),
|
|
200
200
|
"item-key": String(n),
|
|
201
201
|
index: n,
|
|
202
202
|
count: N.value.length,
|
|
203
203
|
resolve: (e) => k(e, n),
|
|
204
|
-
"extra-actions": K.value || M.value ? void 0 : O(n)
|
|
204
|
+
"extra-actions": K.value || M.value ? void 0 : y(s)(C.component, O(n)),
|
|
205
205
|
buttons: W.value && !K.value,
|
|
206
206
|
"can-clone": H(e) && !K.value,
|
|
207
207
|
"can-delete": V.value && !K.value,
|
|
208
208
|
collapsible: !!C.component.collapsible,
|
|
209
209
|
collapsed: z(n),
|
|
210
210
|
onMove: y(Y).moveWithButton,
|
|
211
|
-
onClone: (e) =>
|
|
212
|
-
onDelete: (e) =>
|
|
213
|
-
onToggle: (e) =>
|
|
211
|
+
onClone: (e) => Ct(n),
|
|
212
|
+
onDelete: (e) => St(n),
|
|
213
|
+
onToggle: (e) => Ot(n)
|
|
214
214
|
}, {
|
|
215
|
-
default: b(() => [
|
|
215
|
+
default: b(() => [Z(n) && !M.value ? (g(), u(te, {
|
|
216
216
|
key: 0,
|
|
217
217
|
type: "button",
|
|
218
218
|
variant: "ghost",
|
|
219
219
|
size: "icon-xs",
|
|
220
220
|
"aria-label": y(w)("builder.edit_block", {}, "Edit block"),
|
|
221
221
|
"aria-pressed": !!F.value[n],
|
|
222
|
-
onClick: (e) =>
|
|
222
|
+
onClick: (e) => At(n)
|
|
223
223
|
}, {
|
|
224
|
-
default: b(() => [
|
|
224
|
+
default: b(() => [m(y(i), {
|
|
225
225
|
name: "alfakit::forms.components.builder.actions.edit",
|
|
226
|
-
fallback: y(
|
|
226
|
+
fallback: y(Ue)
|
|
227
227
|
}, null, 8, ["fallback"])]),
|
|
228
228
|
_: 1
|
|
229
229
|
}, 8, [
|
|
230
230
|
"aria-label",
|
|
231
231
|
"aria-pressed",
|
|
232
232
|
"onClick"
|
|
233
|
-
])) :
|
|
233
|
+
])) : d("", !0), K.value ? (g(), u(ve, {
|
|
234
234
|
key: 1,
|
|
235
|
-
label: y(
|
|
235
|
+
label: y(a)(C.component, N.value, n) ?? "",
|
|
236
236
|
resolve: (e) => k(e, n),
|
|
237
237
|
"can-move-up": W.value && n > 0,
|
|
238
238
|
"can-move-down": W.value && n < N.value.length - 1,
|
|
239
239
|
"can-clone": H(e),
|
|
240
240
|
"can-delete": V.value,
|
|
241
|
-
"extra-actions": O(n)
|
|
242
|
-
onAction: (e) =>
|
|
243
|
-
onExtra: (e) =>
|
|
241
|
+
"extra-actions": y(s)(C.component, O(n)),
|
|
242
|
+
onAction: (e) => vt(e, n),
|
|
243
|
+
onExtra: (e) => yt(e, n)
|
|
244
244
|
}, null, 8, [
|
|
245
245
|
"label",
|
|
246
246
|
"resolve",
|
|
@@ -251,7 +251,7 @@ var Ue = {
|
|
|
251
251
|
"extra-actions",
|
|
252
252
|
"onAction",
|
|
253
253
|
"onExtra"
|
|
254
|
-
])) :
|
|
254
|
+
])) : d("", !0)]),
|
|
255
255
|
_: 2
|
|
256
256
|
}, 1032, [
|
|
257
257
|
"context",
|
|
@@ -270,8 +270,8 @@ var Ue = {
|
|
|
270
270
|
"onDelete",
|
|
271
271
|
"onToggle"
|
|
272
272
|
])
|
|
273
|
-
]),
|
|
274
|
-
default: b(() => [
|
|
273
|
+
]), m(de, null, {
|
|
274
|
+
default: b(() => [kt(n) ? (g(), f("div", {
|
|
275
275
|
key: 0,
|
|
276
276
|
"data-slot": "builder-preview",
|
|
277
277
|
class: h(y(r)("p-4", $.value && "cursor-pointer")),
|
|
@@ -280,7 +280,7 @@ var Ue = {
|
|
|
280
280
|
"aria-label": $.value ? y(w)("builder.edit_block", {}, "Edit block") : void 0,
|
|
281
281
|
onClick: (e) => $.value && Q(n),
|
|
282
282
|
onKeydown: [x(S((e) => $.value && Q(n), ["prevent"]), ["enter"]), x(S((e) => $.value && Q(n), ["prevent"]), ["space"])]
|
|
283
|
-
}, [
|
|
283
|
+
}, [p("div", { class: h(y(r)(!C.component.interactivePreviews && "pointer-events-none")) }, [X(n) ? (g(), u(He(X(n)), {
|
|
284
284
|
key: 0,
|
|
285
285
|
data: e.data,
|
|
286
286
|
block: e.type,
|
|
@@ -289,43 +289,43 @@ var Ue = {
|
|
|
289
289
|
"data",
|
|
290
290
|
"block",
|
|
291
291
|
"index"
|
|
292
|
-
])) : (g(),
|
|
292
|
+
])) : (g(), f("div", {
|
|
293
293
|
key: 1,
|
|
294
294
|
innerHTML: O(n)?.preview ?? ""
|
|
295
|
-
}, null, 8,
|
|
296
|
-
components: y(
|
|
295
|
+
}, null, 8, at))], 2)], 42, it)) : (g(), f("div", ot, [m(ie, {
|
|
296
|
+
components: y(Se)(C.component, N.value, n),
|
|
297
297
|
columns: R(e.type)?.columns ?? C.component.items[n]?.columns ?? { default: 1 }
|
|
298
298
|
}, null, 8, ["components", "columns"])]))]),
|
|
299
299
|
_: 2
|
|
300
300
|
}, 1024)]),
|
|
301
301
|
_: 2
|
|
302
|
-
}, 1032, ["open"])], 42,
|
|
303
|
-
B.value && G.value && C.component.blocks.length > 0 && N.value.length > 0 ? (g(),
|
|
302
|
+
}, 1032, ["open"])], 42, Ze))), 128))], 14, Xe),
|
|
303
|
+
B.value && G.value && C.component.blocks.length > 0 && N.value.length > 0 ? (g(), u(fe, {
|
|
304
304
|
key: 3,
|
|
305
305
|
alignment: C.component.addActionAlignment
|
|
306
306
|
}, {
|
|
307
|
-
default: b(() => [
|
|
307
|
+
default: b(() => [m(be, {
|
|
308
308
|
component: C.component,
|
|
309
309
|
items: N.value,
|
|
310
|
-
onPick:
|
|
310
|
+
onPick: wt
|
|
311
311
|
}, {
|
|
312
|
-
default: b(() => [
|
|
312
|
+
default: b(() => [m(te, {
|
|
313
313
|
type: "button",
|
|
314
314
|
variant: "outline",
|
|
315
315
|
size: "sm",
|
|
316
316
|
disabled: G.value?.disabled,
|
|
317
317
|
"data-slot": "builder-add"
|
|
318
318
|
}, {
|
|
319
|
-
default: b(() => [G.value?.icon ? (g(),
|
|
319
|
+
default: b(() => [G.value?.icon ? (g(), u(y(i), {
|
|
320
320
|
key: 0,
|
|
321
321
|
name: G.value.icon
|
|
322
|
-
}, null, 8, ["name"])) :
|
|
322
|
+
}, null, 8, ["name"])) : d("", !0), Le(" " + v(G.value?.label), 1)]),
|
|
323
323
|
_: 1
|
|
324
324
|
}, 8, ["disabled"])]),
|
|
325
325
|
_: 1
|
|
326
326
|
}, 8, ["component", "items"])]),
|
|
327
327
|
_: 1
|
|
328
|
-
}, 8, ["alignment"])) :
|
|
328
|
+
}, 8, ["alignment"])) : d("", !0)
|
|
329
329
|
], 512)]),
|
|
330
330
|
_: 1
|
|
331
331
|
}, 8, [
|