@plitzi/sdk-shared 0.37.2 → 0.37.4
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 +1162 -0
- package/dist/actions/access.d.ts +12 -0
- package/dist/actions/access.mjs +13 -0
- package/dist/actions/functions.d.ts +27 -0
- package/dist/actions/functions.mjs +18 -0
- package/dist/actions/index.d.ts +4 -0
- package/dist/actions/index.mjs +9 -7
- package/dist/auth/index.d.ts +2 -1
- package/dist/auth/index.mjs +2 -2
- package/dist/auth/visitorRoles.d.ts +27 -0
- package/dist/auth/visitorRoles.mjs +48 -0
- package/dist/authoring/builder.mjs +1 -0
- package/dist/authoring/declare.d.ts +53 -0
- package/dist/authoring/declare.mjs +2 -2
- package/dist/authoring/index.mjs +5 -5
- package/dist/authoring/paramSpec.d.ts +1 -1
- package/dist/authoring/paramSpec.mjs +1 -0
- package/dist/authoring/spaceCallbacks.mjs +2 -2
- package/dist/dataSource/computed.d.ts +21 -0
- package/dist/dataSource/computed.mjs +45 -0
- package/dist/dataSource/getBindingsDetails.mjs +35 -34
- package/dist/dataSource/index.d.ts +1 -0
- package/dist/dataSource/index.mjs +7 -6
- package/dist/dataSource/utility/not.mjs +4 -7
- package/dist/dataSource/utility/stringToArray.mjs +1 -1
- package/dist/dataSource/utility/truthiness.d.ts +1 -0
- package/dist/dataSource/utility/truthiness.mjs +8 -0
- package/dist/dataSource/utility/twigTemplate.d.ts +2 -1
- package/dist/dataSource/utility/twigTemplate.mjs +29 -17
- package/dist/devTools/utils/PlitziConsole.mjs +22 -22
- package/dist/helpers/cookies.d.ts +10 -0
- package/dist/helpers/cookies.mjs +19 -0
- package/dist/helpers/fetchManifest.d.ts +9 -0
- package/dist/helpers/fetchManifest.mjs +3 -6
- package/dist/helpers/formatDate.d.ts +5 -3
- package/dist/helpers/formatDate.mjs +34 -36
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.mjs +17 -14
- package/dist/helpers/isDate.d.ts +7 -0
- package/dist/helpers/isDate.mjs +15 -0
- package/dist/helpers/keys.d.ts +42 -0
- package/dist/helpers/keys.mjs +91 -0
- package/dist/helpers/twigWrapper/AST.d.ts +2 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.d.ts +12 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +57 -34
- package/dist/helpers/twigWrapper/Evaluator/index.d.ts +1 -1
- package/dist/helpers/twigWrapper/Evaluator/index.mjs +2 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.d.ts +2 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +147 -34
- package/dist/helpers/twigWrapper/Parser/Parser.d.ts +2 -1
- package/dist/helpers/twigWrapper/Parser/Parser.mjs +21 -20
- package/dist/helpers/twigWrapper/filters/filters.mjs +130 -112
- package/dist/helpers/twigWrapper/index.d.ts +5 -2
- package/dist/helpers/twigWrapper/index.mjs +7 -5
- package/dist/helpers/twigWrapper/inspectTemplate.d.ts +23 -0
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +110 -0
- package/dist/helpers/twigWrapper/processTwig/helpers.d.ts +7 -0
- package/dist/helpers/twigWrapper/processTwig/helpers.mjs +2 -1
- package/dist/helpers/twigWrapper/processTwig/index.d.ts +2 -1
- package/dist/helpers/twigWrapper/processTwig/index.mjs +3 -2
- package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +28 -0
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +73 -16
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.d.ts +17 -0
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +14 -0
- package/dist/helpers/twigWrapper/templateRoots.d.ts +11 -0
- package/dist/helpers/twigWrapper/templateRoots.mjs +4 -4
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.d.ts +1 -1
- package/dist/history/describe.d.ts +29 -0
- package/dist/history/describe.mjs +93 -0
- package/dist/history/diff.d.ts +33 -0
- package/dist/history/diff.mjs +73 -0
- package/dist/history/index.d.ts +3 -0
- package/dist/history/index.mjs +3 -0
- package/dist/history/types.d.ts +48 -0
- package/dist/history/types.mjs +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +76 -67
- package/dist/navigation/index.d.ts +1 -1
- package/dist/navigation/index.mjs +2 -2
- package/dist/navigation/routes.d.ts +11 -1
- package/dist/navigation/routes.mjs +15 -10
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.d.ts +14 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +3 -3
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +2 -1
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.d.ts +3 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.d.ts +11 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +24 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +9 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -1
- package/dist/network/graphql/builder/Mutations/index.d.ts +28 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +108 -84
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.d.ts +23 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +49 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +13 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.d.ts +17 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +22 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +32 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +16 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +17 -3
- package/dist/network/graphql/builder/Queries/index.mjs +30 -22
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -1
- package/dist/network/graphql/sdk/Mutations/index.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +2 -91
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +2 -44
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +1 -1
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +2 -55
- package/dist/network/graphql/sdk/Queries/index.d.ts +1 -5
- package/dist/network/index.mjs +7 -7
- package/dist/network/spaceEvents.d.ts +33 -3
- package/dist/network/spaceEvents.mjs +102 -89
- package/dist/realtime/client.d.ts +46 -0
- package/dist/realtime/client.mjs +192 -0
- package/dist/realtime/index.d.ts +6 -0
- package/dist/realtime/index.mjs +4 -0
- package/dist/realtime/presence.d.ts +38 -0
- package/dist/realtime/presence.mjs +70 -0
- package/dist/realtime/topics.d.ts +36 -0
- package/dist/realtime/topics.mjs +25 -0
- package/dist/server/actions/useRealtimeSync.d.ts +9 -0
- package/dist/server/actions/useRealtimeSync.mjs +7 -0
- package/dist/state/index.d.ts +1 -0
- package/dist/state/index.mjs +3 -2
- package/dist/state/paintedState.d.ts +52 -0
- package/dist/state/paintedState.mjs +37 -0
- package/dist/state/runtimeStatePersist.d.ts +8 -1
- package/dist/state/runtimeStatePersist.mjs +79 -29
- package/dist/store/index.d.ts +45 -45
- package/dist/store/renderSettings.d.ts +6 -3
- package/dist/store/tracing/index.d.ts +1 -0
- package/dist/store/tracing/tracingCollector.d.ts +17 -1
- package/dist/store/tracing/tracingCollector.mjs +5 -0
- package/dist/style/index.d.ts +1 -0
- package/dist/style/index.mjs +3 -2
- package/dist/style/runtimeStyle.d.ts +29 -0
- package/dist/style/runtimeStyle.mjs +7 -0
- package/dist/style/styleConstants.d.ts +3 -2
- package/dist/style/styleConstants.mjs +2 -0
- package/dist/style/styleStates.d.ts +14 -1
- package/dist/style/styleStates.mjs +10 -7
- package/dist/theme/ThemeProvider.mjs +35 -29
- package/dist/theme/themeCookie.mjs +11 -15
- package/dist/types/ActionTypes.d.ts +4 -0
- package/dist/types/AuthTypes.d.ts +11 -1
- package/dist/types/CommonTypes.d.ts +6 -0
- package/dist/types/FunctionTypes.d.ts +52 -0
- package/dist/types/FunctionTypes.mjs +0 -0
- package/dist/types/PluginTypes.d.ts +0 -1
- package/dist/types/RealtimeTypes.d.ts +94 -0
- package/dist/types/RealtimeTypes.mjs +0 -0
- package/dist/types/SchemaTypes.d.ts +54 -0
- package/dist/types/SchemaTypes.mjs +8 -0
- package/dist/types/ServerTypes.d.ts +259 -15
- package/dist/types/SpaceTypes.d.ts +53 -0
- package/dist/types/StateTypes.d.ts +6 -0
- package/dist/types/StoreTypes.d.ts +11 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.mjs +3 -2
- package/package.json +180 -11
- package/vite.config.ts +0 -12
- package/dist/network/graphql/builder/Queries/PluginsQuery.d.ts +0 -9
- package/dist/network/graphql/builder/Queries/PluginsQuery.mjs +0 -54
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionAccess } from '../types/ActionTypes';
|
|
2
|
+
/** Who is asking, as far as access is concerned: whether they are signed in, and what they may do. */
|
|
3
|
+
export type AccessCaller = {
|
|
4
|
+
permissions: readonly string[];
|
|
5
|
+
} | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Why a caller may not use something guarded by `access`, or `undefined` when they may.
|
|
8
|
+
*
|
|
9
|
+
* One reading of the access vocabulary for everything that speaks it — an action's trigger, a realtime channel — so
|
|
10
|
+
* `session` and `role` cannot come to mean two things in two places.
|
|
11
|
+
*/
|
|
12
|
+
export declare const accessRefusal: (access: ActionAccess | undefined, caller: AccessCaller) => "unauthenticated" | "forbidden" | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/actions/access.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
if (!e) return "forbidden";
|
|
4
|
+
if (e.mode !== "public") {
|
|
5
|
+
if (!t) return "unauthenticated";
|
|
6
|
+
if (e.mode === "role") {
|
|
7
|
+
let n = new Set(t.permissions);
|
|
8
|
+
return e.permissions.every((e) => n.has(e)) ? void 0 : "forbidden";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as accessRefusal };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a space's functions answer HTTP: `GET /feed/:id` declared, `GET /api/feed/42` served. The path is
|
|
3
|
+
* the functions' and never a page's — the page server and the page linter both read it from here.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FUNCTION_ROUTES_PREFIX = "/api";
|
|
6
|
+
/** Whether a page at `path` would sit where the space's functions answer. */
|
|
7
|
+
export declare const isFunctionRoutePath: (path: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether a path is one of a space's functions files: relative, inside `functions/`, a `.ts`, `.js`, `.mjs` or `.json`.
|
|
10
|
+
* The one rule for what a source is — the platform's build refuses anything else, and every reader of a working copy
|
|
11
|
+
* reads exactly this.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isFunctionsSourcePath: (path: string) => boolean;
|
|
14
|
+
/** How a reader reaches a directory, whatever it runs on: Node's `fs`, a test's map. */
|
|
15
|
+
export type FunctionsSourceReader = {
|
|
16
|
+
list: (dir: string) => Promise<{
|
|
17
|
+
name: string;
|
|
18
|
+
directory: boolean;
|
|
19
|
+
}[]>;
|
|
20
|
+
read: (file: string) => Promise<string>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A space's functions as a directory holds them — every source file under `root`, by its path there (`lib/feed.ts`),
|
|
24
|
+
* `node_modules` and dotted folders skipped. What a project's working copy is read as, by the CLI and by a server
|
|
25
|
+
* loading its own; a directory that is not there reads as none.
|
|
26
|
+
*/
|
|
27
|
+
export declare const readFunctionsSource: (root: string, reader: FunctionsSourceReader) => Promise<Record<string, string>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/actions/functions.ts
|
|
2
|
+
var e = "/api", t = (e) => e === "/api" || e.startsWith("/api/"), n = (e) => /^[A-Za-z0-9_][A-Za-z0-9_./-]*\.(ts|js|mjs|json)$/.test(e) && !e.split("/").some((e) => e === ".." || e === "." || e === ""), r = async (e, t) => {
|
|
3
|
+
let r = {}, i = async (a) => {
|
|
4
|
+
let o;
|
|
5
|
+
try {
|
|
6
|
+
o = await t.list(a ? `${e}/${a}` : e);
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
for (let s of o) {
|
|
11
|
+
let o = a ? `${a}/${s.name}` : s.name;
|
|
12
|
+
s.directory ? s.name !== "node_modules" && !s.name.startsWith(".") && await i(o) : n(o) && (r[o] = await t.read(`${e}/${o}`));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return await i(""), r;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { e as FUNCTION_ROUTES_PREFIX, t as isFunctionRoutePath, n as isFunctionsSourcePath, r as readFunctionsSource };
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
export { accessRefusal } from './access';
|
|
1
2
|
export { cronFiresBetween, cronMatches, cronNextFire, isKnownTimeZone, parseCron, zonedClock } from './cron';
|
|
2
3
|
export { FAILURE_HANDLER_TASK } from './failureHandler';
|
|
4
|
+
export { FUNCTION_ROUTES_PREFIX, isFunctionRoutePath, isFunctionsSourcePath, readFunctionsSource } from './functions';
|
|
3
5
|
export { triggerAccess, triggerCacheMs, triggerHasStaleVerify, triggerInput, triggerVerify } from './triggerParams';
|
|
4
6
|
export { actionName, actionTriggers, isActionEnabled } from './triggers';
|
|
5
7
|
export { validateActionDocument } from './validateDocument';
|
|
6
8
|
export { isSingleEmailAddress, readSmtpCredential, SMTP_CREDENTIAL_KEYS } from './smtp';
|
|
9
|
+
export type { AccessCaller } from './access';
|
|
10
|
+
export type { FunctionsSourceReader } from './functions';
|
|
7
11
|
export type { CronExpression } from './cron';
|
|
8
12
|
export type { SmtpCredentialProblem, SmtpCredentialReading, SmtpSecurity, SmtpSettings } from './smtp';
|
|
9
13
|
export type { ActionDocumentIssue, ActionDocumentReport } from './validateDocument';
|
package/dist/actions/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { accessRefusal as e } from "./access.mjs";
|
|
2
|
+
import { cronFiresBetween as t, cronMatches as n, cronNextFire as r, isKnownTimeZone as i, parseCron as a, zonedClock as o } from "./cron.mjs";
|
|
3
|
+
import { FAILURE_HANDLER_TASK as s } from "./failureHandler.mjs";
|
|
4
|
+
import { FUNCTION_ROUTES_PREFIX as c, isFunctionRoutePath as l, isFunctionsSourcePath as u, readFunctionsSource as d } from "./functions.mjs";
|
|
5
|
+
import { triggerAccess as f, triggerCacheMs as p, triggerHasStaleVerify as m, triggerInput as h, triggerVerify as g } from "./triggerParams.mjs";
|
|
6
|
+
import { actionName as _, actionTriggers as v, isActionEnabled as y } from "./triggers.mjs";
|
|
7
|
+
import { validateActionDocument as b } from "./validateDocument.mjs";
|
|
8
|
+
import { SMTP_CREDENTIAL_KEYS as x, isSingleEmailAddress as S, readSmtpCredential as C } from "./smtp.mjs";
|
|
9
|
+
export { s as FAILURE_HANDLER_TASK, c as FUNCTION_ROUTES_PREFIX, x as SMTP_CREDENTIAL_KEYS, e as accessRefusal, _ as actionName, v as actionTriggers, t as cronFiresBetween, n as cronMatches, r as cronNextFire, y as isActionEnabled, l as isFunctionRoutePath, u as isFunctionsSourcePath, i as isKnownTimeZone, S as isSingleEmailAddress, a as parseCron, d as readFunctionsSource, C as readSmtpCredential, f as triggerAccess, p as triggerCacheMs, m as triggerHasStaleVerify, h as triggerInput, g as triggerVerify, b as validateActionDocument, o as zonedClock };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { createAuthFailureLink } from './authFailureLink';
|
|
2
1
|
export { authFailureFromResponse, onAuthFailure, reportAuthFailure, sameRegistrableDomain } from './failureChannel';
|
|
2
|
+
export { checkVisitorRoles, visitorAccess, VISITOR_NAME } from './visitorRoles';
|
|
3
3
|
export type { AuthFailureListener, AuthFailureSignal } from './failureChannel';
|
|
4
|
+
export type { VisitorRoles } from './visitorRoles';
|
package/dist/auth/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { authFailureFromResponse as e, onAuthFailure as t, reportAuthFailure as n, sameRegistrableDomain as r } from "./failureChannel.mjs";
|
|
2
|
-
import {
|
|
3
|
-
export { e as authFailureFromResponse,
|
|
2
|
+
import { VISITOR_NAME as i, checkVisitorRoles as a, visitorAccess as o } from "./visitorRoles.mjs";
|
|
3
|
+
export { i as VISITOR_NAME, e as authFailureFromResponse, a as checkVisitorRoles, t as onAuthFailure, n as reportAuthFailure, r as sameRegistrableDomain, o as visitorAccess };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A space's visitor roles (`settings.visitorRoles`): each role a signed-in visitor may hold there, with the permissions
|
|
3
|
+
* it gives — what an action's `access: 'role'` and a page's `can()` are answered from.
|
|
4
|
+
*
|
|
5
|
+
* One reading of them for everyone who handles them: authoring refuses a space that writes them wrong, the builder's
|
|
6
|
+
* save refuses the same, and the server that resolves a visitor never reads a malformed map as a grant.
|
|
7
|
+
*/
|
|
8
|
+
export type VisitorRoles = Record<string, string[]>;
|
|
9
|
+
/** A role or a permission: a name a person reads in the builder and an action names in its access rule. */
|
|
10
|
+
export declare const VISITOR_NAME: RegExp;
|
|
11
|
+
/** The roles as declared, or what is wrong with them — said so it can be fixed from the message alone. */
|
|
12
|
+
export declare const checkVisitorRoles: (value: unknown) => {
|
|
13
|
+
ok: true;
|
|
14
|
+
roles: VisitorRoles;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
problem: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* What a visitor holding `held` may do in a space that declares `declared`: the roles the space still declares, and
|
|
21
|
+
* every permission they give. A role the space no longer declares gives nothing — a grant outlives an edit of the
|
|
22
|
+
* roles, and must not outlive what it meant. Malformed roles give nothing at all.
|
|
23
|
+
*/
|
|
24
|
+
export declare const visitorAccess: (declared: unknown, held: readonly string[]) => {
|
|
25
|
+
roles: string[];
|
|
26
|
+
permissions: string[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/auth/visitorRoles.ts
|
|
2
|
+
var e = /^[A-Za-z][\w-]{0,63}$/, t = "`visitorRoles: { author: [\"postPublish\"], editor: [\"postPublish\", \"postEdit\"] }`", n = (n) => {
|
|
3
|
+
if (typeof n != "object" || !n || Array.isArray(n)) return {
|
|
4
|
+
ok: !1,
|
|
5
|
+
problem: `\`settings.visitorRoles\` is ${JSON.stringify(n)}. Write each role with its permissions: ${t}.`
|
|
6
|
+
};
|
|
7
|
+
let r = {};
|
|
8
|
+
for (let [i, a] of Object.entries(n)) {
|
|
9
|
+
if (!e.test(i)) return {
|
|
10
|
+
ok: !1,
|
|
11
|
+
problem: `\`settings.visitorRoles\` has the role "${i}". A role is a name — a letter, then letters, digits, \`-\` or \`_\` — like "author".`
|
|
12
|
+
};
|
|
13
|
+
if (!Array.isArray(a) || a.length === 0) return {
|
|
14
|
+
ok: !1,
|
|
15
|
+
problem: `\`settings.visitorRoles.${i}\` is ${JSON.stringify(a)}. A role is the permissions it gives, as a list of names: ${t}.`
|
|
16
|
+
};
|
|
17
|
+
let n = /* @__PURE__ */ new Set();
|
|
18
|
+
for (let t of a) {
|
|
19
|
+
if (typeof t != "string" || !e.test(t)) return {
|
|
20
|
+
ok: !1,
|
|
21
|
+
problem: `\`settings.visitorRoles.${i}\` has ${JSON.stringify(t)}, which is not a permission name. Name it the way an action's \`access: 'role'\` asks for it, like "postPublish".`
|
|
22
|
+
};
|
|
23
|
+
if (n.has(t)) return {
|
|
24
|
+
ok: !1,
|
|
25
|
+
problem: `\`settings.visitorRoles.${i}\` names "${t}" twice.`
|
|
26
|
+
};
|
|
27
|
+
n.add(t);
|
|
28
|
+
}
|
|
29
|
+
r[i] = [...n];
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
ok: !0,
|
|
33
|
+
roles: r
|
|
34
|
+
};
|
|
35
|
+
}, r = (e, t) => {
|
|
36
|
+
let r = e === void 0 ? void 0 : n(e);
|
|
37
|
+
if (!r?.ok) return {
|
|
38
|
+
roles: [],
|
|
39
|
+
permissions: []
|
|
40
|
+
};
|
|
41
|
+
let i = [...new Set(t)].filter((e) => Object.hasOwn(r.roles, e));
|
|
42
|
+
return {
|
|
43
|
+
roles: i,
|
|
44
|
+
permissions: [...new Set(i.flatMap((e) => r.roles[e]))]
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { e as VISITOR_NAME, n as checkVisitorRoles, r as visitorAccess };
|
|
@@ -6,6 +6,7 @@ var e = {
|
|
|
6
6
|
boolean: "boolean",
|
|
7
7
|
number: "text",
|
|
8
8
|
scalar: "text",
|
|
9
|
+
json: "codemirror-json",
|
|
9
10
|
elementIds: "elements"
|
|
10
11
|
}, t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[-_\s]+/).map((e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" "), n = (n, r) => ({
|
|
11
12
|
type: r.builderType ?? e[r.type],
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InteractionCallback } from '../types/InteractionTypes';
|
|
2
|
+
import { PluginBuilder, PluginSchema } from '../types/PluginTypes';
|
|
3
|
+
import { ElementDefinition } from '../types/SchemaTypes';
|
|
2
4
|
/**
|
|
3
5
|
* How an element says what it can be authored with.
|
|
4
6
|
*
|
|
@@ -50,6 +52,15 @@ export interface ElementDeclarationData {
|
|
|
50
52
|
* else it throws on its first render. A dropdown's panel, a tab container's header and body.
|
|
51
53
|
*/
|
|
52
54
|
ancestorType?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The values an enumerated attribute takes — a heading's `subType`, a link's `mode` — by attribute name.
|
|
57
|
+
*
|
|
58
|
+
* A component's props say this in TypeScript, which is gone at run time; an author writing JavaScript, a document
|
|
59
|
+
* that arrived as JSON or a value that went through a cast reaches the element anyway, and `subType: 'h7'` renders an
|
|
60
|
+
* `<h7>`. Written with {@link valuesOf}, so the list cannot drift from the props it mirrors; read by the authoring
|
|
61
|
+
* surface to refuse a value outside it.
|
|
62
|
+
*/
|
|
63
|
+
attributeValues?: Record<string, readonly string[]>;
|
|
53
64
|
content?: {
|
|
54
65
|
attributes?: Record<string, unknown>;
|
|
55
66
|
definition?: {
|
|
@@ -57,6 +68,39 @@ export interface ElementDeclarationData {
|
|
|
57
68
|
};
|
|
58
69
|
};
|
|
59
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* A plugin's declaration: an element of somebody's own, declared the way the built-in ones declare themselves.
|
|
73
|
+
*
|
|
74
|
+
* On top of what {@link ElementDeclarationData} says of any element it carries the whole `content`, because for a
|
|
75
|
+
* plugin that is also what gets PUBLISHED — its build writes it into `plugin-manifest.json`, which the builder, the page
|
|
76
|
+
* server and the MCP server read before they load any code. Data only, so that build can read it without React.
|
|
77
|
+
*
|
|
78
|
+
* `A` is the attributes the element accepts: its component's props, minus what the runtime supplies.
|
|
79
|
+
* `const declaration = { … } satisfies PluginDeclaration<SeatPickerAttributes>` then refuses a default the component
|
|
80
|
+
* does not take.
|
|
81
|
+
*/
|
|
82
|
+
export interface PluginDeclaration<A extends object = Record<string, unknown>> extends Omit<ElementDeclarationData, 'content'> {
|
|
83
|
+
content: {
|
|
84
|
+
/** The element's starting attributes — its component's defaults, where the builder can show them. */
|
|
85
|
+
attributes: A;
|
|
86
|
+
definition: Omit<ElementDefinition, 'rootId' | 'parentId' | 'interactions' | 'runtime' | 'loadStrategy'> & {
|
|
87
|
+
/** What the element is for, in a sentence: the builder shows it, and an agent reads it to choose the element. */
|
|
88
|
+
description?: string;
|
|
89
|
+
};
|
|
90
|
+
builder: PluginBuilder;
|
|
91
|
+
/** How the builder's catalogue shows the element. Whether it is verified is the platform's to say, never its own. */
|
|
92
|
+
market: {
|
|
93
|
+
category: string;
|
|
94
|
+
owner: string;
|
|
95
|
+
license: string;
|
|
96
|
+
website: string;
|
|
97
|
+
backgroundColor: string;
|
|
98
|
+
icon: string;
|
|
99
|
+
};
|
|
100
|
+
defaultStyle: PluginSchema['defaultStyle'];
|
|
101
|
+
settings?: Record<string, string | number | boolean>;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
60
104
|
/**
|
|
61
105
|
* The attributes a declaration accepts, defaulting to "anything" for one that never said.
|
|
62
106
|
*
|
|
@@ -81,5 +125,14 @@ type AuthorableProps<Props, Injected extends keyof Props> = Omit<Props, 'ref' |
|
|
|
81
125
|
* "any value that is not null" everywhere else it could land.
|
|
82
126
|
*/
|
|
83
127
|
export type AuthorableAttributes<Props, Injected extends keyof Props = never> = keyof AuthorableProps<Props, Injected> extends never ? unknown : Partial<AuthorableProps<Props, Injected>>;
|
|
128
|
+
/**
|
|
129
|
+
* Every value of a string-literal union, as a list — and a compile error when the list leaves one out.
|
|
130
|
+
*
|
|
131
|
+
* `valuesOf<NonNullable<ButtonProps['subType']>>()(['button', 'submit', 'reset'])`. A value outside the union is
|
|
132
|
+
* refused by the parameter type; one the union has and the list does not makes the argument ask for `missing`.
|
|
133
|
+
*/
|
|
134
|
+
export declare const valuesOf: <T extends string>() => <const V extends readonly T[]>(values: V & ([Exclude<T, V[number]>] extends [never] ? unknown : {
|
|
135
|
+
readonly missing: Exclude<T, V[number]>;
|
|
136
|
+
})) => readonly string[];
|
|
84
137
|
export declare const elementDeclaration: <A>() => <const D extends ElementDeclarationData>(declaration: D) => D & ElementAttributesBrand<A>;
|
|
85
138
|
export {};
|
package/dist/authoring/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toBuilderParams as e, toInteractionCallback as t, toInteractionCallbacks as n } from "./builder.mjs";
|
|
2
|
-
import { elementDeclaration as r } from "./declare.mjs";
|
|
3
|
-
import { hiddenParams as
|
|
4
|
-
import { BUILTIN_ELEMENT_CALLBACKS as
|
|
5
|
-
import { spaceCallbacks as
|
|
6
|
-
export {
|
|
2
|
+
import { elementDeclaration as r, valuesOf as i } from "./declare.mjs";
|
|
3
|
+
import { hiddenParams as a, invalidParams as o, missingRequiredParams as s, reconcileParams as c } from "./paramSpec.mjs";
|
|
4
|
+
import { BUILTIN_ELEMENT_CALLBACKS as l, applyElementCallback as u, getElementCallback as d } from "./elementCallbacks.mjs";
|
|
5
|
+
import { spaceCallbacks as f } from "./spaceCallbacks.mjs";
|
|
6
|
+
export { l as BUILTIN_ELEMENT_CALLBACKS, u as applyElementCallback, r as elementDeclaration, d as getElementCallback, a as hiddenParams, o as invalidParams, s as missingRequiredParams, c as reconcileParams, f as spaceCallbacks, e as toBuilderParams, t as toInteractionCallback, n as toInteractionCallbacks, i as valuesOf };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InteractionParamType } from '../types';
|
|
2
|
-
export type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'elementIds';
|
|
2
|
+
export type BuiltinParamType = 'text' | 'textarea' | 'select' | 'boolean' | 'number' | 'scalar' | 'json' | 'elementIds';
|
|
3
3
|
export interface BuiltinParam {
|
|
4
4
|
type: BuiltinParamType;
|
|
5
5
|
description: string;
|
|
@@ -14,6 +14,7 @@ var t = (e, t, n) => {
|
|
|
14
14
|
case "number": return typeof e == "number" || typeof e == "string" && r(e);
|
|
15
15
|
case "select": return typeof e == "string" && (!t.options || t.options.includes(e));
|
|
16
16
|
case "scalar": return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
17
|
+
case "json": return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "object" && !!e;
|
|
17
18
|
case "text":
|
|
18
19
|
case "textarea": return typeof e == "string";
|
|
19
20
|
case "elementIds": return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
@@ -22,9 +22,9 @@ var e = { addNotification: {
|
|
|
22
22
|
"bottom-left"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
appearance: {
|
|
26
26
|
type: "select",
|
|
27
|
-
description: "Visual style of the notification
|
|
27
|
+
description: "Visual style of the notification: success, danger, warning or info.",
|
|
28
28
|
default: "success",
|
|
29
29
|
options: [
|
|
30
30
|
"success",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space's computed values, from its definitions and the global sources they read.
|
|
3
|
+
*
|
|
4
|
+
* In declaration order, each one seeing the values before it as `computed.<name>` — so `level` can be written over
|
|
5
|
+
* `xp` without repeating it. A value that reads one declared after it reads nothing; authoring refuses that.
|
|
6
|
+
*
|
|
7
|
+
* Given the `previous` evaluation, a value that comes out the same keeps the object it was, and so does the whole
|
|
8
|
+
* when none changed. They are all evaluated again whenever the state changes, and a list or a record evaluates to a new
|
|
9
|
+
* object every time: every element reading one — a star on each of a hundred and sixty library items reading the
|
|
10
|
+
* favourites — rendered again for the tool in hand changing, because what it read was no longer the same object.
|
|
11
|
+
*/
|
|
12
|
+
export declare const evaluateComputed: (definitions: Record<string, string>, globals: Record<string, unknown>, previous?: Record<string, unknown>) => Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* The sources as a flow step reads them: `state` as the store holds it this instant, and `computed` evaluated over it.
|
|
15
|
+
*
|
|
16
|
+
* `runtime.sources` carries both as the last render left them — they are copied there after React renders — so a step
|
|
17
|
+
* reading them right after an earlier step wrote the state could see the value from before the write, or not,
|
|
18
|
+
* depending on whether React had rendered in between. Read here, a step always sees every write made before it: the
|
|
19
|
+
* flow's own and anything else that happened while it waited.
|
|
20
|
+
*/
|
|
21
|
+
export declare const liveSources: (sources: Record<string, unknown>, state: unknown, definitions: unknown) => Record<string, unknown>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { processTwigValue as e } from "../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
2
|
+
import t from "@plitzi/plitzi-ui/utils/deepEqual";
|
|
3
|
+
//#region src/dataSource/computed.ts
|
|
4
|
+
var n = (n, r, i) => {
|
|
5
|
+
let a = {}, o = i !== void 0 && Object.keys(i).length === Object.keys(n).length;
|
|
6
|
+
for (let [s, c] of Object.entries(n)) {
|
|
7
|
+
let n = e(c, {
|
|
8
|
+
...r,
|
|
9
|
+
computed: { ...a }
|
|
10
|
+
}), l = i?.[s], u = i !== void 0 && Object.hasOwn(i, s) && (l === n || t(l, n));
|
|
11
|
+
a[s] = u ? l : n, o &&= u;
|
|
12
|
+
}
|
|
13
|
+
return o && i ? i : a;
|
|
14
|
+
}, r = (e) => typeof e == "object" && !!e, i = (e) => r(e) && Object.values(e).every((e) => typeof e == "string"), a = [
|
|
15
|
+
"variables",
|
|
16
|
+
"navigation",
|
|
17
|
+
"auth",
|
|
18
|
+
"host",
|
|
19
|
+
"theme"
|
|
20
|
+
], o = (e, t, n) => {
|
|
21
|
+
let a = r(t) ? t : {};
|
|
22
|
+
return i(n) ? {
|
|
23
|
+
...e,
|
|
24
|
+
state: a,
|
|
25
|
+
computed: c(n, e, a)
|
|
26
|
+
} : {
|
|
27
|
+
...e,
|
|
28
|
+
state: a
|
|
29
|
+
};
|
|
30
|
+
}, s, c = (e, t, r) => {
|
|
31
|
+
let i = a.map((e) => t[e]);
|
|
32
|
+
if (s?.definitions === e && s.state === r && s.globals.every((e, t) => e === i[t])) return s.computed;
|
|
33
|
+
let o = n(e, {
|
|
34
|
+
...Object.fromEntries(a.map((e, t) => [e, i[t]])),
|
|
35
|
+
state: r
|
|
36
|
+
}, s?.definitions === e ? s.computed : void 0);
|
|
37
|
+
return s = {
|
|
38
|
+
definitions: e,
|
|
39
|
+
state: r,
|
|
40
|
+
globals: i,
|
|
41
|
+
computed: o
|
|
42
|
+
}, o;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { n as evaluateComputed, o as liveSources };
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import e from "./utility/
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { isTrue as e } from "./utility/truthiness.mjs";
|
|
2
|
+
import t from "./utility/index.mjs";
|
|
3
|
+
import { checkboxParams as n } from "./utility/checkboxParams.mjs";
|
|
4
|
+
import { camelCase as r, get as i, set as a } from "@plitzi/plitzi-ui/helpers/lodash";
|
|
5
|
+
import { QueryBuilderEvaluator as o } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
6
|
+
import { produce as s } from "immer";
|
|
6
7
|
//#region src/dataSource/getBindingsDetails.ts
|
|
7
|
-
var
|
|
8
|
-
let o =
|
|
8
|
+
var c = (e, t, n, r, a) => {
|
|
9
|
+
let o = r === "initialState" ? `definition.${r}.${a}` : `${r}.${a}`;
|
|
9
10
|
return {
|
|
10
|
-
fromValue: t ?
|
|
11
|
-
toValue:
|
|
11
|
+
fromValue: t ? i(e, t, i(n, o)) : void 0,
|
|
12
|
+
toValue: i(n, o, t ? i(e, t) : void 0)
|
|
12
13
|
};
|
|
13
|
-
},
|
|
14
|
-
let { attributes:
|
|
15
|
-
return !
|
|
16
|
-
attributes:
|
|
14
|
+
}, l = (l, u, d = {}) => {
|
|
15
|
+
let { attributes: f, definition: p } = u, { bindings: m } = p;
|
|
16
|
+
return !m || typeof m == "object" && !Object.keys(m).length ? {
|
|
17
|
+
attributes: f,
|
|
17
18
|
style: {},
|
|
18
|
-
definition:
|
|
19
|
-
} :
|
|
20
|
-
attributes:
|
|
21
|
-
style:
|
|
22
|
-
definition:
|
|
23
|
-
}, (
|
|
24
|
-
Object.keys(
|
|
25
|
-
|
|
26
|
-
let { source:
|
|
27
|
-
if (!
|
|
28
|
-
|
|
29
|
-
let { fromValue:
|
|
30
|
-
|
|
31
|
-
let { action:
|
|
32
|
-
if (!
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
...
|
|
36
|
-
sourceTo:
|
|
19
|
+
definition: p
|
|
20
|
+
} : s({
|
|
21
|
+
attributes: f,
|
|
22
|
+
style: d,
|
|
23
|
+
definition: p
|
|
24
|
+
}, (s) => {
|
|
25
|
+
Object.keys(m).forEach((u) => {
|
|
26
|
+
m[u] && Array.isArray(m[u]) && m[u].length && m[u].forEach((d) => {
|
|
27
|
+
let { source: f, transformers: p, when: m, enabled: h = !0 } = d, { to: g } = d;
|
|
28
|
+
if (!g || m && !o(m, l, !1, !0) || !h) return;
|
|
29
|
+
u === "style" && (g = r(g));
|
|
30
|
+
let { fromValue: _, toValue: v } = c(l, f, s, u, g), y = _;
|
|
31
|
+
p && Array.isArray(p) && p.length > 0 && p.forEach((e) => {
|
|
32
|
+
let { action: r, params: i, enabled: a = !0 } = e;
|
|
33
|
+
if (!a) return;
|
|
34
|
+
let o = t[r];
|
|
35
|
+
o && (y = o.callback(y, n(o, i) ?? {}, s, {
|
|
36
|
+
...l,
|
|
37
|
+
sourceTo: v
|
|
37
38
|
}));
|
|
38
|
-
}), (typeof
|
|
39
|
+
}), u === "initialState" && g === "visibility" && f && i(l, f) !== void 0 && (y = e(y)), (typeof y == "boolean" || typeof y == "number" || y) && (u === "initialState" ? a(s, `definition.${u}.${g}`, y) : a(s, `${u}.${g}`, y));
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
//#endregion
|
|
44
|
-
export {
|
|
45
|
+
export { l as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './hooks';
|
|
2
2
|
export * from './helpers';
|
|
3
|
+
export { evaluateComputed, liveSources } from './computed';
|
|
3
4
|
export { default as getBindingsDetails } from './getBindingsDetails';
|
|
4
5
|
export { default as resolveVariables } from './resolveVariables';
|
|
5
6
|
export type { VariableScope } from './resolveVariables';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import e,
|
|
2
|
-
import n from "./
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { evaluateComputed as e, liveSources as t } from "./computed.mjs";
|
|
2
|
+
import n, { utilityOptions as r } from "./utility/index.mjs";
|
|
3
|
+
import i from "./getBindingsDetails.mjs";
|
|
4
|
+
import a from "./helpers/getSourceName.mjs";
|
|
5
|
+
import o from "./hooks/useRegisterSource.mjs";
|
|
6
|
+
import s from "./resolveVariables.mjs";
|
|
7
|
+
export { e as evaluateComputed, i as getBindingsDetails, a as getSourceName, t as liveSources, s as resolveVariables, o as useRegisterSource, n as utility, r as utilityOptions };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { isTrue as e } from "./truthiness.mjs";
|
|
1
2
|
//#region src/dataSource/utility/not.ts
|
|
2
|
-
var
|
|
3
|
-
"false",
|
|
4
|
-
"0",
|
|
5
|
-
""
|
|
6
|
-
]), t = (t) => typeof t == "string" ? !e.has(t.trim().toLowerCase()) : Array.isArray(t) ? t.length > 0 : !!t, n = {
|
|
3
|
+
var t = {
|
|
7
4
|
action: "not",
|
|
8
5
|
title: "Not",
|
|
9
6
|
type: "utility",
|
|
10
7
|
params: {},
|
|
11
8
|
preview: { content: "" },
|
|
12
|
-
callback: (
|
|
9
|
+
callback: (t) => !e(t)
|
|
13
10
|
};
|
|
14
11
|
//#endregion
|
|
15
|
-
export {
|
|
12
|
+
export { t as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTrue: (value: unknown) => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { DataSourceUtility } from '../../types';
|
|
2
|
-
|
|
2
|
+
export type TwigTemplateReturnMode = 'text' | 'value';
|
|
3
|
+
declare const twigTemplate: DataSourceUtility<unknown, unknown, string>;
|
|
3
4
|
export default twigTemplate;
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import { processTwig as e } from "../../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
2
|
-
var
|
|
1
|
+
import { processTwig as e, processTwigValue as t } from "../../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
2
|
+
var n = {
|
|
3
3
|
action: "twigTemplate",
|
|
4
4
|
title: "Twig Template",
|
|
5
5
|
type: "utility",
|
|
6
|
-
params: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
params: {
|
|
7
|
+
template: {
|
|
8
|
+
label: "Template",
|
|
9
|
+
defaultValue: "Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",
|
|
10
|
+
type: "codemirror-text"
|
|
11
|
+
},
|
|
12
|
+
returnMode: {
|
|
13
|
+
label: "Returns",
|
|
14
|
+
defaultValue: "text",
|
|
15
|
+
type: "select",
|
|
16
|
+
options: [{
|
|
17
|
+
label: "Text",
|
|
18
|
+
value: "text"
|
|
19
|
+
}, {
|
|
20
|
+
label: "Value (a single {{ expression }})",
|
|
21
|
+
value: "value"
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
11
25
|
preview: { template: "" },
|
|
12
|
-
callback: (
|
|
13
|
-
let { template:
|
|
26
|
+
callback: (n, r, i, a = {}) => {
|
|
27
|
+
let { template: o, returnMode: s = "text" } = r, c = {
|
|
28
|
+
source: n,
|
|
29
|
+
...a
|
|
30
|
+
};
|
|
14
31
|
try {
|
|
15
|
-
|
|
16
|
-
source: t,
|
|
17
|
-
...i
|
|
18
|
-
});
|
|
19
|
-
(typeof n == "string" || typeof n == "object" && n) && (o = n);
|
|
32
|
+
return s === "value" ? t(o, c) : e(o, c);
|
|
20
33
|
} catch {
|
|
21
|
-
|
|
34
|
+
return n;
|
|
22
35
|
}
|
|
23
|
-
return o;
|
|
24
36
|
}
|
|
25
37
|
};
|
|
26
38
|
//#endregion
|
|
27
|
-
export {
|
|
39
|
+
export { n as default };
|