@plitzi/plitzi-builder 0.33.1 → 0.34.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/CHANGELOG.md +44 -0
- package/dist/index.html +2 -3
- package/dist/modules/Actions/Actions.d.ts +2 -0
- package/dist/modules/Actions/ActionsContext.d.ts +24 -0
- package/dist/modules/Actions/ActionsContextProvider.d.ts +6 -0
- package/dist/modules/Actions/components/ActionCheck/ActionCheck.d.ts +5 -0
- package/dist/modules/Actions/components/ActionCheck/index.d.ts +3 -0
- package/dist/modules/Actions/components/ActionEvents/ActionEvents.d.ts +5 -0
- package/dist/modules/Actions/components/ActionEvents/index.d.ts +3 -0
- package/dist/modules/Actions/components/ActionForm/ActionForm.d.ts +16 -0
- package/dist/modules/Actions/components/ActionForm/index.d.ts +3 -0
- package/dist/modules/Actions/components/ActionList/ActionList.d.ts +9 -0
- package/dist/modules/Actions/components/ActionList/index.d.ts +3 -0
- package/dist/modules/Actions/components/ActionTestRun/ActionTestRun.d.ts +10 -0
- package/dist/modules/Actions/components/ActionTestRun/index.d.ts +3 -0
- package/dist/modules/Actions/components/ActionWebhookUrl/ActionWebhookUrl.d.ts +11 -0
- package/dist/modules/Actions/components/ActionWebhookUrl/index.d.ts +3 -0
- package/dist/modules/Actions/index.d.ts +5 -0
- package/dist/modules/App/AppContainer/containers/ContainerActions.d.ts +2 -0
- package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +19 -0
- package/dist/modules/App/components/AppHeader/QuotaMeter.d.ts +2 -0
- package/dist/modules/App/models/PageForm.d.ts +3 -3
- package/dist/modules/Builder/BuilderHelper.d.ts +8 -1
- package/dist/modules/Builder/components/BuilderElementTools/ElementDefinitionSettings.d.ts +6 -4
- package/dist/modules/Builder/components/BuilderSearch/BuilderSearch.d.ts +16 -0
- package/dist/modules/Builder/components/BuilderSearch/BuilderSearchContext.d.ts +5 -0
- package/dist/modules/Builder/components/BuilderSearch/components/BuilderSearchButton/BuilderSearchButton.d.ts +2 -0
- package/dist/modules/Builder/components/BuilderSearch/components/BuilderSearchButton/index.d.ts +3 -0
- package/dist/modules/Builder/components/BuilderSearch/components/BuilderSearchPanel/BuilderSearchPanel.d.ts +8 -0
- package/dist/modules/Builder/components/BuilderSearch/components/BuilderSearchPanel/index.d.ts +3 -0
- package/dist/modules/Builder/components/BuilderSearch/helpers.d.ts +2 -0
- package/dist/modules/Builder/components/BuilderSearch/index.d.ts +3 -0
- package/dist/modules/Builder/components/BuilderTree/BuilderTreeSearch/BuilderTreeSearch.d.ts +13 -0
- package/dist/modules/Builder/components/BuilderTree/BuilderTreeSearch/index.d.ts +2 -0
- package/dist/modules/Builder/components/ElementMatchItem/ElementMatchItem.d.ts +12 -0
- package/dist/modules/Builder/components/ElementMatchItem/index.d.ts +3 -0
- package/dist/modules/Builder/helpers/elementChain.d.ts +23 -0
- package/dist/modules/Builder/helpers/elementChain.test.d.ts +1 -0
- package/dist/modules/Builder/helpers/searchElements.d.ts +29 -0
- package/dist/modules/Builder/helpers/searchElements.test.d.ts +1 -0
- package/dist/modules/Builder/hooks/useRevealElement.d.ts +15 -0
- package/dist/modules/Elements/ElementHelper.d.ts +9 -2
- package/dist/modules/Fonts/FontPreviews/FontPreviews.d.ts +17 -0
- package/dist/modules/Fonts/FontPreviews/index.d.ts +2 -0
- package/dist/modules/Fonts/Fonts.d.ts +8 -0
- package/dist/modules/Fonts/components/AddGoogleFont/AddGoogleFont.d.ts +7 -0
- package/dist/modules/Fonts/components/AddGoogleFont/index.d.ts +2 -0
- package/dist/modules/Fonts/components/AddHostedFont/AddHostedFont.d.ts +17 -0
- package/dist/modules/Fonts/components/AddHostedFont/index.d.ts +2 -0
- package/dist/modules/Fonts/components/AddRemoteFont/AddRemoteFont.d.ts +13 -0
- package/dist/modules/Fonts/components/AddRemoteFont/index.d.ts +2 -0
- package/dist/modules/Fonts/components/AddSystemFont/AddSystemFont.d.ts +13 -0
- package/dist/modules/Fonts/components/AddSystemFont/index.d.ts +2 -0
- package/dist/modules/Fonts/components/FontRow/FontRow.d.ts +13 -0
- package/dist/modules/Fonts/components/FontRow/index.d.ts +2 -0
- package/dist/modules/Fonts/fontsBaseUrl.d.ts +9 -0
- package/dist/modules/Fonts/hooks/useFontCatalog.d.ts +21 -0
- package/dist/modules/Fonts/index.d.ts +2 -0
- package/dist/modules/Interactions/Interactions.d.ts +3 -2
- package/dist/modules/Interactions/components/Workflow/Workflow.d.ts +5 -1
- package/dist/modules/Interactions/components/Workflow/WorkflowContextProvider.d.ts +3 -1
- package/dist/modules/Interactions/components/Workflow/WorkflowFlow.d.ts +3 -1
- package/dist/modules/Interactions/components/Workflow/WorkflowNode/NodeHeader.d.ts +2 -2
- package/dist/modules/Interactions/components/Workflow/WorkflowNode/WorkflowNode.d.ts +2 -2
- package/dist/modules/Interactions/components/Workflow/helpers/nodeWarnings.d.ts +6 -9
- package/dist/modules/Segments/SegmentsReducer.d.ts +7 -3
- package/dist/modules/Space/helpers/elementsByRoot.d.ts +19 -0
- package/dist/modules/Space/helpers/elementsByRoot.test.d.ts +1 -0
- package/dist/modules/Space/hooks/useAccountUsage.d.ts +60 -0
- package/dist/modules/Space/hooks/useSpaceQuota.d.ts +52 -0
- package/dist/modules/Space/hooks/useSpaceQuota.test.d.ts +1 -0
- package/dist/modules/Variables/components/UrlParams/UrlParams.d.ts +17 -0
- package/dist/modules/Variables/components/UrlParams/index.d.ts +2 -0
- package/dist/package.json.d.ts +30 -31
- package/dist/plitzi-builder-dev-vendor.js +2350 -831
- package/dist/plitzi-builder-dev-vendor.js.gz +0 -0
- 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-vendor.js +1 -1
- package/dist/plitzi-builder-vendor.js.gz +0 -0
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +3228 -2956
- package/dist/plitzi-builder.js.gz +0 -0
- package/package.json +42 -43
- package/dist/modules/AI/helpers/getRootNode.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @plitzi/plitzi-builder
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.34.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [5aceda0]
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- Updated dependencies [5aceda0]
|
|
14
|
+
- Updated dependencies [9c3292c]
|
|
15
|
+
- @plitzi/sdk-shared@0.34.0
|
|
16
|
+
- @plitzi/sdk-elements@0.34.0
|
|
17
|
+
- @plitzi/plitzi-sdk@0.34.0
|
|
18
|
+
- @plitzi/sdk-auth@0.34.0
|
|
19
|
+
- @plitzi/sdk-dev-tools@0.34.0
|
|
20
|
+
- @plitzi/sdk-event-bridge@0.34.0
|
|
21
|
+
- @plitzi/sdk-interactions@0.34.0
|
|
22
|
+
- @plitzi/sdk-navigation@0.34.0
|
|
23
|
+
- @plitzi/sdk-plugins@0.34.0
|
|
24
|
+
- @plitzi/sdk-schema@0.34.0
|
|
25
|
+
- @plitzi/sdk-style@0.34.0
|
|
26
|
+
- @plitzi/sdk-variables@0.34.0
|
|
27
|
+
|
|
28
|
+
## 0.33.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- v0.33.2
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
- @plitzi/plitzi-sdk@0.33.2
|
|
35
|
+
- @plitzi/sdk-auth@0.33.2
|
|
36
|
+
- @plitzi/sdk-dev-tools@0.33.2
|
|
37
|
+
- @plitzi/sdk-elements@0.33.2
|
|
38
|
+
- @plitzi/sdk-event-bridge@0.33.2
|
|
39
|
+
- @plitzi/sdk-interactions@0.33.2
|
|
40
|
+
- @plitzi/sdk-navigation@0.33.2
|
|
41
|
+
- @plitzi/sdk-plugins@0.33.2
|
|
42
|
+
- @plitzi/sdk-schema@0.33.2
|
|
43
|
+
- @plitzi/sdk-shared@0.33.2
|
|
44
|
+
- @plitzi/sdk-style@0.33.2
|
|
45
|
+
- @plitzi/sdk-variables@0.33.2
|
|
46
|
+
|
|
3
47
|
## 0.33.1
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
package/dist/index.html
CHANGED
|
@@ -56,11 +56,10 @@
|
|
|
56
56
|
render(
|
|
57
57
|
'plitzi',
|
|
58
58
|
{
|
|
59
|
-
webKey:
|
|
60
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIl0sInNjb3BlIjoic3BhY2U6cmVuZGVyIiwiaWF0IjoxNzg2NjU5NTg5LCJqdGkiOiJjMjRhZjMwN2Q1YTgzZmNjIiwibmJmIjoxNzg2NjU5NTg5fQ.q3-yIi5TmY8SLghX5q3jpN2qqsGJbDIF9dcVJvfLbfY',
|
|
59
|
+
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCJdLCJpc3MiOiJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJhdWQiOlsiaHR0cHM6Ly9wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWwiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAxIiwiaHR0cHM6Ly9hcGkucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zc3IucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9tY3AucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hdXRoLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly8xMjcuMC4wLjE6NTMwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6NTE4MCJdLCJzY29wZSI6InNwYWNlOnJlbmRlciIsImlhdCI6MTc4OTI0ODQ3NCwianRpIjoiZDAwNTkyYjNkYzc3ZGZjNSIsIm5iZiI6MTc4OTI0ODQ3NH0.1nXztIRTuKU016ZWahgXokFt8R8uQBnlB2m5oETBPYI',
|
|
61
60
|
// The actor. Without it the builder loads and every write is refused, since authorization is
|
|
62
61
|
// can(actor, space, permission). Both halves come from `yarn token 1 --user admin` in plitzi-sdk-server.
|
|
63
|
-
userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
62
|
+
userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiYXVkIjpbImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vYXBpLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vbWNwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXV0aC5wbGl0emkubG9jYWwiLCJodHRwOi8vMTI3LjAuMC4xOjUzMDAiLCJodHRwOi8vbG9jYWxob3N0OjUxODAiXSwic2NvcGUiOiJ1c2VyIiwiZXhwIjoxNzg5MzM0OTAzLCJpYXQiOjE3ODkyNDg1MDMsImp0aSI6Ijg3NjEyMDY1MGZiMWE5ZWEiLCJuYmYiOjE3ODkyNDg1MDN9.XTNR-ST5X6u-UIEnrGXGPQHRrT0Wnqz2ZgD-STWmMjI',
|
|
64
63
|
environment: 'main',
|
|
65
64
|
server: {
|
|
66
65
|
basePath: '',
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActionDocument, ActionRunReport, ActionTaskDescriptor, ActionTriggerType, SpaceAction, SpaceCredential } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ActionsContextValue = {
|
|
3
|
+
actions: Record<string, SpaceAction>;
|
|
4
|
+
/** Served by this deployment's server, not hardcoded in the builder. */
|
|
5
|
+
tasks: ActionTaskDescriptor[];
|
|
6
|
+
/** Names and identifiers only — values never leave the server. */
|
|
7
|
+
credentials: SpaceCredential[];
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: string;
|
|
10
|
+
hasServerRendering: boolean;
|
|
11
|
+
/** One origin per deployment, for building webhook URLs. */
|
|
12
|
+
deployments: {
|
|
13
|
+
environment: string;
|
|
14
|
+
domain: string;
|
|
15
|
+
isDefault: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
addAction: (name: string, document: ActionDocument) => Promise<SpaceAction | undefined>;
|
|
18
|
+
updateAction: (identifier: string, name: string, document: ActionDocument) => Promise<SpaceAction | undefined>;
|
|
19
|
+
removeAction: (identifier: string) => Promise<boolean>;
|
|
20
|
+
/** Runs the stored action through the same runner a visitor hits, under the trigger's own access rules. */
|
|
21
|
+
runAction: (identifier: string, input: Record<string, unknown>, trigger?: ActionTriggerType) => Promise<ActionRunReport | undefined>;
|
|
22
|
+
};
|
|
23
|
+
declare const ActionsContext: import('react').Context<ActionsContextValue>;
|
|
24
|
+
export default ActionsContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionRunReport, ActionDocument, ActionTaskDescriptor, ActionTriggerType, SpaceAction, SpaceCredential } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ActionFormProps = {
|
|
3
|
+
action?: SpaceAction;
|
|
4
|
+
tasks: ActionTaskDescriptor[];
|
|
5
|
+
credentials: SpaceCredential[];
|
|
6
|
+
deployments: {
|
|
7
|
+
environment: string;
|
|
8
|
+
domain: string;
|
|
9
|
+
isDefault: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
onRun: (identifier: string, input: Record<string, unknown>, trigger: ActionTriggerType) => Promise<ActionRunReport | undefined>;
|
|
12
|
+
onSubmit: (name: string, document: ActionDocument) => Promise<void> | void;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
};
|
|
15
|
+
declare const ActionForm: ({ action, tasks, credentials, deployments, onRun, onSubmit, onCancel }: ActionFormProps) => import("react").JSX.Element;
|
|
16
|
+
export default ActionForm;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SpaceAction } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ActionListProps = {
|
|
3
|
+
actions: SpaceAction[];
|
|
4
|
+
onSelect: (identifier: string) => void;
|
|
5
|
+
onRemove: (identifier: string) => void;
|
|
6
|
+
onCreate: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const ActionList: ({ actions, onSelect, onRemove, onCreate }: ActionListProps) => import("react").JSX.Element;
|
|
9
|
+
export default ActionList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionDocument, ActionRunReport, ActionTriggerType } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ActionTestRunProps = {
|
|
3
|
+
/** The stored document — runs execute it, not unsaved form edits. */
|
|
4
|
+
document: ActionDocument;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
disabledReason?: string;
|
|
7
|
+
onRun: (input: Record<string, unknown>, trigger: ActionTriggerType) => Promise<ActionRunReport | undefined>;
|
|
8
|
+
};
|
|
9
|
+
declare const ActionTestRun: ({ document, disabled, disabledReason, onRun }: ActionTestRunProps) => import("react").JSX.Element;
|
|
10
|
+
export default ActionTestRun;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ActionWebhookUrlProps = {
|
|
2
|
+
identifier: string;
|
|
3
|
+
deployments: {
|
|
4
|
+
environment: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
isDefault: boolean;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
/** The path mirrors sdk-server's webhook endpoint mount. */
|
|
10
|
+
declare const ActionWebhookUrl: ({ identifier, deployments }: ActionWebhookUrlProps) => import("react").JSX.Element;
|
|
11
|
+
export default ActionWebhookUrl;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as Actions } from './Actions';
|
|
2
|
+
import { default as ActionsContext } from './ActionsContext';
|
|
3
|
+
import { default as ActionsContextProvider } from './ActionsContextProvider';
|
|
4
|
+
export * from './ActionsContext';
|
|
5
|
+
export { Actions, ActionsContext, ActionsContextProvider };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QuotaReading } from '../../../Space/hooks/useSpaceQuota';
|
|
2
|
+
export type QuotaBreakdownProps = {
|
|
3
|
+
readings: QuotaReading[];
|
|
4
|
+
/** The space being edited, so it is answered from the store rather than from the figure the server last saved. */
|
|
5
|
+
spaceId: number;
|
|
6
|
+
liveElements: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The number in the header, taken apart.
|
|
10
|
+
*
|
|
11
|
+
* The meter answers "how much room is left"; this answers what follows it — where the room went. Two breakdowns,
|
|
12
|
+
* because the two ceilings are spent by different things: elements sit in pages, and page views are spent by
|
|
13
|
+
* visitors on paths.
|
|
14
|
+
*
|
|
15
|
+
* The space being edited is answered entirely from the store, so it is on screen before any request is made, and it
|
|
16
|
+
* is there even for someone whose account owns none of this. The rest of the account is what the request is for.
|
|
17
|
+
*/
|
|
18
|
+
declare const QuotaBreakdown: ({ readings, spaceId, liveElements }: QuotaBreakdownProps) => import("react").JSX.Element;
|
|
19
|
+
export default QuotaBreakdown;
|
|
@@ -4,17 +4,17 @@ import { MouseEvent } from 'react';
|
|
|
4
4
|
declare const pageFormSchema: z.ZodObject<{
|
|
5
5
|
name: z.ZodString;
|
|
6
6
|
slug: z.ZodString;
|
|
7
|
-
|
|
7
|
+
id: z.ZodString;
|
|
8
8
|
pageFolder: z.ZodOptional<z.ZodString>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export type PageFormProps = {
|
|
11
11
|
name?: string;
|
|
12
12
|
slug?: string;
|
|
13
|
-
|
|
13
|
+
id?: string;
|
|
14
14
|
pageFolder?: string;
|
|
15
15
|
pageFolders?: PageFolder[];
|
|
16
16
|
onClose?: (e: MouseEvent) => void;
|
|
17
17
|
onSubmit?: (e: MouseEvent | undefined, values: z.infer<typeof pageFormSchema>) => void;
|
|
18
18
|
};
|
|
19
|
-
declare const PageForm: ({ name, slug,
|
|
19
|
+
declare const PageForm: ({ name, slug, id, pageFolder, pageFolders, onClose, onSubmit }: PageFormProps) => import("react").JSX.Element;
|
|
20
20
|
export default PageForm;
|
|
@@ -27,7 +27,14 @@ export declare const getClipboardDataProcessed: (clipboardData?: DataTransfer) =
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
} | undefined>;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* A pasted element, named on the spot.
|
|
32
|
+
*
|
|
33
|
+
* `mintId` is positional and local to the payload being assembled: what comes out of here is a throwaway template
|
|
34
|
+
* document that `SCHEMA_ADD_TEMPLATE` drops into the real space, and that is where a name colliding with the space
|
|
35
|
+
* is renamed. All this has to guarantee is that the paste does not collide with itself.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getElementDefinition: (componentDefinitions: Record<string, ComponentDefinition>, mintId: (type: string) => string, type: string, attributes?: Element["attributes"], styleSelectors?: Element["definition"]["styleSelectors"], parentId?: string) => {
|
|
31
38
|
definition: Element["definition"];
|
|
32
39
|
attributes: Element["attributes"];
|
|
33
40
|
id: string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Element } from '@plitzi/sdk-shared';
|
|
2
2
|
export type ElementDefinitionSettingsProps = {
|
|
3
3
|
definition: Element['definition'];
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/** The one name this element answers to. Editing it renames the element across the whole document. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Why this id cannot be used here, or null when it is free. Given the slugified id, never the raw typing. */
|
|
7
|
+
getNameConflict: (id: string) => string | null;
|
|
6
8
|
onUpdate?: (key: string, value: string | boolean | number | object, isDefinition?: boolean) => void;
|
|
7
|
-
|
|
9
|
+
onRename: (id: string) => void;
|
|
8
10
|
};
|
|
9
|
-
declare const ElementDefinitionSettings: ({ definition,
|
|
11
|
+
declare const ElementDefinitionSettings: ({ definition, id, getNameConflict, onUpdate, onRename }: ElementDefinitionSettingsProps) => import("react").JSX.Element;
|
|
10
12
|
export default ElementDefinitionSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type BuilderSearchProps = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Finding an element from anywhere in the builder, whatever panel is open.
|
|
7
|
+
*
|
|
8
|
+
* The Layers panel has a search of its own, but it is only there while that panel is — and an author looking for
|
|
9
|
+
* an element across forty pages and a handful of layouts is rarely looking at Layers when they need it. This one
|
|
10
|
+
* opens with ⌘P / Ctrl+P or the header button, searches the whole space, and takes the author to the match.
|
|
11
|
+
*
|
|
12
|
+
* The canvas is an iframe, and keys pressed inside it never reach this document: the canvas forwards the shortcut
|
|
13
|
+
* through `openSearch` instead.
|
|
14
|
+
*/
|
|
15
|
+
declare const BuilderSearch: ({ children }: BuilderSearchProps) => import("react").JSX.Element;
|
|
16
|
+
export default BuilderSearch;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type BuilderSearchPanelProps = {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* The input and its results. Mounted only while the search is open, so every opening starts from an empty query.
|
|
6
|
+
*/
|
|
7
|
+
declare const BuilderSearchPanel: ({ onClose }: BuilderSearchPanelProps) => import("react").JSX.Element;
|
|
8
|
+
export default BuilderSearchPanel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type BuilderTreeSearchProps = {
|
|
2
|
+
query: string;
|
|
3
|
+
baseElementId?: string;
|
|
4
|
+
onQueryChange: (query: string) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The Layers panel's own way into the global search: the same space-wide results, inline, where the tree is.
|
|
8
|
+
*
|
|
9
|
+
* Picking one opens its page or layout, opens the tree down to it and selects it — then clears the query, which is
|
|
10
|
+
* what puts the tree back on screen to show it. The builder-wide search (⌘P) does the same from anywhere else.
|
|
11
|
+
*/
|
|
12
|
+
declare const BuilderTreeSearch: ({ query, baseElementId, onQueryChange }: BuilderTreeSearchProps) => import("react").JSX.Element;
|
|
13
|
+
export default BuilderTreeSearch;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementMatch } from '../../helpers/searchElements';
|
|
2
|
+
export type ElementMatchItemProps = {
|
|
3
|
+
match: ElementMatch;
|
|
4
|
+
/** The page or layout the match lives in, when saying so helps: left out for the root already on screen. */
|
|
5
|
+
rootLabel?: string;
|
|
6
|
+
/** Highlighted by the keyboard, and kept scrolled into view. */
|
|
7
|
+
active?: boolean;
|
|
8
|
+
onSelect: (match: ElementMatch) => void;
|
|
9
|
+
onHover?: (match?: ElementMatch) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const ElementMatchItem: ({ match, rootLabel, active, onSelect, onHover }: ElementMatchItemProps) => import("react").JSX.Element;
|
|
12
|
+
export default ElementMatchItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Element } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The flat schema, typed as it actually behaves.
|
|
4
|
+
*
|
|
5
|
+
* `Record<string, Element>` promises an element for every string there is, so the compiler calls the miss checks
|
|
6
|
+
* below dead code — and a `parentId` naming an element the schema no longer has is exactly what this walk exists
|
|
7
|
+
* to survive. Callers hand over the store's own map, which is assignable to this.
|
|
8
|
+
*/
|
|
9
|
+
export type ElementLookup = Record<string, Element | undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* The chain from an element up to its root, outermost first.
|
|
12
|
+
*
|
|
13
|
+
* Walked through `parentId` rather than read off `rootId`, because the tree the panel opens is the chain of
|
|
14
|
+
* PARENTS: revealing a match six levels down means opening all six, and `rootId` names only the far end of it. The
|
|
15
|
+
* seen-set is not paranoia — a schema edited by two people at once can briefly describe a cycle, and without it
|
|
16
|
+
* this loops forever inside a render.
|
|
17
|
+
*/
|
|
18
|
+
export declare const chainOf: (flat: ElementLookup, id: string) => {
|
|
19
|
+
rootId: string;
|
|
20
|
+
ancestors: string[];
|
|
21
|
+
};
|
|
22
|
+
/** Whether an element lives in the page or layout `rootId` — the root itself included. */
|
|
23
|
+
export declare const isInRoot: (flat: ElementLookup, id: string | undefined, rootId: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ElementLookup } from './elementChain';
|
|
2
|
+
export type ElementMatch = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
/** Free display text, shown only when it says something the id does not. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** The page or layout this element lives in — where the search has to take you before it can select it. */
|
|
8
|
+
rootId: string;
|
|
9
|
+
/** The ids between the root and this element, outermost first: what the tree has to open to reveal it. */
|
|
10
|
+
ancestors: string[];
|
|
11
|
+
score: number;
|
|
12
|
+
};
|
|
13
|
+
export type SearchOptions = {
|
|
14
|
+
/** Answers past this are noise: nobody scrolls a thousand hits, they type another letter. */
|
|
15
|
+
limit?: number;
|
|
16
|
+
/** The page the author is on. Its matches sort first — that is where they were already looking. */
|
|
17
|
+
currentRootId?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Every element in the SPACE whose id, label, page name or type matches — not only the ones on the page being
|
|
21
|
+
* edited.
|
|
22
|
+
*
|
|
23
|
+
* Across every page and layout on purpose: the tree can only ever show one root's elements, so an author with forty
|
|
24
|
+
* pages had no way to answer "where is the element called `cta-primary`" except by opening pages until one of them
|
|
25
|
+
* had it. Results carry the root they were found in, so the panel can say where each one is and take you there.
|
|
26
|
+
*/
|
|
27
|
+
export declare const searchElements: (flat: ElementLookup, query: string, { limit, currentRootId }?: SearchOptions) => ElementMatch[];
|
|
28
|
+
/** What to call a root in the results: its page name if it has one, otherwise its label, otherwise its id. */
|
|
29
|
+
export declare const rootName: (flat: ElementLookup, rootId: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElementMatch } from '../helpers/searchElements';
|
|
2
|
+
export type RevealTarget = Pick<ElementMatch, 'id' | 'rootId' | 'ancestors'>;
|
|
3
|
+
/**
|
|
4
|
+
* Takes the author to an element anywhere in the space: its page or layout on screen, the tree opened down to it,
|
|
5
|
+
* and the element selected.
|
|
6
|
+
*
|
|
7
|
+
* The branches go into the same `openedCache` the tree reads, so revealing a match and expanding a node by hand are
|
|
8
|
+
* the same act — an element eight levels down is selected AND visible in the Layers panel, not selected somewhere
|
|
9
|
+
* the panel is not showing.
|
|
10
|
+
*
|
|
11
|
+
* The switch always goes out, even to the root already on screen: the builder may be showing a layout on top of
|
|
12
|
+
* the current page, and asking for the page is what brings it back. Asking for the root already open is a no-op.
|
|
13
|
+
*/
|
|
14
|
+
declare const useRevealElement: () => ({ id, rootId, ancestors }: RevealTarget) => void;
|
|
15
|
+
export default useRevealElement;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { ComponentDefinition, Element } from '@plitzi/sdk-shared';
|
|
2
|
-
|
|
1
|
+
import { ComponentDefinition, Element, Schema } from '@plitzi/sdk-shared';
|
|
2
|
+
/** Mints names for a burst of new elements against one snapshot of the document.
|
|
3
|
+
*
|
|
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
|
+
* of its siblings in the same drop — which is why the taken set is carried across the burst rather than re-read
|
|
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
|
+
export declare const makeIdMinter: (flat: Schema["flat"]) => (type: string) => string;
|
|
9
|
+
export declare const getInitialItems: (parentId: string, items: string[] | undefined, definitions: Record<string, ComponentDefinition>, mintId: (type: string) => string, rootId?: string) => {
|
|
3
10
|
directItems: Record<string, Element>;
|
|
4
11
|
items: Record<string, Element>;
|
|
5
12
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the space's families into the EDITOR's document, so a font can be chosen by looking at it.
|
|
3
|
+
*
|
|
4
|
+
* The canvas is an iframe with a document of its own: everything it loads is invisible to the panels around it,
|
|
5
|
+
* which is why the picker used to draw every family name in the same interface font. It was given a fixed Google
|
|
6
|
+
* stylesheet for exactly this, subsetted to the glyphs of eighteen hard-coded names — except the ampersand in that
|
|
7
|
+
* URL was HTML-escaped, so the subsetting was silently ignored and the browser fetched the families whole.
|
|
8
|
+
*
|
|
9
|
+
* Two different requests, because the two kinds of font are worth loading to different depths:
|
|
10
|
+
*
|
|
11
|
+
* - Google families are fetched for the LETTERS OF THEIR OWN NAMES (`text=`), a few hundred bytes for the whole
|
|
12
|
+
* list. Enough to draw an option; deliberately useless for anything else.
|
|
13
|
+
* - What the space hosts or points at is loaded properly. There is no subsetting endpoint in front of somebody
|
|
14
|
+
* else's CDN, and these are the space's own files.
|
|
15
|
+
*/
|
|
16
|
+
declare const FontPreviews: () => null;
|
|
17
|
+
export default FontPreviews;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this space loads, and where each family comes from.
|
|
3
|
+
*
|
|
4
|
+
* A space-level panel rather than something under an element's typography, because a font is a resource: it costs
|
|
5
|
+
* a request, it belongs to the space, and the element inspector only ever picks from what is declared here.
|
|
6
|
+
*/
|
|
7
|
+
declare const Fonts: () => import("react").JSX.Element;
|
|
8
|
+
export default Fonts;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SpaceFont } from '@plitzi/sdk-shared';
|
|
2
|
+
export type AddGoogleFontProps = {
|
|
3
|
+
declared: string[];
|
|
4
|
+
onAdd: (font: SpaceFont) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const AddGoogleFont: ({ declared, onAdd }: AddGoogleFontProps) => import("react").JSX.Element;
|
|
7
|
+
export default AddGoogleFont;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpaceFont } from '@plitzi/sdk-shared';
|
|
2
|
+
export type AddHostedFontProps = {
|
|
3
|
+
/** Already declared, so a second face of the same family is added to it rather than refused as a duplicate. */
|
|
4
|
+
fonts: SpaceFont[];
|
|
5
|
+
onAdd: (font: SpaceFont) => void;
|
|
6
|
+
onUpdate: (family: string, font: SpaceFont) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A face this deployment stores and serves itself.
|
|
10
|
+
*
|
|
11
|
+
* One file is one WEIGHT and one slant, which is why the two are asked for here rather than guessed: a family with
|
|
12
|
+
* a real bold is a second upload, and the weight select in the inspector offers exactly what has been declared.
|
|
13
|
+
* Uploading another face of a family that already exists extends it instead of starting a second entry, because
|
|
14
|
+
* `font-family` could not tell two entries of one name apart anyway.
|
|
15
|
+
*/
|
|
16
|
+
declare const AddHostedFont: ({ fonts, onAdd, onUpdate }: AddHostedFontProps) => import("react").JSX.Element;
|
|
17
|
+
export default AddHostedFont;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpaceFont } from '@plitzi/sdk-shared';
|
|
2
|
+
export type AddRemoteFontProps = {
|
|
3
|
+
onAdd: (font: SpaceFont) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* A family that lives on somebody else's origin: Adobe Fonts, Bunny, Fontshare, the customer's own CDN.
|
|
7
|
+
*
|
|
8
|
+
* The weights are typed rather than discovered, because nothing on our side can read them out of a foundry's kit —
|
|
9
|
+
* and they are not decoration: they are what the weight select offers, and what tells a bold apart from one the
|
|
10
|
+
* browser drew itself.
|
|
11
|
+
*/
|
|
12
|
+
declare const AddRemoteFont: ({ onAdd }: AddRemoteFontProps) => import("react").JSX.Element;
|
|
13
|
+
export default AddRemoteFont;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpaceFont } from '@plitzi/sdk-shared';
|
|
2
|
+
export type AddSystemFontProps = {
|
|
3
|
+
onAdd: (font: SpaceFont) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* A stack the visitor's machine is expected to have already: a licensed face installed across a company, or a
|
|
7
|
+
* platform family the common stacks do not cover.
|
|
8
|
+
*
|
|
9
|
+
* Nothing is downloaded, which is the whole appeal — and the whole risk. Whoever does not have it installed reads
|
|
10
|
+
* the fallback, so the fallback is the field that matters here.
|
|
11
|
+
*/
|
|
12
|
+
declare const AddSystemFont: ({ onAdd }: AddSystemFontProps) => import("react").JSX.Element;
|
|
13
|
+
export default AddSystemFont;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SpaceFont } from '@plitzi/sdk-shared';
|
|
2
|
+
export type FontRowProps = {
|
|
3
|
+
font: SpaceFont;
|
|
4
|
+
/** How many rules name this family. Removing one that is in use leaves those rules on their fallback. */
|
|
5
|
+
uses: number;
|
|
6
|
+
/** Whether this deployment has anywhere to copy a Google family INTO. */
|
|
7
|
+
canMirror?: boolean;
|
|
8
|
+
mirroring?: boolean;
|
|
9
|
+
onRemove?: (family: string) => void;
|
|
10
|
+
onMirror?: (family: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const FontRow: ({ font, uses, canMirror, mirroring, onRemove, onMirror }: FontRowProps) => import("react").JSX.Element;
|
|
13
|
+
export default FontRow;
|