@lattice-php/lattice 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action/components/action-form.d.ts +6 -1
- package/dist/action/components/action-form.js +34 -49
- package/dist/action/components/action-form.js.map +1 -1
- package/dist/action/components/action-trigger-provider.d.ts +1 -1
- package/dist/action/components/action-trigger-provider.js.map +1 -1
- package/dist/action/hooks/use-action.d.ts +1 -1
- package/dist/action/hooks/use-action.js +3 -1
- package/dist/action/hooks/use-action.js.map +1 -1
- package/dist/action/index.d.ts +0 -2
- package/dist/action/index.js +1 -2
- package/dist/chat/plugin.d.ts +0 -1
- package/dist/chat/plugin.js.map +1 -1
- package/dist/clipboard/index.d.ts +0 -4
- package/dist/clipboard/index.js +1 -15
- package/dist/{events → core}/event-names.js +1 -1
- package/dist/core/event-names.js.map +1 -0
- package/dist/core/hooks/use-window-event.d.ts +8 -0
- package/dist/core/hooks/use-window-event.js +22 -0
- package/dist/core/hooks/use-window-event.js.map +1 -0
- package/dist/core/index.js +1 -1
- package/dist/core/types.d.ts +8 -61
- package/dist/create-app.d.ts +31 -3
- package/dist/create-app.js +48 -10
- package/dist/create-app.js.map +1 -1
- package/dist/effects/dispatch.js +1 -1
- package/dist/effects/dispatch.js.map +1 -1
- package/dist/effects/registry.d.ts +2 -18
- package/dist/effects/registry.js +5 -9
- package/dist/effects/registry.js.map +1 -1
- package/dist/event-bridge.js +10 -23
- package/dist/event-bridge.js.map +1 -1
- package/dist/form/components/base/field.d.ts +2 -2
- package/dist/form/components/base/field.js +2 -2
- package/dist/form/components/base/field.js.map +1 -1
- package/dist/form/components/fields/color-picker-field.d.ts +2 -0
- package/dist/form/components/fields/color-picker-field.js +57 -0
- package/dist/form/components/fields/color-picker-field.js.map +1 -0
- package/dist/form/components/fields/date-input.js +1 -1
- package/dist/form/components/fields/date-time-input.js +1 -1
- package/dist/form/components/fields/file-upload.js +11 -18
- package/dist/form/components/fields/file-upload.js.map +1 -1
- package/dist/form/components/fields/number-input.js +1 -1
- package/dist/form/components/fields/rich-editor-field.js +35 -276
- package/dist/form/components/fields/rich-editor-field.js.map +1 -1
- package/dist/form/components/fields/row-action-menu.js +2 -2
- package/dist/form/components/fields/row-action-menu.js.map +1 -1
- package/dist/form/components/fields/row-actions.js +3 -1
- package/dist/form/components/fields/row-actions.js.map +1 -1
- package/dist/form/components/fields/select.js +60 -17
- package/dist/form/components/fields/select.js.map +1 -1
- package/dist/form/components/fields/table-rows.js +5 -17
- package/dist/form/components/fields/table-rows.js.map +1 -1
- package/dist/form/components/fields/text-input.js +8 -1
- package/dist/form/components/fields/text-input.js.map +1 -1
- package/dist/form/components/fields/time-input.js +1 -1
- package/dist/form/components/form.js +8 -23
- package/dist/form/components/form.js.map +1 -1
- package/dist/form/components/index.d.ts +1 -0
- package/dist/form/components/index.js +2 -1
- package/dist/form/embed.d.ts +5 -0
- package/dist/form/embed.js +4 -1
- package/dist/form/hooks/use-form-resolver.js.map +1 -1
- package/dist/form/index.js +2 -1
- package/dist/form/lib/collect-fields.d.ts +7 -0
- package/dist/form/lib/collect-fields.js +19 -0
- package/dist/form/lib/collect-fields.js.map +1 -0
- package/dist/form/lib/conditions.d.ts +4 -10
- package/dist/form/lib/conditions.js.map +1 -1
- package/dist/form/lib/field-errors.d.ts +3 -0
- package/dist/form/lib/field-errors.js +11 -0
- package/dist/form/lib/field-errors.js.map +1 -0
- package/dist/form/lib/field-props.d.ts +4 -18
- package/dist/form/lib/field-props.js.map +1 -1
- package/dist/form/plugin.js +2 -0
- package/dist/form/plugin.js.map +1 -1
- package/dist/form/rich-editor/builtins.d.ts +6 -0
- package/dist/form/rich-editor/builtins.js +400 -0
- package/dist/form/rich-editor/builtins.js.map +1 -0
- package/dist/form/rich-editor/index.d.ts +7 -0
- package/dist/form/rich-editor/index.js +3 -0
- package/dist/form/rich-editor/registry.d.ts +67 -0
- package/dist/form/rich-editor/registry.js +79 -0
- package/dist/form/rich-editor/registry.js.map +1 -0
- package/dist/form/rich-editor/toolbar-button.d.ts +12 -0
- package/dist/form/rich-editor/toolbar-button.js +28 -0
- package/dist/form/rich-editor/toolbar-button.js.map +1 -0
- package/dist/form/types.d.ts +1 -6
- package/dist/format/date-time.d.ts +3 -2
- package/dist/format/date-time.js.map +1 -1
- package/dist/format/format-context.d.ts +6 -0
- package/dist/format/format-context.js +17 -0
- package/dist/format/format-context.js.map +1 -0
- package/dist/i18n/date-time.d.ts +3 -2
- package/dist/i18n/date-time.js.map +1 -1
- package/dist/i18n/index.js +3 -2
- package/dist/i18n/locale-reload.d.ts +1 -1
- package/dist/i18n/locale-reload.js +7 -6
- package/dist/i18n/locale-reload.js.map +1 -1
- package/dist/i18n/locale.js +1 -1
- package/dist/i18n/locale.js.map +1 -1
- package/dist/i18n/page-props.d.ts +3 -2
- package/dist/i18n/page-props.js +1 -15
- package/dist/i18n/page-props.js.map +1 -1
- package/dist/i18n/shared-props.d.ts +7 -0
- package/dist/i18n/shared-props.js +23 -0
- package/dist/i18n/shared-props.js.map +1 -0
- package/dist/i18n/timezone.js +1 -1
- package/dist/i18n/timezone.js.map +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.js +5 -5
- package/dist/lattice.css +212 -47
- package/dist/layout/components/breadcrumbs.js +3 -1
- package/dist/layout/components/breadcrumbs.js.map +1 -1
- package/dist/layout/components/sidebar.js +15 -48
- package/dist/layout/components/sidebar.js.map +1 -1
- package/dist/layout/plugin.d.ts +0 -1
- package/dist/layout/plugin.js.map +1 -1
- package/dist/lib/color.d.ts +9 -0
- package/dist/lib/color.js +48 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/is-truthy.d.ts +2 -0
- package/dist/lib/is-truthy.js +9 -0
- package/dist/lib/is-truthy.js.map +1 -0
- package/dist/lib/use-debounced-callback.d.ts +10 -0
- package/dist/lib/use-debounced-callback.js +34 -0
- package/dist/lib/use-debounced-callback.js.map +1 -0
- package/dist/lib/use-media-query.d.ts +5 -0
- package/dist/lib/use-media-query.js +26 -0
- package/dist/lib/use-media-query.js.map +1 -0
- package/dist/lib/use-persistent-state.d.ts +13 -0
- package/dist/lib/use-persistent-state.js +62 -0
- package/dist/lib/use-persistent-state.js.map +1 -0
- package/dist/notifications/api.d.ts +6 -6
- package/dist/notifications/api.js.map +1 -1
- package/dist/notifications/components/notifications.js +3 -1
- package/dist/notifications/components/notifications.js.map +1 -1
- package/dist/notifications/plugin.d.ts +0 -1
- package/dist/notifications/plugin.js.map +1 -1
- package/dist/notifications/types.d.ts +2 -10
- package/dist/provider-base.js +1 -1
- package/dist/realtime/build-effects.js +5 -5
- package/dist/realtime/build-effects.js.map +1 -1
- package/dist/realtime/listeners.d.ts +2 -2
- package/dist/realtime/listeners.js +1 -1
- package/dist/realtime/listeners.js.map +1 -1
- package/dist/realtime/subscriptions.d.ts +2 -2
- package/dist/realtime/subscriptions.js.map +1 -1
- package/dist/registry.d.ts +5 -0
- package/dist/registry.js.map +1 -1
- package/dist/remote/components/data-list.js +1 -1
- package/dist/remote/plugin.d.ts +0 -1
- package/dist/remote/plugin.js.map +1 -1
- package/dist/table/components/bulk-bar.js +7 -5
- package/dist/table/components/bulk-bar.js.map +1 -1
- package/dist/table/components/cells/badge-cell.js +4 -1
- package/dist/table/components/cells/badge-cell.js.map +1 -1
- package/dist/table/components/cells/boolean-cell.js +4 -4
- package/dist/table/components/cells/boolean-cell.js.map +1 -1
- package/dist/table/components/cells/copyable-cell.d.ts +9 -0
- package/dist/table/components/cells/copyable-cell.js +17 -0
- package/dist/table/components/cells/copyable-cell.js.map +1 -0
- package/dist/table/components/cells/icon-cell.js +5 -2
- package/dist/table/components/cells/icon-cell.js.map +1 -1
- package/dist/table/components/cells/image-cell.js +8 -9
- package/dist/table/components/cells/image-cell.js.map +1 -1
- package/dist/table/components/cells/money-cell.js +7 -10
- package/dist/table/components/cells/money-cell.js.map +1 -1
- package/dist/table/components/cells/number-cell.js +14 -19
- package/dist/table/components/cells/number-cell.js.map +1 -1
- package/dist/table/components/cells/numeric-cell.d.ts +10 -0
- package/dist/table/components/cells/numeric-cell.js +25 -0
- package/dist/table/components/cells/numeric-cell.js.map +1 -0
- package/dist/table/components/cells/stack-cell.js +1 -1
- package/dist/table/components/cells/text-cell.js +8 -6
- package/dist/table/components/cells/text-cell.js.map +1 -1
- package/dist/table/components/column-filter-control.js +25 -32
- package/dist/table/components/column-filter-control.js.map +1 -1
- package/dist/table/components/column-header.d.ts +3 -3
- package/dist/table/components/column-header.js +5 -3
- package/dist/table/components/column-header.js.map +1 -1
- package/dist/table/components/column-visibility-menu.js +6 -11
- package/dist/table/components/column-visibility-menu.js.map +1 -1
- package/dist/table/components/filter-bar.d.ts +2 -2
- package/dist/table/components/filter-bar.js +13 -22
- package/dist/table/components/filter-bar.js.map +1 -1
- package/dist/table/components/filter-controls.d.ts +2 -1
- package/dist/table/components/filter-controls.js +37 -38
- package/dist/table/components/filter-controls.js.map +1 -1
- package/dist/table/components/filter-value-input.d.ts +0 -1
- package/dist/table/components/filter-value-input.js +21 -20
- package/dist/table/components/filter-value-input.js.map +1 -1
- package/dist/table/components/pagination.js +16 -20
- package/dist/table/components/pagination.js.map +1 -1
- package/dist/table/components/sort-bar.d.ts +3 -3
- package/dist/table/components/sort-bar.js +11 -12
- package/dist/table/components/sort-bar.js.map +1 -1
- package/dist/table/components/table-cell.js.map +1 -1
- package/dist/table/components/table-search.d.ts +9 -0
- package/dist/table/components/table-search.js +72 -0
- package/dist/table/components/table-search.js.map +1 -0
- package/dist/table/components/table.js +73 -21
- package/dist/table/components/table.js.map +1 -1
- package/dist/table/hooks/use-column-visibility.js +29 -58
- package/dist/table/hooks/use-column-visibility.js.map +1 -1
- package/dist/table/hooks/use-expanded-rows.d.ts +8 -0
- package/dist/table/hooks/use-expanded-rows.js +24 -0
- package/dist/table/hooks/use-expanded-rows.js.map +1 -0
- package/dist/table/hooks/use-table.d.ts +5 -3
- package/dist/table/hooks/use-table.js +59 -55
- package/dist/table/hooks/use-table.js.map +1 -1
- package/dist/table/lib/bulk.d.ts +2 -0
- package/dist/table/lib/bulk.js +3 -1
- package/dist/table/lib/bulk.js.map +1 -1
- package/dist/table/lib/payload.d.ts +3 -2
- package/dist/table/lib/payload.js +16 -10
- package/dist/table/lib/payload.js.map +1 -1
- package/dist/table/lib/query.d.ts +5 -5
- package/dist/table/lib/query.js +21 -19
- package/dist/table/lib/query.js.map +1 -1
- package/dist/table/plugin.d.ts +0 -1
- package/dist/table/plugin.js.map +1 -1
- package/dist/table/types.d.ts +5 -81
- package/dist/toast/callout.js +2 -4
- package/dist/toast/callout.js.map +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toast/index.js +2 -2
- package/dist/toast/toast.d.ts +1 -7
- package/dist/toast/toast.js +3 -15
- package/dist/toast/toast.js.map +1 -1
- package/dist/toast/toaster.js.map +1 -1
- package/dist/types/generated.d.ts +444 -225
- package/dist/types/index.d.ts +1 -1
- package/dist/ui/affix-group.d.ts +2 -1
- package/dist/ui/affix-group.js +9 -7
- package/dist/ui/affix-group.js.map +1 -1
- package/dist/ui/avatar.d.ts +3 -0
- package/dist/ui/avatar.js +52 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/button.d.ts +5 -3
- package/dist/ui/button.js +10 -3
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/chart-view.js +155 -28
- package/dist/ui/chart-view.js.map +1 -1
- package/dist/ui/click-behavior.d.ts +4 -4
- package/dist/ui/click-behavior.js.map +1 -1
- package/dist/ui/collapsible.js +3 -15
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/color-picker.d.ts +8 -0
- package/dist/ui/color-picker.js +59 -0
- package/dist/ui/color-picker.js.map +1 -0
- package/dist/ui/combobox.d.ts +11 -2
- package/dist/ui/combobox.js +57 -11
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/confirm-dialog.js +1 -1
- package/dist/ui/confirm-dialog.js.map +1 -1
- package/dist/ui/control.d.ts +1 -1
- package/dist/ui/copyable-text.d.ts +7 -0
- package/dist/ui/copyable-text.js +21 -13
- package/dist/ui/copyable-text.js.map +1 -1
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.js +29 -5
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/fragment.js +1 -1
- package/dist/ui/fragment.js.map +1 -1
- package/dist/ui/heading.js +39 -21
- package/dist/ui/heading.js.map +1 -1
- package/dist/ui/icon-button.d.ts +22 -0
- package/dist/ui/icon-button.js +51 -0
- package/dist/ui/icon-button.js.map +1 -0
- package/dist/ui/icon.js +10 -11
- package/dist/ui/icon.js.map +1 -1
- package/dist/ui/image-preview.d.ts +12 -0
- package/dist/ui/image-preview.js +65 -0
- package/dist/ui/image-preview.js.map +1 -0
- package/dist/ui/image.d.ts +3 -0
- package/dist/ui/image.js +21 -0
- package/dist/ui/image.js.map +1 -0
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +4 -3
- package/dist/ui/info-tooltip.js +1 -1
- package/dist/ui/info-tooltip.js.map +1 -1
- package/dist/ui/input.d.ts +3 -1
- package/dist/ui/input.js +2 -2
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/modal.js +17 -4
- package/dist/ui/modal.js.map +1 -1
- package/dist/ui/native-select.d.ts +10 -0
- package/dist/ui/native-select.js +23 -0
- package/dist/ui/native-select.js.map +1 -0
- package/dist/ui/pill.d.ts +2 -0
- package/dist/ui/pill.js +10 -0
- package/dist/ui/pill.js.map +1 -0
- package/dist/ui/plugin.js +11 -1
- package/dist/ui/plugin.js.map +1 -1
- package/dist/ui/progress.d.ts +3 -0
- package/dist/ui/progress.js +114 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/section.js +2 -15
- package/dist/ui/section.js.map +1 -1
- package/dist/ui/segmented-pills.js +2 -1
- package/dist/ui/segmented-pills.js.map +1 -1
- package/dist/ui/separator.d.ts +3 -0
- package/dist/ui/separator.js +15 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/tabs.js +12 -10
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.js +5 -10
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/tree-context.d.ts +33 -0
- package/dist/ui/tree-context.js +135 -0
- package/dist/ui/tree-context.js.map +1 -0
- package/dist/ui/tree.d.ts +19 -0
- package/dist/ui/tree.js +187 -0
- package/dist/ui/tree.js.map +1 -0
- package/dist/ui/use-collapsible-state.d.ts +7 -0
- package/dist/ui/use-collapsible-state.js +21 -0
- package/dist/ui/use-collapsible-state.js.map +1 -0
- package/dist-standalone/chunks/chart-view-C6R5iPra.js +36 -0
- package/dist-standalone/chunks/date-picker-field-DhhEB-Mh.js +1 -0
- package/dist-standalone/chunks/jsx-runtime-Drll_-DD.js +1 -0
- package/dist-standalone/chunks/locale-CXqr7LPR.js +1 -0
- package/dist-standalone/chunks/page-props-DOfg30l5.js +1 -0
- package/dist-standalone/chunks/rich-editor-field-DORXTHPw.js +154 -0
- package/dist-standalone/chunks/{subscriptions-B3UuDBmx.js → subscriptions-B_ISgA7V.js} +1 -1
- package/dist-standalone/chunks/use-effect-dispatcher-D1wPPwHj.js +97 -0
- package/dist-standalone/lattice.css +1 -1
- package/dist-standalone/lattice.js +15 -15
- package/dist-standalone/manifest.json +11 -9
- package/dist-standalone/sprite.svg +1 -1
- package/package.json +6 -1
- package/resources/icons/code-xml.svg +17 -0
- package/resources/icons/heading.svg +17 -0
- package/dist/clipboard/index.js.map +0 -1
- package/dist/events/event-names.js.map +0 -1
- package/dist/table/components/table-action-node.d.ts +0 -4
- package/dist/table/components/table-action-node.js +0 -24
- package/dist/table/components/table-action-node.js.map +0 -1
- package/dist-standalone/chunks/chart-view-CK5fKIkR.js +0 -36
- package/dist-standalone/chunks/date-picker-field-BlCPFhZd.js +0 -1
- package/dist-standalone/chunks/jsx-runtime-CJ_btYLc.js +0 -1
- package/dist-standalone/chunks/rich-editor-field-DH5dS5c1.js +0 -154
- package/dist-standalone/chunks/use-effect-dispatcher-k98Nzf9M.js +0 -97
- /package/dist/{events → core}/event-names.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","names":[],"sources":["../../../resources/js/form/rich-editor/registry.ts"],"sourcesContent":["import type { AnyExtension, Editor } from \"@tiptap/core\";\nimport type { StarterKitOptions } from \"@tiptap/starter-kit\";\nimport type { ComponentType } from \"react\";\nimport type { ResolveProps } from \"@lattice-php/lattice/core/types\";\nimport type {\n EditorExtension,\n EditorExtensionPropsMap,\n} from \"@lattice-php/lattice/types/generated\";\n\n/**\n * Consumer apps augment this via `declare module \"@lattice-php/lattice\"` to type\n * their custom extensions' props; built-ins resolve through\n * `EditorExtensionPropsMap`. The editor counterpart of `EffectProps`.\n */\nexport interface EditorExtensionProps {}\n\nexport type EditorExtensionPayloadOf<TType extends string> = ResolveProps<\n EditorExtensionProps,\n EditorExtensionPropsMap,\n TType,\n Record<string, unknown>\n>;\n\nexport type ToolbarButton = {\n icon: string;\n key: string;\n label: string;\n isActive: (editor: Editor) => boolean;\n isDisabled?: (editor: Editor) => boolean;\n run: (editor: Editor) => void;\n};\n\n/**\n * A toolbar item that renders its own markup (dropdowns, popovers) instead of\n * the standard icon button.\n */\nexport type ToolbarControl = {\n key: string;\n component: ComponentType<{ editor: Editor }>;\n};\n\nexport type ToolbarItem = ToolbarButton | ToolbarControl;\n\nexport type ToolbarEntry = ToolbarItem | \"separator\";\n\nexport type RichEditorExtensionDefinition<P = Record<string, unknown>> = {\n extensions?: (props: P) => AnyExtension[];\n /** Contribution to the single shared StarterKit configuration. */\n starterKit?: (props: P) => Partial<StarterKitOptions>;\n toolbar?: (props: P) => ToolbarItem[];\n /**\n * Adjacent toolbar contributions from the same group render without a\n * separator between them; defaults to the extension's own wire type.\n */\n group?: string;\n};\n\nexport type ResolvedRichEditorExtension = {\n type: string;\n props: Record<string, unknown>;\n definition: RichEditorExtensionDefinition;\n group: string;\n};\n\nconst registry = new Map<string, RichEditorExtensionDefinition>();\n\n/**\n * Wire props stay `Partial` at the definition boundary — a client-registered\n * type's props carry no generated shape, so definitions default each field.\n */\nexport function registerRichEditorExtension<TType extends string>(\n type: TType,\n definition: RichEditorExtensionDefinition<Partial<EditorExtensionPayloadOf<TType>>>,\n): void {\n registry.set(type, definition as unknown as RichEditorExtensionDefinition);\n}\n\n/**\n * Registration that yields to an existing entry. The built-ins load with the\n * lazy editor chunk — after app boot code ran — so seeding (instead of\n * registering) keeps a consumer's deliberate override of a built-in type.\n *\n * @internal\n */\nexport function seedRichEditorExtension<TType extends string>(\n type: TType,\n definition: RichEditorExtensionDefinition<Partial<EditorExtensionPayloadOf<TType>>>,\n): void {\n if (!registry.has(type)) {\n registerRichEditorExtension(type, definition);\n }\n}\n\nconst warned = new Set<string>();\n\nexport function resolveRichEditorExtensions(\n specs: EditorExtension[],\n): ResolvedRichEditorExtension[] {\n const resolved: ResolvedRichEditorExtension[] = [];\n\n for (const spec of specs) {\n const definition = registry.get(spec.type);\n\n if (!definition) {\n if (import.meta.env.DEV && !warned.has(spec.type)) {\n warned.add(spec.type);\n console.warn(`[Lattice] Rich-editor extension \"${spec.type}\" is not registered.`);\n }\n\n continue;\n }\n\n resolved.push({\n type: spec.type,\n props: spec.props,\n definition,\n group: definition.group ?? spec.type,\n });\n }\n\n return resolved;\n}\n\n/**\n * One shared StarterKit for the whole editor: the always-on baseline (document,\n * paragraph, text, hard break, undo/redo, cursors and the invisible list/trailing\n * helpers) plus whatever the active extensions re-enable. Everything else is\n * explicitly disabled — StarterKit turns every feature on unless told otherwise.\n */\nconst DISABLED_STARTER_KIT_FEATURES: Partial<StarterKitOptions> = {\n blockquote: false,\n bold: false,\n bulletList: false,\n code: false,\n codeBlock: false,\n heading: false,\n horizontalRule: false,\n italic: false,\n link: false,\n listItem: false,\n orderedList: false,\n strike: false,\n underline: false,\n};\n\nexport function assembleStarterKitOptions(\n extensions: ResolvedRichEditorExtension[],\n): Partial<StarterKitOptions> {\n return extensions.reduce(\n (options, extension) => ({ ...options, ...extension.definition.starterKit?.(extension.props) }),\n { ...DISABLED_STARTER_KIT_FEATURES },\n );\n}\n\nexport function assembleTiptapExtensions(\n extensions: ResolvedRichEditorExtension[],\n): AnyExtension[] {\n return extensions.flatMap(\n (extension) => extension.definition.extensions?.(extension.props) ?? [],\n );\n}\n\nexport function assembleToolbar(extensions: ResolvedRichEditorExtension[]): ToolbarEntry[] {\n const entries: ToolbarEntry[] = [];\n let previousGroup: string | null = null;\n\n for (const extension of extensions) {\n const items = extension.definition.toolbar?.(extension.props) ?? [];\n\n if (items.length === 0) {\n continue;\n }\n\n if (previousGroup !== null && previousGroup !== extension.group) {\n entries.push(\"separator\");\n }\n\n entries.push(...items);\n previousGroup = extension.group;\n }\n\n return entries;\n}\n"],"mappings":";AAgEA,IAAM,2BAAW,IAAI,IAA2C;;;;;AAMhE,SAAgB,4BACd,MACA,YACM;CACN,SAAS,IAAI,MAAM,UAAsD;AAC3E;;;;;;;;AASA,SAAgB,wBACd,MACA,YACM;CACN,IAAI,CAAC,SAAS,IAAI,IAAI,GACpB,4BAA4B,MAAM,UAAU;AAEhD;AAIA,SAAgB,4BACd,OAC+B;CAC/B,MAAM,WAA0C,CAAC;CAEjD,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,aAAa,SAAS,IAAI,KAAK,IAAI;EAEzC,IAAI,CAAC,YAMH;EAGF,SAAS,KAAK;GACZ,MAAM,KAAK;GACX,OAAO,KAAK;GACZ;GACA,OAAO,WAAW,SAAS,KAAK;EAClC,CAAC;CACH;CAEA,OAAO;AACT;;;;;;;AAQA,IAAM,gCAA4D;CAChE,YAAY;CACZ,MAAM;CACN,YAAY;CACZ,MAAM;CACN,WAAW;CACX,SAAS;CACT,gBAAgB;CAChB,QAAQ;CACR,MAAM;CACN,UAAU;CACV,aAAa;CACb,QAAQ;CACR,WAAW;AACb;AAEA,SAAgB,0BACd,YAC4B;CAC5B,OAAO,WAAW,QACf,SAAS,eAAe;EAAE,GAAG;EAAS,GAAG,UAAU,WAAW,aAAa,UAAU,KAAK;CAAE,IAC7F,EAAE,GAAG,8BAA8B,CACrC;AACF;AAEA,SAAgB,yBACd,YACgB;CAChB,OAAO,WAAW,SACf,cAAc,UAAU,WAAW,aAAa,UAAU,KAAK,KAAK,CAAC,CACxE;AACF;AAEA,SAAgB,gBAAgB,YAA2D;CACzF,MAAM,UAA0B,CAAC;CACjC,IAAI,gBAA+B;CAEnC,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,QAAQ,UAAU,WAAW,UAAU,UAAU,KAAK,KAAK,CAAC;EAElE,IAAI,MAAM,WAAW,GACnB;EAGF,IAAI,kBAAkB,QAAQ,kBAAkB,UAAU,OACxD,QAAQ,KAAK,WAAW;EAG1B,QAAQ,KAAK,GAAG,KAAK;EACrB,gBAAgB,UAAU;CAC5B;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The shared editor toolbar trigger: an {@link IconButton} that keeps focus in
|
|
4
|
+
* the editor (mousedown is prevented so clicks don't blur it, which would
|
|
5
|
+
* otherwise trigger a precognition request).
|
|
6
|
+
*/
|
|
7
|
+
export declare function ToolbarIconButton({ active, icon, label, testId, ...props }: React.ComponentProps<"button"> & {
|
|
8
|
+
active?: boolean;
|
|
9
|
+
icon: string;
|
|
10
|
+
label: string;
|
|
11
|
+
testId: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IconButton } from "../../ui/icon-button.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region resources/js/form/rich-editor/toolbar-button.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The shared editor toolbar trigger: an {@link IconButton} that keeps focus in
|
|
7
|
+
* the editor (mousedown is prevented so clicks don't blur it, which would
|
|
8
|
+
* otherwise trigger a precognition request).
|
|
9
|
+
*/
|
|
10
|
+
function ToolbarIconButton({ active = false, icon, label, testId, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
12
|
+
size: "sm",
|
|
13
|
+
icon,
|
|
14
|
+
label,
|
|
15
|
+
title: label,
|
|
16
|
+
active,
|
|
17
|
+
"data-test": testId,
|
|
18
|
+
...props,
|
|
19
|
+
onMouseDown: (event) => {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
props.onMouseDown?.(event);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { ToolbarIconButton };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=toolbar-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-button.js","names":[],"sources":["../../../resources/js/form/rich-editor/toolbar-button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { IconButton } from \"@lattice-php/lattice/ui/icon-button\";\n\n/**\n * The shared editor toolbar trigger: an {@link IconButton} that keeps focus in\n * the editor (mousedown is prevented so clicks don't blur it, which would\n * otherwise trigger a precognition request).\n */\nexport function ToolbarIconButton({\n active = false,\n icon,\n label,\n testId,\n ...props\n}: React.ComponentProps<\"button\"> & {\n active?: boolean;\n icon: string;\n label: string;\n testId: string;\n}) {\n return (\n <IconButton\n size=\"sm\"\n icon={icon}\n label={label}\n title={label}\n active={active}\n data-test={testId}\n {...props}\n onMouseDown={(event) => {\n event.preventDefault();\n props.onMouseDown?.(event);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,kBAAkB,EAChC,SAAS,OACT,MACA,OACA,QACA,GAAG,SAMF;CACD,OACE,oBAAC,YAAD;EACE,MAAK;EACC;EACC;EACP,OAAO;EACC;EACR,aAAW;EACX,GAAI;EACJ,cAAc,UAAU;GACtB,MAAM,eAAe;GACrB,MAAM,cAAc,KAAK;EAC3B;CACD,CAAA;AAEL"}
|
package/dist/form/types.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { Method } from '@inertiajs/core';
|
|
2
2
|
import { NodeUnionOf } from '../core/types.js';
|
|
3
3
|
import { FormFieldNodeType, FormNodeType } from '../types/generated.js';
|
|
4
|
-
export type { Checkbox, Choice, DateInput, DateTimeInput, Form, FormNodeType, HiddenInput, NumberInput, PasswordInput, RichEditor, Select, Textarea, TextInput, TimeInput, } from '../types/generated.js';
|
|
4
|
+
export type { Checkbox, Choice, DateInput, DateTimeInput, Form, FormNodeType, HiddenInput, LabelAction, NumberInput, PasswordInput, RichEditor, Select, Textarea, TextInput, TimeInput, } from '../types/generated.js';
|
|
5
5
|
export type FormFieldNode = NodeUnionOf<FormFieldNodeType>;
|
|
6
6
|
export type FormNode = NodeUnionOf<FormNodeType>;
|
|
7
7
|
export type FormMethod = Method;
|
|
8
|
-
export type FormLabelAction = {
|
|
9
|
-
href: string;
|
|
10
|
-
label: string;
|
|
11
|
-
tabIndex?: number;
|
|
12
|
-
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { DateTimeStyle } from '../types/generated.js';
|
|
1
2
|
export type FormatOptions = {
|
|
2
3
|
locale?: string;
|
|
3
4
|
timeZone?: string;
|
|
4
5
|
};
|
|
5
6
|
export type DateConfig = {
|
|
6
|
-
dateStyle:
|
|
7
|
-
timeStyle:
|
|
7
|
+
dateStyle: DateTimeStyle | null;
|
|
8
|
+
timeStyle: DateTimeStyle | null;
|
|
8
9
|
month?: string | null;
|
|
9
10
|
year?: string | null;
|
|
10
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.js","names":[],"sources":["../../resources/js/format/date-time.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"date-time.js","names":[],"sources":["../../resources/js/format/date-time.ts"],"sourcesContent":["import type { DateTimeStyle } from \"@lattice-php/lattice/types/generated\";\n\nexport type FormatOptions = {\n locale?: string;\n timeZone?: string;\n};\n\nexport type DateConfig = {\n dateStyle: DateTimeStyle | null;\n timeStyle: DateTimeStyle | null;\n month?: string | null;\n year?: string | null;\n};\n\nexport function formatDateValue(value: unknown, date: DateConfig, options?: FormatOptions): string {\n const parsed = new Date(String(value));\n\n if (Number.isNaN(parsed.getTime())) {\n return String(value ?? \"\");\n }\n\n const intl: Intl.DateTimeFormatOptions = { timeZone: options?.timeZone };\n\n if (date.dateStyle) {\n intl.dateStyle = date.dateStyle;\n }\n\n if (date.timeStyle) {\n intl.timeStyle = date.timeStyle;\n }\n\n if (date.month) {\n intl.month = date.month as Intl.DateTimeFormatOptions[\"month\"];\n }\n\n if (date.year) {\n intl.year = date.year as Intl.DateTimeFormatOptions[\"year\"];\n }\n\n return new Intl.DateTimeFormat(options?.locale, intl).format(parsed);\n}\n\nexport function preciseDateTime(value: unknown, options?: FormatOptions): string {\n const date = new Date(String(value));\n\n if (Number.isNaN(date.getTime())) {\n return \"\";\n }\n\n const formatted = new Intl.DateTimeFormat(options?.locale, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n timeZone: options?.timeZone,\n timeZoneName: \"short\",\n }).format(date);\n\n return options?.timeZone ? `${formatted} (${options.timeZone})` : formatted;\n}\n"],"mappings":";AAcA,SAAgB,gBAAgB,OAAgB,MAAkB,SAAiC;CACjG,MAAM,SAAS,IAAI,KAAK,OAAO,KAAK,CAAC;CAErC,IAAI,OAAO,MAAM,OAAO,QAAQ,CAAC,GAC/B,OAAO,OAAO,SAAS,EAAE;CAG3B,MAAM,OAAmC,EAAE,UAAU,SAAS,SAAS;CAEvE,IAAI,KAAK,WACP,KAAK,YAAY,KAAK;CAGxB,IAAI,KAAK,WACP,KAAK,YAAY,KAAK;CAGxB,IAAI,KAAK,OACP,KAAK,QAAQ,KAAK;CAGpB,IAAI,KAAK,MACP,KAAK,OAAO,KAAK;CAGnB,OAAO,IAAI,KAAK,eAAe,SAAS,QAAQ,IAAI,EAAE,OAAO,MAAM;AACrE;AAEA,SAAgB,gBAAgB,OAAgB,SAAiC;CAC/E,MAAM,OAAO,IAAI,KAAK,OAAO,KAAK,CAAC;CAEnC,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,GAC7B,OAAO;CAGT,MAAM,YAAY,IAAI,KAAK,eAAe,SAAS,QAAQ;EACzD,MAAM;EACN,OAAO;EACP,KAAK;EACL,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,UAAU,SAAS;EACnB,cAAc;CAChB,CAAC,EAAE,OAAO,IAAI;CAEd,OAAO,SAAS,WAAW,GAAG,UAAU,IAAI,QAAQ,SAAS,KAAK;AACpE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useLocale } from "../i18n/locale.js";
|
|
2
|
+
import { useTimezone } from "../i18n/timezone.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
//#region resources/js/format/format-context.ts
|
|
5
|
+
/** The `{ locale, timezone }` pair every `formatValue` call needs. */
|
|
6
|
+
function useFormatContext() {
|
|
7
|
+
const { locale } = useLocale();
|
|
8
|
+
const { timezone } = useTimezone();
|
|
9
|
+
return useMemo(() => ({
|
|
10
|
+
locale,
|
|
11
|
+
timezone
|
|
12
|
+
}), [locale, timezone]);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useFormatContext };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=format-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-context.js","names":[],"sources":["../../resources/js/format/format-context.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useLocale } from \"@lattice-php/lattice/i18n/locale\";\nimport { useTimezone } from \"@lattice-php/lattice/i18n/timezone\";\n\nexport type FormatContext = { locale: string; timezone: string };\n\n/** The `{ locale, timezone }` pair every `formatValue` call needs. */\nexport function useFormatContext(): FormatContext {\n const { locale } = useLocale();\n const { timezone } = useTimezone();\n\n return useMemo(() => ({ locale, timezone }), [locale, timezone]);\n}\n"],"mappings":";;;;;AAOA,SAAgB,mBAAkC;CAChD,MAAM,EAAE,WAAW,UAAU;CAC7B,MAAM,EAAE,aAAa,YAAY;CAEjC,OAAO,eAAe;EAAE;EAAQ;CAAS,IAAI,CAAC,QAAQ,QAAQ,CAAC;AACjE"}
|
package/dist/i18n/date-time.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { DateTimeStyle } from '../types/generated.js';
|
|
2
3
|
export type DateTimeProps = {
|
|
3
4
|
value: unknown;
|
|
4
|
-
dateStyle?:
|
|
5
|
-
timeStyle?:
|
|
5
|
+
dateStyle?: DateTimeStyle | null;
|
|
6
|
+
timeStyle?: DateTimeStyle | null;
|
|
6
7
|
};
|
|
7
8
|
export declare function DateTime({ value, dateStyle, timeStyle, }: DateTimeProps): ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.js","names":[],"sources":["../../resources/js/i18n/date-time.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n type FormatOptions,\n formatDateValue,\n preciseDateTime,\n} from \"@lattice-php/lattice/format/date-time\";\nimport { useLocale } from \"./locale\";\nimport { useTimezone } from \"./timezone\";\n\nexport type DateTimeProps = {\n value: unknown;\n dateStyle?:
|
|
1
|
+
{"version":3,"file":"date-time.js","names":[],"sources":["../../resources/js/i18n/date-time.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n type FormatOptions,\n formatDateValue,\n preciseDateTime,\n} from \"@lattice-php/lattice/format/date-time\";\nimport type { DateTimeStyle } from \"@lattice-php/lattice/types/generated\";\nimport { useLocale } from \"./locale\";\nimport { useTimezone } from \"./timezone\";\n\nexport type DateTimeProps = {\n value: unknown;\n dateStyle?: DateTimeStyle | null;\n timeStyle?: DateTimeStyle | null;\n};\n\nexport function DateTime({\n value,\n dateStyle = \"medium\",\n timeStyle = \"short\",\n}: DateTimeProps): ReactNode {\n const { locale } = useLocale();\n const { timezone } = useTimezone();\n\n if (value === null || value === undefined || value === \"\") {\n return null;\n }\n\n const options: FormatOptions = { locale, timeZone: timezone };\n const text = formatDateValue(value, { dateStyle, timeStyle }, options);\n const iso = isoOrNull(value);\n const title = preciseDateTime(value, options);\n\n return (\n <time dateTime={iso ?? undefined} title={title || undefined}>\n {text}\n </time>\n );\n}\n\nfunction isoOrNull(value: unknown): string | null {\n const date = new Date(String(value));\n\n return Number.isNaN(date.getTime()) ? null : date.toISOString();\n}\n"],"mappings":";;;;;AAgBA,SAAgB,SAAS,EACvB,OACA,YAAY,UACZ,YAAY,WACe;CAC3B,MAAM,EAAE,WAAW,UAAU;CAC7B,MAAM,EAAE,aAAa,YAAY;CAEjC,IAAI,UAAU,QAAQ,UAAU,KAAA,KAAa,UAAU,IACrD,OAAO;CAGT,MAAM,UAAyB;EAAE;EAAQ,UAAU;CAAS;CAC5D,MAAM,OAAO,gBAAgB,OAAO;EAAE;EAAW;CAAU,GAAG,OAAO;CACrE,MAAM,MAAM,UAAU,KAAK;CAC3B,MAAM,QAAQ,gBAAgB,OAAO,OAAO;CAE5C,OACE,oBAAC,QAAD;EAAM,UAAU,OAAO,KAAA;EAAW,OAAO,SAAS,KAAA;YAC/C;CACG,CAAA;AAEV;AAEA,SAAS,UAAU,OAA+B;CAChD,MAAM,OAAO,IAAI,KAAK,OAAO,KAAK,CAAC;CAEnC,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,IAAI,OAAO,KAAK,YAAY;AAChE"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { LocaleReload } from "./locale-reload.js";
|
|
2
|
+
import { i18nConfigFromPageProps } from "./shared-props.js";
|
|
1
3
|
import { currentLocale, localeHeader, setLocale, useLocale } from "./locale.js";
|
|
2
4
|
import { i18n, translate, useT } from "./instance.js";
|
|
3
5
|
import { configureI18n, enableBackend } from "./backend.js";
|
|
4
|
-
import { LocaleReload } from "./locale-reload.js";
|
|
5
6
|
import { LocaleSwitcher, useLocaleOptions } from "./locale-switcher.js";
|
|
6
|
-
import { configureI18nFromPageProps
|
|
7
|
+
import { configureI18nFromPageProps } from "./page-props.js";
|
|
7
8
|
import { currentTimezone, setTimezone, useTimezone } from "./timezone.js";
|
|
8
9
|
import { DateTime } from "./date-time.js";
|
|
9
10
|
export { DateTime, LocaleReload, LocaleSwitcher, configureI18n, configureI18nFromPageProps, currentLocale, currentTimezone, enableBackend, i18n, i18nConfigFromPageProps, localeHeader, setLocale, setTimezone, translate, useLocale, useLocaleOptions, useT, useTimezone };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VisitOptions } from '@inertiajs/core';
|
|
2
2
|
type LocaleReloadProps = Pick<VisitOptions, "preserveScroll" | "preserveState">;
|
|
3
|
-
export declare function LocaleReload({ preserveScroll, preserveState }: LocaleReloadProps):
|
|
3
|
+
export declare function LocaleReload({ preserveScroll, preserveState }: LocaleReloadProps): null;
|
|
4
4
|
export {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LATTICE_EVENT } from "../core/event-names.js";
|
|
2
|
+
import { useWindowEvent } from "../core/hooks/use-window-event.js";
|
|
2
3
|
import { router } from "@inertiajs/react";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
//#region resources/js/i18n/locale-reload.tsx
|
|
6
5
|
function LocaleReload({ preserveScroll = true, preserveState = true }) {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
useWindowEvent(LATTICE_EVENT.localeChange, (event) => {
|
|
7
|
+
const locale = event.detail?.locale;
|
|
8
|
+
if (typeof locale === "string" && locale !== "") router.visit(window.location.href, {
|
|
9
9
|
preserveScroll,
|
|
10
10
|
preserveState
|
|
11
11
|
});
|
|
12
|
-
}
|
|
12
|
+
});
|
|
13
|
+
return null;
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
export { LocaleReload };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-reload.js","names":[],"sources":["../../resources/js/i18n/locale-reload.tsx"],"sourcesContent":["import type { VisitOptions } from \"@inertiajs/core\";\nimport { router } from \"@inertiajs/react\";\nimport {
|
|
1
|
+
{"version":3,"file":"locale-reload.js","names":[],"sources":["../../resources/js/i18n/locale-reload.tsx"],"sourcesContent":["import type { VisitOptions } from \"@inertiajs/core\";\nimport { router } from \"@inertiajs/react\";\nimport { LATTICE_EVENT } from \"@lattice-php/lattice/core/event-names\";\nimport { useWindowEvent } from \"@lattice-php/lattice/core/hooks/use-window-event\";\n\ntype LocaleReloadProps = Pick<VisitOptions, \"preserveScroll\" | \"preserveState\">;\n\n// preserveState by default: the visit only re-fetches the re-localized props,\n// so keeping the page mounted avoids remounting the whole tree (and losing\n// table sort/filter, form input, focus) on every locale switch.\nexport function LocaleReload({ preserveScroll = true, preserveState = true }: LocaleReloadProps) {\n useWindowEvent(LATTICE_EVENT.localeChange, (event) => {\n const locale = (event as CustomEvent<{ locale?: unknown }>).detail?.locale;\n\n if (typeof locale === \"string\" && locale !== \"\") {\n router.visit(window.location.href, { preserveScroll, preserveState });\n }\n });\n\n return null;\n}\n"],"mappings":";;;;AAUA,SAAgB,aAAa,EAAE,iBAAiB,MAAM,gBAAgB,QAA2B;CAC/F,eAAe,cAAc,eAAe,UAAU;EACpD,MAAM,SAAU,MAA4C,QAAQ;EAEpE,IAAI,OAAO,WAAW,YAAY,WAAW,IAC3C,OAAO,MAAM,OAAO,SAAS,MAAM;GAAE;GAAgB;EAAc,CAAC;CAExE,CAAC;CAED,OAAO;AACT"}
|
package/dist/i18n/locale.js
CHANGED
package/dist/i18n/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","names":[],"sources":["../../resources/js/i18n/locale.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { LATTICE_EVENT } from \"@lattice-php/lattice/
|
|
1
|
+
{"version":3,"file":"locale.js","names":[],"sources":["../../resources/js/i18n/locale.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { LATTICE_EVENT } from \"@lattice-php/lattice/core/event-names\";\n\nexport type UseLocaleReturn = {\n readonly locale: string;\n readonly setLocale: (locale: string) => void;\n};\n\nconst key = \"locale\";\nconst fallback = \"en\";\nconst maxAge = 365 * 24 * 60 * 60;\nconst listeners = new Set<() => void>();\n\nlet active: string | undefined;\n\nfunction normalize(value: string): string {\n const next = value.trim();\n\n return next === \"\" ? fallback : next;\n}\n\nfunction storedValue(): string | null {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction cookieValue(): string | null {\n if (typeof document === \"undefined\") {\n return null;\n }\n\n const item = document.cookie\n .split(\";\")\n .map((cookie) => cookie.trim())\n .find((cookie) => cookie.startsWith(`${key}=`));\n\n if (!item) {\n return null;\n }\n\n try {\n return decodeURIComponent(item.slice(key.length + 1));\n } catch {\n return null;\n }\n}\n\nfunction documentValue(): string | null {\n if (typeof document === \"undefined\") {\n return null;\n }\n\n return document.documentElement.lang || null;\n}\n\nfunction detectedLocale(): string {\n return normalize(storedValue() ?? cookieValue() ?? documentValue() ?? fallback);\n}\n\nfunction persist(locale: string): void {\n if (typeof document !== \"undefined\") {\n document.cookie = `${key}=${encodeURIComponent(locale)};path=/;max-age=${maxAge};SameSite=Lax`;\n document.documentElement.lang = locale;\n }\n\n if (typeof window !== \"undefined\") {\n try {\n localStorage.setItem(key, locale);\n } catch {\n return;\n }\n }\n}\n\nfunction snapshot(): string {\n active ??= detectedLocale();\n\n return active;\n}\n\nfunction subscribe(callback: () => void): () => void {\n listeners.add(callback);\n\n return () => {\n listeners.delete(callback);\n };\n}\n\nfunction notify(): void {\n listeners.forEach((listener) => listener());\n}\n\nfunction dispatch(locale: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n\n window.dispatchEvent(new CustomEvent(LATTICE_EVENT.localeChange, { detail: { locale } }));\n}\n\nexport function currentLocale(): string {\n return snapshot();\n}\n\nexport function localeHeader(): Record<string, string> {\n return { \"Accept-Language\": currentLocale() };\n}\n\nexport function subscribeLocale(callback: (locale: string) => void): () => void {\n return subscribe(() => callback(currentLocale()));\n}\n\nexport function setLocale(locale: string): void {\n const previous = currentLocale();\n const next = normalize(locale);\n\n active = next;\n persist(next);\n\n if (next === previous) {\n return;\n }\n\n notify();\n dispatch(next);\n}\n\nexport function useLocale(): UseLocaleReturn {\n const locale = useSyncExternalStore(subscribe, snapshot, () => fallback);\n\n return { locale, setLocale } as const;\n}\n"],"mappings":";;;AAQA,IAAM,MAAM;AACZ,IAAM,WAAW;AACjB,IAAM,SAAS,MAAM,KAAK,KAAK;AAC/B,IAAM,4BAAY,IAAI,IAAgB;AAEtC,IAAI;AAEJ,SAAS,UAAU,OAAuB;CACxC,MAAM,OAAO,MAAM,KAAK;CAExB,OAAO,SAAS,KAAK,WAAW;AAClC;AAEA,SAAS,cAA6B;CACpC,IAAI,OAAO,WAAW,aACpB,OAAO;CAGT,IAAI;EACF,OAAO,aAAa,QAAQ,GAAG;CACjC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,cAA6B;CACpC,IAAI,OAAO,aAAa,aACtB,OAAO;CAGT,MAAM,OAAO,SAAS,OACnB,MAAM,GAAG,EACT,KAAK,WAAW,OAAO,KAAK,CAAC,EAC7B,MAAM,WAAW,OAAO,WAAW,GAAG,IAAI,EAAE,CAAC;CAEhD,IAAI,CAAC,MACH,OAAO;CAGT,IAAI;EACF,OAAO,mBAAmB,KAAK,MAAM,CAAc,CAAC;CACtD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,gBAA+B;CACtC,IAAI,OAAO,aAAa,aACtB,OAAO;CAGT,OAAO,SAAS,gBAAgB,QAAQ;AAC1C;AAEA,SAAS,iBAAyB;CAChC,OAAO,UAAU,YAAY,KAAK,YAAY,KAAK,cAAc,KAAK,QAAQ;AAChF;AAEA,SAAS,QAAQ,QAAsB;CACrC,IAAI,OAAO,aAAa,aAAa;EACnC,SAAS,SAAS,GAAG,IAAI,GAAG,mBAAmB,MAAM,EAAE,kBAAkB,OAAO;EAChF,SAAS,gBAAgB,OAAO;CAClC;CAEA,IAAI,OAAO,WAAW,aACpB,IAAI;EACF,aAAa,QAAQ,KAAK,MAAM;CAClC,QAAQ;EACN;CACF;AAEJ;AAEA,SAAS,WAAmB;CAC1B,WAAW,eAAe;CAE1B,OAAO;AACT;AAEA,SAAS,UAAU,UAAkC;CACnD,UAAU,IAAI,QAAQ;CAEtB,aAAa;EACX,UAAU,OAAO,QAAQ;CAC3B;AACF;AAEA,SAAS,SAAe;CACtB,UAAU,SAAS,aAAa,SAAS,CAAC;AAC5C;AAEA,SAAS,SAAS,QAAsB;CACtC,IAAI,OAAO,WAAW,aACpB;CAGF,OAAO,cAAc,IAAI,YAAY,cAAc,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1F;AAEA,SAAgB,gBAAwB;CACtC,OAAO,SAAS;AAClB;AAEA,SAAgB,eAAuC;CACrD,OAAO,EAAE,mBAAmB,cAAc,EAAE;AAC9C;AAEA,SAAgB,gBAAgB,UAAgD;CAC9E,OAAO,gBAAgB,SAAS,cAAc,CAAC,CAAC;AAClD;AAEA,SAAgB,UAAU,QAAsB;CAC9C,MAAM,WAAW,cAAc;CAC/B,MAAM,OAAO,UAAU,MAAM;CAE7B,SAAS;CACT,QAAQ,IAAI;CAEZ,IAAI,SAAS,UACX;CAGF,OAAO;CACP,SAAS,IAAI;AACf;AAEA,SAAgB,YAA6B;CAG3C,OAAO;EAAE,QAFM,qBAAqB,WAAW,gBAAgB,QAEtD;EAAQ;CAAU;AAC7B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { ConfigureI18nOptions
|
|
2
|
-
|
|
1
|
+
import { ConfigureI18nOptions } from './backend.js';
|
|
2
|
+
import { i18nConfigFromPageProps } from './shared-props.js';
|
|
3
|
+
export { i18nConfigFromPageProps };
|
|
3
4
|
export declare function configureI18nFromPageProps(props: unknown, options?: ConfigureI18nOptions): Promise<void>;
|
package/dist/i18n/page-props.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
+
import { i18nConfigFromPageProps } from "./shared-props.js";
|
|
1
2
|
import { configureI18n } from "./backend.js";
|
|
2
3
|
//#region resources/js/i18n/page-props.ts
|
|
3
|
-
function isRecord(value) {
|
|
4
|
-
return typeof value === "object" && value !== null;
|
|
5
|
-
}
|
|
6
|
-
function isStringArray(value) {
|
|
7
|
-
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
8
|
-
}
|
|
9
|
-
function isI18nConfig(value) {
|
|
10
|
-
return isRecord(value) && typeof value.enabled === "boolean" && typeof value.saveMissing === "boolean" && isStringArray(value.locales) && isStringArray(value.preloadLocales) && (value.timezone === void 0 || value.timezone === null || typeof value.timezone === "string");
|
|
11
|
-
}
|
|
12
|
-
function i18nConfigFromPageProps(props) {
|
|
13
|
-
if (!isRecord(props)) return;
|
|
14
|
-
const shared = props.lattice;
|
|
15
|
-
const config = isRecord(shared) ? shared.i18n : void 0;
|
|
16
|
-
return isI18nConfig(config) ? config : void 0;
|
|
17
|
-
}
|
|
18
4
|
function configureI18nFromPageProps(props, options = {}) {
|
|
19
5
|
return configureI18n(i18nConfigFromPageProps(props), options);
|
|
20
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-props.js","names":[],"sources":["../../resources/js/i18n/page-props.ts"],"sourcesContent":["import { configureI18n, type ConfigureI18nOptions
|
|
1
|
+
{"version":3,"file":"page-props.js","names":[],"sources":["../../resources/js/i18n/page-props.ts"],"sourcesContent":["import { configureI18n, type ConfigureI18nOptions } from \"./backend\";\nimport { i18nConfigFromPageProps } from \"./shared-props\";\n\nexport { i18nConfigFromPageProps };\n\nexport function configureI18nFromPageProps(\n props: unknown,\n options: ConfigureI18nOptions = {},\n): Promise<void> {\n return configureI18n(i18nConfigFromPageProps(props), options);\n}\n"],"mappings":";;;AAKA,SAAgB,2BACd,OACA,UAAgC,CAAC,GAClB;CACf,OAAO,cAAc,wBAAwB,KAAK,GAAG,OAAO;AAC9D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { I18nConfig } from '../types/generated.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parse the backend-shared `lattice.i18n` Inertia prop. Lives apart from the
|
|
4
|
+
* configure entrypoint so callers can inspect the prop without pulling the
|
|
5
|
+
* i18next backend into their bundle.
|
|
6
|
+
*/
|
|
7
|
+
export declare function i18nConfigFromPageProps(props: unknown): I18nConfig | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isRecord } from "../core/materialize.js";
|
|
2
|
+
//#region resources/js/i18n/shared-props.ts
|
|
3
|
+
function isStringArray(value) {
|
|
4
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
5
|
+
}
|
|
6
|
+
function isI18nConfig(value) {
|
|
7
|
+
return isRecord(value) && typeof value.enabled === "boolean" && typeof value.saveMissing === "boolean" && isStringArray(value.locales) && isStringArray(value.preloadLocales) && (value.timezone === void 0 || value.timezone === null || typeof value.timezone === "string");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Parse the backend-shared `lattice.i18n` Inertia prop. Lives apart from the
|
|
11
|
+
* configure entrypoint so callers can inspect the prop without pulling the
|
|
12
|
+
* i18next backend into their bundle.
|
|
13
|
+
*/
|
|
14
|
+
function i18nConfigFromPageProps(props) {
|
|
15
|
+
if (!isRecord(props)) return;
|
|
16
|
+
const shared = props.lattice;
|
|
17
|
+
const config = isRecord(shared) ? shared.i18n : void 0;
|
|
18
|
+
return isI18nConfig(config) ? config : void 0;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i18nConfigFromPageProps };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=shared-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-props.js","names":[],"sources":["../../resources/js/i18n/shared-props.ts"],"sourcesContent":["import { isRecord } from \"@lattice-php/lattice/core/materialize\";\nimport type { I18nConfig } from \"@lattice-php/lattice/types/generated\";\n\nfunction isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((item) => typeof item === \"string\");\n}\n\nfunction isI18nConfig(value: unknown): value is I18nConfig {\n return (\n isRecord(value) &&\n typeof value.enabled === \"boolean\" &&\n typeof value.saveMissing === \"boolean\" &&\n isStringArray(value.locales) &&\n isStringArray(value.preloadLocales) &&\n (value.timezone === undefined || value.timezone === null || typeof value.timezone === \"string\")\n );\n}\n\n/**\n * Parse the backend-shared `lattice.i18n` Inertia prop. Lives apart from the\n * configure entrypoint so callers can inspect the prop without pulling the\n * i18next backend into their bundle.\n */\nexport function i18nConfigFromPageProps(props: unknown): I18nConfig | undefined {\n if (!isRecord(props)) {\n return undefined;\n }\n\n const shared = props.lattice;\n const config = isRecord(shared) ? shared.i18n : undefined;\n\n return isI18nConfig(config) ? config : undefined;\n}\n"],"mappings":";;AAGA,SAAS,cAAc,OAAmC;CACxD,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,SAAS,OAAO,SAAS,QAAQ;AAC/E;AAEA,SAAS,aAAa,OAAqC;CACzD,OACE,SAAS,KAAK,KACd,OAAO,MAAM,YAAY,aACzB,OAAO,MAAM,gBAAgB,aAC7B,cAAc,MAAM,OAAO,KAC3B,cAAc,MAAM,cAAc,MACjC,MAAM,aAAa,KAAA,KAAa,MAAM,aAAa,QAAQ,OAAO,MAAM,aAAa;AAE1F;;;;;;AAOA,SAAgB,wBAAwB,OAAwC;CAC9E,IAAI,CAAC,SAAS,KAAK,GACjB;CAGF,MAAM,SAAS,MAAM;CACrB,MAAM,SAAS,SAAS,MAAM,IAAI,OAAO,OAAO,KAAA;CAEhD,OAAO,aAAa,MAAM,IAAI,SAAS,KAAA;AACzC"}
|
package/dist/i18n/timezone.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timezone.js","names":[],"sources":["../../resources/js/i18n/timezone.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { LATTICE_EVENT } from \"@lattice-php/lattice/
|
|
1
|
+
{"version":3,"file":"timezone.js","names":[],"sources":["../../resources/js/i18n/timezone.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\nimport { LATTICE_EVENT } from \"@lattice-php/lattice/core/event-names\";\nimport { configTimezone, subscribeConfig } from \"./config\";\n\nexport type UseTimezoneReturn = {\n readonly timezone: string;\n readonly setTimezone: (timezone: string) => void;\n};\n\nconst fallback = \"UTC\";\nconst listeners = new Set<() => void>();\n\nlet override: string | undefined;\n\nfunction detectedTimezone(): string {\n if (typeof Intl === \"undefined\") {\n return fallback;\n }\n\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || fallback;\n } catch {\n return fallback;\n }\n}\n\nfunction snapshot(): string {\n return override ?? configTimezone() ?? detectedTimezone();\n}\n\nfunction subscribe(callback: () => void): () => void {\n listeners.add(callback);\n\n return () => {\n listeners.delete(callback);\n };\n}\n\nfunction notify(): void {\n listeners.forEach((listener) => listener());\n}\n\nsubscribeConfig(() => notify());\n\nfunction dispatch(timezone: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n\n window.dispatchEvent(new CustomEvent(LATTICE_EVENT.timezoneChange, { detail: { timezone } }));\n}\n\nexport function currentTimezone(): string {\n return snapshot();\n}\n\nexport function setTimezone(timezone: string): void {\n const previous = currentTimezone();\n const next = timezone.trim();\n\n override = next === \"\" ? undefined : next;\n\n if (currentTimezone() === previous) {\n return;\n }\n\n notify();\n dispatch(currentTimezone());\n}\n\nexport function useTimezone(): UseTimezoneReturn {\n const timezone = useSyncExternalStore(subscribe, snapshot, () => fallback);\n\n return { timezone, setTimezone } as const;\n}\n"],"mappings":";;;;AASA,IAAM,WAAW;AACjB,IAAM,4BAAY,IAAI,IAAgB;AAEtC,IAAI;AAEJ,SAAS,mBAA2B;CAClC,IAAI,OAAO,SAAS,aAClB,OAAO;CAGT,IAAI;EACF,OAAO,KAAK,eAAe,EAAE,gBAAgB,EAAE,YAAY;CAC7D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,WAAmB;CAC1B,OAAO,YAAY,eAAe,KAAK,iBAAiB;AAC1D;AAEA,SAAS,UAAU,UAAkC;CACnD,UAAU,IAAI,QAAQ;CAEtB,aAAa;EACX,UAAU,OAAO,QAAQ;CAC3B;AACF;AAEA,SAAS,SAAe;CACtB,UAAU,SAAS,aAAa,SAAS,CAAC;AAC5C;AAEA,sBAAsB,OAAO,CAAC;AAE9B,SAAS,SAAS,UAAwB;CACxC,IAAI,OAAO,WAAW,aACpB;CAGF,OAAO,cAAc,IAAI,YAAY,cAAc,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9F;AAEA,SAAgB,kBAA0B;CACxC,OAAO,SAAS;AAClB;AAEA,SAAgB,YAAY,UAAwB;CAClD,MAAM,WAAW,gBAAgB;CACjC,MAAM,OAAO,SAAS,KAAK;CAE3B,WAAW,SAAS,KAAK,KAAA,IAAY;CAErC,IAAI,gBAAgB,MAAM,UACxB;CAGF,OAAO;CACP,SAAS,gBAAgB,CAAC;AAC5B;AAEA,SAAgB,cAAiC;CAG/C,OAAO;EAAE,UAFQ,qBAAqB,WAAW,gBAAgB,QAExD;EAAU;CAAY;AACjC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,15 +4,16 @@ export { chatComponents } from './chat/plugin.js';
|
|
|
4
4
|
export { getActionEffects, isActionEffect, dispatchEffects, dispatchActionError, } from './effects/dispatch.js';
|
|
5
5
|
export { useEffectDispatcher } from './effects/use-effect-dispatcher.js';
|
|
6
6
|
export { builtinEffectHandlers, effectHandler, mergeEffectHandlers } from './effects/registry.js';
|
|
7
|
+
export { registerRichEditorExtension } from './form/rich-editor/registry.js';
|
|
7
8
|
export { initializeTheme, updateAppearance, useAppearance } from './appearance/index.js';
|
|
8
|
-
export { copyToClipboard
|
|
9
|
-
export { createLatticeApp, type CreateLatticeAppOptions } from './create-app.js';
|
|
9
|
+
export { copyToClipboard } from './clipboard/index.js';
|
|
10
|
+
export { createLatticeApp, type CreateLatticeAppI18nOptions, type CreateLatticeAppOptions, } from './create-app.js';
|
|
10
11
|
export { EventBridge } from './event-bridge.js';
|
|
11
12
|
export { Icon, IconRenderer, IconRendererProvider, SpriteProvider } from './icons/index.js';
|
|
12
13
|
export { createLayoutResolver, createPageResolver, pageComponentName, withVisitHeaders, } from './inertia.js';
|
|
13
14
|
export { Callouts, layoutComponents, OutletContext, SchemaLayout, SidebarCollapsedContext, useSidebarCollapsed, } from './layout/index.js';
|
|
14
15
|
export { Provider, useColumnRegistry, useComponentRegistry } from './provider.js';
|
|
15
|
-
export { onCallout, onToast,
|
|
16
|
+
export { onCallout, onToast, Toaster } from './toast/index.js';
|
|
16
17
|
export { createPlugin, createRegistry, eagerComponent, extendRegistry, lazyComponent, } from './core/registry.js';
|
|
17
18
|
export type { Plugin, Registry } from './core/registry.js';
|
|
18
19
|
export type { UseChatOptions } from './chat/hooks/use-chat.js';
|
|
@@ -20,19 +21,19 @@ export type { ChatFrame, ChatMessage, ChatRole, ChatStatus, ChatTransport, ChatT
|
|
|
20
21
|
export { Renderer } from './core/renderer.js';
|
|
21
22
|
export { LATTICE_REF_HEADER, withRefHeader } from './core/component-ref.js';
|
|
22
23
|
export { withHeaders } from './core/headers.js';
|
|
23
|
-
export { LATTICE_EVENT } from './
|
|
24
|
+
export { LATTICE_EVENT } from './core/event-names.js';
|
|
24
25
|
export type { ButtonVariant } from './ui/button.js';
|
|
25
|
-
export type { ReloadComponentEvent } from './
|
|
26
|
-
export type { ComponentProps, KnownPageContainer, LayoutPayload, Node,
|
|
26
|
+
export type { ReloadComponentEvent } from './core/event-names.js';
|
|
27
|
+
export type { ComponentProps, KnownPageContainer, LayoutPayload, Node, NodeProps, NodeType, PageContainer, PageBreadcrumb, PagePayload, ComponentPropsOf, RendererComponent, RendererComponentModule, RendererComponentProps, Schema, UnknownComponent, } from './core/types.js';
|
|
27
28
|
export { RealtimeListeners } from './realtime/listeners.js';
|
|
28
|
-
export type { ChannelVisibility, DateFormat,
|
|
29
|
+
export type { ChannelVisibility, DateFormat, Listen, NumberFormat } from './types/generated.js';
|
|
29
30
|
export { columnCell } from './table/registry.js';
|
|
30
31
|
export type { ColumnCellArgs, ColumnCellComponent, ColumnRegistry } from './table/registry.js';
|
|
31
|
-
export type { ColumnProps, ColumnPropsOf } from './table/types.js';
|
|
32
|
+
export type { ColumnNode, ColumnProps, ColumnPropsOf, FilterNode, FilterProps, FilterPropsOf, } from './table/types.js';
|
|
32
33
|
export type { Method } from '@inertiajs/core';
|
|
33
34
|
export type { ActionEffect, ActionResponse } from './effects/dispatch.js';
|
|
34
|
-
export type { EffectHandler, EffectHandlerRegistry, EffectOf, EffectProps, } from './effects/registry.js';
|
|
35
|
+
export type { EffectHandler, EffectHandlerRegistry, EffectOf, EffectProps, EffectPropsOf, } from './effects/registry.js';
|
|
36
|
+
export type { EditorExtensionPayloadOf, EditorExtensionProps, RichEditorExtensionDefinition, ToolbarButton, ToolbarControl, ToolbarItem, } from './form/rich-editor/registry.js';
|
|
35
37
|
export type { Appearance, ResolvedAppearance, UseAppearanceReturn } from './appearance/index.js';
|
|
36
|
-
export type { CopiedValue, CopyFn, UseClipboardReturn } from './clipboard/index.js';
|
|
37
38
|
export type { Callout, ToastMessage, Variant } from './toast/index.js';
|
|
38
39
|
export type { IconName, IconRendererFunction, IconRendererProps, KnownIcons, SpriteValue, } from './icons/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { initializeTheme, updateAppearance, useAppearance } from "./appearance/index.js";
|
|
2
2
|
import { createPlugin, createRegistry, eagerComponent, extendRegistry, lazyComponent } from "./core/registry.js";
|
|
3
3
|
import { useColumnRegistry, useComponentRegistry } from "./core/registry-context.js";
|
|
4
|
-
import { LATTICE_EVENT } from "./
|
|
4
|
+
import { LATTICE_EVENT } from "./core/event-names.js";
|
|
5
5
|
import { LATTICE_REF_HEADER, withRefHeader } from "./core/component-ref.js";
|
|
6
6
|
import { withHeaders } from "./core/headers.js";
|
|
7
7
|
import { Icon, SpriteProvider } from "./icons/sprite.js";
|
|
8
8
|
import { IconRenderer, IconRendererProvider } from "./icons/icon-renderer.js";
|
|
9
9
|
import { CollapsedContext, useCollapsed } from "./core/collapsed-context.js";
|
|
10
10
|
import { Renderer } from "./core/renderer.js";
|
|
11
|
-
import { onToast
|
|
11
|
+
import { onToast } from "./toast/toast.js";
|
|
12
12
|
import { onCallout } from "./toast/callout.js";
|
|
13
|
-
import { EventBridge } from "./event-bridge.js";
|
|
14
13
|
import { Toaster } from "./toast/toaster.js";
|
|
15
14
|
import Callouts from "./layout/components/callouts.js";
|
|
16
15
|
import { builtinEffectHandlers, effectHandler, mergeEffectHandlers } from "./effects/registry.js";
|
|
@@ -21,12 +20,13 @@ import { layoutComponents } from "./layout/plugin.js";
|
|
|
21
20
|
import SchemaLayout from "./layout/components/schema-layout.js";
|
|
22
21
|
import { RealtimeListeners } from "./realtime/listeners.js";
|
|
23
22
|
import { createLayoutResolver, createPageResolver, pageComponentName, withVisitHeaders } from "./inertia.js";
|
|
23
|
+
import { EventBridge } from "./event-bridge.js";
|
|
24
24
|
import { useChat } from "./chat/hooks/use-chat.js";
|
|
25
25
|
import { chatComponents } from "./chat/plugin.js";
|
|
26
26
|
import { copyToClipboard } from "./ui/copyable-text.js";
|
|
27
27
|
import { columnCell } from "./table/registry.js";
|
|
28
28
|
import { registry } from "./registry.js";
|
|
29
29
|
import { createLatticeApp } from "./create-app.js";
|
|
30
|
-
import {
|
|
30
|
+
import { registerRichEditorExtension } from "./form/rich-editor/registry.js";
|
|
31
31
|
import { Provider } from "./provider.js";
|
|
32
|
-
export { Callouts, EventBridge, Icon, IconRenderer, IconRendererProvider, LATTICE_EVENT, LATTICE_REF_HEADER, OutletContext, Provider, RealtimeListeners, Renderer, SchemaLayout, CollapsedContext as SidebarCollapsedContext, SpriteProvider, Toaster, builtinEffectHandlers, chatComponents, columnCell, copyToClipboard, createLatticeApp, createLayoutResolver, createPageResolver, createPlugin, createRegistry, dispatchActionError, dispatchEffects, eagerComponent, effectHandler, extendRegistry, getActionEffects, initializeTheme, isActionEffect, layoutComponents, lazyComponent, mergeEffectHandlers, onCallout, onToast, pageComponentName,
|
|
32
|
+
export { Callouts, EventBridge, Icon, IconRenderer, IconRendererProvider, LATTICE_EVENT, LATTICE_REF_HEADER, OutletContext, Provider, RealtimeListeners, Renderer, SchemaLayout, CollapsedContext as SidebarCollapsedContext, SpriteProvider, Toaster, builtinEffectHandlers, chatComponents, columnCell, copyToClipboard, createLatticeApp, createLayoutResolver, createPageResolver, createPlugin, createRegistry, dispatchActionError, dispatchEffects, eagerComponent, effectHandler, extendRegistry, getActionEffects, initializeTheme, isActionEffect, layoutComponents, lazyComponent, mergeEffectHandlers, onCallout, onToast, pageComponentName, registerRichEditorExtension, registry, updateAppearance, useAppearance, useChat, useColumnRegistry, useComponentRegistry, useEffectDispatcher, useCollapsed as useSidebarCollapsed, withHeaders, withRefHeader, withVisitHeaders };
|