@plitzi/sdk-shared 0.39.1 → 0.39.2
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 +7 -0
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/actions/access.mjs +1 -2
- package/dist/actions/cron.mjs +1 -2
- package/dist/actions/failureHandler.mjs +1 -2
- package/dist/actions/flowDelay.d.ts +6 -0
- package/dist/actions/flowDelay.mjs +3 -0
- package/dist/actions/functions.d.ts +6 -3
- package/dist/actions/functions.mjs +12 -8
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.mjs +10 -9
- package/dist/actions/jobs.mjs +1 -2
- package/dist/actions/smtp.mjs +1 -2
- package/dist/actions/triggerParams.mjs +1 -2
- package/dist/actions/triggers.mjs +1 -2
- package/dist/actions/validateDocument.mjs +133 -123
- package/dist/activity/describe.mjs +1 -2
- package/dist/activity/guard.mjs +1 -2
- package/dist/activity/types.mjs +1 -2
- package/dist/auth/failureChannel.mjs +1 -2
- package/dist/auth/visitorRoles.mjs +1 -2
- package/dist/authoring/builder.mjs +1 -2
- package/dist/authoring/declare.mjs +1 -2
- package/dist/authoring/elementCallbacks.mjs +1 -2
- package/dist/authoring/index.mjs +3 -3
- package/dist/authoring/paramSpec.mjs +1 -2
- package/dist/authoring/spaceCallbacks.mjs +1 -2
- package/dist/builder/contexts/BuilderContext.mjs +1 -2
- package/dist/builder/contexts/index.mjs +1 -2
- package/dist/conditions/dates.d.ts +2 -0
- package/dist/conditions/dates.mjs +12 -0
- package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
- package/dist/conditions/evaluateRuleGroup.mjs +4 -0
- package/dist/conditions/evaluator.d.ts +39 -0
- package/dist/conditions/evaluator.mjs +75 -0
- package/dist/conditions/index.d.ts +10 -0
- package/dist/conditions/index.mjs +5 -0
- package/dist/conditions/rules.d.ts +3 -0
- package/dist/conditions/rules.mjs +3 -0
- package/dist/conditions/types.d.ts +44 -0
- package/dist/connectors/constants.mjs +1 -2
- package/dist/connectors/manifestTokens.mjs +1 -2
- package/dist/connectors/presets.mjs +1 -2
- package/dist/connectors/validateManifest.mjs +56 -57
- package/dist/dataSource/computed.mjs +16 -17
- package/dist/dataSource/getBindingsDetails.d.ts +5 -6
- package/dist/dataSource/getBindingsDetails.mjs +65 -40
- package/dist/dataSource/globalSources.d.ts +1 -1
- package/dist/dataSource/globalSources.mjs +1 -2
- package/dist/dataSource/helpers/getSourceName.mjs +1 -2
- package/dist/dataSource/index.mjs +5 -5
- package/dist/dataSource/utility/arrayMap.mjs +2 -2
- package/dist/dataSource/utility/capitalize.mjs +1 -2
- package/dist/dataSource/utility/checkboxParams.mjs +1 -2
- package/dist/dataSource/utility/dateConverter.mjs +0 -1
- package/dist/dataSource/utility/index.mjs +15 -16
- package/dist/dataSource/utility/not.mjs +1 -2
- package/dist/dataSource/utility/staticValue.mjs +0 -1
- package/dist/dataSource/utility/stringToArray.mjs +0 -1
- package/dist/dataSource/utility/styleSelector.mjs +1 -2
- package/dist/dataSource/utility/styleVariant.mjs +2 -3
- package/dist/dataSource/utility/truthiness.mjs +1 -2
- package/dist/dataSource/utility/twigTemplate.mjs +0 -1
- package/dist/dataSource/variables/resolveVariables.mjs +2 -3
- package/dist/dates/formatDate.mjs +29 -30
- package/dist/dates/isDate.mjs +1 -2
- package/dist/devTools/chrome.mjs +1 -2
- package/dist/devTools/debugCookie.mjs +1 -2
- package/dist/devTools/index.mjs +5 -5
- package/dist/devTools/interactionLog.mjs +1 -2
- package/dist/devTools/react/DevToolsContext.mjs +1 -2
- package/dist/devTools/sight/sight.mjs +1 -2
- package/dist/devTools/utils/PlitziConsole.mjs +1 -2
- package/dist/elements/ComponentContext.mjs +1 -2
- package/dist/flags/flagsCookie.mjs +5 -6
- package/dist/flags/index.d.ts +1 -0
- package/dist/flags/index.mjs +4 -3
- package/dist/flags/overrides.d.ts +36 -0
- package/dist/flags/overrides.mjs +13 -0
- package/dist/flags/react/useFlagResolution.mjs +5 -6
- package/dist/flags/resolveFlags.d.ts +1 -1
- package/dist/flags/resolveFlags.mjs +2 -3
- package/dist/flags/schemaFlag.mjs +1 -2
- package/dist/functions/contract.d.ts +326 -0
- package/dist/functions/contract.mjs +3 -0
- package/dist/functions/index.d.ts +15 -0
- package/dist/functions/index.mjs +9 -0
- package/dist/functions/kv.d.ts +80 -0
- package/dist/functions/kvChange.d.ts +67 -0
- package/dist/functions/kvChange.mjs +24 -0
- package/dist/functions/later.d.ts +18 -0
- package/dist/functions/messages.d.ts +4 -0
- package/dist/functions/messages.mjs +205 -0
- package/dist/functions/protocol.d.ts +416 -0
- package/dist/functions/protocol.mjs +37 -0
- package/dist/functions/rateLimit.d.ts +17 -0
- package/dist/functions/rateLimit.mjs +0 -0
- package/dist/functions/refusal.d.ts +26 -0
- package/dist/functions/refusal.mjs +11 -0
- package/dist/functions/runtime.d.ts +44 -0
- package/dist/functions/runtime.mjs +13 -0
- package/dist/functions/sizes.d.ts +27 -0
- package/dist/functions/sizes.mjs +7 -0
- package/dist/functions/wire.d.ts +11 -0
- package/dist/functions/wire.mjs +39 -0
- package/dist/helpers/canonicalJson.mjs +1 -2
- package/dist/helpers/clipboard.mjs +1 -2
- package/dist/helpers/cookies.mjs +1 -2
- package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
- package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
- package/dist/helpers/deepEqual/index.d.ts +1 -0
- package/dist/helpers/deepEqual/index.mjs +1 -0
- package/dist/helpers/eventTarget.mjs +1 -2
- package/dist/helpers/fetchManifest.mjs +1 -2
- package/dist/helpers/images.mjs +1 -2
- package/dist/helpers/index.d.ts +4 -6
- package/dist/helpers/index.mjs +24 -20
- package/dist/helpers/interval.mjs +1 -2
- package/dist/helpers/isRecord.mjs +1 -2
- package/dist/helpers/keys.mjs +1 -2
- package/dist/helpers/lodash/camelCase.d.ts +1 -0
- package/dist/helpers/lodash/camelCase.mjs +7 -0
- package/dist/helpers/lodash/capitalize.d.ts +1 -0
- package/dist/helpers/lodash/capitalize.mjs +5 -0
- package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
- package/dist/helpers/lodash/cloneDeep.mjs +53 -0
- package/dist/helpers/lodash/get.d.ts +11 -0
- package/dist/helpers/lodash/get.mjs +14 -0
- package/dist/helpers/lodash/has.d.ts +2 -0
- package/dist/helpers/lodash/has.mjs +12 -0
- package/dist/helpers/lodash/index.d.ts +11 -0
- package/dist/helpers/lodash/index.mjs +7 -0
- package/dist/helpers/lodash/omit.d.ts +4 -0
- package/dist/helpers/lodash/omit.mjs +35 -0
- package/dist/helpers/lodash/set.d.ts +2 -0
- package/dist/helpers/lodash/set.mjs +20 -0
- package/dist/helpers/lodash/shared.d.ts +2 -0
- package/dist/helpers/lodash/shared.mjs +37 -0
- package/dist/helpers/reducerOrigin.mjs +1 -2
- package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
- package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
- package/dist/helpers/resources.d.ts +21 -0
- package/dist/helpers/resources.mjs +40 -0
- package/dist/helpers/scroll.mjs +1 -2
- package/dist/helpers/security.d.ts +15 -0
- package/dist/helpers/security.mjs +8 -4
- package/dist/helpers/spaceRoot.mjs +1 -2
- package/dist/helpers/syntaxHighlight.mjs +1 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
- package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
- package/dist/helpers/twigWrapper/charClass.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
- package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
- package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
- package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
- package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
- package/dist/helpers/twigWrapper/index.mjs +8 -8
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
- package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
- package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
- package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
- package/dist/helpers/utils.mjs +2 -3
- package/dist/history/describe.mjs +1 -2
- package/dist/history/diff.mjs +1 -2
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/useFontHead.mjs +1 -2
- package/dist/hooks/useNetwork.mjs +1 -2
- package/dist/hooks/usePlitzi.d.ts +7 -6
- package/dist/hooks/usePlitzi.mjs +1 -2
- package/dist/hooks/useStableValue.mjs +5 -6
- package/dist/navigation/index.mjs +3 -3
- package/dist/navigation/matchPath.mjs +19 -11
- package/dist/navigation/routes.mjs +57 -38
- package/dist/navigation/sitemap.mjs +9 -10
- package/dist/network/entitlements.d.ts +21 -0
- package/dist/network/entitlements.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/index.mjs +37 -38
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
- package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
- package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
- package/dist/network/graphql/index.d.ts +0 -1
- package/dist/network/graphql/index.mjs +1 -3
- package/dist/network/index.d.ts +1 -5
- package/dist/network/index.mjs +7 -11
- package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
- package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
- package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
- package/dist/network/react/NetworkInternalContext.mjs +4 -0
- package/dist/network/react/index.d.ts +5 -0
- package/dist/network/react/index.mjs +3 -0
- package/dist/network/spaceEvents.mjs +16 -17
- package/dist/plugins/bundle/bundle.mjs +1 -2
- package/dist/plugins/declaration.mjs +1 -2
- package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
- package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
- package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
- package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
- package/dist/plugins/react/PluginsContext.mjs +6 -3
- package/dist/plugins/react/index.d.ts +3 -0
- package/dist/plugins/react/index.mjs +4 -1
- package/dist/project/index.mjs +7 -7
- package/dist/project/layout/check.mjs +26 -27
- package/dist/project/layout/codes.mjs +1 -2
- package/dist/project/layout/contents.mjs +12 -13
- package/dist/project/layout/files.mjs +1 -2
- package/dist/project/layout/folders.mjs +43 -44
- package/dist/project/layout/index.mjs +3 -3
- package/dist/project/layout/plugins.mjs +56 -57
- package/dist/project/layout/vendor.mjs +14 -15
- package/dist/project/network.mjs +1 -2
- package/dist/project/pages/index.mjs +1 -2
- package/dist/project/paths/index.d.ts +8 -2
- package/dist/project/paths/index.mjs +3 -4
- package/dist/project/root.mjs +1 -2
- package/dist/queries/index.mjs +1 -2
- package/dist/queries/queryCache.mjs +1 -2
- package/dist/queries/serverQueries.mjs +1 -2
- package/dist/queries/useQuery.mjs +1 -2
- package/dist/queries/useServerQuery.mjs +1 -2
- package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
- package/dist/react/generateFacade.d.ts +1 -0
- package/dist/{helpers → react}/generateFacade.mjs +4 -5
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.mjs +4 -0
- package/dist/{helpers → react}/sharedContext.mjs +0 -1
- package/dist/realtime/client.mjs +3 -4
- package/dist/realtime/index.mjs +4 -4
- package/dist/realtime/presence.mjs +1 -2
- package/dist/realtime/topics.mjs +1 -2
- package/dist/runs/index.mjs +1 -2
- package/dist/runs/report.mjs +1 -2
- package/dist/schema/anchor.mjs +1 -2
- package/dist/schema/index.mjs +18 -18
- package/dist/schema/layoutChain.mjs +1 -2
- package/dist/schema/markdownHeadings.mjs +1 -2
- package/dist/schema/motion.mjs +1 -2
- package/dist/schema/motionReveal.mjs +1 -2
- package/dist/schema/pageAccess.d.ts +9 -0
- package/dist/schema/pageAccess.mjs +42 -36
- package/dist/schema/pageElements.d.ts +3 -1
- package/dist/schema/pageElements.mjs +9 -3
- package/dist/schema/pageHead.d.ts +5 -2
- package/dist/schema/pageHead.mjs +3 -4
- package/dist/schema/providerAnswer.mjs +1 -2
- package/dist/schema/providerWhen.d.ts +1 -1
- package/dist/schema/providerWhen.mjs +6 -7
- package/dist/schema/react/SchemaContext.mjs +1 -2
- package/dist/schema/schemaConstants.mjs +1 -2
- package/dist/schema/schemaSettings.mjs +1 -2
- package/dist/schema/serverElements.d.ts +0 -24
- package/dist/schema/serverElements.mjs +60 -39
- package/dist/schema/serverInput.mjs +23 -24
- package/dist/schema/serverQuery.d.ts +15 -5
- package/dist/schema/serverQuery.mjs +47 -35
- package/dist/schema/snippet.mjs +1 -2
- package/dist/schema/wire.mjs +1 -2
- package/dist/security/index.d.ts +49 -0
- package/dist/security/index.mjs +44 -0
- package/dist/server/actions/useActionsSync.mjs +1 -2
- package/dist/server/actions/useImagesSync.mjs +1 -2
- package/dist/server/actions/useRealtimeSync.mjs +1 -2
- package/dist/server/index.mjs +7 -7
- package/dist/server/rsc/refreshRsc.mjs +23 -24
- package/dist/server/rsc/useRscRefresh.mjs +1 -2
- package/dist/server/rsc/useRscSync.mjs +1 -2
- package/dist/server/usePluginRoute.mjs +1 -2
- package/dist/source/export.d.ts +1 -1
- package/dist/source/export.mjs +1 -2
- package/dist/source/import.mjs +1 -2
- package/dist/source/index.mjs +4 -4
- package/dist/source/snapshot.mjs +1 -2
- package/dist/state/index.d.ts +0 -1
- package/dist/state/index.mjs +1 -3
- package/dist/state/paintedState.mjs +10 -11
- package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
- package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
- package/dist/store/actionRuns/index.mjs +3 -3
- package/dist/store/actionRuns/useActionRuns.mjs +5 -6
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.mjs +2 -1
- package/dist/store/renderSettings.d.ts +1 -1
- package/dist/store/renderSettings.mjs +1 -2
- package/dist/{state → store}/runtimeStatePersist.mjs +29 -30
- package/dist/store/storeHooks.d.ts +45 -45
- package/dist/store/storeHooks.mjs +1 -2
- package/dist/store/tracing/index.mjs +5 -5
- package/dist/store/tracing/preview.mjs +1 -2
- package/dist/store/tracing/tracingCollector.d.ts +2 -2
- package/dist/store/tracing/tracingCollector.mjs +79 -78
- package/dist/store/tracing/tracingMiddleware.mjs +1 -2
- package/dist/store/tracing/tracingStore.mjs +1 -2
- package/dist/store/tracing/useTracing.mjs +6 -7
- package/dist/style/breakpoints.mjs +1 -2
- package/dist/style/cssLayers.mjs +1 -2
- package/dist/style/displayModes.mjs +1 -2
- package/dist/style/fontAssets.mjs +1 -2
- package/dist/style/fontValidation.mjs +14 -15
- package/dist/style/fonts.d.ts +5 -3
- package/dist/style/fonts.mjs +23 -24
- package/dist/style/fontsFromCss.mjs +1 -2
- package/dist/style/index.mjs +18 -18
- package/dist/style/keyframes.mjs +1 -2
- package/dist/style/layoutGrid.mjs +1 -2
- package/dist/style/notifications.mjs +1 -2
- package/dist/style/react/useDisplayMode.mjs +1 -2
- package/dist/style/react/useElementSize.mjs +1 -2
- package/dist/style/runtimeStyle.d.ts +19 -21
- package/dist/style/runtimeStyle.mjs +4 -7
- package/dist/style/snippetStyle.mjs +5 -6
- package/dist/style/styleConditions.mjs +1 -2
- package/dist/style/styleConstants.mjs +1 -2
- package/dist/style/stylePseudos.mjs +1 -2
- package/dist/style/styleStates.mjs +1 -2
- package/dist/style/styleTarget.mjs +24 -25
- package/dist/theme/cookie/index.mjs +1 -1
- package/dist/theme/cookie/themeCookie.d.ts +21 -1
- package/dist/theme/cookie/themeCookie.mjs +19 -4
- package/dist/theme/index.d.ts +1 -9
- package/dist/theme/index.mjs +1 -6
- package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
- package/dist/theme/react/ThemeProvider.mjs +78 -0
- package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
- package/dist/theme/react/ThemeScope.mjs +9 -0
- package/dist/theme/react/index.d.ts +9 -0
- package/dist/theme/react/index.mjs +5 -0
- package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
- package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
- package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
- package/dist/theme/react/useTheme.mjs +19 -0
- package/dist/types/ActionTypes.d.ts +33 -0
- package/dist/types/AuthTypes.d.ts +6 -0
- package/dist/types/CommonTypes.d.ts +14 -3
- package/dist/types/DataSourceTypes.d.ts +1 -1
- package/dist/types/FunctionTypes.d.ts +16 -6
- package/dist/types/InteractionTypes.d.ts +1 -1
- package/dist/types/JobTypes.d.ts +56 -182
- package/dist/types/PluginTypes.d.ts +8 -1
- package/dist/types/SchemaTypes.d.ts +1 -1
- package/dist/types/SchemaTypes.mjs +1 -2
- package/dist/types/ServerAdapterTypes.d.ts +0 -326
- package/dist/types/ServerTypes.d.ts +0 -311
- package/dist/types/SpaceTypes.d.ts +5 -2
- package/dist/types/StoreTypes.d.ts +9 -3
- package/dist/types/StyleTypes.d.ts +6 -0
- package/dist/types/StyleTypes.mjs +1 -2
- package/dist/types/index.d.ts +0 -3
- package/dist/websockets/RTCodec.mjs +1 -2
- package/eslint.config.mjs +25 -0
- package/package.json +29 -18
- package/vite.config.ts +58 -0
- package/dist/helpers/generateFacade.d.ts +0 -2
- package/dist/helpers/ruleEvaluator.d.ts +0 -16
- package/dist/helpers/ruleEvaluator.mjs +0 -5
- package/dist/network/NetworkInternalContext.mjs +0 -5
- package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
- package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
- package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
- package/dist/network/graphql/sdk/index.d.ts +0 -5
- package/dist/network/graphql/sdk/index.mjs +0 -3
- package/dist/theme/ThemeProvider.mjs +0 -69
- package/dist/theme/ThemeScope.mjs +0 -10
- package/dist/theme/useTheme.mjs +0 -20
- package/dist/types/OAuthTypes.d.ts +0 -246
- package/dist/types/ServerConfigTypes.d.ts +0 -527
- package/dist/types/ServerLogTypes.d.ts +0 -119
- /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
- /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
- /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
- /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
- /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
- /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/style/notifications.ts
|
|
2
2
|
var e = ".Toastify__toast-container.plitzi-sdk-toasts", t = [
|
|
3
3
|
{
|
|
4
4
|
selector: e,
|
|
@@ -88,5 +88,4 @@ var e = ".Toastify__toast-container.plitzi-sdk-toasts", t = [
|
|
|
88
88
|
customCss: r.endsWith("\n\n") ? r.slice(0, -2) : r
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
|
-
//#endregion
|
|
92
91
|
export { i as NOTIFICATIONS_FIELDS, o as notificationsCss, a as notificationsProblem, d as splitNotificationsCss, s as withNotificationsCss };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { displayModeWidthRem as e } from "../breakpoints.mjs";
|
|
2
2
|
import { useSyncExternalStore as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/style/react/useDisplayMode.ts
|
|
4
4
|
var n = {
|
|
5
5
|
mobile: `(max-width: ${e("tablet")})`,
|
|
6
6
|
tablet: `(max-width: ${e("desktop")})`
|
|
@@ -14,5 +14,4 @@ var n = {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
}, o = () => "desktop", s = () => t(a, i, o);
|
|
17
|
-
//#endregion
|
|
18
17
|
export { s as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/style/react/useElementSize.ts
|
|
3
3
|
var n = (n) => {
|
|
4
4
|
let [r, i] = t(void 0);
|
|
5
5
|
return e(() => {
|
|
@@ -16,5 +16,4 @@ var n = (n) => {
|
|
|
16
16
|
return a.observe(e), () => a.disconnect();
|
|
17
17
|
}, [n]), r;
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { n as default };
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The space's compiled stylesheet (`style.cache`) on a server-rendered page,
|
|
2
|
+
* The space's compiled stylesheet (`style.cache`) on a server-rendered page: linked, not carried.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* It is the whole space's — every page's rules — and on a large one most of the page: the dashboard's 429 KB of a
|
|
5
|
+
* 496 KB document. Inline, every response compressed it again and every page load parsed it again with the HTML; a
|
|
6
|
+
* file of its own is compressed once, kept by the browser for good under its name, and the page carries what is this
|
|
7
|
+
* request's alone — the variables, the custom CSS — beside a `<link>` to it.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* It travels as a file only when its text is the same for every visitor of that version of the space: a `{{ token }}`
|
|
10
|
+
* in it is replaced by the variables as THIS request resolves them (its route, its host), so a cache holding one stays
|
|
11
|
+
* inline, as does any page the server could not answer the file for (a draft, a space named by a token).
|
|
11
12
|
*/
|
|
12
13
|
/** The `data-id` of the stylesheet the SDK renders into the page. */
|
|
13
14
|
export declare const RUNTIME_STYLE_ID = "plitzi-runtime-style";
|
|
14
|
-
/** The
|
|
15
|
-
export declare const
|
|
15
|
+
/** The `id` of the `<link>` a server-rendered page's head loads the stylesheet with. */
|
|
16
|
+
export declare const STYLE_SHEET_ID = "plitzi-style";
|
|
17
|
+
/** Where a space's stylesheet is served from: `/_plitzi/style/<hash>.css`, on the page's own host. */
|
|
18
|
+
export declare const STYLE_SHEET_PATH = "/_plitzi/style/";
|
|
19
|
+
/** The address of the stylesheet named `hash`. */
|
|
20
|
+
export declare const styleSheetHref: (hash: string) => string;
|
|
21
|
+
/** Whether the cache reads the same for every request, and so can be a file of its own. */
|
|
22
|
+
export declare const styleSheetLinkable: (cache: string) => boolean;
|
|
16
23
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* - `{{ token }}`: the stylesheet holds the cache with its tokens already replaced, and the browser needs the tokens to
|
|
20
|
-
* replace them again when a variable changes.
|
|
21
|
-
* - `<`: React escapes a `<style` inside a stylesheet as it renders it, so the text would not come back as it went.
|
|
22
|
-
* - `\r` and `\0`: the HTML parser normalises both.
|
|
23
|
-
* - The end marker: the cache would end early.
|
|
24
|
-
*
|
|
25
|
-
* An empty cache has nothing to save.
|
|
24
|
+
* The stylesheet's text: the cache in the runtime layer, with the layers' order said first — the file may be the first
|
|
25
|
+
* thing on the page to name them, and a plugin's stylesheet arriving later would otherwise take a layer above it.
|
|
26
26
|
*/
|
|
27
|
-
export declare const
|
|
28
|
-
/** The cache the server left in the runtime stylesheet under `root`, or `undefined` when there is none to read. */
|
|
29
|
-
export declare const styleCacheFromDocument: (root: ParentNode) => string | undefined;
|
|
27
|
+
export declare const styleSheetCss: (cache: string) => string;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as RUNTIME_STYLE_ID, r as markStyleCache, a as styleCacheFromDocument, i as styleCacheTravelsInDocument };
|
|
1
|
+
import { PLUGIN_CSS_LAYER as e, RUNTIME_CSS_LAYER as t } from "./cssLayers.mjs";
|
|
2
|
+
// src/style/runtimeStyle.ts
|
|
3
|
+
var n = "plitzi-runtime-style", r = "plitzi-style", i = "/_plitzi/style/", a = (e) => `${i}${e}.css`, o = (e) => e !== "" && !e.includes("{{"), s = (n) => `@layer ${e}, ${t};@layer ${t}{${n}}`;
|
|
4
|
+
export { n as RUNTIME_STYLE_ID, r as STYLE_SHEET_ID, i as STYLE_SHEET_PATH, s as styleSheetCss, a as styleSheetHref, o as styleSheetLinkable };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isDisplayMode as e } from "./displayModes.mjs";
|
|
2
2
|
import { StyleVariableCategory as t } from "../types/StyleTypes.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
var r = (...
|
|
3
|
+
import { sameValue as n } from "../history/diff.mjs";
|
|
4
|
+
// src/style/snippetStyle.ts
|
|
5
|
+
var r = (...t) => [...new Set(t.flatMap((t) => Object.keys(t).filter(e)))], i = (e) => {
|
|
6
6
|
if (!e) return;
|
|
7
7
|
let { cache: t, ...n } = e;
|
|
8
8
|
return n;
|
|
9
|
-
}, a = (e) => new Set(Object.values(e).flatMap((e) => Object.keys(e))), o = (
|
|
9
|
+
}, a = (e) => new Set(Object.values(e).flatMap((e) => Object.keys(e))), o = (e, t, a) => r(t, a).every((r) => n(i(t[r]?.[e]), i(a[r]?.[e]))), s = (e, n) => {
|
|
10
10
|
let i = { ...e.platform };
|
|
11
11
|
r(n.platform).forEach((t) => {
|
|
12
12
|
let r = Object.entries(n.platform[t]).filter(([n]) => !Object.hasOwn(e.platform[t], n));
|
|
@@ -28,5 +28,4 @@ var r = (...e) => [...new Set(e.flatMap((e) => Object.keys(e).filter(n)))], i =
|
|
|
28
28
|
variables: a
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { s as mergeSnippetStyle, o as sameSelector, a as selectorsOf };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/style/styleConditions.ts
|
|
2
2
|
var e = {
|
|
3
3
|
"motion-reduce": "@media (prefers-reduced-motion: reduce)",
|
|
4
4
|
"motion-safe": "@media (prefers-reduced-motion: no-preference)"
|
|
@@ -25,5 +25,4 @@ var e = {
|
|
|
25
25
|
let r = /^@container\s+(.*)$/.exec(n);
|
|
26
26
|
if (r) return c(`container ${r[1]}`);
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { e as MOTION_CONDITIONS, n as STYLE_CONDITION_LABELS, t as STYLE_MOTION_CONDITIONS, c as canonicalCondition, u as conditionAtRule, d as conditionLabel, f as conditionOfAtRule, l as isStyleCondition, s as parseContainerCondition };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/style/styleConstants.ts
|
|
2
2
|
var e = {
|
|
3
3
|
platform: {
|
|
4
4
|
desktop: {},
|
|
@@ -456,5 +456,4 @@ var e = {
|
|
|
456
456
|
[t.STROKE]: "none",
|
|
457
457
|
[t.STROKE_WIDTH]: "1"
|
|
458
458
|
};
|
|
459
|
-
//#endregion
|
|
460
459
|
export { e as EMPTY_STYLE_SCHEMA, r as StyleBindingsAllowed, i as baseDefaultValue, t as default, n as inheritableAttributesBase };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/style/stylePseudos.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"before",
|
|
4
4
|
"after",
|
|
@@ -102,5 +102,4 @@ var e = [
|
|
|
102
102
|
let t = p(e.trim());
|
|
103
103
|
return t?.length ? t.every((e) => /^(["']).*\1$/s.test(e) || d.has(e.toLowerCase()) || f.test(e) && e.endsWith(")")) : !1;
|
|
104
104
|
};
|
|
105
|
-
//#endregion
|
|
106
105
|
export { i as CONTENT_PSEUDOS, a as GENERATED_PSEUDOS, l as PSEUDO_PROPERTIES, e as STYLE_PSEUDOS, t as STYLE_PSEUDO_LABELS, m as isContentValue, n as isStylePseudo, u as pseudoHonours, r as pseudoSuffix };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/style/styleStates.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"hover",
|
|
4
4
|
"focus",
|
|
@@ -72,5 +72,4 @@ var e = [
|
|
|
72
72
|
odd: ":nth-child(odd)",
|
|
73
73
|
even: ":nth-child(even)"
|
|
74
74
|
}, d = (e) => (a(e) ? u[e] : void 0) ?? `:${e}`, f = (e) => e === "hidden", p = ">", m = (e) => e === ">";
|
|
75
|
-
//#endregion
|
|
76
75
|
export { c as CURRENT_SELECTOR, l as EXPANDED_SELECTOR, t as HIDDEN_CLASS, p as PARENT_ANCESTOR, e as STYLE_STATES, n as STYLE_STATE_LABELS, r as STYLE_STATE_MEANINGS, s as inCascadeOrder, a as isKnownState, m as isParentAncestor, f as isStartingState, d as stateSuffix };
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { canonicalCondition as e } from "./styleConditions.mjs";
|
|
2
2
|
import { isStylePseudo as t } from "./stylePseudos.mjs";
|
|
3
3
|
import { isParentAncestor as n } from "./styleStates.mjs";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { isRecord as r } from "../helpers/isRecord.mjs";
|
|
5
|
+
// src/style/styleTarget.ts
|
|
6
6
|
var i = (e) => {
|
|
7
7
|
let t = [];
|
|
8
8
|
return e.styleAncestor ? t.push("ancestors", e.styleAncestor) : e.styleCondition && t.push("conditions", e.styleCondition), e.styleVariant && t.push("variants", e.styleVariant), e.stylePseudo && t.push("pseudos", e.stylePseudo), t.push(...e.styleState ? ["states", e.styleState] : ["default"]), t;
|
|
9
|
-
}, a = (
|
|
10
|
-
if (
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
}, o = (
|
|
17
|
-
let
|
|
18
|
-
for (let
|
|
19
|
-
if (!
|
|
20
|
-
|
|
9
|
+
}, a = (r) => {
|
|
10
|
+
if (r.styleAncestor && r.styleCondition) return "an ancestor condition cannot also be under a condition";
|
|
11
|
+
if (r.styleAncestor && r.stylePseudo) return "a pseudo-element has no ancestor conditions of its own";
|
|
12
|
+
if (r.styleCondition && r.styleVariant) return "a condition holds the class’s own rules, not its variants’";
|
|
13
|
+
if (r.styleCondition && e(r.styleCondition) !== r.styleCondition) return `"${r.styleCondition}" is not a condition`;
|
|
14
|
+
if (r.stylePseudo && !t(r.stylePseudo)) return `"${String(r.stylePseudo)}" is not a pseudo-element`;
|
|
15
|
+
if (r.styleAncestor && n(r.styleAncestor) && r.styleVariant) return "the element around it is named by its state, never by a variant";
|
|
16
|
+
}, o = (e, t) => {
|
|
17
|
+
let n = e;
|
|
18
|
+
for (let e of t) {
|
|
19
|
+
if (!r(n) || !Object.hasOwn(n, e)) return;
|
|
20
|
+
n = n[e];
|
|
21
21
|
}
|
|
22
|
-
return
|
|
23
|
-
}, s = (t, n
|
|
24
|
-
let i =
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
i[
|
|
22
|
+
return n;
|
|
23
|
+
}, s = (e, t, n) => {
|
|
24
|
+
let i = e;
|
|
25
|
+
t.slice(0, -1).forEach((e) => {
|
|
26
|
+
let t = i[e], n = r(t) ? t : {};
|
|
27
|
+
i[e] = n, i = n;
|
|
28
28
|
});
|
|
29
|
-
let a =
|
|
30
|
-
a !== void 0 && (i[a] =
|
|
31
|
-
}, c = (
|
|
29
|
+
let a = t.at(-1);
|
|
30
|
+
a !== void 0 && (i[a] = n);
|
|
31
|
+
}, c = (e) => r(e) && Object.values(e).every((e) => typeof e == "string" || typeof e == "number"), l = (e, t) => {
|
|
32
32
|
let n = o(e, i(t));
|
|
33
33
|
return c(n) ? n : void 0;
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { c as isStyleRules, s as setAtKeys, i as styleTargetKeys, a as styleTargetProblem, l as styleTargetRules, o as valueAtKeys };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readThemeCookie, themeFromCookies, writeThemeCookie } from "./themeCookie.mjs";
|
|
1
|
+
export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readSchemeCookie, readThemeCookie, requestScheme, schemeCookieName, schemeFromClientHint, schemeFromCookies, themeFromCookies, writeSchemeCookie, writeThemeCookie } from "./themeCookie.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from '../../types';
|
|
1
|
+
import { ColorScheme, Theme } from '../../types';
|
|
2
2
|
/** The name the choice is kept under, and the one a server reads it back with. */
|
|
3
3
|
export declare const THEME_COOKIE_NAME = "theme";
|
|
4
4
|
/** The two a document may WEAR. `system` writes nothing — the absence is what lets the media queries answer. */
|
|
@@ -28,3 +28,23 @@ export declare const themeFromCookies: (cookies: string | undefined, name?: stri
|
|
|
28
28
|
*/
|
|
29
29
|
export declare const readThemeCookie: (name?: string) => Theme | undefined;
|
|
30
30
|
export declare const writeThemeCookie: (mode: Theme, name?: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The scheme the visitor's machine asks for, kept beside the choice — under the choice's name with `-scheme` — so a
|
|
33
|
+
* server can resolve `system` as the browser will: a picture whose address names the scheme is asked for once, in the
|
|
34
|
+
* right one, rather than the light one swapped for the dark as the page hydrates. Not a choice: a fact about the
|
|
35
|
+
* machine the browser had, written whenever it is learnt and read only for a surface that defers to it.
|
|
36
|
+
*/
|
|
37
|
+
export declare const schemeCookieName: (themeCookieName?: string) => string;
|
|
38
|
+
export declare const schemeFromCookies: (cookies: string | undefined, name?: string) => ColorScheme | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The scheme a Chromium browser says in its `Sec-CH-Prefers-Color-Scheme` client hint, once a page asked for it
|
|
41
|
+
* (`Accept-CH`). A structured-field string: `"dark"`, quoted.
|
|
42
|
+
*/
|
|
43
|
+
export declare const schemeFromClientHint: (header: string | undefined) => ColorScheme | undefined;
|
|
44
|
+
export declare const readSchemeCookie: (name?: string) => ColorScheme | undefined;
|
|
45
|
+
export declare const writeSchemeCookie: (scheme: ColorScheme, name?: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* What a server knows of the visitor's machine: the client hint it said on this request, else the scheme the browser
|
|
48
|
+
* kept from its last visit. `undefined` on a first visit from a browser without the hint.
|
|
49
|
+
*/
|
|
50
|
+
export declare const requestScheme: (cookies: string | undefined, hint: string | undefined) => ColorScheme | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cookieFromHeader as e } from "../../helpers/cookies.mjs";
|
|
2
|
-
|
|
2
|
+
// src/theme/cookie/themeCookie.ts
|
|
3
3
|
var t = "theme", n = ["dark", "light"], r = [...n, "system"], i = 31536e3, a = (e) => r.includes(e), o = (e, t) => {
|
|
4
4
|
for (let r of n) t.classList.toggle(r, e === r);
|
|
5
5
|
}, s = (n, r = t) => {
|
|
@@ -15,6 +15,21 @@ var t = "theme", n = ["dark", "light"], r = [...n, "system"], i = 31536e3, a = (
|
|
|
15
15
|
try {
|
|
16
16
|
document.cookie = `${n}=${encodeURIComponent(e)};path=/;max-age=${i};SameSite=Lax`;
|
|
17
17
|
} catch {}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
}, u = (e = t) => `${e}-scheme`, d = (e) => e === "light" || e === "dark", f = (t, n = u()) => {
|
|
19
|
+
let r = e(t, n);
|
|
20
|
+
return d(r) ? r : void 0;
|
|
21
|
+
}, p = (e) => {
|
|
22
|
+
let t = e?.trim().replace(/^"|"$/g, "");
|
|
23
|
+
return d(t) ? t : void 0;
|
|
24
|
+
}, m = (e = u()) => {
|
|
25
|
+
try {
|
|
26
|
+
return f(document.cookie, e);
|
|
27
|
+
} catch {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}, h = (e, t = u()) => {
|
|
31
|
+
try {
|
|
32
|
+
document.cookie = `${t}=${e};path=/;max-age=${i};SameSite=Lax`;
|
|
33
|
+
} catch {}
|
|
34
|
+
}, g = (e, t) => p(t) ?? f(e);
|
|
35
|
+
export { n as THEME_CLASSES, t as THEME_COOKIE_NAME, o as applyThemeClass, a as isTheme, m as readSchemeCookie, c as readThemeCookie, g as requestScheme, u as schemeCookieName, p as schemeFromClientHint, f as schemeFromCookies, s as themeFromCookies, h as writeSchemeCookie, l as writeThemeCookie };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { default as useTheme } from './useTheme';
|
|
3
|
-
export * from './ThemeProvider';
|
|
4
|
-
export * from './ThemeScope';
|
|
1
|
+
/** What a theme is on the wire — its cookie — for a server as for a page. Drawing one is `./react`. */
|
|
5
2
|
export * from './cookie';
|
|
6
|
-
export * from './themeStore';
|
|
7
|
-
export * from './useTheme';
|
|
8
|
-
export { default as themeStore } from './themeStore';
|
|
9
|
-
export { default as ThemeScopeContext } from './ThemeScope';
|
|
10
|
-
export { ThemeProvider, useTheme };
|
package/dist/theme/index.mjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import s, { createThemeState as c, createThemeStore as l, resolveScheme as u, setAreaTheme as d, setMachineScheme as f, setThemeMode as p, startingThemeState as m, themeFor as h } from "./themeStore.mjs";
|
|
3
|
-
import g, { ThemeStartContext as _, useThemeState as v, useThemeStore as y } from "./ThemeScope.mjs";
|
|
4
|
-
import b from "./ThemeProvider.mjs";
|
|
5
|
-
import x, { SPACE_THEME_AREA as S } from "./useTheme.mjs";
|
|
6
|
-
export { S as SPACE_THEME_AREA, e as THEME_CLASSES, t as THEME_COOKIE_NAME, b as ThemeProvider, g as ThemeScopeContext, _ as ThemeStartContext, n as applyThemeClass, c as createThemeState, l as createThemeStore, r as isTheme, i as readThemeCookie, u as resolveScheme, d as setAreaTheme, f as setMachineScheme, p as setThemeMode, m as startingThemeState, h as themeFor, a as themeFromCookies, s as themeStore, x as useTheme, v as useThemeState, y as useThemeStore, o as writeThemeCookie };
|
|
1
|
+
export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readSchemeCookie, readThemeCookie, requestScheme, schemeCookieName, schemeFromClientHint, schemeFromCookies, themeFromCookies, writeSchemeCookie, writeThemeCookie } from "./cookie/themeCookie.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Theme } from '
|
|
1
|
+
import { ColorScheme, Theme } from '../../types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Whose theme this provider is running.
|
|
@@ -24,6 +24,12 @@ export type ThemeProviderProps = {
|
|
|
24
24
|
*/
|
|
25
25
|
theme?: Theme;
|
|
26
26
|
scope?: ThemeScope;
|
|
27
|
+
/**
|
|
28
|
+
* The scheme the visitor's machine asks for, as the host already knows it — a server, from the client hint or the
|
|
29
|
+
* cookie this provider keeps it in — so a `system` surface renders resolved as the browser will, from its first
|
|
30
|
+
* render. Left out, `light` until the browser answers.
|
|
31
|
+
*/
|
|
32
|
+
scheme?: ColorScheme;
|
|
27
33
|
/** The cookie the choice lives in. Named per surface where two share an origin — the builder and a space do. */
|
|
28
34
|
cookieName?: string;
|
|
29
35
|
children?: ReactNode;
|
|
@@ -38,5 +44,5 @@ export type ThemeProviderProps = {
|
|
|
38
44
|
* updating the moment the visitor changes their system setting, which is how a panel ends up dark inside a page
|
|
39
45
|
* that is still light.
|
|
40
46
|
*/
|
|
41
|
-
declare const ThemeProvider: ({ defaultTheme, theme, scope, cookieName, children }: ThemeProviderProps) => import('react').JSX.Element;
|
|
47
|
+
declare const ThemeProvider: ({ defaultTheme, theme, scheme, scope, cookieName, children }: ThemeProviderProps) => import('react').JSX.Element;
|
|
42
48
|
export default ThemeProvider;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
|
|
2
|
+
import { THEME_COOKIE_NAME as t, applyThemeClass as n, readSchemeCookie as r, readThemeCookie as i, schemeCookieName as a, writeSchemeCookie as o, writeThemeCookie as s } from "../cookie/themeCookie.mjs";
|
|
3
|
+
import c, { ThemeStartContext as l, useThemeState as u } from "./ThemeScope.mjs";
|
|
4
|
+
import d, { createThemeStore as f, resolveScheme as p, setMachineScheme as m, setThemeMode as h } from "./themeStore.mjs";
|
|
5
|
+
import { use as g, useEffect as _, useId as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
6
|
+
import { StoreContext as S, useIsomorphicLayoutEffect as C } from "@plitzi/nexus/react";
|
|
7
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
8
|
+
// src/theme/react/ThemeProvider.tsx
|
|
9
|
+
var E = "(prefers-color-scheme: dark)", D = () => window.matchMedia(E).matches ? "dark" : "light", O = ({ store: t }) => {
|
|
10
|
+
let n = u(t);
|
|
11
|
+
return e([
|
|
12
|
+
"theme.mode",
|
|
13
|
+
"theme.resolved",
|
|
14
|
+
"theme.areas"
|
|
15
|
+
], [
|
|
16
|
+
n.mode,
|
|
17
|
+
p(n.mode, n.scheme),
|
|
18
|
+
n.areas
|
|
19
|
+
]), null;
|
|
20
|
+
}, k = ({ defaultTheme: e = "system", theme: u, scheme: p, scope: k = "document", cookieName: A = t, children: j }) => {
|
|
21
|
+
let M = k === "container", N = v(), [P] = x(() => M ? f(`theme${N}`) : void 0), F = P ?? d, I = b({
|
|
22
|
+
mode: e,
|
|
23
|
+
remembered: !1
|
|
24
|
+
});
|
|
25
|
+
C(() => {
|
|
26
|
+
let t = M ? void 0 : i(A), n = u ?? t ?? e;
|
|
27
|
+
I.current = {
|
|
28
|
+
mode: n,
|
|
29
|
+
remembered: t !== void 0
|
|
30
|
+
}, F.batch(() => {
|
|
31
|
+
m(D(), F), h(n, F);
|
|
32
|
+
});
|
|
33
|
+
}, [
|
|
34
|
+
e,
|
|
35
|
+
u,
|
|
36
|
+
A,
|
|
37
|
+
M,
|
|
38
|
+
F
|
|
39
|
+
]);
|
|
40
|
+
let L = u ?? e, R = y(() => ({
|
|
41
|
+
mode: L,
|
|
42
|
+
...p ? { scheme: p } : {}
|
|
43
|
+
}), [L, p]), z = g(S) !== void 0;
|
|
44
|
+
_(() => {
|
|
45
|
+
let e = window.matchMedia(E), t = () => {
|
|
46
|
+
let t = e.matches ? "dark" : "light";
|
|
47
|
+
m(t, F), !M && r(a(A)) !== t && o(t, a(A));
|
|
48
|
+
};
|
|
49
|
+
return e.addEventListener("change", t), t(), () => e.removeEventListener("change", t);
|
|
50
|
+
}, [
|
|
51
|
+
F,
|
|
52
|
+
M,
|
|
53
|
+
A
|
|
54
|
+
]), _(() => {
|
|
55
|
+
if (M) return;
|
|
56
|
+
let e = () => {
|
|
57
|
+
let { mode: e } = F.getState();
|
|
58
|
+
(I.current.remembered || e !== I.current.mode) && (s(e, A), I.current.remembered = !0), n(e, document.documentElement);
|
|
59
|
+
};
|
|
60
|
+
return e(), F.subscribe(e);
|
|
61
|
+
}, [
|
|
62
|
+
A,
|
|
63
|
+
M,
|
|
64
|
+
F
|
|
65
|
+
]);
|
|
66
|
+
let B = z ? /* @__PURE__ */ w(O, { store: F }) : null;
|
|
67
|
+
return M ? /* @__PURE__ */ w(c, {
|
|
68
|
+
value: P,
|
|
69
|
+
children: /* @__PURE__ */ T(l, {
|
|
70
|
+
value: R,
|
|
71
|
+
children: [B, j]
|
|
72
|
+
})
|
|
73
|
+
}) : /* @__PURE__ */ T(l, {
|
|
74
|
+
value: R,
|
|
75
|
+
children: [B, j]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { k as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThemeStoreInstance } from './themeStore';
|
|
2
|
-
import { Theme, ThemeState } from '
|
|
2
|
+
import { ColorScheme, Theme, ThemeState } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Which theme store the tree under here reads.
|
|
5
5
|
*
|
|
@@ -25,7 +25,11 @@ export default ThemeScopeContext;
|
|
|
25
25
|
* and `{{ theme.resolved }}` was not: a picture whose address names the scheme was the light one, swapped for the dark
|
|
26
26
|
* one as the page hydrated.
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type ThemeStart = {
|
|
29
|
+
mode: Theme;
|
|
30
|
+
scheme?: ColorScheme;
|
|
31
|
+
};
|
|
32
|
+
export declare const ThemeStartContext: import('react').Context<ThemeStart | undefined>;
|
|
29
33
|
/**
|
|
30
34
|
* The theme store's state, as the server rendered it until the surface is live.
|
|
31
35
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e, { startingThemeState as t } from "./themeStore.mjs";
|
|
2
|
+
import { sharedContext as n } from "../../react/sharedContext.mjs";
|
|
3
|
+
import { use as r, useMemo as i, useSyncExternalStore as a } from "react";
|
|
4
|
+
// src/theme/react/ThemeScope.ts
|
|
5
|
+
var o = n("ThemeScopeContext", void 0), s = () => r(o) ?? e, c = n("ThemeStartContext", void 0), l = (e) => {
|
|
6
|
+
let n = r(c), o = i(() => n === void 0 ? void 0 : t(n.mode, n.scheme), [n]);
|
|
7
|
+
return a(e.subscribe, e.getState, () => o ?? e.getState());
|
|
8
|
+
};
|
|
9
|
+
export { c as ThemeStartContext, o as default, l as useThemeState, s as useThemeStore };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as ThemeProvider } from './ThemeProvider';
|
|
2
|
+
import { default as useTheme } from './useTheme';
|
|
3
|
+
export * from './ThemeProvider';
|
|
4
|
+
export * from './ThemeScope';
|
|
5
|
+
export * from './themeStore';
|
|
6
|
+
export * from './useTheme';
|
|
7
|
+
export { default as themeStore } from './themeStore';
|
|
8
|
+
export { default as ThemeScopeContext } from './ThemeScope';
|
|
9
|
+
export { ThemeProvider, useTheme };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from "./ThemeProvider.mjs";
|
|
2
|
+
import t, { SPACE_THEME_AREA as n } from "./useTheme.mjs";
|
|
3
|
+
import r, { ThemeStartContext as i, useThemeState as a, useThemeStore as o } from "./ThemeScope.mjs";
|
|
4
|
+
import s, { createThemeState as c, createThemeStore as l, resolveScheme as u, setAreaTheme as d, setMachineScheme as f, setThemeMode as p, startingThemeState as m, themeFor as h } from "./themeStore.mjs";
|
|
5
|
+
export { n as SPACE_THEME_AREA, e as ThemeProvider, r as ThemeScopeContext, i as ThemeStartContext, c as createThemeState, l as createThemeStore, u as resolveScheme, d as setAreaTheme, f as setMachineScheme, p as setThemeMode, m as startingThemeState, h as themeFor, s as themeStore, t as useTheme, a as useThemeState, o as useThemeStore };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ColorScheme, Theme, ThemeState } from '
|
|
1
|
+
import { ColorScheme, Theme, ThemeState } from '../../types';
|
|
2
2
|
export declare const createThemeState: () => ThemeState;
|
|
3
3
|
/**
|
|
4
|
-
* The state a surface starts in, before anything could ask the machine: the mode it opens with, and
|
|
5
|
-
*
|
|
6
|
-
* stylesheet's media queries correct without a class.
|
|
4
|
+
* The state a surface starts in, before anything could ask the machine: the mode it opens with, and what a `system`
|
|
5
|
+
* mode resolves to until the browser answers — the scheme the host read (a server, from the client hint or the cookie
|
|
6
|
+
* the browser kept it in), or `light`, the one guess left, which the stylesheet's media queries correct without a class.
|
|
7
7
|
*/
|
|
8
|
-
export declare const startingThemeState: (mode: Theme) => ThemeState;
|
|
8
|
+
export declare const startingThemeState: (mode: Theme, scheme?: ColorScheme) => ThemeState;
|
|
9
9
|
/**
|
|
10
10
|
* The theme, as a store rather than a context.
|
|
11
11
|
*
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createStore as e } from "@plitzi/nexus";
|
|
2
|
-
|
|
2
|
+
// src/theme/react/themeStore.ts
|
|
3
3
|
var t = () => ({
|
|
4
4
|
mode: "system",
|
|
5
5
|
scheme: "light",
|
|
6
6
|
areas: {}
|
|
7
|
-
}), n = (e) => ({
|
|
7
|
+
}), n = (e, n) => ({
|
|
8
8
|
...t(),
|
|
9
|
-
mode: e
|
|
9
|
+
mode: e,
|
|
10
|
+
...n ? { scheme: n } : {}
|
|
10
11
|
}), r = (n = "theme") => e(t(), { id: n }), i = r(), a = (e, t) => e === "system" ? t : e, o = (e, t) => (t ? e.areas[t] : void 0) ?? e.mode, s = (e, t = i) => {
|
|
11
12
|
t.batch(() => {
|
|
12
13
|
t.setState("mode", e), t.setState("areas", {});
|
|
@@ -16,5 +17,4 @@ var t = () => ({
|
|
|
16
17
|
}, l = (e, t = i) => {
|
|
17
18
|
t.setState("scheme", e);
|
|
18
19
|
};
|
|
19
|
-
//#endregion
|
|
20
20
|
export { t as createThemeState, r as createThemeStore, i as default, a as resolveScheme, c as setAreaTheme, l as setMachineScheme, s as setThemeMode, n as startingThemeState, o as themeFor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeValue } from '
|
|
1
|
+
import { ThemeValue } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* The area every surface that paints the SPACE uses — the builder's canvas, and every `BuilderAreaPreview`: the
|
|
4
4
|
* page thumbnails, a template preview, what the agent renders in the chat.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useThemeState as e, useThemeStore as t } from "./ThemeScope.mjs";
|
|
2
|
+
import { resolveScheme as n, setAreaTheme as r, setThemeMode as i, themeFor as a } from "./themeStore.mjs";
|
|
3
|
+
import { useCallback as o, useMemo as s } from "react";
|
|
4
|
+
// src/theme/react/useTheme.ts
|
|
5
|
+
var c = "canvas", l = (c) => {
|
|
6
|
+
let l = t(), u = e(l), d = a(u, c), f = n(d, u.scheme), p = o((e) => c ? r(c, e, l) : i(e, l), [c, l]), m = o(() => p(f === "dark" ? "light" : "dark"), [f, p]);
|
|
7
|
+
return s(() => ({
|
|
8
|
+
theme: d,
|
|
9
|
+
resolvedTheme: f,
|
|
10
|
+
setTheme: p,
|
|
11
|
+
toggleTheme: m
|
|
12
|
+
}), [
|
|
13
|
+
d,
|
|
14
|
+
f,
|
|
15
|
+
p,
|
|
16
|
+
m
|
|
17
|
+
]);
|
|
18
|
+
};
|
|
19
|
+
export { c as SPACE_THEME_AREA, l as default };
|
|
@@ -201,6 +201,14 @@ export type ActionLimits = {
|
|
|
201
201
|
* response rather than per run, because it exists to stop one answer from being unbounded. 5 000 000 by default.
|
|
202
202
|
*/
|
|
203
203
|
maxResponseBytes?: number;
|
|
204
|
+
/**
|
|
205
|
+
* Bytes all of one run's outbound responses may carry back together: 10 000 000 by default.
|
|
206
|
+
*
|
|
207
|
+
* `maxResponseBytes` bounds one answer; a flow that reads twenty answers just under it holds twenty of them, and a
|
|
208
|
+
* parsed answer holds several times its size in memory. Counted as the answers stream in, across every request the
|
|
209
|
+
* run makes, and refused the moment they go over — the run fails as `over_capacity`, naming this ceiling.
|
|
210
|
+
*/
|
|
211
|
+
maxRunBytes?: number;
|
|
204
212
|
};
|
|
205
213
|
/**
|
|
206
214
|
* A server action: a declarative flow, stored per space, executed by the server.
|
|
@@ -308,6 +316,11 @@ export type ActionErrorReason = 'not_found' | 'disabled'
|
|
|
308
316
|
| 'duplicate'
|
|
309
317
|
/** A concurrency or stream cap was reached. */
|
|
310
318
|
| 'over_capacity'
|
|
319
|
+
/**
|
|
320
|
+
* The space's plan spent this period's allowance of runs (a paywall): refused until the period renews or the plan
|
|
321
|
+
* grows, the refusal naming which. Never retried: it would be refused again.
|
|
322
|
+
*/
|
|
323
|
+
| 'quota'
|
|
311
324
|
/** The run's lineage already names this action: a loop through the outside world. */
|
|
312
325
|
| 'recursion' | 'timeout' | 'aborted' | 'failed';
|
|
313
326
|
/**
|
|
@@ -385,7 +398,27 @@ export type ActionRunRecord = {
|
|
|
385
398
|
trace: InteractionNode[];
|
|
386
399
|
/** Present when the run ended badly. Already redacted of credential values. */
|
|
387
400
|
error?: string;
|
|
401
|
+
/** Why, when a ceiling ended it — its deadline, its step or request budget, the process's capacity. A step that threw is
|
|
402
|
+
* `error` with no reason. */
|
|
403
|
+
reason?: ActionErrorReason;
|
|
404
|
+
/**
|
|
405
|
+
* The run ended because its own code refused (`ActionRefusal`, `refuse(…)`): an answer written for whoever asked, not
|
|
406
|
+
* a fault — `error` is that answer.
|
|
407
|
+
*/
|
|
408
|
+
refused?: true;
|
|
409
|
+
/**
|
|
410
|
+
* The limit the run was stopped at, when that is what ended it — the run asked for more than it may, which is its own
|
|
411
|
+
* doing and not a fault: what a process's error rate leaves out. See {@link ActionRunLimit}.
|
|
412
|
+
*/
|
|
413
|
+
limit?: ActionRunLimit;
|
|
388
414
|
};
|
|
415
|
+
/**
|
|
416
|
+
* A limit a run can be stopped at: the action's own — its deadline (`time`), its steps, its outbound requests and the
|
|
417
|
+
* bytes they answered (`response`) — those of the space's code it ran, as its runner stops it (`cpu`, `wall`, `memory`,
|
|
418
|
+
* `output`, `calls`: the runner's stop reasons), its account's CPU budget over the minute (`cpuBudget`), and its plan's
|
|
419
|
+
* allowance over the period — runs, a function's compute — spent (`quota`, a paywall).
|
|
420
|
+
*/
|
|
421
|
+
export type ActionRunLimit = 'time' | 'steps' | 'requests' | 'response' | 'cpu' | 'wall' | 'memory' | 'output' | 'calls' | 'cpuBudget' | 'quota';
|
|
389
422
|
/**
|
|
390
423
|
* One step of a server action run, as a debugger may show it to anybody allowed to debug the page.
|
|
391
424
|
*
|