@plitzi/sdk-shared 0.30.19
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 +1015 -0
- package/dist/_virtual/_rolldown/runtime.mjs +11 -0
- package/dist/builder/contexts/BuilderContext.d.ts +61 -0
- package/dist/builder/contexts/BuilderContext.mjs +5 -0
- package/dist/builder/contexts/index.d.ts +3 -0
- package/dist/builder/contexts/index.mjs +6 -0
- package/dist/builder/index.d.ts +3 -0
- package/dist/builder/index.mjs +3 -0
- package/dist/collections/CollectionContext.d.ts +2 -0
- package/dist/collections/CollectionContext.mjs +5 -0
- package/dist/collections/index.d.ts +3 -0
- package/dist/collections/index.mjs +2 -0
- package/dist/dataSource/DataSourceContext.d.ts +3 -0
- package/dist/dataSource/DataSourceContext.mjs +5 -0
- package/dist/dataSource/hooks/index.d.ts +3 -0
- package/dist/dataSource/hooks/index.mjs +2 -0
- package/dist/dataSource/hooks/useDataSource.d.ts +20 -0
- package/dist/dataSource/hooks/useDataSource.mjs +45 -0
- package/dist/dataSource/index.d.ts +2 -0
- package/dist/dataSource/index.mjs +2 -0
- package/dist/devTools/DevToolsContext.d.ts +11 -0
- package/dist/devTools/DevToolsContext.mjs +8 -0
- package/dist/devTools/index.d.ts +5 -0
- package/dist/devTools/index.mjs +3 -0
- package/dist/devTools/utils/PlitziConsole.d.ts +39 -0
- package/dist/devTools/utils/PlitziConsole.mjs +97 -0
- package/dist/elements/ComponentContext.d.ts +3 -0
- package/dist/elements/ComponentContext.mjs +5 -0
- package/dist/elements/ElementContext.d.ts +19 -0
- package/dist/elements/ElementContext.mjs +6 -0
- package/dist/elements/hooks/useElement.d.ts +3 -0
- package/dist/elements/hooks/useElement.mjs +10 -0
- package/dist/elements/index.d.ts +7 -0
- package/dist/elements/index.mjs +4 -0
- package/dist/helpers/fetchManifest.d.ts +2 -0
- package/dist/helpers/fetchManifest.mjs +14 -0
- package/dist/helpers/formatDate.d.ts +56 -0
- package/dist/helpers/formatDate.mjs +54 -0
- package/dist/helpers/generateFacade.d.ts +2 -0
- package/dist/helpers/generateFacade.mjs +35 -0
- package/dist/helpers/index.d.ts +12 -0
- package/dist/helpers/index.mjs +9 -0
- package/dist/helpers/security.d.ts +6 -0
- package/dist/helpers/security.mjs +10 -0
- package/dist/helpers/stripTypename.d.ts +15 -0
- package/dist/helpers/stripTypename.mjs +41 -0
- package/dist/helpers/syntaxHighlight.d.ts +2 -0
- package/dist/helpers/syntaxHighlight.mjs +7 -0
- package/dist/helpers/twigWrapper.d.ts +4 -0
- package/dist/helpers/twigWrapper.mjs +33 -0
- package/dist/helpers/utils.d.ts +18 -0
- package/dist/helpers/utils.mjs +62 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.mjs +3 -0
- package/dist/hooks/useNetwork.d.ts +12 -0
- package/dist/hooks/useNetwork.mjs +45 -0
- package/dist/hooks/usePlitziServiceContext.d.ts +42 -0
- package/dist/hooks/usePlitziServiceContext.mjs +17 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.mjs +37 -0
- package/dist/network/NetworkContext.d.ts +31 -0
- package/dist/network/NetworkContext.mjs +20 -0
- package/dist/network/NetworkInternalContext.d.ts +7 -0
- package/dist/network/NetworkInternalContext.mjs +6 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.mjs +24 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.mjs +17 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.mjs +16 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +59 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +53 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.mjs +12 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +35 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +39 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +37 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +37 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +23 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +23 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.mjs +34 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.mjs +18 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.mjs +34 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.mjs +29 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.mjs +34 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.mjs +12 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.mjs +26 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.mjs +18 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.mjs +26 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +37 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.d.ts +6 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +39 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +35 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +26 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +35 -0
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.d.ts +8 -0
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +23 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +23 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +34 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.d.ts +6 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +29 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +34 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +20 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +36 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +18 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +18 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +14 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +13 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +13 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +27 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.d.ts +4 -0
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +11 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +18 -0
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +15 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +29 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +26 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +29 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +32 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +12 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +30 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +13 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +12 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.d.ts +2 -0
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +13 -0
- package/dist/network/graphql/builder/Mutations/index.d.ts +178 -0
- package/dist/network/graphql/builder/Mutations/index.mjs +151 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.mjs +35 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.mjs +16 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.mjs +27 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.mjs +37 -0
- package/dist/network/graphql/builder/Queries/InitQuery.d.ts +15 -0
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +130 -0
- package/dist/network/graphql/builder/Queries/PluginsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/PluginsQuery.mjs +54 -0
- package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.d.ts +6 -0
- package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +47 -0
- package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +58 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +32 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +29 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.d.ts +9 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +30 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.d.ts +11 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +15 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.d.ts +8 -0
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +20 -0
- package/dist/network/graphql/builder/Queries/index.d.ts +44 -0
- package/dist/network/graphql/builder/Queries/index.mjs +31 -0
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.mjs +17 -0
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.mjs +17 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.d.ts +2 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.mjs +40 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.mjs +39 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.mjs +29 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.mjs +15 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.mjs +26 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.d.ts +7 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.mjs +21 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.d.ts +7 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.mjs +14 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.d.ts +7 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.mjs +21 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.mjs +15 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.d.ts +17 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.mjs +17 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.d.ts +8 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.mjs +13 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.d.ts +16 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.mjs +17 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.d.ts +9 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.mjs +14 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.d.ts +8 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.mjs +13 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.d.ts +9 -0
- package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.mjs +14 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.d.ts +11 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.mjs +39 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.mjs +28 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.mjs +38 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.d.ts +9 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.mjs +28 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.d.ts +9 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.mjs +14 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.d.ts +5 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.mjs +11 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.mjs +25 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.d.ts +5 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.mjs +11 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.mjs +25 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.mjs +25 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.d.ts +5 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.mjs +11 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.mjs +25 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.mjs +20 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.d.ts +5 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.mjs +11 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.mjs +20 -0
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.d.ts +6 -0
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.d.ts +4 -0
- package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.mjs +13 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.d.ts +16 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.d.ts +7 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.d.ts +15 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.mjs +16 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.mjs +15 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.d.ts +9 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.mjs +14 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.d.ts +10 -0
- package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.mjs +15 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.d.ts +8 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.mjs +13 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.d.ts +7 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.mjs +12 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.d.ts +8 -0
- package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.mjs +13 -0
- package/dist/network/graphql/builder/Subscriptions/index.d.ts +151 -0
- package/dist/network/graphql/builder/Subscriptions/index.mjs +103 -0
- package/dist/network/graphql/builder/index.d.ts +7 -0
- package/dist/network/graphql/builder/index.mjs +4 -0
- package/dist/network/graphql/index.d.ts +2 -0
- package/dist/network/graphql/index.mjs +6 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddMutation.d.ts +2 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.d.ts +4 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.mjs +16 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveMutation.d.ts +2 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +4 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.mjs +14 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateMutation.d.ts +2 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +4 -0
- package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.mjs +16 -0
- package/dist/network/graphql/sdk/Mutations/index.d.ts +14 -0
- package/dist/network/graphql/sdk/Mutations/index.mjs +11 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.d.ts +6 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.mjs +32 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.d.ts +6 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.mjs +14 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.d.ts +9 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.mjs +25 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.d.ts +9 -0
- package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.mjs +25 -0
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +14 -0
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +100 -0
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +6 -0
- package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +46 -0
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +9 -0
- package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +57 -0
- package/dist/network/graphql/sdk/Queries/index.d.ts +26 -0
- package/dist/network/graphql/sdk/Queries/index.mjs +19 -0
- package/dist/network/graphql/sdk/index.d.ts +5 -0
- package/dist/network/graphql/sdk/index.mjs +3 -0
- package/dist/network/index.d.ts +6 -0
- package/dist/network/index.mjs +8 -0
- package/dist/schema/SchemaContext.d.ts +3 -0
- package/dist/schema/SchemaContext.mjs +5 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.mjs +3 -0
- package/dist/schema/schemaConstants.d.ts +9 -0
- package/dist/schema/schemaConstants.mjs +19 -0
- package/dist/segments/SegmentsContext.d.ts +2 -0
- package/dist/segments/SegmentsContext.mjs +6 -0
- package/dist/segments/index.d.ts +3 -0
- package/dist/segments/index.mjs +2 -0
- package/dist/server/hooks/useRscData.d.ts +14 -0
- package/dist/server/hooks/useRscData.mjs +16 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.mjs +4 -0
- package/dist/server/rsc/RscContext.d.ts +13 -0
- package/dist/server/rsc/RscContext.mjs +5 -0
- package/dist/server/rsc/RscProvider.d.ts +13 -0
- package/dist/server/rsc/RscProvider.mjs +42 -0
- package/dist/style/index.d.ts +3 -0
- package/dist/style/index.mjs +2 -0
- package/dist/style/styleConstants.d.ts +105 -0
- package/dist/style/styleConstants.mjs +226 -0
- package/dist/theme/ThemeProvider.d.ts +12 -0
- package/dist/theme/ThemeProvider.mjs +40 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.mjs +2 -0
- package/dist/types/AuthTypes.d.ts +32 -0
- package/dist/types/AuthTypes.mjs +0 -0
- package/dist/types/BuilderTypes.d.ts +20 -0
- package/dist/types/BuilderTypes.mjs +0 -0
- package/dist/types/CollectionTypes.d.ts +84 -0
- package/dist/types/CollectionTypes.mjs +0 -0
- package/dist/types/CommonTypes.d.ts +24 -0
- package/dist/types/CommonTypes.mjs +0 -0
- package/dist/types/ComponentTypes.d.ts +45 -0
- package/dist/types/ComponentTypes.mjs +0 -0
- package/dist/types/DataSourceTypes.d.ts +56 -0
- package/dist/types/DataSourceTypes.mjs +0 -0
- package/dist/types/DevToolsTypes.d.ts +44 -0
- package/dist/types/DevToolsTypes.mjs +0 -0
- package/dist/types/ElementTypes.d.ts +35 -0
- package/dist/types/ElementTypes.mjs +0 -0
- package/dist/types/EventBridgeTypes.d.ts +5 -0
- package/dist/types/EventBridgeTypes.mjs +0 -0
- package/dist/types/InteractionTypes.d.ts +101 -0
- package/dist/types/InteractionTypes.mjs +0 -0
- package/dist/types/McpTypes.d.ts +164 -0
- package/dist/types/McpTypes.mjs +0 -0
- package/dist/types/NavigationTypes.d.ts +13 -0
- package/dist/types/NavigationTypes.mjs +0 -0
- package/dist/types/PluginTypes.d.ts +121 -0
- package/dist/types/PluginTypes.mjs +0 -0
- package/dist/types/ResourceTypes.d.ts +40 -0
- package/dist/types/ResourceTypes.mjs +0 -0
- package/dist/types/SchemaTypes.d.ts +152 -0
- package/dist/types/SchemaTypes.mjs +0 -0
- package/dist/types/SdkTypes.d.ts +16 -0
- package/dist/types/SdkTypes.mjs +0 -0
- package/dist/types/SegmentTypes.d.ts +41 -0
- package/dist/types/SegmentTypes.mjs +0 -0
- package/dist/types/ServerTypes.d.ts +200 -0
- package/dist/types/ServerTypes.mjs +0 -0
- package/dist/types/SpaceTypes.d.ts +25 -0
- package/dist/types/SpaceTypes.mjs +0 -0
- package/dist/types/StateTypes.d.ts +7 -0
- package/dist/types/StateTypes.mjs +0 -0
- package/dist/types/StoreTypes.d.ts +22 -0
- package/dist/types/StoreTypes.mjs +0 -0
- package/dist/types/StyleTypes.d.ts +59 -0
- package/dist/types/StyleTypes.mjs +6 -0
- package/dist/types/ThemeTypes.d.ts +5 -0
- package/dist/types/ThemeTypes.mjs +0 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.mjs +2 -0
- package/dist/websockets/RTCodec.d.ts +134 -0
- package/dist/websockets/RTCodec.mjs +35 -0
- package/dist/websockets/index.d.ts +3 -0
- package/dist/websockets/index.mjs +2 -0
- package/eslint.config.mjs +85 -0
- package/package.json +1063 -0
- package/setupTests.ts +29 -0
- package/tailwind.config.js +29 -0
- package/vite.config.ts +163 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __exportAll };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentPluginWithHOC, DropPosition, Element, EventBridgeEvent, PluginBuilder, Schema, Style, StyleThemeMode } from '../../types';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type BuilderContextValue = {
|
|
4
|
+
theme: StyleThemeMode;
|
|
5
|
+
setTheme: Dispatch<SetStateAction<StyleThemeMode>>;
|
|
6
|
+
mode: 'normal' | 'template' | 'segment';
|
|
7
|
+
schemaName: string;
|
|
8
|
+
setMultiPagesMode: Dispatch<SetStateAction<boolean>>;
|
|
9
|
+
multiPagesMode: boolean;
|
|
10
|
+
hasMultiPages: boolean;
|
|
11
|
+
baseContext: {
|
|
12
|
+
baseElementId: string;
|
|
13
|
+
};
|
|
14
|
+
baseElementIdOriginal: string;
|
|
15
|
+
builderSetBaseContext: (id?: string) => void;
|
|
16
|
+
builderElementPermissions: {
|
|
17
|
+
(element: Element, path: string, defaultValue?: boolean): boolean;
|
|
18
|
+
(element: Element, path?: undefined, defaultValue?: boolean): PluginBuilder;
|
|
19
|
+
(element: Element, path?: string, defaultValue?: boolean): boolean | PluginBuilder;
|
|
20
|
+
};
|
|
21
|
+
builderHandler: (event: EventBridgeEvent, ...data: unknown[]) => void;
|
|
22
|
+
updateElement: (elementId: string, attributeKey: string, attributeValue: unknown, category?: 'attributes' | 'definition') => void;
|
|
23
|
+
elementAsTemplate: (cdnIdentifier: string, schema: Schema, style: Style, name: string, description: string, element: Element) => Promise<void>;
|
|
24
|
+
builderGetBaseElement: (otherBaseElementId?: string) => undefined | {
|
|
25
|
+
data: Element;
|
|
26
|
+
Plugin: ComponentPluginWithHOC | Record<string, ComponentPluginWithHOC>;
|
|
27
|
+
};
|
|
28
|
+
builderDropElement: {
|
|
29
|
+
(type: 'add##plitzi-template', data: {
|
|
30
|
+
elements: Record<string, Element>;
|
|
31
|
+
baseElement?: Element;
|
|
32
|
+
style: Style;
|
|
33
|
+
variables: Schema['variables'];
|
|
34
|
+
}, dropPosition: DropPosition, toElementId: string, rootId?: string): boolean;
|
|
35
|
+
<T extends string>(type: `add##${Exclude<T, 'plitzi-template'>}`, data: {
|
|
36
|
+
id: string;
|
|
37
|
+
element: Element;
|
|
38
|
+
}, dropPosition: DropPosition, toElementId: string, rootId?: string): boolean;
|
|
39
|
+
<T extends string>(type: `move##${Exclude<T, 'plitzi-template'>}`, data: {
|
|
40
|
+
id: string;
|
|
41
|
+
parentId: string;
|
|
42
|
+
element: Element;
|
|
43
|
+
}, dropPosition: DropPosition, toElementId: string, rootId?: string): boolean;
|
|
44
|
+
(type: string, data: {
|
|
45
|
+
elements: Record<string, Element>;
|
|
46
|
+
baseElement?: Element;
|
|
47
|
+
style: Style;
|
|
48
|
+
variables: Schema['variables'];
|
|
49
|
+
} | {
|
|
50
|
+
id: string;
|
|
51
|
+
element: Element;
|
|
52
|
+
} | {
|
|
53
|
+
id: string;
|
|
54
|
+
parentId: string;
|
|
55
|
+
element: Element;
|
|
56
|
+
}, dropPosition: DropPosition, toElementId: string, rootId?: string): boolean;
|
|
57
|
+
};
|
|
58
|
+
builderSetElementVisibility: (elementId: string, visibility: boolean) => void;
|
|
59
|
+
};
|
|
60
|
+
declare const BuilderContext: import('react').Context<BuilderContextValue>;
|
|
61
|
+
export default BuilderContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { __exportAll as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import t from "./BuilderContext.mjs";
|
|
3
|
+
//#region src/builder/contexts/index.ts
|
|
4
|
+
var n = /* @__PURE__ */ e({ BuilderContext: () => t });
|
|
5
|
+
//#endregion
|
|
6
|
+
export { t as BuilderContext, n as contexts_exports };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SourceMeta } from '../../types';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
export type UseDataSourceMode = 'write' | 'read';
|
|
4
|
+
export type UseDataSourceFilter = 'soft' | 'hard';
|
|
5
|
+
export type UseDataSourceProps<T extends UseDataSourceMode> = {
|
|
6
|
+
id?: string;
|
|
7
|
+
fields?: SourceMeta['fields'];
|
|
8
|
+
mode: T;
|
|
9
|
+
sourceFilter?: string[];
|
|
10
|
+
filterMode?: UseDataSourceFilter;
|
|
11
|
+
} & (T extends 'read' ? {
|
|
12
|
+
name?: string;
|
|
13
|
+
source?: string;
|
|
14
|
+
} : {
|
|
15
|
+
name: string;
|
|
16
|
+
source: string;
|
|
17
|
+
});
|
|
18
|
+
declare function useDataSource<T = unknown>(props: UseDataSourceProps<'read'>): Record<string, T>;
|
|
19
|
+
declare function useDataSource<T = unknown>(props: UseDataSourceProps<'write'>): [Context<T>, string];
|
|
20
|
+
export default useDataSource;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { emptyObject as e, makeId as t } from "../../helpers/utils.mjs";
|
|
2
|
+
import n from "../DataSourceContext.mjs";
|
|
3
|
+
import { use as r, useEffect as i, useMemo as a, useRef as o } from "react";
|
|
4
|
+
//#region src/dataSource/hooks/useDataSource.ts
|
|
5
|
+
function s({ id: s = "", source: c, name: l, fields: u = [], mode: d = "write", sourceFilter: f = [], filterMode: p = "soft" }) {
|
|
6
|
+
let { addSource: m, getSources: h, updateFields: g, removeSource: _ } = r(n), v = o(!1), y = a(() => `${s}_${t(8)}`, [s]), b = o(void 0), x = o({});
|
|
7
|
+
if (d === "write" && (!l || !c)) throw Error("Name and Source are required in write mode");
|
|
8
|
+
if (d === "write" && !v.current && (v.current = !0, b.current = m(y, {
|
|
9
|
+
id: s,
|
|
10
|
+
source: c,
|
|
11
|
+
name: l,
|
|
12
|
+
fields: u
|
|
13
|
+
})), i(() => (d === "write" && !v.current && (v.current = !0, b.current = m(y, {
|
|
14
|
+
id: s,
|
|
15
|
+
source: c,
|
|
16
|
+
name: l,
|
|
17
|
+
fields: u
|
|
18
|
+
})), () => {
|
|
19
|
+
v.current = !1, _(y);
|
|
20
|
+
}), [y]), i(() => {
|
|
21
|
+
d === "write" && g(y, u);
|
|
22
|
+
}, [
|
|
23
|
+
u,
|
|
24
|
+
y,
|
|
25
|
+
g,
|
|
26
|
+
d
|
|
27
|
+
]), d === "write") return [b.current, y];
|
|
28
|
+
if (p === "hard" && !f.length) return e;
|
|
29
|
+
let S = Object.values(h());
|
|
30
|
+
f.length && (S = S.filter((e) => !f.length || !e.meta.source || f.includes(e.meta.source)));
|
|
31
|
+
let C = S.filter((e) => e.meta.source).map((e) => ({
|
|
32
|
+
...e,
|
|
33
|
+
value: r(e.context)
|
|
34
|
+
})).reduce((e, t) => ({
|
|
35
|
+
...e,
|
|
36
|
+
[t.meta.source]: t.value
|
|
37
|
+
}), {});
|
|
38
|
+
return Object.entries(x.current).filter(([e, t]) => t !== C[e]).length > 0 || Object.keys(C).length !== Object.keys(x.current).length ? x.current = C : (Object.keys(x.current).forEach((e) => {
|
|
39
|
+
delete x.current[e];
|
|
40
|
+
}), Object.entries(C).forEach(([e, t]) => {
|
|
41
|
+
x.current[e] = t;
|
|
42
|
+
})), x.current;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { s as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Log, ProviderCallback } from '../types';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type DevToolsContextValue = {
|
|
4
|
+
providers: Record<string, ProviderCallback>;
|
|
5
|
+
logs: Log[];
|
|
6
|
+
setLogs?: Dispatch<SetStateAction<Log[]>>;
|
|
7
|
+
clearLogs?: () => void;
|
|
8
|
+
getData?: (methodName: string, ...args: unknown[]) => Record<string, unknown> | undefined;
|
|
9
|
+
};
|
|
10
|
+
declare const DevToolsContext: import('react').Context<DevToolsContextValue>;
|
|
11
|
+
export default DevToolsContext;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Log, ProviderCallback } from '../../types/DevToolsTypes';
|
|
2
|
+
import { StoreLogger } from '@plitzi/sdk-store';
|
|
3
|
+
type CallbackInternal = (logType: Log['logType'], category: Log['category'], message: Log['message'], params: Record<string, unknown> | Log['params'], time?: Log['time']) => void;
|
|
4
|
+
type CallbackAddProvider = (methodName: string, callback: ProviderCallback) => void;
|
|
5
|
+
type CallbackRemoveProvider = (methodName: string) => void;
|
|
6
|
+
declare class PlitziConsole {
|
|
7
|
+
#private;
|
|
8
|
+
callbackInternal?: CallbackInternal;
|
|
9
|
+
callbackAddProvider?: CallbackAddProvider;
|
|
10
|
+
callbackRemoveProvider?: CallbackRemoveProvider;
|
|
11
|
+
pendingLimit: number;
|
|
12
|
+
logsListenedLimit: number;
|
|
13
|
+
pendingLogs: Log[];
|
|
14
|
+
listening: boolean;
|
|
15
|
+
listeningCategory?: Log['category'];
|
|
16
|
+
logsListened: Log[];
|
|
17
|
+
listeningParams?: {
|
|
18
|
+
category: Log['category'];
|
|
19
|
+
};
|
|
20
|
+
constructor(callback?: CallbackInternal, pendingLimit?: number);
|
|
21
|
+
setCallback(callback?: CallbackInternal): void;
|
|
22
|
+
processPendingLogs(): void;
|
|
23
|
+
setCallbackAddProvider(callback?: CallbackAddProvider): void;
|
|
24
|
+
setCallbackRemoveProvider(callback?: CallbackRemoveProvider): void;
|
|
25
|
+
flush(hard?: boolean): void;
|
|
26
|
+
addProviderMethod(methodName: string, callback: ProviderCallback): void;
|
|
27
|
+
removeProviderMethod(methodName: string): void;
|
|
28
|
+
getTime(asString: true): string;
|
|
29
|
+
getTime(asString?: false): Date;
|
|
30
|
+
info(category: Log['category'], message: Log['message'], params: Log['params']): void;
|
|
31
|
+
warning(category: Log['category'], message: Log['message'], params: Log['params']): void;
|
|
32
|
+
danger(category: Log['category'], message: Log['message'], params: Log['params']): void;
|
|
33
|
+
success(category: Log['category'], message: Log['message'], params: Log['params']): void;
|
|
34
|
+
begin(category: Log['category']): void;
|
|
35
|
+
end(): void;
|
|
36
|
+
}
|
|
37
|
+
export declare const pConsole: PlitziConsole;
|
|
38
|
+
export declare function createStoreDevToolsLogger<TState extends object>(storeName?: string): StoreLogger<TState>;
|
|
39
|
+
export default PlitziConsole;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { formatDate as e } from "../../helpers/formatDate.mjs";
|
|
2
|
+
import t from "@plitzi/sdk-store/helpers/getByPath";
|
|
3
|
+
//#region src/devTools/utils/PlitziConsole.ts
|
|
4
|
+
var n = class {
|
|
5
|
+
callbackInternal;
|
|
6
|
+
callbackAddProvider;
|
|
7
|
+
callbackRemoveProvider;
|
|
8
|
+
pendingLimit = 100;
|
|
9
|
+
logsListenedLimit = 1e3;
|
|
10
|
+
pendingLogs = [];
|
|
11
|
+
listening = !1;
|
|
12
|
+
listeningCategory;
|
|
13
|
+
logsListened = [];
|
|
14
|
+
listeningParams;
|
|
15
|
+
constructor(e, t = 100) {
|
|
16
|
+
this.callbackInternal = e, this.pendingLimit = t;
|
|
17
|
+
}
|
|
18
|
+
setCallback(e) {
|
|
19
|
+
this.callbackInternal = e;
|
|
20
|
+
}
|
|
21
|
+
processPendingLogs() {
|
|
22
|
+
if (this.pendingLogs.length && this.callbackInternal) {
|
|
23
|
+
for (let e of this.pendingLogs) this.callbackInternal(e.logType, e.category, e.message, e.params, e.time);
|
|
24
|
+
this.pendingLogs = [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
setCallbackAddProvider(e) {
|
|
28
|
+
this.callbackAddProvider = e;
|
|
29
|
+
}
|
|
30
|
+
setCallbackRemoveProvider(e) {
|
|
31
|
+
this.callbackRemoveProvider = e;
|
|
32
|
+
}
|
|
33
|
+
flush(e = !1) {
|
|
34
|
+
this.logsListened = [], e && (this.pendingLogs = []);
|
|
35
|
+
}
|
|
36
|
+
#e(e, t, n, r) {
|
|
37
|
+
let i = this.getTime(!0);
|
|
38
|
+
if (!this.callbackInternal) {
|
|
39
|
+
this.pendingLogs.push({
|
|
40
|
+
logType: e,
|
|
41
|
+
category: t,
|
|
42
|
+
message: n,
|
|
43
|
+
params: r,
|
|
44
|
+
time: i
|
|
45
|
+
}), this.pendingLogs.length > this.pendingLimit && this.pendingLogs.shift();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.listening ? this.logsListened.push({
|
|
49
|
+
logType: e,
|
|
50
|
+
category: t,
|
|
51
|
+
message: n,
|
|
52
|
+
params: r,
|
|
53
|
+
time: i
|
|
54
|
+
}) : this.callbackInternal(e, t, n, r, i), this.logsListened.length > this.logsListenedLimit && this.logsListened.shift();
|
|
55
|
+
}
|
|
56
|
+
addProviderMethod(e, t) {
|
|
57
|
+
this.callbackAddProvider?.(e, t);
|
|
58
|
+
}
|
|
59
|
+
removeProviderMethod(e) {
|
|
60
|
+
typeof this.callbackRemoveProvider == "function" && this.callbackRemoveProvider(e);
|
|
61
|
+
}
|
|
62
|
+
getTime(t = !1) {
|
|
63
|
+
let n = /* @__PURE__ */ new Date();
|
|
64
|
+
return t ? e(n, "HH:mm:ss.SSS") : n;
|
|
65
|
+
}
|
|
66
|
+
info(e, t, n) {
|
|
67
|
+
this.#e("info", e, t, n);
|
|
68
|
+
}
|
|
69
|
+
warning(e, t, n) {
|
|
70
|
+
this.#e("warning", e, t, n);
|
|
71
|
+
}
|
|
72
|
+
danger(e, t, n) {
|
|
73
|
+
this.#e("danger", e, t, n);
|
|
74
|
+
}
|
|
75
|
+
success(e, t, n) {
|
|
76
|
+
this.#e("success", e, t, n);
|
|
77
|
+
}
|
|
78
|
+
begin(e) {
|
|
79
|
+
this.listening = !0, this.listeningParams = { category: e };
|
|
80
|
+
}
|
|
81
|
+
end() {
|
|
82
|
+
this.listening = !1, this.listeningCategory && this.logsListened.length > 0 && this.callbackInternal?.("info", this.listeningCategory, `${this.logsListened.length} Log${this.logsListened.length === 1 ? "" : "s"}`, { logs: this.logsListened }), this.logsListened = [], this.listeningCategory = void 0;
|
|
83
|
+
}
|
|
84
|
+
}, r = new n();
|
|
85
|
+
function i(e = "store") {
|
|
86
|
+
return ({ path: n, prev: i, next: a }) => {
|
|
87
|
+
let o = n ? t(i, n) : i, s = n ? t(a, n) : a;
|
|
88
|
+
r.info("store", e, {
|
|
89
|
+
storeName: e,
|
|
90
|
+
path: n,
|
|
91
|
+
prev: o,
|
|
92
|
+
next: s
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { i as createStoreDevToolsLogger, n as default, r as pConsole };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Element, ElementLayout } from '../types';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export type ElementContextValue<T extends 'skipHOC' | 'full' = 'full'> = {
|
|
4
|
+
id: string;
|
|
5
|
+
rootId?: string;
|
|
6
|
+
} & (T extends 'skipHOC' ? {
|
|
7
|
+
plitziJsxSkipHOC: true;
|
|
8
|
+
} : {
|
|
9
|
+
plitziJsxSkipHOC?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
plitziElementLayout?: ElementLayout;
|
|
12
|
+
attributes: Element['attributes'];
|
|
13
|
+
definition: Element['definition'];
|
|
14
|
+
elementState: Record<string, unknown>;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
setElementState: <S extends Record<string, unknown> = Record<string, unknown>>(value?: S | ((prev: S) => S)) => boolean;
|
|
17
|
+
});
|
|
18
|
+
declare const ElementContext: import('react').Context<ElementContextValue<"full"> | ElementContextValue<"skipHOC">>;
|
|
19
|
+
export default ElementContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../ElementContext.mjs";
|
|
2
|
+
import { use as t } from "react";
|
|
3
|
+
//#region src/elements/hooks/useElement.ts
|
|
4
|
+
var n = () => {
|
|
5
|
+
let n = t(e);
|
|
6
|
+
if (n === void 0) throw Error("ElementContext value is undefined. Make sure you use the ElementContext before using the hook.");
|
|
7
|
+
return n;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as ComponentContext } from './ComponentContext';
|
|
2
|
+
import { default as ElementContext } from './ElementContext';
|
|
3
|
+
import { default as useElement } from './hooks/useElement';
|
|
4
|
+
export * from './ElementContext';
|
|
5
|
+
export * from './ComponentContext';
|
|
6
|
+
export * from './hooks/useElement';
|
|
7
|
+
export { ComponentContext, ElementContext, useElement };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/fetchManifest.ts
|
|
2
|
+
var e = async (e) => {
|
|
3
|
+
let t;
|
|
4
|
+
try {
|
|
5
|
+
return t = await (await fetch(e, {
|
|
6
|
+
method: "GET",
|
|
7
|
+
headers: { "Content-Type": "application/json" }
|
|
8
|
+
})).json(), t;
|
|
9
|
+
} catch {
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FormatDistanceToNowOptions } from 'date-fns';
|
|
2
|
+
export type SupportedLocale = 'en' | 'es' | 'pt';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a date input to a valid JavaScript Date object.
|
|
5
|
+
*
|
|
6
|
+
* Supports multiple input formats:
|
|
7
|
+
*
|
|
8
|
+
* - Date: returned as-is
|
|
9
|
+
* - Number: interpreted as timestamp
|
|
10
|
+
*
|
|
11
|
+
* - < 1e12 → treated as seconds and converted to milliseconds
|
|
12
|
+
* - > = 1e12 → treated as milliseconds
|
|
13
|
+
* - String: parsed as ISO 8601 date string
|
|
14
|
+
*
|
|
15
|
+
* @param {Date | number | string} d - The date input to normalize
|
|
16
|
+
* @returns {Date} A valid JavaScript Date object
|
|
17
|
+
*/
|
|
18
|
+
export declare const parseDate: (date: string | number | Date) => Date;
|
|
19
|
+
/**
|
|
20
|
+
* Formats a date to a readable string, with locale support.
|
|
21
|
+
*
|
|
22
|
+
* @param date - Date as timestamp (ms), timestamp in seconds, or ISO string
|
|
23
|
+
* @param formatStr - Date-fns format string (default 'dd MMMM, yyyy')
|
|
24
|
+
* @param locale - 'en' | 'es' | 'pt' (default 'en')
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatDate(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
27
|
+
export declare function formatDateUTC(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
28
|
+
/** Formats a UTC timestamp/string to local timezone */
|
|
29
|
+
export declare function formatUTCToLocal(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the difference between two dates in milliseconds
|
|
32
|
+
*
|
|
33
|
+
* @param start - Date, timestamp (ms or s) or ISO string
|
|
34
|
+
* @param end - Date, timestamp (ms or s) or ISO string
|
|
35
|
+
*/
|
|
36
|
+
export declare function getDurationMs(start: string | number | Date, end: string | number | Date): number;
|
|
37
|
+
/**
|
|
38
|
+
* Returns a human-readable "time ago" string.
|
|
39
|
+
*
|
|
40
|
+
* Supports:
|
|
41
|
+
*
|
|
42
|
+
* - Date objects
|
|
43
|
+
* - Timestamps (ms or seconds)
|
|
44
|
+
* - ISO strings
|
|
45
|
+
*
|
|
46
|
+
* Examples: formatFromNow('2024-01-01') → "2 months ago" formatFromNow(1700000000, 'es') → "hace 3 meses"
|
|
47
|
+
*
|
|
48
|
+
* @param date - Date, ISO string, or timestamp
|
|
49
|
+
* @param locale - 'en' | 'es' | 'pt' (default 'en')
|
|
50
|
+
* @returns {string} A human-friendly "from now" string
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatFromNow(date?: string | number | Date, locale?: SupportedLocale, options?: FormatDistanceToNowOptions): string;
|
|
53
|
+
export declare function isValidFormat(formatStr: string): boolean;
|
|
54
|
+
export declare const toUnixSeconds: (input: string | number | Date) => string;
|
|
55
|
+
/** Strictly validates whether a string matches a given date-fns format. */
|
|
56
|
+
export declare function isDate(value: string, formatStr: string): boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { differenceInMilliseconds as e, format as t, formatDistanceToNow as n, getTime as r, isValid as i, parse as a, parseISO as o } from "date-fns";
|
|
2
|
+
import { enUS as s, es as c, pt as l } from "date-fns/locale";
|
|
3
|
+
import { toZonedTime as u } from "date-fns-tz";
|
|
4
|
+
//#region src/helpers/formatDate.ts
|
|
5
|
+
var d = {
|
|
6
|
+
en: s,
|
|
7
|
+
es: c,
|
|
8
|
+
pt: l
|
|
9
|
+
}, f = (e) => {
|
|
10
|
+
let t;
|
|
11
|
+
return t = typeof e == "number" ? e < 0xe8d4a51000 ? /* @__PURE__ */ new Date(e * 1e3) : new Date(e) : typeof e == "string" ? o(e) : e, t;
|
|
12
|
+
};
|
|
13
|
+
function p(e, n = "dd MMMM, yyyy", r = "en") {
|
|
14
|
+
return e ? t(f(e), n, { locale: d[r] }) : "";
|
|
15
|
+
}
|
|
16
|
+
function m(e, n = "dd MMMM, yyyy", r = "en") {
|
|
17
|
+
return e ? t(u(f(e), "UTC"), n, { locale: d[r] }) : "";
|
|
18
|
+
}
|
|
19
|
+
function h(e, n = "dd MMMM, yyyy HH:mm", r = "en") {
|
|
20
|
+
if (!e) return "";
|
|
21
|
+
let i = f(e), a = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
22
|
+
return t(u(i, a), n, { locale: d[r] });
|
|
23
|
+
}
|
|
24
|
+
function g(t, n) {
|
|
25
|
+
let r = f(t);
|
|
26
|
+
return e(f(n), r);
|
|
27
|
+
}
|
|
28
|
+
function _(e, t = "en", r) {
|
|
29
|
+
if (!e) return "";
|
|
30
|
+
let i = f(e);
|
|
31
|
+
return isNaN(i.getTime()) ? "" : n(i, {
|
|
32
|
+
...r,
|
|
33
|
+
locale: d[t]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function v(e) {
|
|
37
|
+
try {
|
|
38
|
+
return t(/* @__PURE__ */ new Date(), e), !0;
|
|
39
|
+
} catch {
|
|
40
|
+
return !1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var y = (e) => Math.floor(r(f(e)) / 1e3).toString();
|
|
44
|
+
function b(e, n) {
|
|
45
|
+
if (typeof e != "string") return !1;
|
|
46
|
+
try {
|
|
47
|
+
let r = a(e, n, /* @__PURE__ */ new Date());
|
|
48
|
+
return i(r) ? t(r, n) === e : !1;
|
|
49
|
+
} catch {
|
|
50
|
+
return !1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { p as formatDate, m as formatDateUTC, _ as formatFromNow, h as formatUTCToLocal, g as getDurationMs, b as isDate, v as isValidFormat, f as parseDate, y as toUnixSeconds };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { omit as e } from "@plitzi/plitzi-ui/helpers";
|
|
2
|
+
//#region src/helpers/generateFacade.tsx
|
|
3
|
+
var t = (e) => e.replace(/^@/, "").replace(/[-/]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()).replace(/\s+/g, ""), n = (e, t = "PlitziFacade") => {
|
|
4
|
+
let n = typeof window < "u" ? Object.keys(window[t]?.[e] ?? {}) : [];
|
|
5
|
+
return n.length === 0 ? "" : `export default window.${t}.${e};${n.filter((e) => e !== "default").map((n) => `export const ${n} = window.${t}.${e}.${n};`).join("")}`;
|
|
6
|
+
}, r = (e) => URL.createObjectURL(new Blob([e], { type: "application/javascript" })), i = () => {
|
|
7
|
+
let e = {};
|
|
8
|
+
return typeof document > "u" || document.querySelectorAll("script[type=\"importmap\"]").forEach((t) => {
|
|
9
|
+
if (t.textContent) try {
|
|
10
|
+
let n = JSON.parse(t.textContent);
|
|
11
|
+
n.imports && Object.entries(n.imports).forEach(([t, n]) => {
|
|
12
|
+
e[t] && console.warn(`Duplicated import detected: "${t}"`), e[t] = n;
|
|
13
|
+
});
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.error("Invalid importmap JSON", e);
|
|
16
|
+
}
|
|
17
|
+
}), e;
|
|
18
|
+
}, a = (e, i = "PlitziFacade") => JSON.stringify({ imports: Object.keys(e).map((e) => ({
|
|
19
|
+
key: e,
|
|
20
|
+
bob: r(n(t(e), i))
|
|
21
|
+
})).reduce((e, t) => ({
|
|
22
|
+
...e,
|
|
23
|
+
[t.key]: t.bob
|
|
24
|
+
}), {}) }), o = (n, r = "PlitziFacade") => {
|
|
25
|
+
if (typeof document > "u" || typeof window > "u") return;
|
|
26
|
+
let o = i(), s = e(n, Object.keys(o));
|
|
27
|
+
if (Object.keys(s).length === 0) return;
|
|
28
|
+
window[r] = Object.fromEntries(Object.entries(s).map(([e, n]) => [t(e), n]));
|
|
29
|
+
let c = a(s, r);
|
|
30
|
+
if (!c) return;
|
|
31
|
+
let l = document.createElement("script");
|
|
32
|
+
l.type = "importmap", l.textContent = c, document.head.appendChild(l);
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as fetchManifest } from './fetchManifest';
|
|
2
|
+
import { default as generateFacade } from './generateFacade';
|
|
3
|
+
import { default as syntaxHighlight } from './syntaxHighlight';
|
|
4
|
+
export * from './fetchManifest';
|
|
5
|
+
export * from './formatDate';
|
|
6
|
+
export * from './generateFacade';
|
|
7
|
+
export * from './syntaxHighlight';
|
|
8
|
+
export * from './twigWrapper';
|
|
9
|
+
export * from './utils';
|
|
10
|
+
export * from './security';
|
|
11
|
+
export * from './stripTypename';
|
|
12
|
+
export { fetchManifest, generateFacade, syntaxHighlight };
|