@mgamadeus/ddd-admin-ui 0.1.0-rc.5 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.claude/skills/ddd-admin-ui-specialist/SKILL.md +31 -4
  2. package/CHANGELOG.md +89 -1
  3. package/README.md +23 -14
  4. package/STANDARDS.md +95 -21
  5. package/dist/form/DrawerFooter.d.ts +9 -1
  6. package/dist/form/DrawerFooter.d.ts.map +1 -1
  7. package/dist/form/DrawerFooter.js +33 -32
  8. package/dist/form/DrawerFooter.js.map +1 -1
  9. package/dist/form/FormActions.d.ts +18 -13
  10. package/dist/form/FormActions.d.ts.map +1 -1
  11. package/dist/form/FormActions.js +104 -32
  12. package/dist/form/FormActions.js.map +1 -1
  13. package/dist/form/FormDialog.d.ts +52 -0
  14. package/dist/form/FormDialog.d.ts.map +1 -0
  15. package/dist/form/FormDialog.js +77 -0
  16. package/dist/form/FormDialog.js.map +1 -0
  17. package/dist/form/FormDrawer.d.ts +1 -0
  18. package/dist/form/FormDrawer.d.ts.map +1 -1
  19. package/dist/form/FormDrawer.js +3 -1
  20. package/dist/form/FormDrawer.js.map +1 -1
  21. package/dist/form/FormHeader.d.ts +6 -1
  22. package/dist/form/FormHeader.d.ts.map +1 -1
  23. package/dist/form/FormHeader.js +1 -1
  24. package/dist/form/FormHeader.js.map +1 -1
  25. package/dist/form/FormSubmitButton.d.ts +6 -1
  26. package/dist/form/FormSubmitButton.d.ts.map +1 -1
  27. package/dist/form/FormSubmitButton.js +5 -2
  28. package/dist/form/FormSubmitButton.js.map +1 -1
  29. package/dist/form/index.d.ts +2 -0
  30. package/dist/form/index.d.ts.map +1 -1
  31. package/dist/form/index.js +1 -0
  32. package/dist/form/index.js.map +1 -1
  33. package/dist/form/linkSubmitButtons.d.ts +7 -0
  34. package/dist/form/linkSubmitButtons.d.ts.map +1 -0
  35. package/dist/form/linkSubmitButtons.js +27 -0
  36. package/dist/form/linkSubmitButtons.js.map +1 -0
  37. package/dist/form/saveShortcut.d.ts +25 -0
  38. package/dist/form/saveShortcut.d.ts.map +1 -0
  39. package/dist/form/saveShortcut.js +59 -0
  40. package/dist/form/saveShortcut.js.map +1 -0
  41. package/dist/form/useConfirmDialog.d.ts +3 -2
  42. package/dist/form/useConfirmDialog.d.ts.map +1 -1
  43. package/dist/form/useConfirmDialog.js +21 -18
  44. package/dist/form/useConfirmDialog.js.map +1 -1
  45. package/dist/i18n/hints.json +2 -0
  46. package/dist/i18n-keys.json +20 -3
  47. package/dist/list/EntityListBulkBar.d.ts +7 -1
  48. package/dist/list/EntityListBulkBar.d.ts.map +1 -1
  49. package/dist/list/EntityListBulkBar.js +5 -1
  50. package/dist/list/EntityListBulkBar.js.map +1 -1
  51. package/dist/logic/index.d.ts +7 -0
  52. package/dist/logic/index.d.ts.map +1 -1
  53. package/dist/logic/index.js +4 -0
  54. package/dist/logic/index.js.map +1 -1
  55. package/dist/logic/pure/confirm.d.ts +13 -0
  56. package/dist/logic/pure/confirm.d.ts.map +1 -1
  57. package/dist/logic/pure/confirm.js +12 -0
  58. package/dist/logic/pure/confirm.js.map +1 -1
  59. package/dist/logic/pure/confirmQueue.d.ts +27 -0
  60. package/dist/logic/pure/confirmQueue.d.ts.map +1 -0
  61. package/dist/logic/pure/confirmQueue.js +52 -0
  62. package/dist/logic/pure/confirmQueue.js.map +1 -0
  63. package/dist/logic/pure/writeAccess.d.ts +18 -0
  64. package/dist/logic/pure/writeAccess.d.ts.map +1 -0
  65. package/dist/logic/pure/writeAccess.js +14 -0
  66. package/dist/logic/pure/writeAccess.js.map +1 -0
  67. package/dist/logic/react/useConfirm.d.ts +14 -0
  68. package/dist/logic/react/useConfirm.d.ts.map +1 -0
  69. package/dist/logic/react/useConfirm.js +16 -0
  70. package/dist/logic/react/useConfirm.js.map +1 -0
  71. package/dist/logic/react/writeAccess.d.ts +18 -0
  72. package/dist/logic/react/writeAccess.d.ts.map +1 -0
  73. package/dist/logic/react/writeAccess.js +18 -0
  74. package/dist/logic/react/writeAccess.js.map +1 -0
  75. package/dist/media/MediaItemPickerDialog.d.ts +1 -0
  76. package/dist/media/MediaItemPickerDialog.d.ts.map +1 -1
  77. package/dist/media/MediaItemPickerDialog.js +3 -1
  78. package/dist/media/MediaItemPickerDialog.js.map +1 -1
  79. package/dist/page/DetailHeader.d.ts +6 -1
  80. package/dist/page/DetailHeader.d.ts.map +1 -1
  81. package/dist/page/DetailHeader.js +3 -3
  82. package/dist/page/DetailHeader.js.map +1 -1
  83. package/dist/page/EntityDetailShell.d.ts +7 -1
  84. package/dist/page/EntityDetailShell.d.ts.map +1 -1
  85. package/dist/page/EntityDetailShell.js +4 -3
  86. package/dist/page/EntityDetailShell.js.map +1 -1
  87. package/dist/page/PageToolbar.d.ts +2 -1
  88. package/dist/page/PageToolbar.d.ts.map +1 -1
  89. package/dist/page/PageToolbar.js +6 -2
  90. package/dist/page/PageToolbar.js.map +1 -1
  91. package/dist/primitives/alert.d.ts +1 -1
  92. package/dist/primitives/badge.d.ts +1 -1
  93. package/dist/primitives/confirmDialogView.d.ts +30 -0
  94. package/dist/primitives/confirmDialogView.d.ts.map +1 -0
  95. package/dist/primitives/confirmDialogView.js +65 -0
  96. package/dist/primitives/confirmDialogView.js.map +1 -0
  97. package/dist/primitives/descriptionContent.d.ts +8 -0
  98. package/dist/primitives/descriptionContent.d.ts.map +1 -0
  99. package/dist/primitives/descriptionContent.js +7 -0
  100. package/dist/primitives/descriptionContent.js.map +1 -0
  101. package/dist/primitives/formActionsSlot.d.ts +24 -0
  102. package/dist/primitives/formActionsSlot.d.ts.map +1 -0
  103. package/dist/primitives/formActionsSlot.js +51 -0
  104. package/dist/primitives/formActionsSlot.js.map +1 -0
  105. package/dist/primitives/index.d.ts +2 -0
  106. package/dist/primitives/index.d.ts.map +1 -1
  107. package/dist/primitives/index.js +1 -0
  108. package/dist/primitives/index.js.map +1 -1
  109. package/dist/provider/AdminUiProvider.d.ts +4 -3
  110. package/dist/provider/AdminUiProvider.d.ts.map +1 -1
  111. package/dist/provider/AdminUiProvider.js +11 -5
  112. package/dist/provider/AdminUiProvider.js.map +1 -1
  113. package/dist/provider/ConfirmHost.d.ts +10 -0
  114. package/dist/provider/ConfirmHost.d.ts.map +1 -0
  115. package/dist/provider/ConfirmHost.js +19 -0
  116. package/dist/provider/ConfirmHost.js.map +1 -0
  117. package/dist/provider/types.d.ts +6 -0
  118. package/dist/provider/types.d.ts.map +1 -1
  119. package/dist/showcase/coverage.js +2 -2
  120. package/dist/showcase/coverage.js.map +1 -1
  121. package/dist/showcase/sections/FormShowcase.d.ts.map +1 -1
  122. package/dist/showcase/sections/FormShowcase.js +41 -5
  123. package/dist/showcase/sections/FormShowcase.js.map +1 -1
  124. package/package.json +2 -2
@@ -0,0 +1,65 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Fragment, useEffect, useId, useRef, useState } from 'react';
4
+ import { useTranslate } from "../i18n/index.js";
5
+ import { Button } from "./button.js";
6
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "./dialog.js";
7
+ import { isInlineDescription } from "./descriptionContent.js";
8
+ import { Input } from "./input.js";
9
+ import { Label } from "./label.js";
10
+ const phraseMatches = (phrase, typed) => phrase === undefined || typed.trim() === phrase.trim();
11
+ const ConfirmBody = ({ entry, focusOnMount, answer }) => {
12
+ const { t } = useTranslate();
13
+ const { options } = entry;
14
+ const phraseId = useId();
15
+ const [typed, setTyped] = useState('');
16
+ const firstControl = useRef(null);
17
+ const unlocked = phraseMatches(options.requirePhrase, typed);
18
+ useEffect(() => {
19
+ if (focusOnMount)
20
+ firstControl.current?.focus();
21
+ }, [focusOnMount]);
22
+ return (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: options.title }), options.description &&
23
+ (isInlineDescription(options.description) ? (_jsx(DialogDescription, { children: options.description })) : (_jsx(DialogDescription, { asChild: true, children: _jsx("div", { children: options.description }) })))] }), options.requirePhrase !== undefined && (_jsxs("div", { className: "grid gap-2", "data-confirm-phrase": "", children: [_jsx(Label, { htmlFor: phraseId, children: options.requirePhraseLabel ?? t('Type “%phrase%” to confirm', { replacements: { phrase: options.requirePhrase } }) }), _jsx(Input, { id: phraseId, ref: element => {
24
+ firstControl.current = element;
25
+ }, value: typed, autoComplete: "off", spellCheck: false, onChange: event => setTyped(event.target.value), onKeyDown: event => {
26
+ if (event.key === 'Enter' && !event.nativeEvent.isComposing) {
27
+ event.preventDefault();
28
+ if (unlocked)
29
+ answer(true);
30
+ }
31
+ } })] })), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "outline", ref: element => {
32
+ if (options.requirePhrase === undefined)
33
+ firstControl.current = element;
34
+ }, onClick: () => answer(false), children: options.cancelLabel ?? t('Cancel', { context: 'confirm-dialog' }) }), _jsx(Button, { type: "button", variant: options.confirmVariant === 'destructive' ? 'destructive' : 'default', disabled: !unlocked, onClick: () => answer(true), children: options.confirmLabel ?? t('Confirm', { context: 'confirm-dialog' }) })] })] }));
35
+ };
36
+ /**
37
+ * The package's confirmation dialog, drawn by `useConfirmDialog` (`./form`) and by `AdminUiProvider` for `useConfirm`.
38
+ * Keeps the last confirmation on screen while the dialog closes, and returns the focus to the element that had it when
39
+ * the dialog opened (it opens without a Radix trigger). A confirmation opened while the previous one still animates
40
+ * out starts a fresh dialog.
41
+ */
42
+ export const ConfirmDialogView = ({ entry, onSettle }) => {
43
+ const lastEntry = useRef(null);
44
+ const openedWith = useRef(null);
45
+ const session = useRef(0);
46
+ const returnFocus = useRef(null);
47
+ if (entry)
48
+ lastEntry.current = entry;
49
+ if (!entry)
50
+ openedWith.current = null;
51
+ else if (openedWith.current === null) {
52
+ openedWith.current = entry.id;
53
+ session.current += 1;
54
+ returnFocus.current = typeof document !== 'undefined' && document.activeElement instanceof HTMLElement ? document.activeElement : null;
55
+ }
56
+ const shown = entry ?? lastEntry.current;
57
+ // this session's element: a dialog cut short by the next session still returns the focus it took
58
+ const focusTarget = returnFocus.current;
59
+ return (_jsx(Dialog, { open: entry !== null, onOpenChange: open => !open && entry && onSettle(entry.id, false), children: _jsx(DialogContent, { showCloseButton: false, className: "sm:max-w-md", onCloseAutoFocus: event => {
60
+ event.preventDefault();
61
+ if (focusTarget?.isConnected)
62
+ focusTarget.focus();
63
+ }, children: shown && (_jsx(Fragment, { children: _jsx(ConfirmBody, { entry: shown, focusOnMount: entry !== null && shown.id !== openedWith.current, answer: confirmed => entry && onSettle(entry.id, confirmed) }) }, shown.id)) }) }, session.current));
64
+ };
65
+ //# sourceMappingURL=confirmDialogView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmDialogView.js","sourceRoot":"","sources":["../../src/primitives/confirmDialogView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAc,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AA0BpC,MAAM,aAAa,GAAG,CAAC,MAA0B,EAAE,KAAa,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC;AAS5H,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAA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I,WAAW,EAAE,WAAW;oBAAE,WAAW,CAAC,KAAK,EAAE,CAAC;YACpD,CAAC,YAEA,KAAK,IAAI,CACR,KAAC,QAAQ,cACP,KAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,EAAE,KAAK,UAAU,CAAC,OAAO,EAC/D,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,GAC3D,IALW,KAAK,CAAC,EAAE,CAMZ,CACZ,GACa,IAlBL,OAAO,CAAC,OAAO,CAmBnB,CACV,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Whether a dialog or drawer description is phrasing content (a string or a number) that fits the `<p>` of
4
+ * `DialogDescription` / `SheetDescription`. Anything else (an element, a fragment, a list) may hold block content and
5
+ * is rendered with `asChild` in a `<div>` with the same classes and id, so no `<p>` nests in a `<p>`.
6
+ */
7
+ export declare const isInlineDescription: (description: ReactNode) => boolean;
8
+ //# sourceMappingURL=descriptionContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptionContent.d.ts","sourceRoot":"","sources":["../../src/primitives/descriptionContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,aAAa,SAAS,KAAG,OACO,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether a dialog or drawer description is phrasing content (a string or a number) that fits the `<p>` of
3
+ * `DialogDescription` / `SheetDescription`. Anything else (an element, a fragment, a list) may hold block content and
4
+ * is rendered with `asChild` in a `<div>` with the same classes and id, so no `<p>` nests in a `<p>`.
5
+ */
6
+ export const isInlineDescription = (description) => typeof description === 'string' || typeof description === 'number';
7
+ //# sourceMappingURL=descriptionContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptionContent.js","sourceRoot":"","sources":["../../src/primitives/descriptionContent.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAAsB,EAAW,EAAE,CACrE,OAAO,WAAW,KAAK,QAAQ,IAAI,OAAO,WAAW,KAAK,QAAQ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface FormActionsSlotProviderProps {
3
+ children?: ReactNode;
4
+ }
5
+ /**
6
+ * The scope of header slots for `FormActions`: wrap a page's header and its form (`EntityDetailShell
7
+ * formActionsSlot` brings its own). A `FormActions` below it portals into the slot closest above it; the nearest
8
+ * provider counts.
9
+ */
10
+ export declare const FormActionsSlotProvider: ({ children }: FormActionsSlotProviderProps) => import("react").JSX.Element;
11
+ export interface FormActionsSlotProps {
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Where a form's `FormActions` show in a header (`placement` `auto` or `header`): an empty element, hidden while empty,
16
+ * registered with the nearest `FormActionsSlotProvider`. Without a provider it stays empty.
17
+ */
18
+ export declare const FormActionsSlot: ({ className }: FormActionsSlotProps) => import("react").JSX.Element;
19
+ /**
20
+ * The slot for actions written at `anchor`: of the nearest provider's slots, the last one before the anchor in
21
+ * document order (the closest above the form). `null` without a provider, a slot or an anchor.
22
+ */
23
+ export declare const useFormActionsSlotFor: (anchor: Element | null) => HTMLElement | null;
24
+ //# sourceMappingURL=formActionsSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formActionsSlot.d.ts","sourceRoot":"","sources":["../../src/primitives/formActionsSlot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,SAAS,EAA+D,MAAM,OAAO,CAAC;AAYnH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,cAAc,4BAA4B,gCAQjF,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,eAAe,oBAAoB,gCAMlE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,OAAO,GAAG,IAAI,KAAG,WAAW,GAAG,IAW5E,CAAC"}
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useState } from 'react';
4
+ import { cn } from "./cn.js";
5
+ const FormActionsSlotContext = createContext(null);
6
+ /**
7
+ * The scope of header slots for `FormActions`: wrap a page's header and its form (`EntityDetailShell
8
+ * formActionsSlot` brings its own). A `FormActions` below it portals into the slot closest above it; the nearest
9
+ * provider counts.
10
+ */
11
+ export const FormActionsSlotProvider = ({ children }) => {
12
+ const [slots, setSlots] = useState([]);
13
+ const register = useCallback((slot) => {
14
+ setSlots(current => (current.includes(slot) ? current : [...current, slot]));
15
+ return () => setSlots(current => current.filter(candidate => candidate !== slot));
16
+ }, []);
17
+ const registry = useMemo(() => ({ slots, register }), [slots, register]);
18
+ return _jsx(FormActionsSlotContext.Provider, { value: registry, children: children });
19
+ };
20
+ /**
21
+ * Where a form's `FormActions` show in a header (`placement` `auto` or `header`): an empty element, hidden while empty,
22
+ * registered with the nearest `FormActionsSlotProvider`. Without a provider it stays empty.
23
+ */
24
+ export const FormActionsSlot = ({ className }) => {
25
+ const registry = useContext(FormActionsSlotContext);
26
+ const [element, setElement] = useState(null);
27
+ const register = registry?.register;
28
+ useLayoutEffect(() => (element && register ? register(element) : undefined), [element, register]);
29
+ return _jsx("div", { ref: setElement, "data-form-actions-slot": "", className: cn('flex items-center empty:hidden', className) });
30
+ };
31
+ /**
32
+ * The slot for actions written at `anchor`: of the nearest provider's slots, the last one before the anchor in
33
+ * document order (the closest above the form). `null` without a provider, a slot or an anchor.
34
+ */
35
+ export const useFormActionsSlotFor = (anchor) => {
36
+ const registry = useContext(FormActionsSlotContext);
37
+ if (!registry || !anchor)
38
+ return null;
39
+ let closest = null;
40
+ for (const slot of registry.slots) {
41
+ if (!slot.isConnected || slot.contains(anchor))
42
+ continue;
43
+ // the anchor follows the slot: the slot is above it
44
+ if (!(slot.compareDocumentPosition(anchor) & Node.DOCUMENT_POSITION_FOLLOWING))
45
+ continue;
46
+ if (!closest || closest.compareDocumentPosition(slot) & Node.DOCUMENT_POSITION_FOLLOWING)
47
+ closest = slot;
48
+ }
49
+ return closest;
50
+ };
51
+ //# sourceMappingURL=formActionsSlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formActionsSlot.js","sourceRoot":"","sources":["../../src/primitives/formActionsSlot.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAkB,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAQ7B,MAAM,sBAAsB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAC;AAMnF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,QAAQ,EAAgC,EAAE,EAAE;IACpF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,IAAiB,EAAE,EAAE;QACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,OAA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AC;IACvC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,SAAS;QACzD,oDAAoD;QACpD,IAAI,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC;YAAE,SAAS;QACzF,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,2BAA2B;YAAE,OAAO,GAAG,IAAI,CAAC;IAC3G,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -25,4 +25,6 @@ export * from './fieldSurface.js';
25
25
  export * from './textarea.js';
26
26
  export * from './segmented-control.js';
27
27
  export * from './link.js';
28
+ export { FormActionsSlot, FormActionsSlotProvider } from './formActionsSlot.js';
29
+ export type { FormActionsSlotProps, FormActionsSlotProviderProps } from './formActionsSlot.js';
28
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACjF,YAAY,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -26,4 +26,5 @@ export * from "./fieldSurface.js";
26
26
  export * from "./textarea.js";
27
27
  export * from "./segmented-control.js";
28
28
  export * from "./link.js";
29
+ export { FormActionsSlot, FormActionsSlotProvider } from "./formActionsSlot.js";
29
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,cAAc,YAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,iBAAkB,CAAC;AACjC,cAAc,aAAc,CAAC;AAC7B,cAAc,WAAY,CAAC;AAC3B,cAAc,eAAgB,CAAC;AAC/B,cAAc,kBAAmB,CAAC;AAClC,cAAc,YAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,gBAAiB,CAAC;AAChC,cAAc,YAAa,CAAC;AAC5B,cAAc,eAAgB,CAAC;AAC/B,cAAc,YAAa,CAAC;AAC5B,cAAc,cAAe,CAAC;AAC9B,cAAc,cAAe,CAAC;AAC9B,cAAc,aAAc,CAAC;AAC7B,cAAc,cAAe,CAAC;AAC9B,cAAc,oBAAqB,CAAC;AACpC,cAAc,aAAc,CAAC;AAC7B,cAAc,aAAc,CAAC;AAC7B,cAAc,aAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAgB,CAAC;AAC/B,cAAc,wBAAyB,CAAC;AACxC,cAAc,WAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,cAAc,YAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,iBAAkB,CAAC;AACjC,cAAc,aAAc,CAAC;AAC7B,cAAc,WAAY,CAAC;AAC3B,cAAc,eAAgB,CAAC;AAC/B,cAAc,kBAAmB,CAAC;AAClC,cAAc,YAAa,CAAC;AAC5B,cAAc,YAAa,CAAC;AAC5B,cAAc,gBAAiB,CAAC;AAChC,cAAc,YAAa,CAAC;AAC5B,cAAc,eAAgB,CAAC;AAC/B,cAAc,YAAa,CAAC;AAC5B,cAAc,cAAe,CAAC;AAC9B,cAAc,cAAe,CAAC;AAC9B,cAAc,aAAc,CAAC;AAC7B,cAAc,cAAe,CAAC;AAC9B,cAAc,oBAAqB,CAAC;AACpC,cAAc,aAAc,CAAC;AAC7B,cAAc,aAAc,CAAC;AAC7B,cAAc,aAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAgB,CAAC;AAC/B,cAAc,wBAAyB,CAAC;AACxC,cAAc,WAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,sBAAuB,CAAC"}
@@ -2,8 +2,9 @@ import type { AdminUiProviderProps } from './types.js';
2
2
  /**
3
3
  * The one provider of the package: registers the host's notification adapter, feeds the translation store from a
4
4
  * host store, renders the tooltip provider and the portal container, and hands the host adapters (storage keys,
5
- * router hooks, upload, markdown editor, AI translation) to packaged screens through `useAdminUi()`, and sets the link
6
- * component of every block (`linkComponent`). Blocks never read `useAdminUi()`: they take adapters as props.
5
+ * router hooks, upload, markdown editor, AI translation) to packaged screens through `useAdminUi()`, sets the link
6
+ * component of every block (`linkComponent`), and answers `useConfirm()` (the package dialog, or the host's `confirm`).
7
+ * Blocks never read `useAdminUi()`: they take adapters as props.
7
8
  */
8
- export declare const AdminUiProvider: ({ children, translations, notifications, storageKey, useUrlStateAdapter, useDrawerUrlAdapter, portalContainer, tooltipDelayMs, upload, renderMarkdownEditor, aiTranslation, preserveSearchParams, linkComponent, }: AdminUiProviderProps) => import("react").JSX.Element;
9
+ export declare const AdminUiProvider: ({ children, translations, notifications, storageKey, useUrlStateAdapter, useDrawerUrlAdapter, portalContainer, tooltipDelayMs, upload, renderMarkdownEditor, aiTranslation, preserveSearchParams, linkComponent, confirm: hostConfirm, }: AdminUiProviderProps) => import("react").JSX.Element;
9
10
  //# sourceMappingURL=AdminUiProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminUiProvider.d.ts","sourceRoot":"","sources":["../../src/provider/AdminUiProvider.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAuB,oBAAoB,EAAsB,MAAM,YAAY,CAAC;AAgBhG;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,oNAc7B,oBAAoB,gCA+BtB,CAAC"}
1
+ {"version":3,"file":"AdminUiProvider.d.ts","sourceRoot":"","sources":["../../src/provider/AdminUiProvider.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAuB,oBAAoB,EAAsB,MAAM,YAAY,CAAC;AAehG;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,0OAe7B,oBAAoB,gCAqCtB,CAAC"}
@@ -1,12 +1,15 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, useLayoutEffect, useMemo } from 'react';
3
+ import { useEffect, useLayoutEffect, useMemo, useState } from 'react';
4
4
  import { setTranslations } from "../i18n/store.js";
5
+ import { createConfirmQueue } from "../logic/pure/confirmQueue.js";
5
6
  import { setNotificationAdapter } from "../logic/pure/notify.js";
7
+ import { ConfirmContext } from "../logic/react/useConfirm.js";
6
8
  import { LinkComponentProvider } from "../primitives/link.js";
7
9
  import { PortalContainerProvider } from "../primitives/portal.js";
8
10
  import { TooltipProvider } from "../primitives/tooltip.js";
9
11
  import { AdminUiContext } from "./adminUiContext.js";
12
+ import { ConfirmHost } from "./ConfirmHost.js";
10
13
  import { defaultStorageKey } from "./storageKey.js";
11
14
  /** Keeps the package's translation store on the host store's current snapshot. */
12
15
  const TranslationBridge = ({ adapter }) => {
@@ -23,10 +26,13 @@ const TranslationBridge = ({ adapter }) => {
23
26
  /**
24
27
  * The one provider of the package: registers the host's notification adapter, feeds the translation store from a
25
28
  * host store, renders the tooltip provider and the portal container, and hands the host adapters (storage keys,
26
- * router hooks, upload, markdown editor, AI translation) to packaged screens through `useAdminUi()`, and sets the link
27
- * component of every block (`linkComponent`). Blocks never read `useAdminUi()`: they take adapters as props.
29
+ * router hooks, upload, markdown editor, AI translation) to packaged screens through `useAdminUi()`, sets the link
30
+ * component of every block (`linkComponent`), and answers `useConfirm()` (the package dialog, or the host's `confirm`).
31
+ * Blocks never read `useAdminUi()`: they take adapters as props.
28
32
  */
29
- export const AdminUiProvider = ({ children, translations, notifications, storageKey = defaultStorageKey, useUrlStateAdapter, useDrawerUrlAdapter, portalContainer, tooltipDelayMs, upload, renderMarkdownEditor, aiTranslation, preserveSearchParams, linkComponent, }) => {
33
+ export const AdminUiProvider = ({ children, translations, notifications, storageKey = defaultStorageKey, useUrlStateAdapter, useDrawerUrlAdapter, portalContainer, tooltipDelayMs, upload, renderMarkdownEditor, aiTranslation, preserveSearchParams, linkComponent, confirm: hostConfirm, }) => {
34
+ const [confirmQueue] = useState(() => createConfirmQueue());
35
+ const confirm = hostConfirm ?? confirmQueue.request;
30
36
  // A layout effect: registered before any child's ordinary effect can raise a toast.
31
37
  useLayoutEffect(() => {
32
38
  if (!notifications)
@@ -43,6 +49,6 @@ export const AdminUiProvider = ({ children, translations, notifications, storage
43
49
  aiTranslation,
44
50
  preserveSearchParams,
45
51
  }), [storageKey, useUrlStateAdapter, useDrawerUrlAdapter, upload, renderMarkdownEditor, aiTranslation, preserveSearchParams]);
46
- return (_jsxs(AdminUiContext.Provider, { value: value, children: [translations && _jsx(TranslationBridge, { adapter: translations }), _jsx(TooltipProvider, { delayDuration: tooltipDelayMs, children: _jsx(PortalContainerProvider, { container: portalContainer, children: linkComponent ? _jsx(LinkComponentProvider, { linkComponent: linkComponent, children: children }) : children }) })] }));
52
+ return (_jsxs(AdminUiContext.Provider, { value: value, children: [translations && _jsx(TranslationBridge, { adapter: translations }), _jsx(TooltipProvider, { delayDuration: tooltipDelayMs, children: _jsx(PortalContainerProvider, { container: portalContainer, children: _jsxs(ConfirmContext.Provider, { value: confirm, children: [linkComponent ? _jsx(LinkComponentProvider, { linkComponent: linkComponent, children: children }) : children, hostConfirm ? null : _jsx(ConfirmHost, { queue: confirmQueue })] }) }) })] }));
47
53
  };
48
54
  //# sourceMappingURL=AdminUiProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminUiProvider.js","sourceRoot":"","sources":["../../src/provider/AdminUiProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAwB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAA0B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAmC,EAAE,EAAE;IACzE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACvC,eAAe,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvF,CAAC,CAAC;QACF,KAAK,EAAE,CAAC;QACR,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,OAAO,C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GAAyB,CAAC,CAAC,CAAC,QAAQ,EAClH,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,YAAY,GAAI,IAClC,GACF,GACV,IACM,CAC3B,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ConfirmQueue } from '../logic/pure/confirmQueue.js';
2
+ import type { ConfirmOptions } from '../logic/pure/confirm.js';
3
+ /**
4
+ * The provider's confirmation dialog: shows the queue's oldest pending call. While mounted the queue takes calls; on
5
+ * unmount every pending call settles with `false` (Strict Mode's second mount takes calls again).
6
+ */
7
+ export declare const ConfirmHost: ({ queue }: {
8
+ queue: ConfirmQueue<ConfirmOptions>;
9
+ }) => import("react").JSX.Element;
10
+ //# sourceMappingURL=ConfirmHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmHost.d.ts","sourceRoot":"","sources":["../../src/provider/ConfirmHost.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,WAAW;IAAE,KAAK,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAAE,gCAQ7E,CAAC"}
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useSyncExternalStore } from 'react';
4
+ import { ConfirmDialogView } from "../primitives/confirmDialogView.js";
5
+ const NO_ENTRY = () => null;
6
+ /**
7
+ * The provider's confirmation dialog: shows the queue's oldest pending call. While mounted the queue takes calls; on
8
+ * unmount every pending call settles with `false` (Strict Mode's second mount takes calls again).
9
+ */
10
+ export const ConfirmHost = ({ queue }) => {
11
+ useEffect(() => {
12
+ queue.activate();
13
+ return () => queue.deactivate();
14
+ }, [queue]);
15
+ const entry = useSyncExternalStore(queue.subscribe, queue.current, NO_ENTRY);
16
+ const settle = useCallback((id, confirmed) => void queue.settle(id, confirmed), [queue]);
17
+ return _jsx(ConfirmDialogView, { entry: entry, onSettle: settle });
18
+ };
19
+ //# sourceMappingURL=ConfirmHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmHost.js","sourceRoot":"","sources":["../../src/provider/ConfirmHost.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAqC,CAAC;AAExE,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAE5B;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAA2C,EAAE,EAAE;IAChF,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,EAAU,EAAE,SAAkB,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1G,OAAO,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAI,CAAC;AAC/D,CAAC,CAAC"}
@@ -2,6 +2,7 @@ import type { TranslationsStore } from '@mgamadeus/ddd-web/contract';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { WritingStyle } from '../i18n/store.js';
4
4
  import type { NotificationAdapter } from '../logic/pure/notify.js';
5
+ import type { ConfirmOptions } from '../logic/pure/confirm.js';
5
6
  import type { EntityDrawerUrlAdapter } from '../logic/pure/entityDrawer.js';
6
7
  import type { UrlStateAdapter } from '../logic/pure/urlListState.js';
7
8
  import type { MediaUploadAdapter } from '../media/types.js';
@@ -59,6 +60,11 @@ export interface AdminUiProviderProps {
59
60
  * `linkComponent` prop still wins. Wrap the router link with `withStickyParams` to keep sticky search parameters.
60
61
  */
61
62
  linkComponent?: PageLinkComponent;
63
+ /**
64
+ * The host's confirmation service behind `useConfirm()` (`(options) => Promise<boolean>`, a stable function); the
65
+ * package dialog does not render then. Absent: the package dialog, one confirmation after the other.
66
+ */
67
+ confirm?: (options: ConfirmOptions) => Promise<boolean>;
62
68
  }
63
69
  export interface AdminUiContextValue extends Required<Pick<AdminUiProviderProps, 'storageKey'>> {
64
70
  useUrlStateAdapter?: UseUrlStateAdapter;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEzF,YAAY,EAAE,mBAAmB,EAA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F;IAC5F,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,2EAA2E;IAC3E,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,SAAS,CAAC;IACrE,mCAAmC;IACnC,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;OAGG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;IAC7F,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;IACpE,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C"}
@@ -9,7 +9,7 @@ export const SHOWCASE_COVERAGE = {
9
9
  'CommandShortcut', 'Dialog', 'DialogClose', 'DialogContent', 'DialogDescription', 'DialogFooter', 'DialogHeader',
10
10
  'DialogTitle', 'DialogTrigger', 'DropdownMenu', 'DropdownMenuCheckboxItem', 'DropdownMenuContent', 'DropdownMenuGroup',
11
11
  'DropdownMenuItem', 'DropdownMenuLabel', 'DropdownMenuSeparator', 'DropdownMenuSub', 'DropdownMenuSubContent',
12
- 'DropdownMenuSubTrigger', 'DropdownMenuTrigger', 'Input', 'Label', 'Popover', 'PopoverAnchor', 'PopoverContent',
12
+ 'DropdownMenuSubTrigger', 'DropdownMenuTrigger', 'FormActionsSlot', 'FormActionsSlotProvider', 'Input', 'Label', 'Popover', 'PopoverAnchor', 'PopoverContent',
13
13
  'PopoverDescription', 'PopoverHeader', 'PopoverTitle', 'PopoverTrigger', 'PortalContainerProvider', 'SegmentedControl',
14
14
  'Select', 'SelectContent', 'SelectGroup', 'SelectItem', 'SelectLabel', 'SelectSeparator', 'SelectTrigger', 'SelectValue',
15
15
  'Separator', 'Sheet', 'SheetClose', 'SheetContent', 'SheetDescription', 'SheetFooter', 'SheetHeader', 'SheetTitle',
@@ -48,7 +48,7 @@ export const SHOWCASE_COVERAGE = {
48
48
  },
49
49
  form: {
50
50
  shown: [
51
- 'DrawerFooter', 'Form', 'FormActions', 'FormDrawer', 'FormErrors', 'FormField', 'FormFieldFrame', 'FormHeader',
51
+ 'DrawerFooter', 'Form', 'FormActions', 'FormDialog', 'FormDrawer', 'FormErrors', 'FormField', 'FormFieldFrame', 'FormHeader',
52
52
  'FormJumpBar', 'FormSection', 'FormSubmitButton', 'FormWrapper', 'VisibleWhen',
53
53
  ],
54
54
  notShown: { UnsavedChangesContext: 'a context (used by FormDrawer)' },
@@ -1 +1 @@
1
- {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/showcase/coverage.ts"],"names":[],"mappings":"AAUA,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,YAAY,KAAK,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAoD;IAChF,UAAU,EAAE;QACV,KAAK,EAAE;YACL,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,oBAAoB,E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ACD,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,uBAAuB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,sBAAsB;YACrH,qBAAqB;SACtB;QACD,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,cAAc,CAAC;QACxF,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,CAAC;QACtF,QAAQ,EAAE,EAAE;KACb;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE,eAAe,EAAE,uCAAuC,EAAE;KACvE;IACD,eAAe,EAAE;QACf,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE,OAAO,EAAE,gFAAgF,EAAE;KACxG;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormShowcase.d.ts","sourceRoot":"","sources":["../../../src/showcase/sections/FormShowcase.tsx"],"names":[],"mappings":"AAuFA,4BAA4B;AAC5B,eAAO,MAAM,YAAY,mCAyBxB,CAAC"}
1
+ {"version":3,"file":"FormShowcase.d.ts","sourceRoot":"","sources":["../../../src/showcase/sections/FormShowcase.tsx"],"names":[],"mappings":"AAwOA,4BAA4B;AAC5B,eAAO,MAAM,YAAY,mCAqCxB,CAAC"}
@@ -1,10 +1,12 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
4
  import { useForm } from 'react-hook-form';
5
- import { DrawerFooter, Form, FORM_PANEL_SCROLL_MARGIN_CLASS, FormActions, FormDrawer, FormErrors, FormField, FormFieldFrame, FormHeader, FormJumpBar, FormSection, FormSubmitButton, FormWrapper, VisibleWhen, } from "../../form/index.js";
6
- import { fieldEquals } from "../../logic/index.js";
7
- import { Button, Input, Switch } from "../../primitives/index.js";
5
+ import { EntityListBulkBar } from "../../list/index.js";
6
+ import { AddEntityButton } from "../../page/index.js";
7
+ import { DrawerFooter, Form, FORM_PANEL_SCROLL_MARGIN_CLASS, FormActions, FormDialog, FormDrawer, FormErrors, FormField, FormFieldFrame, FormHeader, FormJumpBar, FormSection, FormSubmitButton, FormWrapper, VisibleWhen, } from "../../form/index.js";
8
+ import { fieldEquals, useConfirm, WriteAccessProvider } from "../../logic/index.js";
9
+ import { Button, FormActionsSlotProvider, Input, Label, Switch } from "../../primitives/index.js";
8
10
  import { Sample, Samples } from "./PrimitivesShowcase.js";
9
11
  const SERVER_ERROR = {
10
12
  message: 'Could not save',
@@ -18,9 +20,43 @@ const ShowcaseFormBody = ({ idPrefix, onClose }) => {
18
20
  { id: `${idPrefix}-details`, label: 'Details' },
19
21
  ] }), _jsx("div", { id: `${idPrefix}-general`, className: FORM_PANEL_SCROLL_MARGIN_CLASS, children: _jsxs(FormSection, { title: "General", description: "The basics.", children: [_jsx(FormField, { name: "name", label: "Name", required: true, description: "Shown in lists.", children: ({ field, control, disabled }) => _jsx(Input, { ...control, ...field, disabled: disabled }) }), _jsx(FormField, { name: "email", label: "Email", children: ({ field, control }) => _jsx(Input, { ...control, ...field, type: "email" }) })] }) }), _jsx("div", { id: `${idPrefix}-details`, className: FORM_PANEL_SCROLL_MARGIN_CLASS, children: _jsxs(FormSection, { title: "Details", children: [_jsx(FormField, { name: "hasNote", label: "Add a note", children: ({ field, control }) => _jsx(Switch, { id: control.id, checked: field.value, onCheckedChange: field.onChange }) }), _jsx(VisibleWhen, { condition: fieldEquals('hasNote', true), children: _jsx(FormField, { name: "note", label: "Note", children: ({ field, control }) => _jsx(Input, { ...control, ...field }) }) }), _jsx(FormFieldFrame, { label: "Unbound field", description: "FormFieldFrame outside a form value.", children: control => _jsx(Input, { ...control, placeholder: "Free input" }) })] }) }), _jsx(FormActions, { sticky: false, secondary: _jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: "Cancel" }), primary: _jsx(FormSubmitButton, { children: "Save" }) })] }));
20
22
  };
23
+ const FormDialogSample = () => {
24
+ const [open, setOpen] = useState(false);
25
+ const [plainOpen, setPlainOpen] = useState(false);
26
+ const [plainName, setPlainName] = useState('');
27
+ const [pending, setPending] = useState(false);
28
+ const form = useForm({ defaultValues: { name: 'Sample' } });
29
+ const save = () => {
30
+ setPending(true);
31
+ window.setTimeout(() => {
32
+ setPending(false);
33
+ setOpen(false);
34
+ }, 600);
35
+ };
36
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => setOpen(true), children: "Open form dialog" }), _jsx(FormDialog, { open: open, onOpenChange: setOpen, title: "Rename item", description: "A react-hook-form instance, so FormField works inside.", form: form, onSubmit: save, submitLabel: "Save", pendingLabel: "Saving\u2026", isPending: pending, isDirty: form.formState.isDirty, children: _jsx(FormField, { name: "name", label: "Name", required: true, children: ({ field, control }) => _jsx(Input, { ...control, ...field }) }) }), _jsx(Button, { variant: "outline", onClick: () => setPlainOpen(true), children: "Open plain form dialog" }), _jsx(FormDialog, { open: plainOpen, onOpenChange: setPlainOpen, title: "Delete item", description: "No form library: plain state.", onSubmit: () => setPlainOpen(false), submitLabel: "Delete", submitVariant: "destructive", submitDisabled: plainName.trim() === '', isPending: false, children: _jsxs("div", { className: "grid gap-2", children: [_jsx(Label, { htmlFor: "showcase-form-dialog-reason", children: "Reason" }), _jsx(Input, { id: "showcase-form-dialog-reason", value: plainName, onChange: event => setPlainName(event.target.value) })] }) })] }));
37
+ };
38
+ const ConfirmSample = () => {
39
+ const confirm = useConfirm();
40
+ const [answer, setAnswer] = useState('–');
41
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: async () => setAnswer(String(await confirm({ title: 'Archive item?', description: 'It leaves the active list.', confirmLabel: 'Archive' }))), children: "useConfirm()" }), _jsx(Button, { variant: "outline", onClick: async () => setAnswer(String(await confirm({
42
+ title: 'Delete “Main site”?',
43
+ description: 'This cannot be undone.',
44
+ confirmLabel: 'Delete',
45
+ confirmVariant: 'destructive',
46
+ requirePhrase: 'Main site',
47
+ }))), children: "With a phrase" }), _jsxs("span", { className: "self-center text-sm text-muted-foreground", children: ["Answer: ", answer] })] }));
48
+ };
49
+ const HeaderSlotSample = () => {
50
+ const form = useForm({ defaultValues: { name: 'Sample' } });
51
+ return (_jsx(FormActionsSlotProvider, { children: _jsxs("div", { className: "w-full space-y-4", children: [_jsx(FormHeader, { title: "Edit item", description: "The actions sit in the header.", formActionsSlot: true }), _jsxs(Form, { form: form, onSubmit: () => form.reset(form.getValues()), children: [_jsx(FormSection, { title: "General", children: _jsx(FormField, { name: "name", label: "Name", children: ({ field, control }) => _jsx(Input, { ...control, ...field }) }) }), _jsx(FormActions, { placement: "header", primary: _jsx(FormSubmitButton, { children: "Save" }) })] })] }) }));
52
+ };
53
+ const WriteAccessSample = () => {
54
+ const form = useForm({ defaultValues: { name: 'Sample' } });
55
+ return (_jsx(WriteAccessProvider, { value: { allowed: false, reason: 'This workspace is read-only' }, children: _jsxs("div", { className: "flex w-full flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(AddEntityButton, { entity: "Item", onClick: () => { } }), _jsx(AddEntityButton, { entity: "Item", href: "#create" })] }), _jsx(EntityListBulkBar, { selection: { count: 2, clear: () => { } }, actions: [{ id: 'export', label: 'Export', onClick: () => { }, ignoreWriteAccess: true }], onDelete: () => { } }), _jsx(Form, { form: form, onSubmit: () => { }, children: _jsxs("div", { className: "flex gap-2", children: [_jsx(FormSubmitButton, { children: "Save" }), _jsx(FormSubmitButton, { ignoreWriteAccess: true, children: "Preview" })] }) })] }) }));
56
+ };
21
57
  /** The `./form` section. */
22
58
  export const FormShowcase = () => {
23
59
  const [open, setOpen] = useState(false);
24
- return (_jsxs(Samples, { children: [_jsx(Sample, { title: "FormWrapper, FormHeader, Form, FormJumpBar, FormSection, FormField, FormErrors, FormActions", children: _jsxs("div", { className: "w-full", children: [_jsx(FormHeader, { title: "Edit item", description: "A form page." }), _jsx(FormWrapper, { children: _jsx(ShowcaseFormBody, { idPrefix: "showcase-form-page" }) })] }) }), _jsxs(Sample, { title: "FormDrawer, DrawerFooter", children: [_jsx(Button, { variant: "outline", onClick: () => setOpen(true), children: "Open form drawer" }), _jsxs(FormDrawer, { open: open, onClose: () => setOpen(false), title: "Edit item", metadata: { id: 42 }, children: [_jsx(ShowcaseFormBody, { idPrefix: "showcase-form-drawer", onClose: () => setOpen(false) }), _jsx(DrawerFooter, { children: _jsx("span", { className: "text-xs text-muted-foreground", children: "DrawerFooter content" }) })] })] })] }));
60
+ return (_jsxs(Samples, { children: [_jsx(Sample, { title: "FormWrapper, FormHeader, Form, FormJumpBar, FormSection, FormField, FormErrors, FormActions", children: _jsxs("div", { className: "w-full", children: [_jsx(FormHeader, { title: "Edit item", description: "A form page." }), _jsx(FormWrapper, { children: _jsx(ShowcaseFormBody, { idPrefix: "showcase-form-page" }) })] }) }), _jsxs(Sample, { title: "FormDrawer, DrawerFooter", children: [_jsx(Button, { variant: "outline", onClick: () => setOpen(true), children: "Open form drawer" }), _jsxs(FormDrawer, { open: open, onClose: () => setOpen(false), title: "Edit item", metadata: { id: 42 }, children: [_jsx(ShowcaseFormBody, { idPrefix: "showcase-form-drawer", onClose: () => setOpen(false) }), _jsx(DrawerFooter, { children: _jsx("span", { className: "text-xs text-muted-foreground", children: "DrawerFooter content" }) })] })] }), _jsx(Sample, { title: "FormDialog", children: _jsx(FormDialogSample, {}) }), _jsx(Sample, { title: "useConfirm (./logic, drawn by AdminUiProvider)", children: _jsx(ConfirmSample, {}) }), _jsx(Sample, { title: "FormActionsSlotProvider, FormActionsSlot, FormActions placement header", children: _jsx(HeaderSlotSample, {}) }), _jsx(Sample, { title: "WriteAccessProvider (./logic): write controls off, links and reads stay", children: _jsx(WriteAccessSample, {}) })] }));
25
61
  };
26
62
  //# sourceMappingURL=FormShowcase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormShowcase.js","sourceRoot":"","sources":["../../../src/showcase/sections/FormShowcase.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,8BAA8B,EAC9B,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAwB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAA0B,CAAC;AAS3D,MAAM,YAAY,GAAoB;IACpC,OAAO,EAAE,gBAAgB;IACzB,gBAAgB,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,CAAC;CACrG,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAA8C,EAAE,EAAE;IAC7F,MAAM,IAAI,GAAG,OAAO,CAAqB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAClI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAyB,IAAI,CAAC,CAAC;IACjE,OAAO,CACL,MAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,E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C,WAAW,EAAC,cAAc,GAAG,EAC3D,KAAC,WAAW,cACV,KAAC,gBAAgB,IAAC,QAAQ,EAAC,oBAAoB,GAAG,GACtC,IACV,GACC,EACT,MAAC,MAAM,IAAC,KAAK,EAAC,0BAA0B,aACtC,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,iCAE7C,EACT,MAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,aAC3F,KAAC,gBAAgB,IAAC,QAAQ,EAAC,sBAAsB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,EACnF,KAAC,YAAY,cACX,eAAM,SAAS,EAAC,+BAA+B,qCAA4B,GAC9D,IACJ,IACN,EACT,KAAC,MAAM,IAAC,KAAK,EAAC,YAAY,YACxB,KAAC,gBAAgB,KAAG,GACb,EACT,KAAC,MAAM,IAAC,KAAK,EAAC,gDAAgD,YAC5D,KAAC,aAAa,KAAG,GACV,EACT,KAAC,MAAM,IAAC,KAAK,EAAC,wEAAwE,YACpF,KAAC,gBAAgB,KAAG,GACb,EACT,KAAC,MAAM,IAAC,KAAK,EAAC,yEAAyE,YACrF,KAAC,iBAAiB,KAAG,GACd,IACD,CACX,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgamadeus/ddd-admin-ui",
3
- "version": "0.1.0-rc.5",
3
+ "version": "0.1.0",
4
4
  "description": "Admin UI building blocks for React 19 / Next 16 / Tailwind 4 apps on @mgamadeus/ddd-web: entity lists (table and card grid, filters, selection, bulk actions), page frames and detail shells, form shells with conditional fields and server validation, translatable inputs, media pickers, Next adapters, a provider, and the shadcn-style primitives they are drawn with, plus two stylesheets and two JSON manifests.",
5
5
  "keywords": [
6
6
  "ddd",
@@ -155,6 +155,6 @@
155
155
  "test": "node --experimental-strip-types --no-warnings --test \"src/**/*.test.ts\" \"test/unit/**/*.test.ts\" \"test/check-package/**/*.test.ts\"",
156
156
  "check-package": "node scripts/check-package.mjs --dir .",
157
157
  "i18n:manifest": "node scripts/build-i18n-manifest.mjs",
158
- "test:render": "node test/consumer/fixtures/plain/list-snapshot.mjs && node test/consumer/fixtures/plain/status-context.mjs && node test/consumer/fixtures/plain/showcase-render.mjs && node test/consumer/fixtures/plain/sticky-links.mjs"
158
+ "test:render": "node test/consumer/fixtures/plain/list-snapshot.mjs && node test/consumer/fixtures/plain/form-actions-snapshot.mjs && node test/consumer/fixtures/plain/write-access.mjs && node test/consumer/fixtures/plain/status-context.mjs && node test/consumer/fixtures/plain/showcase-render.mjs && node test/consumer/fixtures/plain/sticky-links.mjs"
159
159
  }
160
160
  }