@plitzi/plitzi-builder 0.37.9 → 0.38.1
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 +648 -0
- package/dist/config/index.d.ts +0 -4
- package/dist/index.html +2 -0
- 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/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/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 +8 -3
- 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/hooks/useDragElement.d.ts +2 -2
- 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/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/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/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/package.json.d.ts +16 -17
- package/dist/plitzi-builder-dev-vendor.js.map +1 -1
- package/dist/plitzi-builder-dev-vendor.js.map.gz +0 -0
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +2803 -2496
- package/dist/plitzi-builder.js.gz +0 -0
- package/dist/plitzi-functions-worker.js +3 -3
- package/package.json +30 -31
- 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/Models/TemplateForm.d.ts +0 -16
- 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/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
package/dist/config/index.d.ts
CHANGED
package/dist/index.html
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
|
42
42
|
</noscript>
|
|
43
43
|
|
|
44
|
+
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
45
|
+
|
|
44
46
|
<link href="/plitzi-builder.css" rel="preload" as="style" />
|
|
45
47
|
<link href="/plitzi-builder.css" rel="stylesheet" />
|
|
46
48
|
</head>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema, Style } from '@plitzi/sdk-shared';
|
|
2
2
|
import { AiMode } from '../../../../types';
|
|
3
|
-
export type
|
|
3
|
+
export type AISnippetPreviewProps = {
|
|
4
4
|
baseElementId: string;
|
|
5
5
|
schema?: Pick<Schema, 'flat'>;
|
|
6
6
|
style?: Pick<Style, 'platform' | 'cache'>;
|
|
@@ -8,5 +8,5 @@ export type AITemplatePreviewProps = {
|
|
|
8
8
|
mode?: AiMode;
|
|
9
9
|
version?: number;
|
|
10
10
|
};
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const AISnippetPreview: ({ baseElementId, schema, style, html, mode, version }: AISnippetPreviewProps) => import('react').JSX.Element;
|
|
12
|
+
export default AISnippetPreview;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DisplayMode } from '@plitzi/sdk-shared';
|
|
2
2
|
import { AiMode } from '../../../../../../types';
|
|
3
|
-
export type
|
|
3
|
+
export type AISnippetHeaderProps = {
|
|
4
4
|
baseElementId: string;
|
|
5
5
|
displayMode: DisplayMode;
|
|
6
6
|
onDisplayMode: (mode: DisplayMode) => void;
|
|
@@ -11,5 +11,5 @@ export type AITemplateHeaderProps = {
|
|
|
11
11
|
mode?: AiMode;
|
|
12
12
|
version?: number;
|
|
13
13
|
};
|
|
14
|
-
declare const
|
|
15
|
-
export default
|
|
14
|
+
declare const AISnippetHeader: ({ baseElementId, displayMode, onDisplayMode, onClick, showHtml, onToggleHtml, hasHtml, mode, version }: AISnippetHeaderProps) => import('react').JSX.Element;
|
|
15
|
+
export default AISnippetHeader;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AiAttachment, AiContext, AiMessage, AiProviderSettings, ConversationSummary } from '../types';
|
|
2
2
|
import { AiEffort, AiMode } from '@plitzi/sdk-shared';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
4
|
type QueueEntry = {
|
|
4
5
|
localId: string;
|
|
5
6
|
message: string;
|
|
@@ -23,7 +24,7 @@ declare const useAiChat: (providerSettings?: AiProviderSettings) => {
|
|
|
23
24
|
conversations: ConversationSummary[];
|
|
24
25
|
pendingQueue: QueueEntry[];
|
|
25
26
|
mode: AiMode;
|
|
26
|
-
setMode:
|
|
27
|
+
setMode: Dispatch<SetStateAction<AiMode>>;
|
|
27
28
|
initConversation: () => Promise<void>;
|
|
28
29
|
sendMessage: (message: string, context: AiContext, attachments?: AiAttachment[], effort?: AiEffort) => Promise<void>;
|
|
29
30
|
stopGeneration: () => void;
|
package/dist/modules/App/AppContainer/components/NotificationsSettings/NotificationsSettings.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the toasts an `addNotification` step shows look — the space's `notifications`, the same fields authoring and the
|
|
3
|
+
* MCP server write. They are stored as a rule inside the custom CSS; here they are fields of their own, and the
|
|
4
|
+
* custom CSS editor shows the space's CSS without that rule.
|
|
5
|
+
*/
|
|
6
|
+
declare const NotificationsSettings: () => import('react').JSX.Element;
|
|
7
|
+
export default NotificationsSettings;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything of the space that runs on a server — its actions, functions, connectors, the credentials they use and its
|
|
3
|
+
* runtime — under one entry of the sidebar. Whether the space HAS a server to run them is said here, once, above them
|
|
4
|
+
* all.
|
|
5
|
+
*/
|
|
6
|
+
declare const ContainerServer: () => import('react').JSX.Element;
|
|
7
|
+
export default ContainerServer;
|
|
@@ -6,6 +6,9 @@ export type AppContextValue = {
|
|
|
6
6
|
setPreviewMode: Dispatch<SetStateAction<boolean>>;
|
|
7
7
|
displayBorderComponents: 'black' | 'white' | 'none';
|
|
8
8
|
setDisplayBorderComponents: Dispatch<SetStateAction<'black' | 'white' | 'none'>>;
|
|
9
|
+
/** The layout grid over the canvas: the columns a page is laid out on, to line an element up by eye. */
|
|
10
|
+
displayGrid: boolean;
|
|
11
|
+
setDisplayGrid: Dispatch<SetStateAction<boolean>>;
|
|
9
12
|
zoom: number;
|
|
10
13
|
setZoom: Dispatch<SetStateAction<number>>;
|
|
11
14
|
displayMode: DisplayMode;
|
|
@@ -2,3 +2,5 @@ import { IssuesLevel } from '../../../../Space/helpers/spaceIssues';
|
|
|
2
2
|
export declare const LEVEL_TEXT: Record<IssuesLevel, string>;
|
|
3
3
|
export declare const LEVEL_ICON: Record<IssuesLevel, string>;
|
|
4
4
|
export declare const LEVEL_TITLE: Record<IssuesLevel, string>;
|
|
5
|
+
/** Nothing wrong, and a shorter way to the same page: the accent, never the colours of a problem. */
|
|
6
|
+
export declare const SUGGESTING_TEXT = "text-indigo-600 dark:text-indigo-400";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type EmptyStateProps = {
|
|
3
|
+
/** A Font Awesome class, e.g. `fa-solid fa-bolt`. */
|
|
4
|
+
icon: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** What starts it — usually the one button that creates the first one. */
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** A subject with nothing in it yet: what it is for, and the way to start. The same everywhere it appears. */
|
|
11
|
+
declare const EmptyState: ({ icon, title, description, action }: EmptyStateProps) => import('react').JSX.Element;
|
|
12
|
+
export default EmptyState;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare const HEADER_CLASS_NAME: {
|
|
3
|
+
readonly panel: "mx-2 mt-2";
|
|
4
|
+
readonly page: "mx-auto w-full max-w-5xl px-6 pt-5 pb-4";
|
|
5
|
+
};
|
|
6
|
+
export type PanelSection = {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type PanelSectionsProps = {
|
|
12
|
+
/** What the open section is remembered under, among the builder's own preferences. */
|
|
13
|
+
name: string;
|
|
14
|
+
sections: [PanelSection, ...PanelSection[]];
|
|
15
|
+
/** `panel` in the sidebar's dock, `page` over a view that takes the canvas' place. */
|
|
16
|
+
variant?: keyof typeof HEADER_CLASS_NAME;
|
|
17
|
+
/** Said once under the tabs, whichever section is open — what holds for all of them. */
|
|
18
|
+
notice?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Several subjects behind one entry of the sidebar: a row of tabs over the one that is open. The open one is
|
|
23
|
+
* remembered, so coming back to the entry finds it where it was left — and a section that no longer exists falls back
|
|
24
|
+
* to the first.
|
|
25
|
+
*/
|
|
26
|
+
declare const PanelSections: ({ name, sections, variant, notice, className }: PanelSectionsProps) => import('react').JSX.Element;
|
|
27
|
+
export default PanelSections;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ResourceRowProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
/** A Font Awesome class for the tile at the start of the row. */
|
|
5
|
+
icon?: string;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
subtitle?: ReactNode;
|
|
8
|
+
/** A state worth seeing without opening it: disabled, in use, unsaved. */
|
|
9
|
+
badge?: ReactNode;
|
|
10
|
+
removeTitle?: string;
|
|
11
|
+
onSelect: (id: string) => void;
|
|
12
|
+
onRemove?: (id: string) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* One item of a view's list: the row opens it, the bin removes it. Two buttons side by side, never one inside the
|
|
16
|
+
* other, so each is reachable and announced on its own.
|
|
17
|
+
*/
|
|
18
|
+
declare const ResourceRow: ({ id, icon, title, subtitle, badge, removeTitle, onSelect, onRemove }: ResourceRowProps) => import('react').JSX.Element;
|
|
19
|
+
export default ResourceRow;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SitemapEntry } from './types';
|
|
2
|
+
import { Element, PageFolder } from '@plitzi/sdk-shared';
|
|
3
|
+
export type SitemapDiagramProps = {
|
|
4
|
+
pages: Element[];
|
|
5
|
+
pageFolders: PageFolder[];
|
|
6
|
+
/** Each layout's name, by id — what a page's card says it renders inside. */
|
|
7
|
+
layouts?: Record<string, string>;
|
|
8
|
+
/** The page open in the canvas. */
|
|
9
|
+
currentPageId?: string;
|
|
10
|
+
/** A new page — inside a folder when one is given — or a new folder. */
|
|
11
|
+
onAddNode?: (nodeType: 'page' | 'folder', folderId?: string) => void;
|
|
12
|
+
/** A page or folder dropped into a folder, or onto the top level (`null`). */
|
|
13
|
+
onMove?: (entry: SitemapEntry, folderId: string | null) => void;
|
|
14
|
+
onRemove?: (entry: SitemapEntry) => void;
|
|
15
|
+
/** A page opened in the canvas, from its card, a double click or Enter. */
|
|
16
|
+
onOpen?: (pageId: string) => void;
|
|
17
|
+
/** Back to the canvas: the map replaces it, and the Pages panel that opened it may be closed by now. */
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The site as a map: every folder over what it holds, laid out on its own. From here a page is found, opened, moved by
|
|
22
|
+
* dropping it onto a folder, or removed; a folder folds away what it holds.
|
|
23
|
+
*/
|
|
24
|
+
declare const SitemapDiagram: ({ pages, pageFolders, layouts, currentPageId, onAddNode, onMove, onRemove, onOpen, onClose }: SitemapDiagramProps) => import('react').JSX.Element;
|
|
25
|
+
export default SitemapDiagram;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SitemapPage } from '../../types';
|
|
2
|
+
import { ElementFlagGate } from '@plitzi/sdk-shared';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export type SitemapChipProps = {
|
|
5
|
+
icon: string;
|
|
6
|
+
/** Colours of its own; a neutral chip without. */
|
|
7
|
+
className?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/** One fact about a page, small enough that four of them fit under its name. */
|
|
12
|
+
declare const SitemapChip: ({ icon, className, title, children }: SitemapChipProps) => import('react').JSX.Element;
|
|
13
|
+
/** Who may open the page — and, when it sends everybody else elsewhere, where. */
|
|
14
|
+
export declare const SitemapAccessChip: ({ page }: {
|
|
15
|
+
page: SitemapPage;
|
|
16
|
+
}) => import('react').JSX.Element;
|
|
17
|
+
/** The feature flag the page exists under: `name` while it is on, `!name` while it is off. */
|
|
18
|
+
export declare const SitemapFlagChip: ({ gate }: {
|
|
19
|
+
gate: ElementFlagGate;
|
|
20
|
+
}) => import('react').JSX.Element;
|
|
21
|
+
export default SitemapChip;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SitemapEntry } from '../../types';
|
|
2
|
+
export type SitemapNodeProps = {
|
|
3
|
+
entry: SitemapEntry;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
dropTarget: boolean;
|
|
6
|
+
/** The page open in the canvas right now. */
|
|
7
|
+
current: boolean;
|
|
8
|
+
onOpen?: (id: string) => void;
|
|
9
|
+
/** A new page, made inside this folder. */
|
|
10
|
+
onAddPage?: (folderId: string) => void;
|
|
11
|
+
onRemove: (entry: SitemapEntry) => void;
|
|
12
|
+
};
|
|
13
|
+
/** One page or folder of the site: what it is called, where it answers, who may open it and what wraps it. */
|
|
14
|
+
declare const SitemapNode: ({ entry, selected, dropTarget, current, onOpen, onAddPage, onRemove }: SitemapNodeProps) => import('react').JSX.Element;
|
|
15
|
+
export default SitemapNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type SitemapPathProps = {
|
|
2
|
+
path: string;
|
|
3
|
+
};
|
|
4
|
+
/** A page's address, its dynamic segments (`:productId`) marked as what they are: a value, not a word. */
|
|
5
|
+
declare const SitemapPath: ({ path }: SitemapPathProps) => import('react').JSX.Element;
|
|
6
|
+
export default SitemapPath;
|
package/dist/modules/App/components/SitemapDiagram/components/SitemapToolbar/SitemapToolbar.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type SitemapToolbarProps = {
|
|
2
|
+
pageCount: number;
|
|
3
|
+
folderCount: number;
|
|
4
|
+
query: string;
|
|
5
|
+
/** How many entries the query found, and which of them is being shown. */
|
|
6
|
+
matchCount: number;
|
|
7
|
+
matchIndex: number;
|
|
8
|
+
onQueryChange: (query: string) => void;
|
|
9
|
+
onNextMatch: (backwards: boolean) => void;
|
|
10
|
+
onAddPage: () => void;
|
|
11
|
+
onAddFolder: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** Back to the canvas, what the site holds, a search across it, and the two things made from here. */
|
|
15
|
+
declare const SitemapToolbar: ({ pageCount, folderCount, query, matchCount, matchIndex, onQueryChange, onNextMatch, onAddPage, onAddFolder, onClose }: SitemapToolbarProps) => import('react').JSX.Element;
|
|
16
|
+
export default SitemapToolbar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SitemapEntry } from '../types';
|
|
2
|
+
import { Element, PageFolder } from '@plitzi/sdk-shared';
|
|
3
|
+
/**
|
|
4
|
+
* The site's pages and folders as a tree: each folder holding what names it as its parent, folders and pages alike
|
|
5
|
+
* sorted by name, and every page with what its card shows — where it answers, who may open it, what wraps it.
|
|
6
|
+
*
|
|
7
|
+
* `layouts` names each layout by id: a page refers to its layout by id, and the map shows the name.
|
|
8
|
+
*/
|
|
9
|
+
declare const schemaToSitemap: (pages: Element[], folders: PageFolder[], layouts?: Record<string, string>) => SitemapEntry[];
|
|
10
|
+
export default schemaToSitemap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SitemapEntry } from '../types';
|
|
2
|
+
export type SitemapSearch = {
|
|
3
|
+
/** What matched, in the order the map reads. */
|
|
4
|
+
matches: string[];
|
|
5
|
+
/** The matches and every folder above one: what stays lit while the rest dims. */
|
|
6
|
+
visible: Set<string>;
|
|
7
|
+
/** The folders above a match: shown open whatever was folded. */
|
|
8
|
+
ancestors: Set<string>;
|
|
9
|
+
};
|
|
10
|
+
/** The pages and folders whose name or address holds the query — case aside — and the folders that lead to them. */
|
|
11
|
+
declare const searchSitemap: (entries: SitemapEntry[], query: string) => SitemapSearch;
|
|
12
|
+
export default searchSitemap;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ElementFlagGate } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Who may open a page, as the page's `accessLevel` decides it: unset is anyone, `public` is only somebody signed out,
|
|
4
|
+
* `authenticated` only somebody signed in.
|
|
5
|
+
*/
|
|
6
|
+
export type AccessLevel = 'everyone' | 'guests' | 'signedIn';
|
|
7
|
+
export type SitemapPage = {
|
|
8
|
+
type: 'page';
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
path: string;
|
|
12
|
+
access: AccessLevel;
|
|
13
|
+
isDefault: boolean;
|
|
14
|
+
/** The layout it renders inside, by name. */
|
|
15
|
+
layout?: string;
|
|
16
|
+
/** The feature flag it exists under. */
|
|
17
|
+
flag?: ElementFlagGate;
|
|
18
|
+
/** Where somebody it refuses is sent, by page name. */
|
|
19
|
+
redirectTo?: string;
|
|
20
|
+
};
|
|
21
|
+
export type SitemapFolder = {
|
|
22
|
+
type: 'folder';
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
path: string;
|
|
26
|
+
children: SitemapEntry[];
|
|
27
|
+
};
|
|
28
|
+
/** A page or a folder of the site, as the sitemap draws it. */
|
|
29
|
+
export type SitemapEntry = SitemapPage | SitemapFolder;
|
|
30
|
+
/** One look per access level, for the cards and the legend alike. */
|
|
31
|
+
export declare const ACCESS_LEVELS: Record<AccessLevel, {
|
|
32
|
+
label: string;
|
|
33
|
+
icon: string;
|
|
34
|
+
accent: string;
|
|
35
|
+
badge: string;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ViewPageProps = {
|
|
3
|
+
/** Where "Back" goes — a form inside a view: the list it was opened from. */
|
|
4
|
+
onBack?: () => void;
|
|
5
|
+
backLabel?: string;
|
|
6
|
+
/** The thing being edited. A list needs none: the tab above already names it. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** What this view is for, in a sentence. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** The view's own commands — its primary action last, at the right edge. */
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
/** Scroll inside the page, or leave it to a child that pins its own footer. */
|
|
13
|
+
scroll?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One page of a view that replaces the canvas — Server, Settings: the same column, the same header, the same rhythm,
|
|
19
|
+
* whichever subject is open, so moving between tabs moves nothing but the content.
|
|
20
|
+
*/
|
|
21
|
+
declare const ViewPage: ({ onBack, backLabel, title, description, actions, scroll, className, children }: ViewPageProps) => import('react').JSX.Element;
|
|
22
|
+
export default ViewPage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ViewSectionProps = {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
/** Commands that act on this section alone. */
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** One part of a view's page, under a small label — never a second page title. */
|
|
9
|
+
declare const ViewSection: ({ title, actions, children }: ViewSectionProps) => import('react').JSX.Element;
|
|
10
|
+
export default ViewSection;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { PopupInstance } from '@plitzi/plitzi-ui/components';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The entries of the sidebar that REPLACE the canvas instead of opening beside it. `AppContainer` draws them; here they
|
|
4
|
+
* are only an icon, and alone on the side while open.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FULL_VIEW_IDS: readonly ["server", "settings"];
|
|
7
|
+
export type FullViewId = (typeof FULL_VIEW_IDS)[number];
|
|
8
|
+
export declare const isFullViewId: (id: string | undefined) => id is FullViewId;
|
|
9
|
+
export declare const getPopups: ({ activeIds, platformFlags }: {
|
|
3
10
|
activeIds?: string[];
|
|
11
|
+
/** The editor's own feature flags, as the platform resolved them for whoever opened it. */
|
|
12
|
+
platformFlags?: Record<string, boolean>;
|
|
4
13
|
}) => {
|
|
5
14
|
left: PopupInstance[];
|
|
6
15
|
right: PopupInstance[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the pages are seen as their map instead of the canvas. Opened from the Pages panel, beside which it is drawn,
|
|
4
|
+
* and remembered like the panels are.
|
|
5
|
+
*/
|
|
6
|
+
declare const useSitemapOpen: () => readonly [boolean, Dispatch<SetStateAction<boolean>>];
|
|
7
|
+
export default useSitemapOpen;
|
|
@@ -15,7 +15,7 @@ export declare const getClipboardDataProcessed: (clipboardData?: DataTransfer) =
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
} | {
|
|
18
|
-
dataType: "
|
|
18
|
+
dataType: "snippet";
|
|
19
19
|
data: {
|
|
20
20
|
payload: {
|
|
21
21
|
elements: {
|
|
@@ -30,9 +30,9 @@ export declare const getClipboardDataProcessed: (clipboardData?: DataTransfer) =
|
|
|
30
30
|
/**
|
|
31
31
|
* A pasted element, named on the spot.
|
|
32
32
|
*
|
|
33
|
-
* `mintId` is positional and local to the payload being assembled: what comes out of here is a throwaway
|
|
34
|
-
* document that `
|
|
35
|
-
* is renamed. All this has to guarantee is that the paste does not collide with itself.
|
|
33
|
+
* `mintId` is positional and local to the payload being assembled: what comes out of here is a throwaway snippet
|
|
34
|
+
* document that `schemaAddSnippet` drops into the real space, and that is where a name colliding with the space
|
|
35
|
+
* is renamed (`fitSnippet`). All this has to guarantee is that the paste does not collide with itself.
|
|
36
36
|
*/
|
|
37
37
|
export declare const getElementDefinition: (componentDefinitions: Record<string, ComponentDefinition>, mintId: (type: string) => string, type: string, attributes?: Element["attributes"], styleSelectors?: Element["definition"]["styleSelectors"], parentId?: string) => {
|
|
38
38
|
definition: Element["definition"];
|
|
@@ -2,7 +2,7 @@ import { EventBridgeEvent } from '@plitzi/sdk-shared';
|
|
|
2
2
|
export type BuilderProviderProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
baseElementId: string;
|
|
5
|
-
mode?: 'normal' | '
|
|
5
|
+
mode?: 'normal' | 'snippet';
|
|
6
6
|
schemaName?: string;
|
|
7
7
|
onHandler?: (event: EventBridgeEvent, data: unknown[]) => void;
|
|
8
8
|
onBaseElementChange?: (baseElementId: string) => void;
|
|
@@ -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;
|