@plitzi/plitzi-builder 0.37.8 → 0.37.10
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 +847 -0
- package/dist/config/index.d.ts +0 -4
- package/dist/index.html +4 -2
- package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/AITemplatePreview.d.ts → AISnippetPreview/AISnippetPreview.d.ts} +3 -3
- package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/components/AITemplateHeader/AITemplateHeader.d.ts → AISnippetPreview/components/AISnippetHeader/AISnippetHeader.d.ts} +3 -3
- package/dist/modules/AI/components/ChatMessage/components/AISnippetPreview/components/AISnippetHeader/index.d.ts +3 -0
- package/dist/modules/AI/components/ChatMessage/components/AISnippetPreview/index.d.ts +3 -0
- package/dist/modules/AI/hooks/useAiChat.d.ts +2 -1
- package/dist/modules/Actions/ActionsContext.d.ts +0 -1
- package/dist/modules/App/AppContainer/components/NotificationsSettings/NotificationsSettings.d.ts +7 -0
- package/dist/modules/App/AppContainer/components/NotificationsSettings/index.d.ts +2 -0
- package/dist/modules/App/AppContainer/containers/ContainerServer.d.ts +7 -0
- package/dist/modules/App/AppContainer/containers/ContainerSettings.d.ts +1 -0
- package/dist/modules/App/AppContainer/containers/GeneralSettings.d.ts +2 -0
- package/dist/modules/App/AppContext.d.ts +3 -0
- package/dist/modules/App/components/AppHeader/GridButton.d.ts +3 -0
- package/dist/modules/App/components/AppHeader/IssuesButton/helpers.d.ts +2 -0
- package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +7 -6
- package/dist/modules/App/components/EmptyState/EmptyState.d.ts +12 -0
- package/dist/modules/App/components/EmptyState/index.d.ts +3 -0
- package/dist/modules/App/components/PanelSections/PanelSections.d.ts +27 -0
- package/dist/modules/App/components/PanelSections/index.d.ts +3 -0
- package/dist/modules/App/components/ResourceRow/ResourceRow.d.ts +19 -0
- package/dist/modules/App/components/ResourceRow/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/SitemapDiagram.d.ts +25 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapChip/SitemapChip.d.ts +21 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapChip/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapLegend/SitemapLegend.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapLegend/index.d.ts +2 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapNode/SitemapNode.d.ts +15 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapNode/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapPath/SitemapPath.d.ts +6 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapPath/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapToolbar/SitemapToolbar.d.ts +16 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapToolbar/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/schemaToSitemap.d.ts +10 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/schemaToSitemap.test.d.ts +1 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/searchSitemap.d.ts +12 -0
- package/dist/modules/App/components/SitemapDiagram/index.d.ts +4 -0
- package/dist/modules/App/components/SitemapDiagram/types.d.ts +36 -0
- package/dist/modules/App/components/VersionContents/PluginList.d.ts +7 -0
- package/dist/modules/App/components/VersionContents/VersionContents.d.ts +14 -0
- package/dist/modules/App/components/VersionContents/helpers.d.ts +8 -0
- package/dist/modules/App/components/VersionContents/helpers.test.d.ts +1 -0
- package/dist/modules/App/components/VersionContents/index.d.ts +2 -0
- package/dist/modules/App/components/VersionContents/useVersionContents.d.ts +8 -0
- package/dist/modules/App/components/ViewPage/ViewPage.d.ts +22 -0
- package/dist/modules/App/components/ViewPage/index.d.ts +3 -0
- package/dist/modules/App/components/ViewSection/ViewSection.d.ts +10 -0
- package/dist/modules/App/components/ViewSection/index.d.ts +3 -0
- package/dist/modules/App/helpers/utils.d.ts +10 -1
- package/dist/modules/App/hooks/useSitemapOpen.d.ts +7 -0
- package/dist/modules/Builder/BuilderHelper.d.ts +4 -4
- package/dist/modules/Builder/BuilderProvider.d.ts +1 -1
- package/dist/modules/Builder/Models/SnippetForm.d.ts +16 -0
- package/dist/modules/Builder/components/BuilderContextMenu/BuilderContextMenuItem.d.ts +6 -1
- package/dist/modules/Builder/components/BuilderElementTools/ElementAnchor.d.ts +11 -0
- package/dist/modules/Builder/components/BuilderElementTools/ElementDefinitionSettings.d.ts +3 -1
- package/dist/modules/Builder/components/BuilderElementTools/ElementFlagGate.d.ts +16 -0
- package/dist/modules/Builder/components/BuilderElementTools/NothingSelected.d.ts +6 -0
- package/dist/modules/Builder/helpers/reuse.d.ts +16 -0
- package/dist/modules/Builder/hooks/useSaveAsSnippet.d.ts +8 -0
- package/dist/modules/Components/Components.d.ts +11 -0
- package/dist/modules/Components/components/ComponentBanner/ComponentBanner.d.ts +7 -0
- package/dist/modules/Components/components/ComponentBanner/index.d.ts +1 -0
- package/dist/modules/Components/components/ComponentForm/ComponentForm.d.ts +19 -0
- package/dist/modules/Components/components/ComponentForm/SlotChoice.d.ts +8 -0
- package/dist/modules/Components/components/ComponentForm/index.d.ts +1 -0
- package/dist/modules/Components/components/ComponentItem/ComponentItem.d.ts +12 -0
- package/dist/modules/Components/components/ComponentItem/index.d.ts +1 -0
- package/dist/modules/Components/components/InstanceTools/InstanceTools.d.ts +10 -0
- package/dist/modules/Components/components/InstanceTools/SlotRow.d.ts +13 -0
- package/dist/modules/Components/components/InstanceTools/index.d.ts +1 -0
- package/dist/modules/Components/components/PropsEditor/PropRow.d.ts +14 -0
- package/dist/modules/Components/components/PropsEditor/PropsEditor.d.ts +11 -0
- package/dist/modules/Components/components/PropsEditor/index.d.ts +2 -0
- package/dist/modules/Components/helpers.d.ts +17 -0
- package/dist/modules/Components/helpers.test.d.ts +1 -0
- package/dist/modules/Components/index.d.ts +2 -0
- package/dist/modules/Components/slotChoices.d.ts +9 -0
- package/dist/modules/Components/useOpenComponent.d.ts +13 -0
- package/dist/modules/Components/useSaveAsComponent.d.ts +7 -0
- package/dist/modules/Connectors/ConnectorsContext.d.ts +0 -2
- package/dist/modules/Connectors/helpers/manifestDoc.d.ts +0 -1
- package/dist/modules/Credentials/Credentials.d.ts +0 -7
- package/dist/modules/Elements/ElementHelper.d.ts +3 -2
- package/dist/modules/Elements/hooks/useDragElement.d.ts +5 -4
- package/dist/modules/Flags/Flags.d.ts +9 -0
- package/dist/modules/Flags/components/FlagForm/FlagForm.d.ts +15 -0
- package/dist/modules/Flags/components/FlagForm/FlagRule.d.ts +11 -0
- package/dist/modules/Flags/components/FlagForm/index.d.ts +3 -0
- package/dist/modules/Flags/components/FlagForm/ruleGroup.d.ts +5 -0
- package/dist/modules/Flags/components/FlagForm/ruleGroup.test.d.ts +1 -0
- package/dist/modules/Flags/components/FlagItem/FlagItem.d.ts +14 -0
- package/dist/modules/Flags/components/FlagItem/FlagPreviewOption.d.ts +13 -0
- package/dist/modules/Flags/components/FlagItem/FlagPreviewToggle.d.ts +9 -0
- package/dist/modules/Flags/components/FlagItem/index.d.ts +3 -0
- package/dist/modules/Flags/components/PublishFlagsForm/PublishFlagsForm.d.ts +21 -0
- package/dist/modules/Flags/components/PublishFlagsForm/index.d.ts +3 -0
- package/dist/modules/Flags/helpers/flagRuleFields.d.ts +11 -0
- package/dist/modules/Flags/index.d.ts +3 -0
- package/dist/modules/Functions/Functions.d.ts +4 -3
- package/dist/modules/Functions/components/FunctionInspector/FunctionInspector.d.ts +20 -0
- package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/InspectorSection.d.ts +10 -0
- package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/TaskTest.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/TimeLimit.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryField/TryField.d.ts +10 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryField/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryResult/TryResult.d.ts +9 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryResult/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsEditor/FunctionsEditor.d.ts +20 -0
- package/dist/modules/Functions/components/FunctionsEditor/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsGuide/FunctionsGuide.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsGuide/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsHeader/FunctionsHeader.d.ts +17 -0
- package/dist/modules/Functions/components/FunctionsHeader/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsProblems/FunctionsProblems.d.ts +2 -1
- package/dist/modules/Functions/components/FunctionsSidebar/FunctionsSidebar.d.ts +30 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/FileItem.d.ts +14 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/FolderItem.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/NewFile.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/NewTask.d.ts +13 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/RouteItem.d.ts +9 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/SidebarSection.d.ts +13 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/TaskItem.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsWelcome/FunctionsWelcome.d.ts +6 -0
- package/dist/modules/Functions/components/FunctionsWelcome/index.d.ts +3 -0
- package/dist/modules/Functions/editor/paths.d.ts +9 -0
- package/dist/modules/Functions/editor/source.d.ts +60 -0
- package/dist/modules/Functions/editor/source.test.d.ts +1 -0
- package/dist/modules/Functions/editor/typescriptWorker.d.ts +26 -0
- package/dist/modules/Functions/editor/useFunctionsTypeScript.d.ts +5 -2
- package/dist/modules/Functions/helpers.d.ts +119 -1
- package/dist/modules/History/History.d.ts +5 -1
- package/dist/modules/History/components/ChangeGroup/ChangeGroup.d.ts +2 -1
- package/dist/modules/History/components/ChangeLine/ChangeLine.d.ts +3 -1
- package/dist/modules/History/components/SaveDetail/SaveDetail.d.ts +2 -1
- package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.d.ts +22 -0
- package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.test.d.ts +1 -0
- package/dist/modules/Keyboard/index.d.ts +4 -0
- package/dist/modules/Keyboard/platform.d.ts +7 -0
- package/dist/modules/Network/hooks/useBuilderNetwork.d.ts +12 -0
- package/dist/modules/Queue/QueueContext.d.ts +2 -5
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/ResourceSnippet.d.ts +13 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/SnippetContent.d.ts +8 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/UnreadableSnippet.d.ts +12 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/index.d.ts +3 -0
- package/dist/modules/Resources/components/ResourceManager/helpers/isSnippetFile.d.ts +3 -0
- package/dist/modules/Resources/components/ResourceManager/helpers/isSnippetFile.test.d.ts +1 -0
- package/dist/modules/Resources/components/ResourcesCdnBucket/ResourcesCdnBucket.d.ts +1 -1
- package/dist/modules/Runtime/components/RuntimeCodeNote/RuntimeCodeNote.d.ts +1 -4
- package/dist/modules/Space/components/SpaceIssues/SpaceIssues.d.ts +2 -1
- package/dist/modules/Space/components/SpaceIssues/components/ElementChip/ElementChip.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/ElementChip/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueFix/IssueFix.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueFix/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueItem/IssueItem.d.ts +1 -5
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/SuggestionGroup.d.ts +8 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/SuggestionItem.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/helpers.d.ts +2 -0
- package/dist/modules/Space/hooks/useSpaceUsage.d.ts +36 -0
- package/dist/modules/Undoable/UndoableContext.d.ts +2 -5
- package/dist/package.json.d.ts +4 -4
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +2803 -2451
- package/dist/plitzi-builder.js.gz +0 -0
- package/dist/plitzi-functions-worker.js +3 -3
- package/package.json +18 -18
- package/dist/modules/AI/components/ChatInput/helpers.d.ts +0 -1
- package/dist/modules/AI/components/ChatMessage/components/AITemplatePreview/components/AITemplateHeader/index.d.ts +0 -3
- package/dist/modules/AI/components/ChatMessage/components/AITemplatePreview/index.d.ts +0 -3
- package/dist/modules/App/AppContainer/containers/ContainerActions.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerConnectors.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerCredentials.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerFunctions.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerRuntime.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerVisitors.d.ts +0 -2
- package/dist/modules/App/components/WorkflowDiagram/WorkflowDiagram.d.ts +0 -37
- package/dist/modules/App/components/WorkflowDiagram/components/CustomEdge.d.ts +0 -3
- package/dist/modules/App/components/WorkflowDiagram/components/CustomNode.d.ts +0 -5
- package/dist/modules/App/components/WorkflowDiagram/helpers/schemaToSitemap.d.ts +0 -11
- package/dist/modules/App/components/WorkflowDiagram/helpers/sitemapToFlow.d.ts +0 -20
- package/dist/modules/App/components/WorkflowDiagram/index.d.ts +0 -3
- package/dist/modules/Builder/BuilderPopup.d.ts +0 -6
- package/dist/modules/Builder/Models/TemplateForm.d.ts +0 -16
- package/dist/modules/Functions/components/FunctionsDeclared/FunctionsDeclared.d.ts +0 -10
- package/dist/modules/Functions/components/FunctionsDeclared/index.d.ts +0 -3
- package/dist/modules/Functions/components/FunctionsFiles/FunctionsFiles.d.ts +0 -11
- package/dist/modules/Functions/components/FunctionsFiles/index.d.ts +0 -3
- package/dist/modules/Functions/components/FunctionsTry/FunctionsTry.d.ts +0 -13
- package/dist/modules/Functions/components/FunctionsTry/index.d.ts +0 -3
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/ResourceTemplate.d.ts +0 -13
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/TemplateContent.d.ts +0 -8
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/index.d.ts +0 -3
- package/dist/modules/Segments/Segment.d.ts +0 -11
- package/dist/modules/Segments/Segments.d.ts +0 -2
- package/dist/modules/Segments/SegmentsContextProvider.d.ts +0 -7
- package/dist/modules/Segments/SegmentsReducer.d.ts +0 -133
- package/dist/modules/Segments/index.d.ts +0 -3
- package/dist/modules/Segments/models/PublishForm.d.ts +0 -19
- package/dist/modules/Segments/models/SegmentForm.d.ts +0 -17
- package/dist/modules/Space/hooks/useAccountUsage.d.ts +0 -60
- package/dist/patches/useSyncExternalStoreWithSelector.d.ts +0 -4
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/components/AITemplateHeader → AISnippetPreview/components/AISnippetHeader}/DisplayModeButton.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/components/ConfirmPanel/ConfirmPanel.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/components/ConfirmPanel/index.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/helpers.d.ts +0 -0
- /package/dist/modules/{AI/components → Keyboard}/KeyboardKey/KeyboardKey.d.ts +0 -0
- /package/dist/modules/{AI/components → Keyboard}/KeyboardKey/index.d.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
/** What the form answers: the snippet, and the public bucket of which CDN it goes in. */
|
|
3
|
+
export type SnippetFormValues = {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
cdnIdentifier: string;
|
|
7
|
+
bucketIdentifier: string;
|
|
8
|
+
};
|
|
9
|
+
export type SnippetFormProps = {
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
onClose?: (e?: MouseEvent) => void;
|
|
13
|
+
onSubmit?: (e: MouseEvent | undefined, values: SnippetFormValues) => void;
|
|
14
|
+
};
|
|
15
|
+
declare const SnippetForm: ({ name, description, onSubmit, onClose }: SnippetFormProps) => import('react').JSX.Element;
|
|
16
|
+
export default SnippetForm;
|
|
@@ -2,10 +2,15 @@ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
|
2
2
|
export type BuilderContextMenuItemProps = {
|
|
3
3
|
id?: string;
|
|
4
4
|
title?: string;
|
|
5
|
+
/** What the item does beyond its name, shown on hover. */
|
|
6
|
+
hint?: string;
|
|
7
|
+
/** Only a shortcut that exists: a menu that shows one teaches it. */
|
|
5
8
|
shortcut?: string;
|
|
9
|
+
/** `danger` for what removes. */
|
|
10
|
+
intent?: 'default' | 'danger';
|
|
6
11
|
children?: ReactNode;
|
|
7
12
|
className?: string;
|
|
8
13
|
onClick?: (e: MouseEvent, id: string) => void;
|
|
9
14
|
} & Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>;
|
|
10
|
-
declare const BuilderContextMenuItem: ({ id, title, shortcut, children, className, onClick, ...otherProps }: BuilderContextMenuItemProps) => import('react').JSX.Element;
|
|
15
|
+
declare const BuilderContextMenuItem: ({ id, title, hint, shortcut, intent, children, className, onClick, ...otherProps }: BuilderContextMenuItemProps) => import('react').JSX.Element;
|
|
11
16
|
export default BuilderContextMenuItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ElementAnchorProps = {
|
|
2
|
+
anchor?: string;
|
|
3
|
+
/** `undefined` removes it: the element has no `id` in the DOM. */
|
|
4
|
+
onUpdate?: (key: string, value: string | undefined, isDefinition?: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The `id` an element carries in the DOM, so a link to `/page#anchor` lands on it. Saved as soon as what is typed is
|
|
8
|
+
* one; while it is not, the field says why and the element keeps the one it had.
|
|
9
|
+
*/
|
|
10
|
+
declare const ElementAnchor: ({ anchor, onUpdate }: ElementAnchorProps) => import('react').JSX.Element;
|
|
11
|
+
export default ElementAnchor;
|
|
@@ -5,6 +5,8 @@ export type ElementDefinitionSettingsProps = {
|
|
|
5
5
|
canHoldItems?: boolean;
|
|
6
6
|
/** What the element's type declares, which is what an instance with no strategy of its own follows. */
|
|
7
7
|
declaredLoadStrategy?: ElementLoadStrategy;
|
|
8
|
+
/** The feature flags the space declares — what the element's gate may name. */
|
|
9
|
+
flagNames?: string[];
|
|
8
10
|
/** The one name this element answers to. Editing it renames the element across the whole document. */
|
|
9
11
|
id: string;
|
|
10
12
|
/** Why this id cannot be used here, or null when it is free. Given the slugified id, never the raw typing. */
|
|
@@ -13,5 +15,5 @@ export type ElementDefinitionSettingsProps = {
|
|
|
13
15
|
onUpdate?: (key: string, value: string | boolean | number | object | undefined, isDefinition?: boolean) => void;
|
|
14
16
|
onRename: (id: string) => void;
|
|
15
17
|
};
|
|
16
|
-
declare const ElementDefinitionSettings: ({ definition, canHoldItems, declaredLoadStrategy, id, getNameConflict, onUpdate, onRename }: ElementDefinitionSettingsProps) => import('react').JSX.Element;
|
|
18
|
+
declare const ElementDefinitionSettings: ({ definition, canHoldItems, declaredLoadStrategy, flagNames, id, getNameConflict, onUpdate, onRename }: ElementDefinitionSettingsProps) => import('react').JSX.Element;
|
|
17
19
|
export default ElementDefinitionSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ElementFlagGate as TElementFlagGate } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ElementFlagGateProps = {
|
|
3
|
+
gate?: TElementFlagGate;
|
|
4
|
+
/** The flags the space declares, which are the ones a gate may name. */
|
|
5
|
+
flagNames: string[];
|
|
6
|
+
isPage?: boolean;
|
|
7
|
+
/** `undefined` removes the gate: the element is rendered whatever the flags say. */
|
|
8
|
+
onUpdate?: (key: string, value: TElementFlagGate | undefined, isDefinition?: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The feature flag an element exists under — not a visibility: gated off, it is not rendered at all, on the server or
|
|
12
|
+
* in the browser, and none of its markup is in the page. Offered only once the space declares a flag,
|
|
13
|
+
* and kept on screen for an element still naming one the space removed, so the author can see why it is gone.
|
|
14
|
+
*/
|
|
15
|
+
declare const ElementFlagGate: ({ gate, flagNames: names, isPage, onUpdate }: ElementFlagGateProps) => import('react').JSX.Element | null;
|
|
16
|
+
export default ElementFlagGate;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the tools say before anything is chosen: how to choose, and the keys that work on what is chosen — the place
|
|
3
|
+
* an author looks while learning the canvas, so the place the shortcuts are taught.
|
|
4
|
+
*/
|
|
5
|
+
declare const NothingSelected: () => import('react').JSX.Element;
|
|
6
|
+
export default NothingSelected;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two ways part of a page is reused, as the builder shows them wherever it offers them — the canvas overlay, the
|
|
3
|
+
* context menu, the Components panel: one icon and one line each, said once, so the two never end up looking alike.
|
|
4
|
+
*
|
|
5
|
+
* What tells them apart is what happens after: a component stays linked, a snippet is a copy.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REUSE: {
|
|
8
|
+
readonly component: {
|
|
9
|
+
readonly icon: "fa-solid fa-cube";
|
|
10
|
+
readonly hint: "reusable, and editing it updates every instance";
|
|
11
|
+
};
|
|
12
|
+
readonly snippet: {
|
|
13
|
+
readonly icon: "fa-solid fa-object-group";
|
|
14
|
+
readonly hint: "a copy to drop anywhere, not linked to where it came from";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Element } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Saves an element on the canvas as a snippet: asks for its name and the bucket it goes in, uploads it, and says how
|
|
4
|
+
* that went — saved only once the upload answered, so a failed one is never announced as done. Returns whether it was
|
|
5
|
+
* saved.
|
|
6
|
+
*/
|
|
7
|
+
declare const useSaveAsSnippet: () => (element: Element) => Promise<boolean>;
|
|
8
|
+
export default useSaveAsSnippet;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ComponentsProps = {
|
|
2
|
+
/** What the catalog is searched for: the elements above and these alike. */
|
|
3
|
+
filter: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The space's components, at the foot of the element catalog: placed the way an element is, by dragging it onto a
|
|
7
|
+
* page — with what each is called and how many places render it. Edited by opening it in the canvas, where its tree is
|
|
8
|
+
* edited like a page's.
|
|
9
|
+
*/
|
|
10
|
+
declare const Components: ({ filter }: ComponentsProps) => import('react').JSX.Element;
|
|
11
|
+
export default Components;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SpaceComponent } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ComponentBannerProps = {
|
|
3
|
+
component: SpaceComponent;
|
|
4
|
+
};
|
|
5
|
+
/** Says the canvas is a component, not a page — every instance of it changes with what is edited here. */
|
|
6
|
+
declare const ComponentBanner: ({ component }: ComponentBannerProps) => import('react').JSX.Element;
|
|
7
|
+
export default ComponentBanner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ComponentBanner';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PageFolder, SpaceComponentDeclaration } from '@plitzi/sdk-shared';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
export type ComponentFormProps = {
|
|
4
|
+
declaration?: SpaceComponentDeclaration;
|
|
5
|
+
/** The elements of the component's tree that can be a slot: those that hold children. */
|
|
6
|
+
slotChoices?: {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
pageFolders?: PageFolder[];
|
|
11
|
+
onClose?: (e?: MouseEvent) => void;
|
|
12
|
+
onSubmit?: (e: MouseEvent | undefined, values: SpaceComponentDeclaration) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What a component declares: what it is called, where the builder files it, the props an instance hands in and the
|
|
16
|
+
* elements of its tree an instance fills.
|
|
17
|
+
*/
|
|
18
|
+
declare const ComponentForm: ({ declaration, slotChoices, pageFolders, onClose, onSubmit }: ComponentFormProps) => import('react').JSX.Element;
|
|
19
|
+
export default ComponentForm;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type SlotChoiceProps = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
onToggle: (id: string, checked: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const SlotChoice: ({ id, label, checked, onToggle }: SlotChoiceProps) => import('react').JSX.Element;
|
|
8
|
+
export default SlotChoice;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ComponentForm';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PageFolder, SpaceComponent } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ComponentItemProps = {
|
|
3
|
+
component: SpaceComponent;
|
|
4
|
+
/** How many places in the space render it. */
|
|
5
|
+
instances: number;
|
|
6
|
+
/** Whether it is the one open in the canvas. */
|
|
7
|
+
open: boolean;
|
|
8
|
+
pageFolders: PageFolder[];
|
|
9
|
+
};
|
|
10
|
+
/** One component of the space: dragged onto a page to place it, opened to edit its tree, renamed, removed. */
|
|
11
|
+
declare const ComponentItem: ({ component, instances, open, pageFolders }: ComponentItemProps) => import('react').JSX.Element;
|
|
12
|
+
export default ComponentItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ComponentItem';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type InstanceToolsProps = {
|
|
2
|
+
instanceId: string;
|
|
3
|
+
componentId: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* What only the builder can do with an instance, beside the settings of the element itself: open the component it
|
|
7
|
+
* places, put each of its children in a slot, and detach it — a copy of the component that is then this page's own.
|
|
8
|
+
*/
|
|
9
|
+
declare const InstanceTools: ({ instanceId, componentId }: InstanceToolsProps) => import('react').JSX.Element | null;
|
|
10
|
+
export default InstanceTools;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Element } from '@plitzi/sdk-shared';
|
|
2
|
+
export type SlotRowProps = {
|
|
3
|
+
child: Element;
|
|
4
|
+
slots: {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
/** The slot a child naming none goes in: the component's first. */
|
|
9
|
+
fallback?: string;
|
|
10
|
+
};
|
|
11
|
+
/** One child of an instance, and the slot of the component it fills. */
|
|
12
|
+
declare const SlotRow: ({ child, slots, fallback }: SlotRowProps) => import('react').JSX.Element;
|
|
13
|
+
export default SlotRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './InstanceTools';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProp } from '@plitzi/sdk-shared';
|
|
2
|
+
export type PropEntry = {
|
|
3
|
+
name: string;
|
|
4
|
+
prop: ComponentProp;
|
|
5
|
+
};
|
|
6
|
+
export type PropRowProps = {
|
|
7
|
+
index: number;
|
|
8
|
+
entry: PropEntry;
|
|
9
|
+
problem?: string;
|
|
10
|
+
onChange: (index: number, entry: PropEntry) => void;
|
|
11
|
+
onRemove: (index: number) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const PropRow: ({ index, entry, problem, onChange, onRemove }: PropRowProps) => import('react').JSX.Element;
|
|
14
|
+
export default PropRow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropEntry } from './PropRow';
|
|
2
|
+
export type PropsEditorProps = {
|
|
3
|
+
value: PropEntry[];
|
|
4
|
+
onChange: (value: PropEntry[]) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The props a component declares, one row each: the name it is read by (`{{ props.<name> }}`), its kind, what it is
|
|
8
|
+
* for and whether an instance must hand it in.
|
|
9
|
+
*/
|
|
10
|
+
declare const PropsEditor: ({ value, onChange }: PropsEditorProps) => import('react').JSX.Element;
|
|
11
|
+
export default PropsEditor;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentDefinition, Schema, SpaceComponent } from '@plitzi/sdk-shared';
|
|
2
|
+
/** A name for a new component, from what the author called it and free among the space's components. */
|
|
3
|
+
export declare const componentIdFor: (label: string, components: Schema["components"]) => string;
|
|
4
|
+
/**
|
|
5
|
+
* A new component with nothing in it yet: the one container it is built in, made the way a drop makes one — from the
|
|
6
|
+
* element's own declaration — and named free of every tree of the document.
|
|
7
|
+
*/
|
|
8
|
+
export declare const emptyComponent: (label: string, schema: Pick<Schema, "flat" | "components">, container: ComponentDefinition) => SpaceComponent;
|
|
9
|
+
/** What the builder shows a component as: the name the author gave it, else its id. */
|
|
10
|
+
export declare const componentLabel: (component: SpaceComponent) => string;
|
|
11
|
+
/**
|
|
12
|
+
* How many places render each component.
|
|
13
|
+
*
|
|
14
|
+
* Counted tree by tree. While a component is open, the builder reads `schema.flat` with its tree laid over the pages',
|
|
15
|
+
* so an element is counted from that flat only when no component holds it — and from its component's tree otherwise.
|
|
16
|
+
*/
|
|
17
|
+
export declare const instanceCounts: (schema: Pick<Schema, "flat" | "components">) => Record<string, number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentDefinition, Element, Schema } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The elements of a tree hung off `rootId` that can be a slot: those whose TYPE holds children, as its declaration
|
|
4
|
+
* says. Not the element's own `items`, which an authored document gives every element, a text included.
|
|
5
|
+
*/
|
|
6
|
+
export declare const slotChoicesOf: (flat: Schema["flat"], rootId: Element["id"], definitions: Record<string, ComponentDefinition>) => {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpaceComponent } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The component open in the canvas, and the scope the builder is drawn in while it is.
|
|
4
|
+
*
|
|
5
|
+
* The scope lays the component's tree over the pages' — ids are one namespace, so every tool that finds an element by
|
|
6
|
+
* id finds the component's — and hands its props their defaults. With nothing open it is empty, and a scope with
|
|
7
|
+
* nothing of its own reads straight through to the store.
|
|
8
|
+
*/
|
|
9
|
+
declare const useOpenComponent: () => {
|
|
10
|
+
component?: SpaceComponent;
|
|
11
|
+
scope: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export default useOpenComponent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Element } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Makes a component of an element on the canvas: the element and everything inside it become the component's tree,
|
|
4
|
+
* and an instance of it takes the element's place, so the page renders what it did. Returns whether it was made.
|
|
5
|
+
*/
|
|
6
|
+
declare const useSaveAsComponent: () => (element: Element) => Promise<boolean>;
|
|
7
|
+
export default useSaveAsComponent;
|
|
@@ -3,8 +3,6 @@ export type ConnectorsContextValue = {
|
|
|
3
3
|
connectors: Record<string, SpaceConnector>;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
error: string;
|
|
6
|
-
/** True when the space has at least one deployment that can run server code, which is what resolves connectors. */
|
|
7
|
-
hasServerRendering: boolean;
|
|
8
6
|
addConnector: (name: string, manifest: ConnectorManifestDraft) => Promise<SpaceConnector | undefined>;
|
|
9
7
|
updateConnector: (identifier: string, name: string, manifest: ConnectorManifestDraft) => Promise<SpaceConnector | undefined>;
|
|
10
8
|
removeConnector: (identifier: string) => Promise<boolean>;
|
|
@@ -38,4 +38,3 @@ export declare const fieldDocs: {
|
|
|
38
38
|
readonly mediaBaseUrl: "Host to prepend to relative image and file URLs the CMS returns. Only values under keys ending in url, src or href are rewritten.";
|
|
39
39
|
readonly writeBodyPath: "Key to wrap the submitted values in, e.g. data. Leave empty to send them at the root.";
|
|
40
40
|
};
|
|
41
|
-
export declare const CONNECTOR_SERVER_ONLY_NOTE = "Connectors resolve on the server before the page reaches the browser. A space published without server rendering has no server to resolve them.";
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manages the space's secrets in one place.
|
|
3
|
-
*
|
|
4
|
-
* Credentials were only reachable from the modals that consume them — a deployment form, a CDN row — so a secret
|
|
5
|
-
* could not be prepared before the thing that needs it existed. A connector needs exactly that ordering: the CMS
|
|
6
|
-
* token has to exist before there is a manifest to reference it from.
|
|
7
|
-
*/
|
|
8
1
|
declare const Credentials: () => import('react').JSX.Element;
|
|
9
2
|
export default Credentials;
|
|
@@ -4,8 +4,9 @@ import { ComponentDefinition, Element, Schema } from '@plitzi/sdk-shared';
|
|
|
4
4
|
* A drop can insert a whole sub-tree at once, and each element of it needs a name that is free of the document AND
|
|
5
5
|
* of its siblings in the same drop — which is why the taken set is carried across the burst rather than re-read
|
|
6
6
|
* per element. The random minter, not the positional one: the builder and the MCP write the same document
|
|
7
|
-
* concurrently, and a counter has both mint `heading-3`.
|
|
8
|
-
|
|
7
|
+
* concurrently, and a counter has both mint `heading-3`. Free of every tree — the pages' and each component's — since
|
|
8
|
+
* ids are one namespace across them. */
|
|
9
|
+
export declare const makeIdMinter: (schema: Pick<Schema, "flat" | "components">) => (type: string) => string;
|
|
9
10
|
export declare const getInitialItems: (parentId: string, items: string[] | undefined, definitions: Record<string, ComponentDefinition>, mintId: (type: string) => string, rootId?: string) => {
|
|
10
11
|
directItems: Record<string, Element>;
|
|
11
12
|
items: Record<string, Element>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Snippet } from '@plitzi/sdk-shared';
|
|
2
2
|
import { DragEvent } from 'react';
|
|
3
3
|
export type UseDragElementProps = {
|
|
4
4
|
attributes?: Record<string, unknown>;
|
|
5
5
|
type: string;
|
|
6
6
|
variables?: object[];
|
|
7
|
-
manifest?:
|
|
8
|
-
|
|
7
|
+
manifest?: Snippet;
|
|
8
|
+
/** What the dropped element is called in the builder's tree, instead of its type's default label. */
|
|
9
|
+
label?: string;
|
|
9
10
|
};
|
|
10
|
-
declare const useDragElement: ({ attributes, type, variables, manifest }: UseDragElementProps) => {
|
|
11
|
+
declare const useDragElement: ({ attributes, type, variables, manifest, label }: UseDragElementProps) => {
|
|
11
12
|
onDragStart: (e: DragEvent) => void;
|
|
12
13
|
};
|
|
13
14
|
export default useDragElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space's feature flags: declared and ruled here, previewed in the canvas, and published on their own.
|
|
3
|
+
*
|
|
4
|
+
* Forcing one here is the canvas's `qa` layer — what the author looks at, never saved. Flags are not part of a
|
|
5
|
+
* snapshot: each environment has one set, shared by every revision it serves, and publishing them switches what the
|
|
6
|
+
* environment serves now without shipping whatever else the draft holds.
|
|
7
|
+
*/
|
|
8
|
+
declare const Flags: () => import('react').JSX.Element;
|
|
9
|
+
export default Flags;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Field } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
2
|
+
import { SchemaFlag } from '@plitzi/sdk-shared';
|
|
3
|
+
import { MouseEvent } from 'react';
|
|
4
|
+
export type FlagFormProps = {
|
|
5
|
+
name?: string;
|
|
6
|
+
flag?: SchemaFlag;
|
|
7
|
+
isNewRecord?: boolean;
|
|
8
|
+
/** The names already declared, so a new flag cannot take one. */
|
|
9
|
+
takenNames?: string[];
|
|
10
|
+
fields: Record<string, Field>;
|
|
11
|
+
onSubmit: (name: string, flag: SchemaFlag) => void;
|
|
12
|
+
onClose: (e?: MouseEvent) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const FlagForm: ({ name, flag, isNewRecord, takenNames, fields, onSubmit, onClose }: FlagFormProps) => import('react').JSX.Element;
|
|
15
|
+
export default FlagForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Field } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
2
|
+
export type FlagRuleProps = {
|
|
3
|
+
index: number;
|
|
4
|
+
last: boolean;
|
|
5
|
+
fields: Record<string, Field>;
|
|
6
|
+
onRemove: (index: number) => void;
|
|
7
|
+
onMove: (from: number, to: number) => void;
|
|
8
|
+
};
|
|
9
|
+
/** One rule of a flag: the value it gives, and when. Rules are read top to bottom and the first that matches wins. */
|
|
10
|
+
declare const FlagRule: ({ index, last, fields, onRemove, onMove }: FlagRuleProps) => import('react').JSX.Element;
|
|
11
|
+
export default FlagRule;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
2
|
+
/** What a new rule starts as: no conditions yet. */
|
|
3
|
+
export declare const EMPTY_WHEN: RuleGroup;
|
|
4
|
+
/** A rule's `when` as the query builder edits it: `and` or `or` over a list of conditions and groups. */
|
|
5
|
+
export declare const isRuleGroup: (value: unknown) => value is RuleGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Field } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
2
|
+
import { FlagResolution, SchemaFlag } from '@plitzi/sdk-shared';
|
|
3
|
+
export type FlagItemProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
flag: SchemaFlag;
|
|
6
|
+
resolution?: FlagResolution;
|
|
7
|
+
forced?: boolean;
|
|
8
|
+
fields: Record<string, Field>;
|
|
9
|
+
onUpdate: (name: string, flag: SchemaFlag) => void;
|
|
10
|
+
onRemove: (name: string) => void;
|
|
11
|
+
onForce: (name: string, value: boolean | undefined) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const FlagItem: ({ name, flag, resolution, forced, fields, onUpdate, onRemove, onForce }: FlagItemProps) => import('react').JSX.Element;
|
|
14
|
+
export default FlagItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type FlagPreviewOptionValue = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: boolean | undefined;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
export type FlagPreviewOptionProps = {
|
|
7
|
+
name: string;
|
|
8
|
+
option: FlagPreviewOptionValue;
|
|
9
|
+
active: boolean;
|
|
10
|
+
onForce: (name: string, value: boolean | undefined) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const FlagPreviewOption: ({ name, option, active, onForce }: FlagPreviewOptionProps) => import('react').JSX.Element;
|
|
13
|
+
export default FlagPreviewOption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FlagPreviewToggleProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
/** What the canvas is forced to, if anything. */
|
|
4
|
+
forced?: boolean;
|
|
5
|
+
onForce: (name: string, value: boolean | undefined) => void;
|
|
6
|
+
};
|
|
7
|
+
/** Forces a flag in the canvas only — what an author looks at, never what is saved or published. */
|
|
8
|
+
declare const FlagPreviewToggle: ({ name, forced, onForce }: FlagPreviewToggleProps) => import('react').JSX.Element;
|
|
9
|
+
export default FlagPreviewToggle;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MouseEvent } from 'react';
|
|
3
|
+
declare const publishFlagsSchema: z.ZodObject<{
|
|
4
|
+
environment: z.ZodEnum<{
|
|
5
|
+
production: "production";
|
|
6
|
+
staging: "staging";
|
|
7
|
+
development: "development";
|
|
8
|
+
}>;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PublishFlagsValues = z.infer<typeof publishFlagsSchema>;
|
|
12
|
+
export type PublishFlagsFormProps = {
|
|
13
|
+
onClose?: (e?: MouseEvent) => void;
|
|
14
|
+
onSubmit?: (e: MouseEvent | undefined, values: PublishFlagsValues) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Where the draft's flags go, and why. Not the snapshot form: flags are no part of a snapshot, and saying so is the
|
|
18
|
+
* point — an author turning a flag in production must know the half-finished page they are also editing stays.
|
|
19
|
+
*/
|
|
20
|
+
declare const PublishFlagsForm: ({ onClose, onSubmit }: PublishFlagsFormProps) => import('react').JSX.Element;
|
|
21
|
+
export default PublishFlagsForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Field } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
2
|
+
import { QueryParams, RouteParams } from '@plitzi/sdk-shared';
|
|
3
|
+
/**
|
|
4
|
+
* What a flag's rule may be written over: everything a variable's `when` sees — the environment, the host, the URL the
|
|
5
|
+
* builder is previewing — and the visitor, whose roles are offered from the ones this space declares.
|
|
6
|
+
*/
|
|
7
|
+
export declare const flagRuleFields: ({ routeParams, queryParams, visitorRoles }: {
|
|
8
|
+
routeParams: RouteParams;
|
|
9
|
+
queryParams: QueryParams;
|
|
10
|
+
visitorRoles: string[];
|
|
11
|
+
}) => Record<string, Field>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The space's own server code: its
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The space's own server code: its tasks and routes as the code declares them — listed as it is typed — its files,
|
|
3
|
+
* edited with TypeScript that knows the contract, and the selected task's time limit and test run beside them. Saved as
|
|
4
|
+
* the draft, built and checked on the platform; the live site runs what the space was last published with. A
|
|
5
|
+
* project's `plitzi functions pull` edits the same files.
|
|
5
6
|
*/
|
|
6
7
|
declare const Functions: () => import('react').JSX.Element;
|
|
7
8
|
export default Functions;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ListedTask } from '../../helpers';
|
|
2
|
+
import { ActionRunReport, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
3
|
+
export type FunctionInspectorProps = {
|
|
4
|
+
task: ListedTask;
|
|
5
|
+
/** What every task gets unless it asks for its own, from `defineFunctions`. */
|
|
6
|
+
sharedLimits?: FunctionTimeLimits;
|
|
7
|
+
hosts: string[];
|
|
8
|
+
/** Why its limits cannot be written for you right now — the code is still being read, say — or nothing. */
|
|
9
|
+
limitsDisabledReason: string;
|
|
10
|
+
/** The code differs from the saved draft. */
|
|
11
|
+
modified: boolean;
|
|
12
|
+
onLimitsChange: (task: ListedTask, cpuMs: number | undefined) => void;
|
|
13
|
+
onRun: (task: string, params: Record<string, unknown>) => Promise<ActionRunReport | undefined>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The selected task: what it is as a step, how much CPU a run of it may use — written into its code — and a run of it
|
|
17
|
+
* in the sandbox, saving first when the code changed.
|
|
18
|
+
*/
|
|
19
|
+
declare const FunctionInspector: ({ task, sharedLimits, hosts, limitsDisabledReason, modified, onLimitsChange, onRun }: FunctionInspectorProps) => import('react').JSX.Element;
|
|
20
|
+
export default FunctionInspector;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type InspectorSectionProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
/** One line under the title, saying what the section is for. */
|
|
5
|
+
hint?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** One part of the inspector: its title, what it is for, and what it holds. */
|
|
9
|
+
declare const InspectorSection: ({ title, hint, children }: InspectorSectionProps) => import('react').JSX.Element;
|
|
10
|
+
export default InspectorSection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ListedTask } from '../../../../helpers';
|
|
2
|
+
import { ActionRunReport } from '@plitzi/sdk-shared';
|
|
3
|
+
export type TaskTestProps = {
|
|
4
|
+
/** The task under test. The form starts again from its defaults whenever it changes: give it a `key` of it. */
|
|
5
|
+
task: ListedTask;
|
|
6
|
+
/** The code differs from the saved draft — or the task is not in it yet — so a run saves first. */
|
|
7
|
+
needsSave: boolean;
|
|
8
|
+
/** Runs it in the sandbox as you, saving first when it has to; throws why it could not. */
|
|
9
|
+
onRun: (task: string, params: Record<string, unknown>) => Promise<ActionRunReport | undefined>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The task run in the sandbox as you — its params filled in as its step would fill them, or as JSON — and what it
|
|
13
|
+
* answered: the value, what it logged, how long it took and why it failed. Its fetches and its writes are real.
|
|
14
|
+
*/
|
|
15
|
+
declare const TaskTest: ({ task, needsSave, onRun }: TaskTestProps) => import('react').JSX.Element;
|
|
16
|
+
export default TaskTest;
|