@plitzi/sdk-shared 0.33.2 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/actions/cron.d.ts +34 -0
- package/dist/actions/cron.mjs +72 -0
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/index.mjs +5 -0
- package/dist/actions/triggerParams.d.ts +41 -0
- package/dist/actions/triggerParams.mjs +40 -0
- package/dist/actions/triggers.d.ts +29 -0
- package/dist/actions/triggers.mjs +4 -0
- package/dist/actions/validateDocument.d.ts +23 -0
- package/dist/actions/validateDocument.mjs +267 -0
- package/dist/auth/failureChannel.d.ts +9 -4
- package/dist/auth/failureChannel.mjs +3 -2
- package/dist/authoring/builder.d.ts +51 -0
- package/dist/authoring/builder.mjs +29 -0
- package/dist/authoring/declare.d.ts +64 -0
- package/dist/authoring/declare.mjs +4 -0
- package/dist/authoring/elementCallbacks.d.ts +13 -0
- package/dist/authoring/elementCallbacks.mjs +71 -0
- package/dist/authoring/index.d.ts +21 -0
- package/dist/authoring/index.mjs +6 -0
- package/dist/authoring/paramSpec.d.ts +51 -0
- package/dist/authoring/paramSpec.mjs +40 -0
- package/dist/authoring/spaceCallbacks.d.ts +10 -0
- package/dist/authoring/spaceCallbacks.mjs +51 -0
- package/dist/builder/contexts/BuilderContext.d.ts +2 -4
- package/dist/dataSource/getBindingsDetails.mjs +1 -1
- package/dist/dataSource/helpers/getSourceName.d.ts +1 -3
- package/dist/dataSource/helpers/getSourceName.mjs +1 -1
- package/dist/dataSource/index.d.ts +2 -0
- package/dist/dataSource/index.mjs +6 -5
- package/dist/dataSource/resolveVariables.d.ts +22 -0
- package/dist/dataSource/resolveVariables.mjs +16 -0
- package/dist/dataSource/utility/index.mjs +15 -13
- package/dist/dataSource/utility/not.d.ts +11 -0
- package/dist/dataSource/utility/not.mjs +15 -0
- package/dist/devTools/debugCookie.d.ts +16 -0
- package/dist/devTools/debugCookie.mjs +7 -0
- package/dist/devTools/index.d.ts +6 -2
- package/dist/devTools/index.mjs +4 -2
- package/dist/devTools/interactionLog.d.ts +14 -0
- package/dist/devTools/interactionLog.mjs +4 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.mjs +11 -9
- package/dist/helpers/reducerOrigin.d.ts +15 -0
- package/dist/helpers/reducerOrigin.mjs +4 -0
- package/dist/helpers/ruleEvaluator.d.ts +14 -0
- package/dist/helpers/ruleEvaluator.mjs +5 -0
- package/dist/helpers/twigWrapper/AST.d.ts +12 -1
- package/dist/helpers/twigWrapper/AST.mjs +0 -0
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +7 -0
- package/dist/helpers/twigWrapper/Parser/Cursor.d.ts +7 -0
- package/dist/helpers/twigWrapper/Parser/Cursor.mjs +5 -0
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +46 -8
- package/dist/helpers/twigWrapper/Parser/types.mjs +0 -0
- package/dist/helpers/twigWrapper/charClass.d.ts +7 -0
- package/dist/helpers/twigWrapper/charClass.mjs +16 -12
- package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +2 -2
- package/dist/helpers/utils.d.ts +0 -2
- package/dist/helpers/utils.mjs +16 -19
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.mjs +4 -3
- package/dist/hooks/useFontHead.d.ts +3 -0
- package/dist/hooks/useFontHead.mjs +23 -0
- package/dist/hooks/usePlitziServiceContext.d.ts +3 -2
- package/dist/index.mjs +61 -45
- package/dist/navigation/index.d.ts +1 -1
- package/dist/navigation/index.mjs +2 -2
- package/dist/navigation/routes.d.ts +8 -0
- package/dist/navigation/routes.mjs +39 -39
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +3 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.d.ts +5 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +2 -3
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +0 -1
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +24 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +150 -132
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -1
- package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +30 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +16 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +25 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +17 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.d.ts +30 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +40 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +16 -0
- package/dist/network/graphql/builder/Queries/index.mjs +24 -14
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +4 -0
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +5 -2
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -1
- package/dist/network/spaceEvents.d.ts +20 -1
- package/dist/network/spaceEvents.mjs +89 -74
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.mjs +2 -1
- package/dist/schema/serverElements.d.ts +16 -0
- package/dist/schema/serverElements.mjs +18 -0
- package/dist/server/actions/useActionsSync.d.ts +10 -0
- package/dist/server/actions/useActionsSync.mjs +7 -0
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.mjs +5 -4
- package/dist/server/rsc/refreshRsc.d.ts +11 -1
- package/dist/server/rsc/refreshRsc.mjs +30 -12
- package/dist/server/rsc/useRscSync.mjs +20 -13
- package/dist/state/runtimeStatePersist.mjs +4 -3
- package/dist/store/actionRuns/actionRunsRecorder.d.ts +36 -0
- package/dist/store/actionRuns/actionRunsRecorder.mjs +39 -0
- package/dist/store/actionRuns/actionRunsStore.d.ts +16 -0
- package/dist/store/actionRuns/actionRunsStore.mjs +5 -0
- package/dist/store/actionRuns/index.d.ts +6 -0
- package/dist/store/actionRuns/index.mjs +4 -0
- package/dist/store/actionRuns/useActionRuns.d.ts +13 -0
- package/dist/store/actionRuns/useActionRuns.mjs +10 -0
- package/dist/store/index.d.ts +46 -45
- package/dist/store/index.mjs +6 -3
- package/dist/store/renderSettings.d.ts +3 -0
- package/dist/store/renderSettings.mjs +17 -5
- package/dist/store/tracing/tracingCollector.d.ts +1 -1
- package/dist/store/tracing/tracingCollector.mjs +37 -35
- package/dist/store/tracing/tracingStore.d.ts +13 -0
- package/dist/store/tracing/tracingStore.mjs +3 -3
- package/dist/style/fontAssets.d.ts +12 -0
- package/dist/style/fontAssets.mjs +18 -0
- package/dist/style/fontValidation.d.ts +8 -0
- package/dist/style/fontValidation.mjs +107 -0
- package/dist/style/fonts.d.ts +74 -0
- package/dist/style/fonts.mjs +198 -0
- package/dist/style/fontsFromCss.d.ts +27 -0
- package/dist/style/fontsFromCss.mjs +43 -0
- package/dist/style/index.d.ts +4 -0
- package/dist/style/index.mjs +5 -1
- package/dist/style/styleConstants.d.ts +2 -2
- package/dist/style/styleConstants.mjs +1 -0
- package/dist/theme/ThemeProvider.d.ts +36 -6
- package/dist/theme/ThemeProvider.mjs +49 -35
- package/dist/theme/ThemeScope.d.ts +16 -0
- package/dist/theme/ThemeScope.mjs +6 -0
- package/dist/theme/index.d.ts +7 -1
- package/dist/theme/index.mjs +6 -2
- package/dist/theme/themeCookie.d.ts +30 -0
- package/dist/theme/themeCookie.mjs +24 -0
- package/dist/theme/themeStore.d.ts +40 -0
- package/dist/theme/themeStore.mjs +17 -0
- package/dist/theme/useTheme.d.ts +29 -0
- package/dist/theme/useTheme.mjs +20 -0
- package/dist/types/ActionTypes.d.ts +396 -0
- package/dist/types/ActionTypes.mjs +0 -0
- package/dist/types/AuthTypes.d.ts +23 -2
- package/dist/types/BuilderTypes.d.ts +0 -12
- package/dist/types/CommonTypes.d.ts +13 -0
- package/dist/types/DevToolsTypes.d.ts +57 -14
- package/dist/types/EventBridgeTypes.d.ts +1 -1
- package/dist/types/InteractionTypes.d.ts +23 -3
- package/dist/types/PluginTypes.d.ts +0 -3
- package/dist/types/SchemaTypes.d.ts +29 -4
- package/dist/types/ServerTypes.d.ts +390 -46
- package/dist/types/SpaceTypes.d.ts +16 -0
- package/dist/types/StoreTypes.d.ts +181 -3
- package/dist/types/StyleTypes.d.ts +83 -4
- package/dist/types/TemplateTypes.d.ts +20 -0
- package/dist/types/TemplateTypes.mjs +0 -0
- package/dist/types/ThemeTypes.d.ts +28 -1
- package/dist/types/index.d.ts +2 -0
- package/eslint.config.mjs +2 -0
- package/package.json +244 -29
- package/vite.config.ts +27 -7
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InteractionCallbackParamValues, InteractionCallbackType } from './InteractionTypes';
|
|
2
2
|
import { Style } from './StyleTypes';
|
|
3
3
|
import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
4
4
|
export type ElementRuntime = 'server' | 'client' | 'shared';
|
|
5
|
+
/**
|
|
6
|
+
* When an element's CONTENTS are mounted, relative to its own `visibility`.
|
|
7
|
+
*
|
|
8
|
+
* About the subtree, never about the element itself: whatever a hidden element registers — a modal's `openModal`
|
|
9
|
+
* callback, a form's source, an interaction trigger — is registered by the element, so an element that stops
|
|
10
|
+
* rendering is an element nothing can ever show again. The shell always renders; what these decide is its items.
|
|
11
|
+
*
|
|
12
|
+
* - `eager` (default): always mounted. Right for an element that is on screen almost always — deferring it would only
|
|
13
|
+
* add a render cycle between the page loading and the page appearing — and for a hidden element whose contents
|
|
14
|
+
* have to be in the server's HTML: a section a search engine should read, a panel a CSS-only accordion opens
|
|
15
|
+
* without the SDK's help.
|
|
16
|
+
* - `lazy`: mounted the first time it is shown, and kept from then on. The one for elements that start hidden by
|
|
17
|
+
* nature, and those declare it themselves — a modal or a dialog nobody opens costs nothing, and one that has been
|
|
18
|
+
* opened keeps what the visitor typed into it.
|
|
19
|
+
* - `visible`: mounted only while shown. Pays the build cost on every reveal and drops the subtree's state on
|
|
20
|
+
* every hide — worth it for contents that are expensive to KEEP (a live map, a video, a polling source).
|
|
21
|
+
*/
|
|
5
22
|
export type ElementLoadStrategy = 'eager' | 'lazy' | 'visible';
|
|
6
23
|
export type SchemaRsc = {
|
|
7
24
|
enabled?: boolean;
|
|
@@ -23,7 +40,7 @@ export type ElementBinding = {
|
|
|
23
40
|
enabled?: boolean;
|
|
24
41
|
to: string;
|
|
25
42
|
};
|
|
26
|
-
export type ElementInteraction<T extends Record<
|
|
43
|
+
export type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
27
44
|
id: string;
|
|
28
45
|
title: string;
|
|
29
46
|
type: InteractionCallbackType;
|
|
@@ -57,12 +74,19 @@ export type ElementDefinition = {
|
|
|
57
74
|
};
|
|
58
75
|
/** Where this element is rendered. 'server' = SSR only, 'client' = browser only, 'shared' = both (default). */
|
|
59
76
|
runtime?: ElementRuntime;
|
|
60
|
-
/**
|
|
77
|
+
/** When this element's items are mounted, relative to its `visibility`. See {@link ElementLoadStrategy}. */
|
|
61
78
|
loadStrategy?: ElementLoadStrategy;
|
|
62
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* An element, keyed by the one name it answers to.
|
|
82
|
+
*
|
|
83
|
+
* `id` is that name: the `flat` key, what `parentId`/`items`/`rootId` point at, the `<type>_<id>` a binding's source
|
|
84
|
+
* is built from, and the target an interaction wires to. It is chosen — typed by a person in the builder's tree,
|
|
85
|
+
* written by an agent, or minted as `<type>-<n>` — never an opaque generated handle, so the key an author writes
|
|
86
|
+
* down is the key the runtime resolves. `definition.label` stays free display text and wires nothing.
|
|
87
|
+
*/
|
|
63
88
|
export type Element<TAttributes extends Record<string, unknown> = Record<string, unknown>> = {
|
|
64
89
|
id: string;
|
|
65
|
-
idRef?: string;
|
|
66
90
|
attributes: TAttributes & {
|
|
67
91
|
subType?: string;
|
|
68
92
|
};
|
|
@@ -144,6 +168,7 @@ export type SchemaContextValue = {
|
|
|
144
168
|
schemaUpdate?: (newSchema: SchemaRaw, fromSubscriptions?: boolean) => void;
|
|
145
169
|
schemaAddElement?: (to: string, data: Element, dropPosition?: DropPosition, initialItems?: Record<string, Element>, variables?: SchemaVariable[], fromSubscriptions?: boolean) => void;
|
|
146
170
|
schemaUpdateElement?: (element: Element, fromSubscriptions?: boolean) => void;
|
|
171
|
+
schemaRenameElement?: (elementId: Element['id'], id: Element['id'], fromSubscriptions?: boolean) => void;
|
|
147
172
|
schemaUpdateElements?: (elements: Element[], fromSubscriptions?: boolean) => void;
|
|
148
173
|
schemaMoveElement?: (from: string, to: string, elementId: string, dropPosition?: DropPosition, fromSubscriptions?: boolean) => void;
|
|
149
174
|
schemaCloneElement?: (elementId: string, targetId?: string, fromSubscriptions?: boolean) => void;
|