@pantheon-systems/puck-css 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -0
- package/dist/agent/useAgentEdit.d.ts.map +1 -1
- package/dist/agent/useAgentEdit.js.map +1 -1
- package/dist/agent/useAgentTrigger.d.ts.map +1 -1
- package/dist/agent/useAgentTrigger.js.map +1 -1
- package/dist/auth/AuthGate.d.ts +1 -1
- package/dist/auth/AuthGate.d.ts.map +1 -1
- package/dist/auth/P1AuthProvider.d.ts.map +1 -1
- package/dist/auth/P1AuthProvider.js +52 -1
- package/dist/auth/P1AuthProvider.js.map +1 -1
- package/dist/collaboration/components/CollaboratorAvatars.d.ts.map +1 -1
- package/dist/collaboration/components/CollaboratorAvatars.js +1 -1
- package/dist/collaboration/components/CollaboratorAvatars.js.map +1 -1
- package/dist/collaboration/utils/avatarColor.d.ts +2 -8
- package/dist/collaboration/utils/avatarColor.d.ts.map +1 -1
- package/dist/collaboration/utils/avatarColor.js +4 -31
- package/dist/collaboration/utils/avatarColor.js.map +1 -1
- package/dist/collaboration/utils/focusHighlightConfig.d.ts.map +1 -1
- package/dist/collaboration/utils/focusHighlightConfig.js.map +1 -1
- package/dist/collaboration/utils/initials.d.ts +2 -0
- package/dist/collaboration/utils/initials.d.ts.map +1 -0
- package/dist/collaboration/utils/initials.js +27 -0
- package/dist/collaboration/utils/initials.js.map +1 -0
- package/dist/collaboration/utils/presenceIdentity.d.ts +29 -0
- package/dist/collaboration/utils/presenceIdentity.d.ts.map +1 -0
- package/dist/collaboration/utils/presenceIdentity.js +42 -0
- package/dist/collaboration/utils/presenceIdentity.js.map +1 -0
- package/dist/core/PuckConfigContext.d.ts +7 -0
- package/dist/core/PuckConfigContext.d.ts.map +1 -0
- package/dist/core/PuckConfigContext.js +11 -0
- package/dist/core/PuckConfigContext.js.map +1 -0
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/types.d.ts +36 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/data/collection-operators.d.ts +19 -0
- package/dist/data/collection-operators.d.ts.map +1 -0
- package/dist/data/collection-operators.js +97 -0
- package/dist/data/collection-operators.js.map +1 -0
- package/dist/data/css-queries/css-query-registry.d.ts +11 -0
- package/dist/data/css-queries/css-query-registry.d.ts.map +1 -0
- package/dist/data/css-queries/css-query-registry.js +30 -0
- package/dist/data/css-queries/css-query-registry.js.map +1 -0
- package/dist/data/dal/index.d.ts +1 -1
- package/dist/data/dal/index.d.ts.map +1 -1
- package/dist/data/dal/init.d.ts +5 -0
- package/dist/data/dal/init.d.ts.map +1 -1
- package/dist/data/dal/init.js +31 -4
- package/dist/data/dal/init.js.map +1 -1
- package/dist/data/dal/p1-store.d.ts +23 -0
- package/dist/data/dal/p1-store.d.ts.map +1 -1
- package/dist/data/dal/p1-store.js.map +1 -1
- package/dist/data/data-list-block/DataListFieldsGrouper.d.ts +7 -0
- package/dist/data/data-list-block/DataListFieldsGrouper.d.ts.map +1 -0
- package/dist/data/data-list-block/DataListFieldsGrouper.js +72 -0
- package/dist/data/data-list-block/DataListFieldsGrouper.js.map +1 -0
- package/dist/data/data-list-block/builtin-components/cards.d.ts +8 -0
- package/dist/data/data-list-block/builtin-components/cards.d.ts.map +1 -0
- package/dist/data/data-list-block/builtin-components/cards.js +35 -0
- package/dist/data/data-list-block/builtin-components/cards.js.map +1 -0
- package/dist/data/data-list-block/builtin-components/listing.d.ts +8 -0
- package/dist/data/data-list-block/builtin-components/listing.d.ts.map +1 -0
- package/dist/data/data-list-block/builtin-components/listing.js +11 -0
- package/dist/data/data-list-block/builtin-components/listing.js.map +1 -0
- package/dist/data/data-list-block/builtin-components/rows.d.ts +8 -0
- package/dist/data/data-list-block/builtin-components/rows.d.ts.map +1 -0
- package/dist/data/data-list-block/builtin-components/rows.js +9 -0
- package/dist/data/data-list-block/builtin-components/rows.js.map +1 -0
- package/dist/data/data-list-block/builtin-modes.d.ts +3 -0
- package/dist/data/data-list-block/builtin-modes.d.ts.map +1 -0
- package/dist/data/data-list-block/builtin-modes.js +53 -0
- package/dist/data/data-list-block/builtin-modes.js.map +1 -0
- package/dist/data/data-list-block/create-data-list-block.d.ts +3 -0
- package/dist/data/data-list-block/create-data-list-block.d.ts.map +1 -0
- package/dist/data/data-list-block/create-data-list-block.js +305 -0
- package/dist/data/data-list-block/create-data-list-block.js.map +1 -0
- package/dist/data/data-list-block/field-groups.d.ts +4 -0
- package/dist/data/data-list-block/field-groups.d.ts.map +1 -0
- package/dist/data/data-list-block/field-groups.js +28 -0
- package/dist/data/data-list-block/field-groups.js.map +1 -0
- package/dist/data/data-list-block/index.d.ts +8 -0
- package/dist/data/data-list-block/index.d.ts.map +1 -0
- package/dist/data/data-list-block/index.js +7 -0
- package/dist/data/data-list-block/index.js.map +1 -0
- package/dist/data/data-list-block/types.d.ts +53 -0
- package/dist/data/data-list-block/types.d.ts.map +1 -0
- package/dist/data/data-list-block/types.js +2 -0
- package/dist/data/data-list-block/types.js.map +1 -0
- package/dist/data/data-list-block/utils.d.ts +14 -0
- package/dist/data/data-list-block/utils.d.ts.map +1 -0
- package/dist/data/data-list-block/utils.js +65 -0
- package/dist/data/data-list-block/utils.js.map +1 -0
- package/dist/data/fields/datasource-select-field.d.ts +29 -0
- package/dist/data/fields/datasource-select-field.d.ts.map +1 -0
- package/dist/data/fields/datasource-select-field.js +40 -0
- package/dist/data/fields/datasource-select-field.js.map +1 -0
- package/dist/data/fields/field-section.d.ts +11 -0
- package/dist/data/fields/field-section.d.ts.map +1 -0
- package/dist/data/fields/field-section.js +6 -0
- package/dist/data/fields/field-section.js.map +1 -0
- package/dist/data/fields/image-position-field.d.ts +28 -0
- package/dist/data/fields/image-position-field.d.ts.map +1 -0
- package/dist/data/fields/image-position-field.js +69 -0
- package/dist/data/fields/image-position-field.js.map +1 -0
- package/dist/data/fields/pds-field-helpers.d.ts +34 -0
- package/dist/data/fields/pds-field-helpers.d.ts.map +1 -0
- package/dist/data/fields/pds-field-helpers.js +55 -0
- package/dist/data/fields/pds-field-helpers.js.map +1 -0
- package/dist/data/fields/schema-select-field.d.ts +32 -0
- package/dist/data/fields/schema-select-field.d.ts.map +1 -0
- package/dist/data/fields/schema-select-field.js +134 -0
- package/dist/data/fields/schema-select-field.js.map +1 -0
- package/dist/data/fields/template-select-field.d.ts +16 -0
- package/dist/data/fields/template-select-field.d.ts.map +1 -0
- package/dist/data/fields/template-select-field.js +31 -0
- package/dist/data/fields/template-select-field.js.map +1 -0
- package/dist/data/fields/view-mode-field.d.ts +21 -0
- package/dist/data/fields/view-mode-field.d.ts.map +1 -0
- package/dist/data/fields/view-mode-field.js +14 -0
- package/dist/data/fields/view-mode-field.js.map +1 -0
- package/dist/data/fields.d.ts +12 -0
- package/dist/data/fields.d.ts.map +1 -1
- package/dist/data/fields.js +10 -0
- package/dist/data/fields.js.map +1 -1
- package/dist/data/page-editor-meta.d.ts.map +1 -1
- package/dist/data/page-editor-meta.js +0 -1
- package/dist/data/page-editor-meta.js.map +1 -1
- package/dist/data/query-provider.d.ts +1 -1
- package/dist/data/query-provider.d.ts.map +1 -1
- package/dist/data/remote-datasources/fetch-http-json.d.ts.map +1 -1
- package/dist/data/remote-datasources/fetch-http-json.js.map +1 -1
- package/dist/data/remote-datasources/loader.d.ts.map +1 -1
- package/dist/data/remote-datasources/loader.js +3 -1
- package/dist/data/remote-datasources/loader.js.map +1 -1
- package/dist/data/resolve-data-templates.d.ts.map +1 -1
- package/dist/data/resolve-data-templates.js +31 -4
- package/dist/data/resolve-data-templates.js.map +1 -1
- package/dist/data/schema-heuristics.d.ts +5 -0
- package/dist/data/schema-heuristics.d.ts.map +1 -0
- package/dist/data/schema-heuristics.js +46 -0
- package/dist/data/schema-heuristics.js.map +1 -0
- package/dist/editor/P1App.d.ts.map +1 -1
- package/dist/editor/P1App.js +1 -1
- package/dist/editor/P1App.js.map +1 -1
- package/dist/editor/P1PuckProvider.d.ts.map +1 -1
- package/dist/editor/P1PuckProvider.js +170 -41
- package/dist/editor/P1PuckProvider.js.map +1 -1
- package/dist/editor/aiPanelStore.d.ts +15 -0
- package/dist/editor/aiPanelStore.d.ts.map +1 -0
- package/dist/editor/aiPanelStore.js +43 -0
- package/dist/editor/aiPanelStore.js.map +1 -0
- package/dist/editor/components/CollapsibleFieldSection.d.ts +10 -0
- package/dist/editor/components/CollapsibleFieldSection.d.ts.map +1 -0
- package/dist/editor/components/CollapsibleFieldSection.js +9 -0
- package/dist/editor/components/CollapsibleFieldSection.js.map +1 -0
- package/dist/editor/components/CollapsibleSection.module.css +70 -0
- package/dist/editor/components/CollapsibleSectionHeader.d.ts +20 -0
- package/dist/editor/components/CollapsibleSectionHeader.d.ts.map +1 -0
- package/dist/editor/components/CollapsibleSectionHeader.js +10 -0
- package/dist/editor/components/CollapsibleSectionHeader.js.map +1 -0
- package/dist/editor/components/DraggableRow.d.ts +13 -0
- package/dist/editor/components/DraggableRow.d.ts.map +1 -0
- package/dist/editor/components/DraggableRow.js +20 -0
- package/dist/editor/components/DraggableRow.js.map +1 -0
- package/dist/editor/components/FieldHelpText.d.ts +6 -0
- package/dist/editor/components/FieldHelpText.d.ts.map +1 -0
- package/dist/editor/components/FieldHelpText.js +6 -0
- package/dist/editor/components/FieldHelpText.js.map +1 -0
- package/dist/editor/components/FieldHelpText.module.css +13 -0
- package/dist/editor/components/InspectorTabHeader.js +1 -1
- package/dist/editor/components/InspectorTabHeader.js.map +1 -1
- package/dist/editor/components/OutlinePanel.d.ts +10 -0
- package/dist/editor/components/OutlinePanel.d.ts.map +1 -0
- package/dist/editor/components/OutlinePanel.js +64 -0
- package/dist/editor/components/OutlinePanel.js.map +1 -0
- package/dist/editor/components/OutlinePanel.module.css +111 -0
- package/dist/editor/components/P1InspectorFields.d.ts.map +1 -1
- package/dist/editor/components/P1InspectorFields.js +24 -5
- package/dist/editor/components/P1InspectorFields.js.map +1 -1
- package/dist/editor/components/PanelHeader.d.ts +25 -0
- package/dist/editor/components/PanelHeader.d.ts.map +1 -0
- package/dist/editor/components/PanelHeader.js +12 -0
- package/dist/editor/components/PanelHeader.js.map +1 -0
- package/dist/editor/components/PanelHeader.module.css +34 -0
- package/dist/editor/components/PanelShell.d.ts +10 -0
- package/dist/editor/components/PanelShell.d.ts.map +1 -0
- package/dist/editor/components/PanelShell.js +7 -0
- package/dist/editor/components/PanelShell.js.map +1 -0
- package/dist/editor/components/PanelShell.module.css +15 -0
- package/dist/editor/components/PreviewPanelOverlay.d.ts +12 -0
- package/dist/editor/components/PreviewPanelOverlay.d.ts.map +1 -0
- package/dist/editor/components/PreviewPanelOverlay.js +7 -0
- package/dist/editor/components/PreviewPanelOverlay.js.map +1 -0
- package/dist/editor/components/PublishedStatusBadge.d.ts +1 -1
- package/dist/editor/components/PublishedStatusBadge.d.ts.map +1 -1
- package/dist/editor/components/VersionBannerOverride.d.ts +5 -1
- package/dist/editor/components/VersionBannerOverride.d.ts.map +1 -1
- package/dist/editor/components/VersionBannerOverride.js +54 -5
- package/dist/editor/components/VersionBannerOverride.js.map +1 -1
- package/dist/editor/components/VersionTimeline.d.ts +20 -0
- package/dist/editor/components/VersionTimeline.d.ts.map +1 -0
- package/dist/editor/components/VersionTimeline.js +42 -0
- package/dist/editor/components/VersionTimeline.js.map +1 -0
- package/dist/editor/components/collapsibleSectionContext.d.ts +17 -0
- package/dist/editor/components/collapsibleSectionContext.d.ts.map +1 -0
- package/dist/editor/components/collapsibleSectionContext.js +13 -0
- package/dist/editor/components/collapsibleSectionContext.js.map +1 -0
- package/dist/editor/components/componentIconName.d.ts +15 -0
- package/dist/editor/components/componentIconName.d.ts.map +1 -0
- package/dist/editor/components/componentIconName.js +68 -0
- package/dist/editor/components/componentIconName.js.map +1 -0
- package/dist/editor/components/connectable.d.ts +1 -1
- package/dist/editor/components/connectable.d.ts.map +1 -1
- package/dist/editor/components/merge-preview/MergePreviewPanel.d.ts.map +1 -1
- package/dist/editor/components/merge-preview/MergePreviewPanel.js.map +1 -1
- package/dist/editor/components/merge-preview/MergePreviewRenderer.js +3 -15
- package/dist/editor/components/merge-preview/MergePreviewRenderer.js.map +1 -1
- package/dist/editor/components/outlineTree.d.ts +68 -0
- package/dist/editor/components/outlineTree.d.ts.map +1 -0
- package/dist/editor/components/outlineTree.js +72 -0
- package/dist/editor/components/outlineTree.js.map +1 -0
- package/dist/editor/components/useDragReorder.d.ts +16 -0
- package/dist/editor/components/useDragReorder.d.ts.map +1 -0
- package/dist/editor/components/useDragReorder.js +35 -0
- package/dist/editor/components/useDragReorder.js.map +1 -0
- package/dist/editor/index.d.ts +13 -0
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +8 -0
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/plugin/P1Plugin.d.ts +19 -3
- package/dist/editor/plugin/P1Plugin.d.ts.map +1 -1
- package/dist/editor/plugin/P1Plugin.js +121 -98
- package/dist/editor/plugin/P1Plugin.js.map +1 -1
- package/dist/editor/plugin/context-sync-key.d.ts.map +1 -1
- package/dist/editor/plugin/context-sync-key.js +5 -5
- package/dist/editor/plugin/context-sync-key.js.map +1 -1
- package/dist/editor/plugin/createP1Overrides.d.ts +31 -43
- package/dist/editor/plugin/createP1Overrides.d.ts.map +1 -1
- package/dist/editor/plugin/createP1Overrides.js +47 -43
- package/dist/editor/plugin/createP1Overrides.js.map +1 -1
- package/dist/editor/plugin/document-sync-plugin.d.ts +23 -5
- package/dist/editor/plugin/document-sync-plugin.d.ts.map +1 -1
- package/dist/editor/plugin/document-sync-plugin.js +13 -6
- package/dist/editor/plugin/document-sync-plugin.js.map +1 -1
- package/dist/editor/plugin/fieldGuidance.d.ts +45 -0
- package/dist/editor/plugin/fieldGuidance.d.ts.map +1 -0
- package/dist/editor/plugin/fieldGuidance.js +24 -0
- package/dist/editor/plugin/fieldGuidance.js.map +1 -0
- package/dist/editor/plugin/mergePreviewPlugin.d.ts.map +1 -1
- package/dist/editor/plugin/mergePreviewPlugin.js.map +1 -1
- package/dist/editor/plugin/selectHeaderCollaborators.d.ts +12 -0
- package/dist/editor/plugin/selectHeaderCollaborators.d.ts.map +1 -0
- package/dist/editor/plugin/selectHeaderCollaborators.js +15 -0
- package/dist/editor/plugin/selectHeaderCollaborators.js.map +1 -0
- package/dist/editor/thumbnails/LiveThumbnail.d.ts +47 -0
- package/dist/editor/thumbnails/LiveThumbnail.d.ts.map +1 -0
- package/dist/editor/thumbnails/LiveThumbnail.js +120 -0
- package/dist/editor/thumbnails/LiveThumbnail.js.map +1 -0
- package/dist/editor/thumbnails/ThumbnailCard.d.ts +37 -0
- package/dist/editor/thumbnails/ThumbnailCard.d.ts.map +1 -0
- package/dist/editor/thumbnails/ThumbnailCard.js +91 -0
- package/dist/editor/thumbnails/ThumbnailCard.js.map +1 -0
- package/dist/editor/thumbnails/buildLiveThumbnailDrawer.d.ts +33 -0
- package/dist/editor/thumbnails/buildLiveThumbnailDrawer.d.ts.map +1 -0
- package/dist/editor/thumbnails/buildLiveThumbnailDrawer.js +79 -0
- package/dist/editor/thumbnails/buildLiveThumbnailDrawer.js.map +1 -0
- package/dist/editor/thumbnails/humanizeComponentName.d.ts +18 -0
- package/dist/editor/thumbnails/humanizeComponentName.d.ts.map +1 -0
- package/dist/editor/thumbnails/humanizeComponentName.js +32 -0
- package/dist/editor/thumbnails/humanizeComponentName.js.map +1 -0
- package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.d.ts +15 -0
- package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.d.ts.map +1 -0
- package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.js +19 -0
- package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.js.map +1 -0
- package/dist/editor/thumbnails/thumbnailCache.d.ts +39 -0
- package/dist/editor/thumbnails/thumbnailCache.d.ts.map +1 -0
- package/dist/editor/thumbnails/thumbnailCache.js +97 -0
- package/dist/editor/thumbnails/thumbnailCache.js.map +1 -0
- package/dist/editor/useP1Editor.d.ts +14 -4
- package/dist/editor/useP1Editor.d.ts.map +1 -1
- package/dist/editor/useP1Editor.js +81 -37
- package/dist/editor/useP1Editor.js.map +1 -1
- package/dist/editor/useP1Overrides.d.ts +1 -1
- package/dist/editor/useP1Overrides.d.ts.map +1 -1
- package/dist/editor/useP1Overrides.js.map +1 -1
- package/dist/editor/useP1Plugin.d.ts +15 -3
- package/dist/editor/useP1Plugin.d.ts.map +1 -1
- package/dist/editor/useP1Plugin.js +4 -0
- package/dist/editor/useP1Plugin.js.map +1 -1
- package/dist/editor/useRealtime.d.ts +2 -2
- package/dist/editor/useRealtime.d.ts.map +1 -1
- package/dist/editor/useRealtime.js.map +1 -1
- package/dist/editor/useResponsivePanels.d.ts +29 -0
- package/dist/editor/useResponsivePanels.d.ts.map +1 -0
- package/dist/editor/useResponsivePanels.js +175 -0
- package/dist/editor/useResponsivePanels.js.map +1 -0
- package/dist/editor/useSidebarScrollPreservation.d.ts +10 -0
- package/dist/editor/useSidebarScrollPreservation.d.ts.map +1 -0
- package/dist/editor/useSidebarScrollPreservation.js +39 -0
- package/dist/editor/useSidebarScrollPreservation.js.map +1 -0
- package/dist/editor/utils/componentRegistry.d.ts +4 -4
- package/dist/editor/utils/componentRegistry.d.ts.map +1 -1
- package/dist/editor/utils/componentRegistry.js +0 -1
- package/dist/editor/utils/componentRegistry.js.map +1 -1
- package/dist/editor/utils/restoreDocumentVersion.d.ts +18 -0
- package/dist/editor/utils/restoreDocumentVersion.d.ts.map +1 -0
- package/dist/editor/utils/restoreDocumentVersion.js +49 -0
- package/dist/editor/utils/restoreDocumentVersion.js.map +1 -0
- package/dist/editor/utils/sanitizeRichtextDefaults.d.ts +22 -0
- package/dist/editor/utils/sanitizeRichtextDefaults.d.ts.map +1 -0
- package/dist/editor/utils/sanitizeRichtextDefaults.js +98 -0
- package/dist/editor/utils/sanitizeRichtextDefaults.js.map +1 -0
- package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts +1 -3
- package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts.map +1 -1
- package/dist/features/content-type-templates/permissions/createPuckPermissions.js.map +1 -1
- package/dist/features/content-type-templates/stores/template-store-api.d.ts.map +1 -1
- package/dist/features/content-type-templates/ui/ActionBarPinButton.d.ts.map +1 -1
- package/dist/features/content-type-templates/ui/ActionBarPinButton.js +1 -1
- package/dist/features/content-type-templates/ui/ActionBarPinButton.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/merge/components/merge-resolution/CherryPickVisualPanel.js +1 -3
- package/dist/merge/components/merge-resolution/CherryPickVisualPanel.js.map +1 -1
- package/dist/merge/components/merge-resolution/DocumentResolutionDetail.js +2 -2
- package/dist/merge/components/merge-resolution/DocumentResolutionDetail.js.map +1 -1
- package/dist/p1/editor/client.d.ts +1 -5
- package/dist/p1/editor/client.d.ts.map +1 -1
- package/dist/p1/editor/client.js +11 -12
- package/dist/p1/editor/client.js.map +1 -1
- package/dist/p1/editor/connect/connect-field-modal.d.ts +1 -1
- package/dist/p1/editor/connect/connect-field-modal.d.ts.map +1 -1
- package/dist/p1/editor/connect/connect-field-modal.js +1 -1
- package/dist/p1/editor/connect/connect-field-modal.js.map +1 -1
- package/dist/p1/editor/connect/connect-preview-config.d.ts +1 -1
- package/dist/p1/editor/connect/connect-preview-config.d.ts.map +1 -1
- package/dist/p1/editor/connect/field-connect-plugin.js +1 -1
- package/dist/p1/editor/connect/field-connect-plugin.js.map +1 -1
- package/dist/p1/editor/editor-preview-resolve.d.ts +15 -4
- package/dist/p1/editor/editor-preview-resolve.d.ts.map +1 -1
- package/dist/p1/editor/editor-preview-resolve.js +30 -8
- package/dist/p1/editor/editor-preview-resolve.js.map +1 -1
- package/dist/p1/editor/hooks/api-hooks.d.ts +4 -4
- package/dist/p1/editor/hooks/api-hooks.d.ts.map +1 -1
- package/dist/p1/editor/hooks/api-hooks.js +57 -30
- package/dist/p1/editor/hooks/api-hooks.js.map +1 -1
- package/dist/p1/editor/hooks/index.d.ts +1 -0
- package/dist/p1/editor/hooks/index.d.ts.map +1 -1
- package/dist/p1/editor/hooks/index.js +1 -0
- package/dist/p1/editor/hooks/index.js.map +1 -1
- package/dist/p1/editor/hooks/useEditorContext.d.ts +1 -1
- package/dist/p1/editor/hooks/useEditorContext.d.ts.map +1 -1
- package/dist/p1/editor/hooks/useEditorContext.js +12 -3
- package/dist/p1/editor/hooks/useEditorContext.js.map +1 -1
- package/dist/p1/editor/hooks/useLiveRemoteDatasources.d.ts +31 -0
- package/dist/p1/editor/hooks/useLiveRemoteDatasources.d.ts.map +1 -0
- package/dist/p1/editor/hooks/useLiveRemoteDatasources.js +45 -0
- package/dist/p1/editor/hooks/useLiveRemoteDatasources.js.map +1 -0
- package/dist/p1/editor/hooks/useP1Plugins.d.ts.map +1 -1
- package/dist/p1/editor/hooks/useP1Plugins.js +6 -12
- package/dist/p1/editor/hooks/useP1Plugins.js.map +1 -1
- package/dist/p1/editor/icons/button-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/button-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/data-list-block-icon.d.ts +2 -0
- package/dist/p1/editor/icons/data-list-block-icon.d.ts.map +1 -0
- package/dist/p1/editor/icons/data-list-block-icon.js +5 -0
- package/dist/p1/editor/icons/data-list-block-icon.js.map +1 -0
- package/dist/p1/editor/icons/default-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/default-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/divider-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/divider-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/grid-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/grid-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/heading-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/heading-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/image-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/image-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/list-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/list-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/paragraph-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/paragraph-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/quote-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/quote-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/icons/spacer-block-icon.d.ts +1 -1
- package/dist/p1/editor/icons/spacer-block-icon.d.ts.map +1 -1
- package/dist/p1/editor/index.d.ts +1 -1
- package/dist/p1/editor/index.d.ts.map +1 -1
- package/dist/p1/editor/index.js +1 -1
- package/dist/p1/editor/index.js.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.d.ts +6 -7
- package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.d.ts.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.js +77 -73
- package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.js.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.d.ts +4 -4
- package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.d.ts.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.js.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-manager.d.ts +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-manager.d.ts.map +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-manager.js +1 -1
- package/dist/p1/editor/remote-datasources/remote-datasource-manager.js.map +1 -1
- package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.d.ts +1 -1
- package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.d.ts.map +1 -1
- package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.js +1 -1
- package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.js.map +1 -1
- package/dist/p1/editor/template-autocomplete-layer.d.ts +2 -2
- package/dist/p1/editor/template-autocomplete-layer.d.ts.map +1 -1
- package/dist/p1/editor/template-autocomplete-layer.js +23 -3
- package/dist/p1/editor/template-autocomplete-layer.js.map +1 -1
- package/dist/p1/pages/render-client.d.ts +1 -1
- package/dist/p1/pages/render-client.d.ts.map +1 -1
- package/dist/p1/pages/render-client.js +2 -1
- package/dist/p1/pages/render-client.js.map +1 -1
- package/dist/pds/components/AgentChip.d.ts.map +1 -1
- package/dist/pds/components/AgentChip.js +1 -2
- package/dist/pds/components/AgentChip.js.map +1 -1
- package/dist/pds/components/CreatePageModal.d.ts +10 -1
- package/dist/pds/components/CreatePageModal.d.ts.map +1 -1
- package/dist/pds/components/CreatePageModal.js +29 -9
- package/dist/pds/components/CreatePageModal.js.map +1 -1
- package/dist/pds/components/CreatePageModal.module.css +34 -0
- package/dist/pds/components/DocStateBadge.d.ts +1 -1
- package/dist/pds/components/DocStateBadge.d.ts.map +1 -1
- package/dist/pds/components/DocStateBadge.js +1 -1
- package/dist/pds/components/DocStateBadge.js.map +1 -1
- package/dist/pds/components/NavIcon.js +1 -1
- package/dist/pds/components/NavIcon.js.map +1 -1
- package/dist/pds/components/P1EditorHeader.d.ts +10 -2
- package/dist/pds/components/P1EditorHeader.d.ts.map +1 -1
- package/dist/pds/components/P1EditorHeader.js +16 -7
- package/dist/pds/components/P1EditorHeader.js.map +1 -1
- package/dist/pds/components/P1EditorHeader.module.css +113 -35
- package/dist/pds/components/P1EditorSubheader.d.ts +1 -4
- package/dist/pds/components/P1EditorSubheader.d.ts.map +1 -1
- package/dist/pds/components/P1EditorSubheader.js +10 -21
- package/dist/pds/components/P1EditorSubheader.js.map +1 -1
- package/dist/pds/components/P1EditorSubheader.module.css +7 -5
- package/dist/pds/components/PageNavigator.d.ts.map +1 -1
- package/dist/pds/components/PageNavigator.js.map +1 -1
- package/dist/pds/components/PresenceStack.d.ts +6 -5
- package/dist/pds/components/PresenceStack.d.ts.map +1 -1
- package/dist/pds/components/PresenceStack.js +43 -4
- package/dist/pds/components/PresenceStack.js.map +1 -1
- package/dist/pds/components/PresenceStack.module.css +52 -7
- package/dist/pds/components/PublishControl.js +2 -2
- package/dist/pds/components/PublishControl.js.map +1 -1
- package/dist/pds/components/WorkstreamSwitcher.d.ts +7 -2
- package/dist/pds/components/WorkstreamSwitcher.d.ts.map +1 -1
- package/dist/pds/components/WorkstreamSwitcher.js +5 -3
- package/dist/pds/components/WorkstreamSwitcher.js.map +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -1
- package/dist/server.js.map +1 -1
- package/dist/versioning/components/HistoricalVersionBanner.d.ts +19 -21
- package/dist/versioning/components/HistoricalVersionBanner.d.ts.map +1 -1
- package/dist/versioning/components/HistoricalVersionBanner.js +9 -21
- package/dist/versioning/components/HistoricalVersionBanner.js.map +1 -1
- package/dist/versioning/components/HistoricalVersionBanner.module.css +174 -0
- package/dist/versioning/components/VersionBannerActions.d.ts +15 -0
- package/dist/versioning/components/VersionBannerActions.d.ts.map +1 -0
- package/dist/versioning/components/VersionBannerActions.js +38 -0
- package/dist/versioning/components/VersionBannerActions.js.map +1 -0
- package/dist/versioning/components/VersionPublishedBadge.d.ts +1 -1
- package/dist/versioning/components/VersionPublishedBadge.d.ts.map +1 -1
- package/dist/versioning/components/version-compare/VisualVersionCompare.d.ts +2 -2
- package/dist/versioning/components/version-compare/VisualVersionCompare.d.ts.map +1 -1
- package/dist/versioning/utils/formatVersionDate.d.ts +15 -0
- package/dist/versioning/utils/formatVersionDate.d.ts.map +1 -0
- package/dist/versioning/utils/formatVersionDate.js +41 -0
- package/dist/versioning/utils/formatVersionDate.js.map +1 -0
- package/dist/versioning/utils/versionKind.d.ts +19 -0
- package/dist/versioning/utils/versionKind.d.ts.map +1 -0
- package/dist/versioning/utils/versionKind.js +30 -0
- package/dist/versioning/utils/versionKind.js.map +1 -0
- package/package.json +11 -7
- package/src/pds/theme/PuckEditorTheme.css +81 -0
- package/src/pds/theme/PuckEditorTheme.test.ts +50 -1
- package/src/styles.css +609 -84
|
@@ -64,18 +64,25 @@ export interface P1OverridesOptions {
|
|
|
64
64
|
onPublishError?: (error: Error) => void;
|
|
65
65
|
/** Whether to show the default Puck publish button */
|
|
66
66
|
showDefaultPublish?: boolean;
|
|
67
|
+
/** Whether currently viewing a historical version of a document */
|
|
68
|
+
isViewingHistoricalVersion?: boolean;
|
|
69
|
+
/** The historical version being previewed. */
|
|
70
|
+
viewingVersion?: DocumentVersion | null;
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
72
|
+
* Callback to exit version preview and return to the latest version.
|
|
73
|
+
* Wired to the "Back to current version" button in the components/outline overlays.
|
|
69
74
|
*/
|
|
70
|
-
|
|
75
|
+
onReturnToLatest?: () => void;
|
|
71
76
|
/**
|
|
72
|
-
* The
|
|
77
|
+
* @deprecated Pass to VersionBannerOverride instead. The banner is no longer
|
|
78
|
+
* rendered by createP1Overrides; this prop is silently ignored.
|
|
73
79
|
*/
|
|
74
|
-
|
|
80
|
+
onRestoreVersion?: (version: DocumentVersion) => Promise<void>;
|
|
75
81
|
/**
|
|
76
|
-
*
|
|
82
|
+
* @deprecated Pass to VersionBannerOverride instead. The banner is no longer
|
|
83
|
+
* rendered by createP1Overrides; this prop is silently ignored.
|
|
77
84
|
*/
|
|
78
|
-
|
|
85
|
+
canRevert?: boolean;
|
|
79
86
|
/**
|
|
80
87
|
* @deprecated Pass syncData to createP1Plugin instead. The plugin renders
|
|
81
88
|
* inside Puck's context where usePuck() works correctly. Passing these props
|
|
@@ -118,46 +125,27 @@ export interface PuckOverrides {
|
|
|
118
125
|
}) => React.ReactElement;
|
|
119
126
|
[key: string]: unknown;
|
|
120
127
|
}
|
|
128
|
+
interface FieldLabelOverrideProps {
|
|
129
|
+
children?: React.ReactNode;
|
|
130
|
+
icon?: React.ReactNode;
|
|
131
|
+
label: string;
|
|
132
|
+
el?: 'label' | 'div';
|
|
133
|
+
readOnly?: boolean;
|
|
134
|
+
}
|
|
121
135
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```tsx
|
|
128
|
-
* import { createP1Overrides, useP1Puck } from '@pantheon-systems/puck-css';
|
|
129
|
-
*
|
|
130
|
-
* function Editor() {
|
|
131
|
-
* const {
|
|
132
|
-
* saveStatus,
|
|
133
|
-
* lastSaved,
|
|
134
|
-
* saveError,
|
|
135
|
-
* saveNow,
|
|
136
|
-
* publishDocument,
|
|
137
|
-
* } = useP1Puck();
|
|
138
|
-
*
|
|
139
|
-
* // Preferred: use refs and getters for better performance
|
|
140
|
-
* const saveStatusRef = useRef(saveStatus);
|
|
141
|
-
* useEffect(() => { saveStatusRef.current = saveStatus; }, [saveStatus]);
|
|
142
|
-
*
|
|
143
|
-
* const overrides = createP1Overrides({
|
|
144
|
-
* getSaveStatus: () => saveStatusRef.current,
|
|
145
|
-
* getLastSaved: () => lastSavedRef.current,
|
|
146
|
-
* getSaveError: () => saveErrorRef.current,
|
|
147
|
-
* onRetrySave: saveNow,
|
|
148
|
-
* });
|
|
136
|
+
* Renders an opted-in field group's label row as a disclosure. Puck hands a
|
|
137
|
+
* label override the field's content as `children`, so the group's own label
|
|
138
|
+
* becomes the toggle — there is no second header and nothing to suppress.
|
|
149
139
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* saveStatus,
|
|
153
|
-
* lastSaved,
|
|
154
|
-
* saveError,
|
|
155
|
-
* onRetrySave: saveNow,
|
|
156
|
-
* });
|
|
140
|
+
* The context is cleared for descendants so a nested group inside a collapsible
|
|
141
|
+
* one keeps its ordinary label.
|
|
157
142
|
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
143
|
+
* Ordinary field labels drop Puck's field-type icon. Its select variant is a
|
|
144
|
+
* chevron, the same glyph the disclosure above uses, so it reads as a group that
|
|
145
|
+
* expands and then does nothing. The label already says what the field is, and
|
|
146
|
+
* the narrow inspector would rather have the space. The read-only lock is a
|
|
147
|
+
* separate slot and survives.
|
|
161
148
|
*/
|
|
149
|
+
export declare function P1FieldLabel(props: FieldLabelOverrideProps): React.ReactElement;
|
|
162
150
|
export declare function createP1Overrides(options: P1OverridesOptions): PuckOverrides;
|
|
163
151
|
//# sourceMappingURL=createP1Overrides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createP1Overrides.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/createP1Overrides.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACzG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"createP1Overrides.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/createP1Overrides.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACzG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAetD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH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
|
+
* Creates Puck overrides for P1 integration, including
|
|
6
|
+
* header actions for save status and publish functionality.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { ActionBar, FieldLabel } from '@puckeditor/core';
|
|
3
10
|
import { SaveIndicator } from '../components/SaveIndicator.js';
|
|
4
|
-
import { HistoricalVersionBanner } from '../../versioning/components/HistoricalVersionBanner.js';
|
|
5
11
|
import { CollaboratorAvatars } from '../../collaboration/components/CollaboratorAvatars.js';
|
|
6
12
|
import { AgentActivityBanner } from '../../collaboration/components/AgentActivityBanner.js';
|
|
7
13
|
import { PublishedStatusBadge } from '../components/PublishedStatusBadge.js';
|
|
8
14
|
import { ActionBarPinButton } from '../../features/content-type-templates/ui/ActionBarPinButton.js';
|
|
9
15
|
import { P1InspectorFields } from '../components/P1InspectorFields.js';
|
|
16
|
+
import { CollapsibleFieldSection } from '../components/CollapsibleFieldSection.js';
|
|
17
|
+
import { CollapsibleFieldContext } from '../components/collapsibleSectionContext.js';
|
|
18
|
+
import { OutlinePanel } from '../components/OutlinePanel.js';
|
|
19
|
+
import { fieldGuidanceFieldTypes } from './fieldGuidance.js';
|
|
10
20
|
// NOTE: PuckDataSynchronizer is NOT imported here - it's used in P1Plugin instead
|
|
11
21
|
// because headerActions renders outside Puck's context where usePuck() doesn't work.
|
|
12
22
|
// Re-exported for backwards compatibility — implementation lives in utils/templatePath.ts.
|
|
@@ -14,46 +24,26 @@ export { templateFromRegistryPath } from '../utils/templatePath.js';
|
|
|
14
24
|
// Re-exported for backwards compatibility — implementation lives in components/P1TemplateFields.tsx.
|
|
15
25
|
export { P1TemplateFields } from '../components/P1TemplateFields.js';
|
|
16
26
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* import { createP1Overrides, useP1Puck } from '@pantheon-systems/puck-css';
|
|
27
|
+
* Renders an opted-in field group's label row as a disclosure. Puck hands a
|
|
28
|
+
* label override the field's content as `children`, so the group's own label
|
|
29
|
+
* becomes the toggle — there is no second header and nothing to suppress.
|
|
24
30
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* saveStatus,
|
|
28
|
-
* lastSaved,
|
|
29
|
-
* saveError,
|
|
30
|
-
* saveNow,
|
|
31
|
-
* publishDocument,
|
|
32
|
-
* } = useP1Puck();
|
|
31
|
+
* The context is cleared for descendants so a nested group inside a collapsible
|
|
32
|
+
* one keeps its ordinary label.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* getSaveStatus: () => saveStatusRef.current,
|
|
40
|
-
* getLastSaved: () => lastSavedRef.current,
|
|
41
|
-
* getSaveError: () => saveErrorRef.current,
|
|
42
|
-
* onRetrySave: saveNow,
|
|
43
|
-
* });
|
|
44
|
-
*
|
|
45
|
-
* // Legacy: direct values (causes overrides to be recreated on changes)
|
|
46
|
-
* const overrides = createP1Overrides({
|
|
47
|
-
* saveStatus,
|
|
48
|
-
* lastSaved,
|
|
49
|
-
* saveError,
|
|
50
|
-
* onRetrySave: saveNow,
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* return <Puck overrides={overrides} {...otherProps} />;
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
34
|
+
* Ordinary field labels drop Puck's field-type icon. Its select variant is a
|
|
35
|
+
* chevron, the same glyph the disclosure above uses, so it reads as a group that
|
|
36
|
+
* expands and then does nothing. The label already says what the field is, and
|
|
37
|
+
* the narrow inspector would rather have the space. The read-only lock is a
|
|
38
|
+
* separate slot and survives.
|
|
56
39
|
*/
|
|
40
|
+
export function P1FieldLabel(props) {
|
|
41
|
+
const collapsible = React.useContext(CollapsibleFieldContext);
|
|
42
|
+
if (collapsible && props.el === 'div') {
|
|
43
|
+
return (_jsx(CollapsibleFieldContext.Provider, { value: null, children: _jsx(CollapsibleFieldSection, { label: props.label, defaultCollapsed: collapsible.defaultCollapsed, count: collapsible.count, children: props.children }) }));
|
|
44
|
+
}
|
|
45
|
+
return _jsx(FieldLabel, { ...props, icon: undefined });
|
|
46
|
+
}
|
|
57
47
|
export function createP1Overrides(options) {
|
|
58
48
|
const {
|
|
59
49
|
// New getter-based API (preferred)
|
|
@@ -63,7 +53,7 @@ export function createP1Overrides(options) {
|
|
|
63
53
|
// Common options
|
|
64
54
|
onRetrySave, showDefaultPublish = false,
|
|
65
55
|
// Deprecated props - kept for type signature compatibility but ignored
|
|
66
|
-
syncData: _syncData, dataSyncKey: _dataSyncKey,
|
|
56
|
+
syncData: _syncData, dataSyncKey: _dataSyncKey, onRestoreVersion: _onRestoreVersion, canRevert: _canRevert,
|
|
67
57
|
// Presence/Agent Features — NOT destructured here.
|
|
68
58
|
// These are read lazily from `options` in the headerActions render function
|
|
69
59
|
// so that the Proxy pattern from useP1Overrides provides live values.
|
|
@@ -72,6 +62,8 @@ export function createP1Overrides(options) {
|
|
|
72
62
|
// Suppress unused variable warnings for deprecated props
|
|
73
63
|
void _syncData;
|
|
74
64
|
void _dataSyncKey;
|
|
65
|
+
void _onRestoreVersion;
|
|
66
|
+
void _canRevert;
|
|
75
67
|
// Determine if using getter API or direct props API
|
|
76
68
|
const usingGetters = typeof getSaveStatus === 'function';
|
|
77
69
|
// Build props for SaveIndicator based on which API is being used
|
|
@@ -91,6 +83,20 @@ export function createP1Overrides(options) {
|
|
|
91
83
|
return {
|
|
92
84
|
actionBar: ({ label, children }) => (_jsxs(ActionBar, { label: label, children: [children, _jsx(ActionBarPinButton, {})] })),
|
|
93
85
|
fields: ({ children }) => (_jsx(P1InspectorFields, { children: children })),
|
|
86
|
+
fieldLabel: P1FieldLabel,
|
|
87
|
+
fieldTypes: {
|
|
88
|
+
...fieldGuidanceFieldTypes,
|
|
89
|
+
// Marks an opted-in object field for P1FieldLabel, which owns the rendering
|
|
90
|
+
// because it is the only override that receives the label. Object fields
|
|
91
|
+
// without `metadata.collapsible` pass through untouched.
|
|
92
|
+
object: ({ field, children, }) => field.metadata?.collapsible ? (_jsx(CollapsibleFieldContext.Provider, { value: {
|
|
93
|
+
defaultCollapsed: field.metadata.defaultCollapsed,
|
|
94
|
+
// Derived from the resolved field set, so omitting a field — how
|
|
95
|
+
// role gating will hide one — moves the count with it.
|
|
96
|
+
count: Object.keys(field.objectFields ?? {}).length,
|
|
97
|
+
}, children: children })) : (_jsx(_Fragment, { children: children })),
|
|
98
|
+
},
|
|
99
|
+
outline: () => _jsx(OutlinePanel, {}),
|
|
94
100
|
headerActions: ({ children }) => {
|
|
95
101
|
// Read presence/agent values lazily from options (Proxy) each render
|
|
96
102
|
// so they reflect the latest state from useP1Overrides' optionsRef.
|
|
@@ -102,12 +108,10 @@ export function createP1Overrides(options) {
|
|
|
102
108
|
const _onStopAgent = options.onStopAgent;
|
|
103
109
|
const _showSaveIndicator = options.showSaveIndicator ?? true;
|
|
104
110
|
const _isViewingHistoricalVersion = options.isViewingHistoricalVersion ?? false;
|
|
105
|
-
const _viewingVersion = options.viewingVersion;
|
|
106
|
-
const _onReturnToLatest = options.onReturnToLatest;
|
|
107
111
|
const _publishedStatus = options.publishedStatus;
|
|
108
112
|
// Find the first active agent for banner display
|
|
109
113
|
const firstActiveAgent = _activeAgents.find(a => a.state === 'editing') || _activeAgents[0];
|
|
110
|
-
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_showAgentActivityBanner && _isAgentEditing && firstActiveAgent && (_jsx(AgentActivityBanner, { agent: firstActiveAgent, showIdle: true, onStopAgent: _onStopAgent })), _showCollaboratorAvatars && _presence.length > 0 && (_jsx(CollaboratorAvatars, { actors: _presence, maxVisible: 5 })), _isViewingHistoricalVersion &&
|
|
114
|
+
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_showAgentActivityBanner && _isAgentEditing && firstActiveAgent && (_jsx(AgentActivityBanner, { agent: firstActiveAgent, showIdle: true, onStopAgent: _onStopAgent })), _showCollaboratorAvatars && _presence.length > 0 && (_jsx(CollaboratorAvatars, { actors: _presence, maxVisible: 5 })), !_isViewingHistoricalVersion && (_jsxs(_Fragment, { children: [_showSaveIndicator && _jsx(SaveIndicator, { ...saveIndicatorProps }), _publishedStatus && (_jsx(PublishedStatusBadge, { status: _publishedStatus }))] })), showDefaultPublish && children] }));
|
|
111
115
|
},
|
|
112
116
|
};
|
|
113
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createP1Overrides.js","sourceRoot":"","sources":["../../../src/editor/plugin/createP1Overrides.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"createP1Overrides.js","sourceRoot":"","sources":["../../../src/editor/plugin/createP1Overrides.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,kFAAkF;AAClF,qFAAqF;AAErF,2FAA2F;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAA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B,GAAI,EAC/D,gBAAgB,IAAI,CACnB,KAAC,oBAAoB,IAAC,MAAM,EAAE,gBAAgB,GAAI,CACnD,IACA,CACJ,EACA,kBAAkB,IAAI,QAAQ,IAC3B,CACP,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { Plugin } from "@puckeditor/core";
|
|
2
2
|
import type { PuckData } from "@pantheon-systems/css-client";
|
|
3
3
|
export interface DocumentSyncSnapshot {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Identity of the document this data actually *is* (`${branchId}:${documentId}`),
|
|
6
|
+
* derived from the payload's own origin. It must never be built from the live
|
|
7
|
+
* branchId: that flips the moment a switch starts, so it names the document
|
|
8
|
+
* being requested rather than the one in hand, and publishing a new key beside
|
|
9
|
+
* the outgoing branch's data made the canvas render a branch behind.
|
|
10
|
+
*/
|
|
5
11
|
syncKey: string | null;
|
|
6
12
|
data: PuckData | null;
|
|
7
13
|
}
|
|
@@ -9,11 +15,23 @@ export interface DocumentSyncStore {
|
|
|
9
15
|
publish(snapshot: DocumentSyncSnapshot): void;
|
|
10
16
|
subscribe(onChange: VoidFunction): VoidFunction;
|
|
11
17
|
getSnapshot(): DocumentSyncSnapshot;
|
|
12
|
-
/** Records which document the Puck canvas currently shows
|
|
13
|
-
markApplied(syncKey: string
|
|
14
|
-
/** Sync key of the document the canvas shows
|
|
15
|
-
getAppliedKey(): string
|
|
18
|
+
/** Records which document the Puck canvas currently shows */
|
|
19
|
+
markApplied(syncKey: string): void;
|
|
20
|
+
/** Sync key of the document the canvas shows; BLANK_SYNC_KEY before the first */
|
|
21
|
+
getAppliedKey(): string;
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Applied key while Puck still shows the blank data it mounted with.
|
|
25
|
+
*
|
|
26
|
+
* A distinct sentinel rather than null because "no document yet" and "the
|
|
27
|
+
* document Puck was mounted with" are different states, and conflating them
|
|
28
|
+
* dropped the first real payload: Puck mounts with empty data and the branch is
|
|
29
|
+
* restored from storage after mount, so the assumption that the first observed
|
|
30
|
+
* document was already on the canvas never held.
|
|
31
|
+
*
|
|
32
|
+
* Contains no colon, so it can never collide with a documentSyncKey.
|
|
33
|
+
*/
|
|
34
|
+
export declare const BLANK_SYNC_KEY = "blank";
|
|
17
35
|
/**
|
|
18
36
|
* Sync-key format for a loaded document. Shared so the publisher
|
|
19
37
|
* (useP1Editor) and readers of the applied key (ContextSyncBridge, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-sync-plugin.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/document-sync-plugin.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC
|
|
1
|
+
{"version":3,"file":"document-sync-plugin.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/document-sync-plugin.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC9C,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,CAAC;IAChD,WAAW,IAAI,oBAAoB,CAAC;IACpC,6DAA6D;IAC7D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,iFAAiF;IACjF,aAAa,IAAI,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,UAAU,CAAC;AAItC;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAW1D;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAwB3D;AAmED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAYzE"}
|
|
@@ -17,6 +17,18 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
17
17
|
*/
|
|
18
18
|
import { useEffect, useSyncExternalStore } from "react";
|
|
19
19
|
import { useGetPuck } from "@puckeditor/core";
|
|
20
|
+
/**
|
|
21
|
+
* Applied key while Puck still shows the blank data it mounted with.
|
|
22
|
+
*
|
|
23
|
+
* A distinct sentinel rather than null because "no document yet" and "the
|
|
24
|
+
* document Puck was mounted with" are different states, and conflating them
|
|
25
|
+
* dropped the first real payload: Puck mounts with empty data and the branch is
|
|
26
|
+
* restored from storage after mount, so the assumption that the first observed
|
|
27
|
+
* document was already on the canvas never held.
|
|
28
|
+
*
|
|
29
|
+
* Contains no colon, so it can never collide with a documentSyncKey.
|
|
30
|
+
*/
|
|
31
|
+
export const BLANK_SYNC_KEY = "blank";
|
|
20
32
|
const EMPTY_SNAPSHOT = { syncKey: null, data: null };
|
|
21
33
|
/**
|
|
22
34
|
* Sync-key format for a loaded document. Shared so the publisher
|
|
@@ -50,7 +62,7 @@ export function normalizeSyncData(data) {
|
|
|
50
62
|
}
|
|
51
63
|
export function createDocumentSyncStore() {
|
|
52
64
|
let snapshot = EMPTY_SNAPSHOT;
|
|
53
|
-
let appliedKey =
|
|
65
|
+
let appliedKey = BLANK_SYNC_KEY;
|
|
54
66
|
const listeners = new Set();
|
|
55
67
|
return {
|
|
56
68
|
publish(next) {
|
|
@@ -85,11 +97,6 @@ function DocumentSync({ store }) {
|
|
|
85
97
|
const appliedKey = store.getAppliedKey();
|
|
86
98
|
if (appliedKey === syncKey)
|
|
87
99
|
return;
|
|
88
|
-
if (appliedKey === null) {
|
|
89
|
-
// First document observed: Puck was mounted with it, nothing to push.
|
|
90
|
-
store.markApplied(syncKey);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
100
|
const { appState, history } = getPuck();
|
|
94
101
|
// Omit indexes so Puck re-runs walkAppState for the new content.
|
|
95
102
|
const { indexes: _indexes, ...rest } = appState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-sync-plugin.js","sourceRoot":"","sources":["../../../src/editor/plugin/document-sync-plugin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;GAcG;AAEH,OAAc,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"document-sync-plugin.js","sourceRoot":"","sources":["../../../src/editor/plugin/document-sync-plugin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;GAcG;AAEH,OAAc,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA0B9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,MAAM,cAAc,GAAyB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAmC,EACnC,UAAkB;IAElB,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC;AAC3C,CAAC;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AAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAwB;IAC/D,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CACrD,8BACE,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI,EAC7B,QAAQ,IACR,CACJ;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-field help text, rendered under the input.
|
|
3
|
+
*
|
|
4
|
+
* Opt in with Puck's per-field `metadata`, the same extension point the
|
|
5
|
+
* collapsible section uses:
|
|
6
|
+
*
|
|
7
|
+
* metadata: { help: 'Always shown.', helpWhenEmpty: 'Shown while empty.' }
|
|
8
|
+
*
|
|
9
|
+
* `helpWhenEmpty` is how an inheriting field says where its value comes from,
|
|
10
|
+
* since a field is inheriting exactly while it is empty. Fields without either
|
|
11
|
+
* key render unchanged.
|
|
12
|
+
*
|
|
13
|
+
* These are `fieldTypes` overrides, so Puck hands us its own field renderer as
|
|
14
|
+
* `children` — the help is appended after it rather than replacing it. Note the
|
|
15
|
+
* side effect of registering a type here: Puck subscribes to the value of every
|
|
16
|
+
* field of that type, which is what makes the empty/authored switch work.
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
export interface FieldGuidanceMetadata {
|
|
20
|
+
help?: string;
|
|
21
|
+
helpWhenEmpty?: string;
|
|
22
|
+
}
|
|
23
|
+
interface GuidedFieldProps {
|
|
24
|
+
field: {
|
|
25
|
+
metadata?: FieldGuidanceMetadata;
|
|
26
|
+
};
|
|
27
|
+
value: unknown;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare function WithHelpText({ field, value, children }: GuidedFieldProps): React.ReactElement;
|
|
31
|
+
/**
|
|
32
|
+
* The field types help text is wired for. Select is included for the fields
|
|
33
|
+
* whose fallback is a fixed default rather than another prop — it has no
|
|
34
|
+
* `placeholder` to show one in, so the help line carries it alone.
|
|
35
|
+
*/
|
|
36
|
+
export declare const fieldGuidanceFieldTypes: {
|
|
37
|
+
text: typeof WithHelpText;
|
|
38
|
+
textarea: typeof WithHelpText;
|
|
39
|
+
select: typeof WithHelpText;
|
|
40
|
+
};
|
|
41
|
+
export declare function createFieldGuidanceOverrides(): {
|
|
42
|
+
fieldTypes: typeof fieldGuidanceFieldTypes;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=fieldGuidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldGuidance.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/fieldGuidance.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,qBAAqB,CAAA;KAAE,CAAC;IAC5C,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CActF;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;CAInC,CAAC;AAEF,wBAAgB,4BAA4B,IAAI;IAC9C,UAAU,EAAE,OAAO,uBAAuB,CAAC;CAC5C,CAEA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FieldHelpText } from '../components/FieldHelpText.js';
|
|
3
|
+
function WithHelpText({ field, value, children }) {
|
|
4
|
+
const { help, helpWhenEmpty } = field.metadata ?? {};
|
|
5
|
+
const text = value === undefined || value === null || value === '' ? helpWhenEmpty ?? help : help;
|
|
6
|
+
if (!text) {
|
|
7
|
+
return _jsx(_Fragment, { children: children });
|
|
8
|
+
}
|
|
9
|
+
return (_jsxs(_Fragment, { children: [children, _jsx(FieldHelpText, { children: text })] }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The field types help text is wired for. Select is included for the fields
|
|
13
|
+
* whose fallback is a fixed default rather than another prop — it has no
|
|
14
|
+
* `placeholder` to show one in, so the help line carries it alone.
|
|
15
|
+
*/
|
|
16
|
+
export const fieldGuidanceFieldTypes = {
|
|
17
|
+
text: WithHelpText,
|
|
18
|
+
textarea: WithHelpText,
|
|
19
|
+
select: WithHelpText,
|
|
20
|
+
};
|
|
21
|
+
export function createFieldGuidanceOverrides() {
|
|
22
|
+
return { fieldTypes: fieldGuidanceFieldTypes };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=fieldGuidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldGuidance.js","sourceRoot":"","sources":["../../../src/editor/plugin/fieldGuidance.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAa/D,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAoB;IAChE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IACrD,MAAM,IAAI,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAElG,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,4BAAG,QAAQ,GAAI,CAAC;IACzB,CAAC;IAED,OAAO,CACL,8BACG,QAAQ,EACT,KAAC,aAAa,cAAE,IAAI,GAAiB,IACpC,CACJ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,YAAY;CACrB,CAAC;AAEF,MAAM,UAAU,4BAA4B;IAG1C,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergePreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/mergePreviewPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mergePreviewPlugin.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/mergePreviewPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,yBAAyB;IACxC,mDAAmD;IAEnD,MAAM,EAAE,GAAG,CAAC;IAEZ,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD;AAyDD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,UAAU,CAYZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergePreviewPlugin.js","sourceRoot":"","sources":["../../../src/editor/plugin/mergePreviewPlugin.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"mergePreviewPlugin.js","sourceRoot":"","sources":["../../../src/editor/plugin/mergePreviewPlugin.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,eAAe,EA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,OAAO,CAAC,MAAM,EACtB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,GAC1C,CACH;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selects the human collaborators shown as avatars in the editor header.
|
|
3
|
+
*
|
|
4
|
+
* Agents are deliberately excluded — they render as chips in the subheader.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
import type { ActorPresence } from '@pantheon-systems/css-client';
|
|
8
|
+
export interface HeaderPresenceState {
|
|
9
|
+
humans?: ActorPresence[];
|
|
10
|
+
}
|
|
11
|
+
export declare function selectHeaderCollaborators(presence: HeaderPresenceState | null | undefined, _hasActiveHumans: boolean, humanPresenceCount: number): ActorPresence[];
|
|
12
|
+
//# sourceMappingURL=selectHeaderCollaborators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectHeaderCollaborators.d.ts","sourceRoot":"","sources":["../../../src/editor/plugin/selectHeaderCollaborators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,EAChD,gBAAgB,EAAE,OAAO,EACzB,kBAAkB,EAAE,MAAM,GACzB,aAAa,EAAE,CAMjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selects the human collaborators shown as avatars in the editor header.
|
|
3
|
+
*
|
|
4
|
+
* Agents are deliberately excluded — they render as chips in the subheader.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export function selectHeaderCollaborators(presence, _hasActiveHumans, humanPresenceCount) {
|
|
8
|
+
const humans = presence?.humans ?? [];
|
|
9
|
+
// humanPresenceCount is the fresher of the two signals on a mid-session
|
|
10
|
+
// departure, so it still guards against a stale presence getter.
|
|
11
|
+
if (humanPresenceCount <= 0 || humans.length === 0)
|
|
12
|
+
return [];
|
|
13
|
+
return humans;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=selectHeaderCollaborators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectHeaderCollaborators.js","sourceRoot":"","sources":["../../../src/editor/plugin/selectHeaderCollaborators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,UAAU,yBAAyB,CACvC,QAAgD,EAChD,gBAAyB,EACzB,kBAA0B;IAE1B,MAAM,MAAM,GAAG,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAC;IACtC,wEAAwE;IACxE,iEAAiE;IACjE,IAAI,kBAAkB,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LiveThumbnail
|
|
3
|
+
*
|
|
4
|
+
* Renders a real, scaled-down preview of a single Puck component using the
|
|
5
|
+
* component's own `defaultProps`, via Puck's <Render>. The preview is clipped
|
|
6
|
+
* to a fixed height and made non-interactive so it reads as a static thumbnail
|
|
7
|
+
* inside the visual component sidebar.
|
|
8
|
+
*
|
|
9
|
+
* Rendering is cached (see thumbnailCache): on a miss we render live and
|
|
10
|
+
* capture the resulting HTML; on a hit we re-inject the cached HTML instead of
|
|
11
|
+
* re-rendering the component. The cache survives editor remounts within a
|
|
12
|
+
* page load, avoiding re-rendering identical previews on every document
|
|
13
|
+
* switch.
|
|
14
|
+
*
|
|
15
|
+
* The initial capture happens right after the component's first commit, but a
|
|
16
|
+
* component that renders its own content asynchronously (e.g. after a fetch,
|
|
17
|
+
* in its own effect) may still be showing a loading state at that point. A
|
|
18
|
+
* MutationObserver keeps watching the live render and re-captures on every
|
|
19
|
+
* DOM change, so the cache converges on the settled output instead of
|
|
20
|
+
* permanently freezing whatever was on screen first.
|
|
21
|
+
*
|
|
22
|
+
* The config handed to Puck's <Render> has its `root` swapped for a
|
|
23
|
+
* pass-through: this preview is a single component, not a page, so it must
|
|
24
|
+
* not run the site's real page-root wrapper (e.g. a title `<h1>`) — that
|
|
25
|
+
* wrapper reflects the actual document currently open in the editor, not
|
|
26
|
+
* this isolated stub, and would otherwise leak into every preview.
|
|
27
|
+
*
|
|
28
|
+
* Unlike the exploratory spike this does NOT self-measure its height — grid
|
|
29
|
+
* cards want a uniform, fixed size, so we clip overflow instead.
|
|
30
|
+
*/
|
|
31
|
+
import React from 'react';
|
|
32
|
+
type RenderConfig = any;
|
|
33
|
+
export interface LiveThumbnailProps {
|
|
34
|
+
/** The Puck config the component belongs to. */
|
|
35
|
+
config: RenderConfig;
|
|
36
|
+
/** Component key to preview (e.g. "HeroBlock"). */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Zoom factor applied to the live render. Lower = more fits. */
|
|
39
|
+
scale?: number;
|
|
40
|
+
/** Fixed height of the clipped preview box, in pixels. */
|
|
41
|
+
height?: number;
|
|
42
|
+
}
|
|
43
|
+
declare function LiveThumbnailImpl({ config, name, scale, height }: LiveThumbnailProps): React.JSX.Element;
|
|
44
|
+
/** Memoized so re-expanding a category doesn't re-render existing previews. */
|
|
45
|
+
export declare const LiveThumbnail: React.MemoExoticComponent<typeof LiveThumbnailImpl>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=LiveThumbnail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveThumbnail.d.ts","sourceRoot":"","sources":["../../../src/editor/thumbnails/LiveThumbnail.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,YAAY,GAAG,GAAG,CAAC;AAExB,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,MAAM,EAAE,YAAY,CAAC;IACrB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,iBAAiB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAW,EAAE,MAAiC,EAAE,EAAE,kBAAkB,qBAiG9G;AAED,+EAA+E;AAC/E,eAAO,MAAM,aAAa,qDAAgC,CAAC"}
|