@plitzi/plitzi-builder 0.39.4 → 0.39.6
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 +39 -0
- package/dist/modules/App/components/AppDirectory/ItemActions.d.ts +3 -1
- package/dist/modules/App/components/AppDirectory/protection.d.ts +16 -0
- package/dist/modules/App/components/AppHeader/HeaderMenu.d.ts +33 -0
- package/dist/modules/App/components/AppHeader/HeaderPopover.d.ts +19 -0
- package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +4 -5
- package/dist/modules/App/components/AppHeader/ReleaseCluster/DraftPanel.d.ts +22 -0
- package/dist/modules/App/components/AppHeader/ReleaseCluster/draftStatus.d.ts +7 -0
- package/dist/modules/App/components/AppHeader/ReleaseCluster/targetAttention.d.ts +14 -0
- package/dist/modules/App/components/AppHeader/ReleaseCluster/useDraftStatus.d.ts +12 -0
- package/dist/modules/App/components/AppHeader/useAnchoredOverlay.d.ts +16 -0
- package/dist/modules/App/components/ChangesSummary/ChangesSummary.d.ts +13 -0
- package/dist/modules/App/components/ChangesSummary/helpers.d.ts +9 -0
- package/dist/modules/App/components/ChangesSummary/index.d.ts +4 -0
- package/dist/modules/App/components/ChangesSummary/useVersionChanges.d.ts +16 -0
- package/dist/modules/App/components/EnvironmentSegments/EnvironmentSegments.d.ts +21 -0
- package/dist/modules/App/components/EnvironmentSegments/index.d.ts +2 -0
- package/dist/modules/App/components/PanelSections/PanelSections.d.ts +1 -1
- package/dist/modules/App/components/SnapshotPruneNotice/SnapshotPruneNotice.d.ts +1 -1
- package/dist/modules/App/components/SnapshotPruneNotice/helpers.d.ts +2 -2
- package/dist/modules/App/components/ViewSection/ViewSection.d.ts +5 -1
- package/dist/modules/App/helpers/age.d.ts +7 -0
- package/dist/modules/App/helpers/environments.d.ts +21 -0
- package/dist/modules/App/helpers/modalSizes.d.ts +12 -0
- package/dist/modules/App/hooks/useLatestSnapshots.d.ts +16 -0
- package/dist/modules/App/hooks/useSpaceTargets.d.ts +11 -0
- package/dist/modules/App/models/PublishSheet/AccessPicker.d.ts +20 -0
- package/dist/modules/App/models/PublishSheet/DeployProgress.d.ts +14 -0
- package/dist/modules/App/models/PublishSheet/DomainCard.d.ts +11 -0
- package/dist/modules/App/models/PublishSheet/DomainList.d.ts +23 -0
- package/dist/modules/App/models/PublishSheet/OwnAddressRow.d.ts +14 -0
- package/dist/modules/App/models/PublishSheet/PublishDone.d.ts +11 -0
- package/dist/modules/App/models/PublishSheet/PublishSheet.d.ts +20 -0
- package/dist/modules/App/models/PublishSheet/ReleaseHistory.d.ts +16 -0
- package/dist/modules/App/models/PublishSheet/RevisionList.d.ts +16 -0
- package/dist/modules/App/models/PublishSheet/RevisionOption.d.ts +11 -0
- package/dist/modules/App/models/PublishSheet/RevisionRow.d.ts +11 -0
- package/dist/modules/App/models/PublishSheet/RollbackConfirm.d.ts +12 -0
- package/dist/modules/App/models/PublishSheet/SaveFirst.d.ts +18 -0
- package/dist/modules/App/models/PublishSheet/ScheduleRow.d.ts +9 -0
- package/dist/modules/App/models/PublishSheet/ScheduledPublishes.d.ts +7 -0
- package/dist/modules/App/models/PublishSheet/SheetFooter.d.ts +24 -0
- package/dist/modules/App/models/PublishSheet/SheetFrame.d.ts +9 -0
- package/dist/modules/App/models/PublishSheet/SheetTabs.d.ts +8 -0
- package/dist/modules/App/models/PublishSheet/ShowWhat.d.ts +34 -0
- package/dist/modules/App/models/PublishSheet/TargetAutomation.d.ts +13 -0
- package/dist/modules/App/models/PublishSheet/TargetNotices.d.ts +10 -0
- package/dist/modules/App/models/PublishSheet/TargetSettings.d.ts +18 -0
- package/dist/modules/App/models/PublishSheet/VersionChoice.d.ts +21 -0
- package/dist/modules/App/models/PublishSheet/WhatHappens.d.ts +24 -0
- package/dist/modules/App/models/PublishSheet/helpers.d.ts +30 -0
- package/dist/modules/App/models/PublishSheet/index.d.ts +2 -0
- package/dist/modules/App/models/SnapshotForm/SnapshotForm.d.ts +26 -0
- package/dist/modules/App/models/SnapshotForm/index.d.ts +2 -0
- package/dist/modules/Builder/Builder.d.ts +4 -1
- package/dist/modules/Builder/components/BuilderArea/BuilderArea.d.ts +6 -1
- package/dist/modules/Components/components/ComponentBanner/ComponentBanner.d.ts +10 -2
- package/dist/modules/Components/components/ComponentDetails/ComponentDetails.d.ts +10 -0
- package/dist/modules/Components/components/ComponentDetails/index.d.ts +3 -0
- package/dist/modules/Components/components/ComponentItem/ComponentItem.d.ts +4 -1
- package/dist/modules/Components/components/ComponentPreview/ComponentPreview.d.ts +10 -0
- package/dist/modules/Components/components/ComponentPreview/index.d.ts +3 -0
- package/dist/modules/Components/preview.d.ts +28 -0
- package/dist/modules/Components/useOpenComponent.d.ts +15 -6
- package/dist/modules/History/helpers.d.ts +1 -1
- package/dist/modules/Space/Models/SpaceCredentialForm/SpaceCredentialForm.d.ts +20 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialEditor/CredentialEditor.d.ts +17 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialEditor/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialFields/CredentialFields.d.ts +7 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialFields/components/CredentialField/CredentialField.d.ts +10 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialFields/components/CredentialField/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/CredentialFields/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/NamedValues/NamedValues.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/NamedValues/components/ValuesInput/ValuesInput.d.ts +8 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/NamedValues/components/ValuesInput/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/NamedValues/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ObtainGuide/ObtainGuide.d.ts +7 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ObtainGuide/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderPicker/ProviderPicker.d.ts +9 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderPicker/components/ProviderOption/ProviderOption.d.ts +8 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderPicker/components/ProviderOption/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderPicker/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderSummary/ProviderSummary.d.ts +9 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/components/ProviderSummary/index.d.ts +3 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/helpers.d.ts +26 -0
- package/dist/modules/Space/Models/SpaceCredentialForm/index.d.ts +4 -0
- package/dist/modules/Space/components/SpaceIssues/SpaceIssues.d.ts +3 -3
- package/dist/modules/Space/components/SpaceIssues/components/CodeGroup/CodeGroup.d.ts +23 -0
- package/dist/modules/Space/components/SpaceIssues/components/CodeGroup/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/CodeText/CodeText.d.ts +7 -0
- package/dist/modules/Space/components/SpaceIssues/components/CodeText/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueGroup/IssueGroup.d.ts +2 -2
- package/dist/modules/Space/components/SpaceIssues/components/IssueItem/IssueItem.d.ts +2 -4
- package/dist/modules/Space/components/SpaceIssues/components/Message/Message.d.ts +9 -0
- package/dist/modules/Space/components/SpaceIssues/components/Message/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/SuggestionGroup.d.ts +5 -2
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/SuggestionItem.d.ts +2 -2
- package/dist/modules/Space/components/SpaceIssues/helpers.d.ts +23 -1
- package/dist/modules/Space/hooks/useSpaceIssues.d.ts +8 -2
- package/dist/modules/StateManager/StateManager.d.ts +5 -0
- package/dist/modules/StateManager/components/ComputedTab/ComputedTab.d.ts +6 -0
- package/dist/modules/StateManager/components/ComputedTab/index.d.ts +3 -0
- package/dist/modules/StateManager/components/Kept/Kept.d.ts +7 -0
- package/dist/modules/StateManager/components/Kept/index.d.ts +3 -0
- package/dist/modules/StateManager/components/Scenarios/Scenarios.d.ts +6 -0
- package/dist/modules/StateManager/components/Scenarios/index.d.ts +3 -0
- package/dist/modules/StateManager/components/StateJson/StateJson.d.ts +7 -0
- package/dist/modules/StateManager/components/StateJson/index.d.ts +3 -0
- package/dist/modules/StateManager/components/StateRow/StateRow.d.ts +16 -0
- package/dist/modules/StateManager/components/StateRow/index.d.ts +3 -0
- package/dist/modules/StateManager/components/StateTab/StateTab.d.ts +8 -0
- package/dist/modules/StateManager/components/StateTab/index.d.ts +3 -0
- package/dist/modules/StateManager/components/SubPathRow/SubPathRow.d.ts +20 -0
- package/dist/modules/StateManager/components/SubPathRow/index.d.ts +3 -0
- package/dist/modules/StateManager/components/UseCounts/UseCounts.d.ts +9 -0
- package/dist/modules/StateManager/components/UseCounts/index.d.ts +3 -0
- package/dist/modules/StateManager/components/UsedBy/UsedBy.d.ts +7 -0
- package/dist/modules/StateManager/components/UsedBy/index.d.ts +3 -0
- package/dist/modules/StateManager/components/ValueEditor/ValueEditor.d.ts +12 -0
- package/dist/modules/StateManager/components/ValueEditor/index.d.ts +3 -0
- package/dist/modules/StateManager/components/ValueJson/ValueJson.d.ts +7 -0
- package/dist/modules/StateManager/components/ValueJson/index.d.ts +3 -0
- package/dist/modules/StateManager/components/VisitorTab/VisitorTab.d.ts +6 -0
- package/dist/modules/StateManager/components/VisitorTab/index.d.ts +3 -0
- package/dist/modules/StateManager/helpers.d.ts +54 -0
- package/dist/modules/StateManager/hooks/useCanvasVisitor.d.ts +21 -0
- package/dist/modules/StateManager/hooks/useStateChanges.d.ts +19 -0
- package/dist/modules/StateManager/layout.d.ts +2 -0
- package/dist/modules/Usages/components/UsageRow/components/UsageTreeGroup/UsageTreeGroup.d.ts +4 -2
- package/dist/modules/Usages/helpers/usageIndex.d.ts +6 -1
- package/dist/modules/Usages/index.d.ts +3 -0
- package/dist/package.json.d.ts +14 -14
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +2839 -2675
- package/dist/plitzi-builder.js.gz +0 -0
- package/dist/plitzi-functions-worker.js +1 -1
- package/package.json +28 -28
- package/dist/modules/App/models/DeployForm/DeployForm.d.ts +0 -24
- package/dist/modules/App/models/DeployForm/InputEnvironment.d.ts +0 -2
- package/dist/modules/App/models/DeployForm/index.d.ts +0 -3
- package/dist/modules/App/models/PublishForm.d.ts +0 -20
- package/dist/modules/Space/Models/SpaceCredentialForm.d.ts +0 -63
- package/dist/modules/Space/helpers/buildCredentialData.d.ts +0 -17
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpaceCredentialProvider } from '@plitzi/sdk-shared';
|
|
3
|
+
import { CredentialGroup } from '@plitzi/sdk-shared/credentials';
|
|
4
|
+
/**
|
|
5
|
+
* A credential as the form holds it: its name, what it signs in to, and its values by field — judged by
|
|
6
|
+
* `credentialProblems`, the rule the server refuses a save with, so a value this form accepts is one the platform keeps.
|
|
7
|
+
*/
|
|
8
|
+
export declare const spaceCredentialFormSchema: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
provider: z.ZodCustom<SpaceCredentialProvider, SpaceCredentialProvider>;
|
|
11
|
+
data: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SpaceCredentialFormValues = z.infer<typeof spaceCredentialFormSchema>;
|
|
14
|
+
/**
|
|
15
|
+
* What a new credential of a kind starts as: named after its provider with its fields' first values — or, an open kind
|
|
16
|
+
* being whatever its author makes it (a Strapi token, a webhook's secret), unnamed with one value to fill in.
|
|
17
|
+
*/
|
|
18
|
+
export declare const initialValues: (provider: SpaceCredentialProvider, name?: string) => SpaceCredentialFormValues;
|
|
19
|
+
/** The credential's values as the API keeps them. */
|
|
20
|
+
export declare const credentialDataOf: (values: SpaceCredentialFormValues) => Record<string, string>;
|
|
21
|
+
/** The kinds offered, in the catalogue's groups and order: every kind, or those the caller can use. */
|
|
22
|
+
export declare const offeredGroups: (providers?: SpaceCredentialProvider[]) => {
|
|
23
|
+
id: CredentialGroup;
|
|
24
|
+
label: string;
|
|
25
|
+
providers: SpaceCredentialProvider[];
|
|
26
|
+
}[];
|
|
@@ -9,9 +9,9 @@ export type SpaceIssuesProps = {
|
|
|
9
9
|
onFix?: () => Promise<unknown>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Everything the linter found in the saved space
|
|
13
|
-
* but most likely not as meant, then the shorter ways to the same page
|
|
14
|
-
*
|
|
12
|
+
* Everything the linter found in the saved space, a tab per list — errors first, since they are what stops a publish,
|
|
13
|
+
* then what renders but most likely not as meant, then the shorter ways to the same page — and in each, a group per
|
|
14
|
+
* code. The tabs and the fix stay put; only the list scrolls.
|
|
15
15
|
*/
|
|
16
16
|
declare const SpaceIssues: ({ issues, intro, onDismiss, onFix }: SpaceIssuesProps) => import('react').JSX.Element;
|
|
17
17
|
export default SpaceIssues;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type CodeGroupProps = {
|
|
3
|
+
code: string;
|
|
4
|
+
/** How many entries it holds. */
|
|
5
|
+
count: number;
|
|
6
|
+
/** What to do, said once for every entry: the row of the code. */
|
|
7
|
+
fix: string | null;
|
|
8
|
+
fixLabel?: string;
|
|
9
|
+
/** Said beside the count when folded — what taking it saves. */
|
|
10
|
+
aside?: string;
|
|
11
|
+
/** The icon of the list it is in, in its colour. */
|
|
12
|
+
icon: string;
|
|
13
|
+
tone: string;
|
|
14
|
+
/** Unfolded from the start: a list with a single code has nothing to choose between. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The entries of one code, folded to a line — its name, how many, what they save — so a long list reads as the few
|
|
20
|
+
* kinds of thing it is. Unfolded, it says what to do once and then each entry.
|
|
21
|
+
*/
|
|
22
|
+
declare const CodeGroup: ({ code, count, fix, fixLabel, aside, icon, tone, defaultOpen, children }: CodeGroupProps) => import('react').JSX.Element;
|
|
23
|
+
export default CodeGroup;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type CodeTextProps = {
|
|
2
|
+
/** Markdown whose `code` is in backticks, as the linter and the code table write it. */
|
|
3
|
+
text: string;
|
|
4
|
+
};
|
|
5
|
+
/** A message or a fix with the code in it set apart, so `display: flex` reads as code and not as a sentence. */
|
|
6
|
+
declare const CodeText: ({ text }: CodeTextProps) => import('react').JSX.Element[];
|
|
7
|
+
export default CodeText;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IssueSeverity } from '../../helpers';
|
|
2
2
|
import { TSpaceIssue } from '@plitzi/sdk-shared/network';
|
|
3
3
|
export type IssueGroupProps = {
|
|
4
|
-
title: string;
|
|
5
4
|
issues: TSpaceIssue[];
|
|
6
5
|
severity: IssueSeverity;
|
|
7
6
|
onDismiss: () => void;
|
|
8
7
|
};
|
|
9
|
-
|
|
8
|
+
/** The errors or the warnings, a group per code: what to write instead said once, then each place it was found. */
|
|
9
|
+
declare const IssueGroup: ({ issues, severity, onDismiss }: IssueGroupProps) => import('react').JSX.Element;
|
|
10
10
|
export default IssueGroup;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { IssueSeverity } from '../../helpers';
|
|
2
1
|
import { TSpaceIssue } from '@plitzi/sdk-shared/network';
|
|
3
2
|
export type IssueItemProps = {
|
|
4
3
|
issue: TSpaceIssue;
|
|
5
|
-
severity: IssueSeverity;
|
|
6
4
|
/** Called once the element is on screen, so whatever holds the list can get out of the way. */
|
|
7
5
|
onDismiss: () => void;
|
|
8
6
|
};
|
|
9
|
-
/** One issue
|
|
10
|
-
declare const IssueItem: ({ issue,
|
|
7
|
+
/** One issue of its code's group, and the element it names — a link to it. What to write instead is the group's. */
|
|
8
|
+
declare const IssueItem: ({ issue, onDismiss }: IssueItemProps) => import('react').JSX.Element;
|
|
11
9
|
export default IssueItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type MessageProps = {
|
|
2
|
+
text: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* What the linter says of one entry. Its messages name every element and value they are about, so the longest run to
|
|
6
|
+
* a paragraph: those start at three lines, the rest a click away, and the list stays one that can be read down.
|
|
7
|
+
*/
|
|
8
|
+
declare const Message: ({ text }: MessageProps) => import('react').JSX.Element;
|
|
9
|
+
export default Message;
|
package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/SuggestionGroup.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export type SuggestionGroupProps = {
|
|
|
3
3
|
suggestions: TSpaceSuggestion[];
|
|
4
4
|
onDismiss: () => void;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The shorter, lighter or phone-ready ways to the same page, a group per code, the ones that save the most first.
|
|
8
|
+
* Nothing in it blocks a publish.
|
|
9
|
+
*/
|
|
10
|
+
declare const SuggestionGroup: ({ suggestions, onDismiss }: SuggestionGroupProps) => import('react').JSX.Element;
|
|
8
11
|
export default SuggestionGroup;
|
package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/SuggestionItem.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export type SuggestionItemProps = {
|
|
|
5
5
|
onDismiss: () => void;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* the copies of a header, the buttons holding a text — each a link to it.
|
|
8
|
+
* One shorter way to the same page, in its code's group: what it is, what taking it saves, and the elements it is
|
|
9
|
+
* about — the copies of a header, the buttons holding a text — each a link to it. The short way is the group's.
|
|
10
10
|
*/
|
|
11
11
|
declare const SuggestionItem: ({ suggestion, onDismiss }: SuggestionItemProps) => import('react').JSX.Element;
|
|
12
12
|
export default SuggestionItem;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
export type IssueSeverity = 'error' | 'warning';
|
|
2
|
+
/** The three lists the linter answers with, in the order they matter: what stops a publish first. */
|
|
3
|
+
export type IssueKind = 'errors' | 'warnings' | 'suggestions';
|
|
2
4
|
export declare const SEVERITY_TEXT: Record<IssueSeverity, string>;
|
|
3
5
|
export declare const SEVERITY_ICON: Record<IssueSeverity, string>;
|
|
4
|
-
export declare const MUTED = "text-
|
|
6
|
+
export declare const MUTED = "text-ui-fg-subtle";
|
|
5
7
|
/** A suggestion is no problem at all: it reads in the accent, beside the red and the amber of what is wrong. */
|
|
6
8
|
export declare const SUGGESTION_TEXT = "text-indigo-600 dark:text-indigo-400";
|
|
9
|
+
/** Every other part of a text split on backticks is code: `a \`b\` c` is text, code, text. */
|
|
10
|
+
export declare const partsOf: (text: string) => {
|
|
11
|
+
text: string;
|
|
12
|
+
code: boolean;
|
|
13
|
+
}[];
|
|
14
|
+
/** A code as a title: `repeated-shape` and `STYLE_WITHOUT_TAG` read "Repeated shape" and "Style without tag". */
|
|
15
|
+
export declare const titleOfCode: (code: string) => string;
|
|
16
|
+
export type CodeGroup<T> = {
|
|
17
|
+
code: string;
|
|
18
|
+
fix: string | null;
|
|
19
|
+
items: T[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The entries of one list by their code, in the order each code is first met: the linter lists the ones that matter
|
|
23
|
+
* most first, so the groups keep that order. What to do is the code's row, so a group says it once.
|
|
24
|
+
*/
|
|
25
|
+
export declare const byCode: <T extends {
|
|
26
|
+
code: string;
|
|
27
|
+
fix: string | null;
|
|
28
|
+
}>(entries: readonly T[]) => CodeGroup<T>[];
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { TSpaceIssues } from '@plitzi/sdk-shared/network';
|
|
2
|
+
/**
|
|
3
|
+
* How long the save queue stays drained before the list is asked for again. While someone edits, it drains after every
|
|
4
|
+
* change, and each answer is the whole space read by the linter on the server: asked each time, a big space's checks
|
|
5
|
+
* queued behind its own saves.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QUIET_MS = 1500;
|
|
2
8
|
/**
|
|
3
9
|
* What is wrong with the space as it is SAVED, read by the same linter the publish gate runs.
|
|
4
10
|
*
|
|
5
|
-
* Asked again
|
|
6
|
-
* builder's own schema is ahead of it for as long as anything is still queued. `refresh` answers with the fresh list,
|
|
11
|
+
* Asked again once the save queue has drained and stayed so for a moment (`QUIET_MS`), not on every edit: the server can
|
|
12
|
+
* only read what it holds, and the builder's own schema is ahead of it for as long as anything is still queued. `refresh` answers with the fresh list,
|
|
7
13
|
* for a caller that has to decide on it — publishing — rather than just show it.
|
|
8
14
|
*/
|
|
9
15
|
declare const useSpaceIssues: () => {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export type StateManagerProps = {
|
|
2
2
|
className?: string;
|
|
3
3
|
};
|
|
4
|
+
/**
|
|
5
|
+
* The page's context as the canvas runs it — what decides how it looks besides the space itself: its state, who visits
|
|
6
|
+
* it, the address it is opened at and the values the space computes from them. Each can be set here to see the page in
|
|
7
|
+
* that case, and a case kept by name (Scenarios). Nothing of it is saved in the space.
|
|
8
|
+
*/
|
|
4
9
|
declare const StateManager: ({ className }: StateManagerProps) => import('react').JSX.Element;
|
|
5
10
|
export default StateManager;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space's computed values (`settings.computed`): each one's template and what it gives now, on the page as the
|
|
3
|
+
* canvas runs it. Read only — a value is changed by changing what it reads, in the other tabs.
|
|
4
|
+
*/
|
|
5
|
+
declare const ComputedTab: () => import('react').JSX.Element;
|
|
6
|
+
export default ComputedTab;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Persistence } from '../../helpers';
|
|
2
|
+
export type KeptProps = {
|
|
3
|
+
persistence: Persistence;
|
|
4
|
+
};
|
|
5
|
+
/** How the space's settings keep a top-level key: a check when kept, the server and the browser when they hold it. */
|
|
6
|
+
declare const Kept: ({ persistence }: KeptProps) => import('react').JSX.Element;
|
|
7
|
+
export default Kept;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cases of the page saved by name — "cart full", "onboarding, step 3" — each the whole context: the state, who visits
|
|
3
|
+
* and the address. Kept in this browser, per space, and never in the space: they are how one person looks at it.
|
|
4
|
+
*/
|
|
5
|
+
declare const Scenarios: () => import('react').JSX.Element;
|
|
6
|
+
export default Scenarios;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type StateJsonProps = {
|
|
2
|
+
state: Record<string, unknown>;
|
|
3
|
+
onApply: (state: Record<string, unknown>) => void;
|
|
4
|
+
};
|
|
5
|
+
/** The whole state as JSON, to paste or rewrite at once, applied as a whole. */
|
|
6
|
+
declare const StateJson: ({ state, onApply }: StateJsonProps) => import('react').JSX.Element;
|
|
7
|
+
export default StateJson;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Persistence, StatePathUse } from '../../helpers';
|
|
2
|
+
import { StateChange } from '../../hooks/useStateChanges';
|
|
3
|
+
export type StateRowProps = {
|
|
4
|
+
use: StatePathUse;
|
|
5
|
+
value: unknown;
|
|
6
|
+
persistence: Persistence;
|
|
7
|
+
/** The deepest paths the space names under the key (`cart.items.0.name`), with what reads and writes each. */
|
|
8
|
+
subPaths: StatePathUse[];
|
|
9
|
+
/** The last change of each path while the panel is open: a row, the key's or a path's under it, says it moved. */
|
|
10
|
+
lastOf: Map<string, StateChange>;
|
|
11
|
+
onChange: (key: string, value: unknown) => void;
|
|
12
|
+
/** Sets one path under the key alone (`cart.items.0.name`), not the whole of what holds it. */
|
|
13
|
+
onChangePath: (segments: [string, ...string[]], value: unknown) => void;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import('react').MemoExoticComponent<({ use, value, persistence, subPaths, lastOf, onChange, onChangePath }: StateRowProps) => import('react').JSX.Element>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page's state as the canvas runs it: every key the space reads or writes — set or not yet — each edited in place,
|
|
3
|
+
* then the keys the page holds that nothing in the space names. As a table — a row per top-level key, unfolded into the
|
|
4
|
+
* paths the space names under it, each set where it is — or the whole of it as JSON. What changes as the canvas
|
|
5
|
+
* runs is listed under, newest first. Nothing here is saved: it is the page's state, not the space's.
|
|
6
|
+
*/
|
|
7
|
+
declare const StateTab: () => import('react').JSX.Element;
|
|
8
|
+
export default StateTab;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StatePathUse } from '../../helpers';
|
|
2
|
+
import { StateChange } from '../../hooks/useStateChanges';
|
|
3
|
+
export type SubPathRowProps = {
|
|
4
|
+
/** The top-level key the path is under. */
|
|
5
|
+
keyName: string;
|
|
6
|
+
/** The key's value: the path's is read off it. */
|
|
7
|
+
value: unknown;
|
|
8
|
+
use: StatePathUse;
|
|
9
|
+
/** The path's last change while the panel is open: its row says it moved. */
|
|
10
|
+
lastChange?: StateChange;
|
|
11
|
+
/** Sets this path alone. */
|
|
12
|
+
onChange: (segments: [string, ...string[]], value: unknown) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A path the space names under a key, in the table's own columns: the path, its value set in place — that path alone,
|
|
16
|
+
* never the whole of what holds it — and what reads and writes it, the counts unfolding the elements, each a link. A
|
|
17
|
+
* path that holds an object or a list shows it in a line: the key's JSON edits it.
|
|
18
|
+
*/
|
|
19
|
+
declare const SubPathRow: ({ keyName, value, use, lastChange, onChange }: SubPathRowProps) => import('react').JSX.Element;
|
|
20
|
+
export default SubPathRow;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type UseCountsProps = {
|
|
2
|
+
reads: string[];
|
|
3
|
+
writes: string[];
|
|
4
|
+
/** Given, the counts are a button: what shows the elements behind them. */
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
7
|
+
/** How many elements read a path, or anything under it, and how many write it. */
|
|
8
|
+
declare const UseCounts: ({ reads, writes, onClick }: UseCountsProps) => import('react').JSX.Element;
|
|
9
|
+
export default UseCounts;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type UsedByProps = {
|
|
2
|
+
reads: string[];
|
|
3
|
+
writes: string[];
|
|
4
|
+
};
|
|
5
|
+
/** The elements that read a key and those whose steps write it, each a link that takes you to it. */
|
|
6
|
+
declare const UsedBy: ({ reads, writes }: UsedByProps) => import('react').JSX.Element;
|
|
7
|
+
export default UsedBy;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ValueEditorProps = {
|
|
2
|
+
/** Undefined: a key the space uses that the page has not set yet. */
|
|
3
|
+
value: unknown;
|
|
4
|
+
onChange: (value: unknown) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* One value of the state, edited as what it is: a toggle for true or false, a number field for a number, and for
|
|
8
|
+
* anything else a field read as typed — JSON when it is (`[1, 2]`, `{"a": 1}`), the words otherwise — applied on Enter
|
|
9
|
+
* or when it is left, so the page is not redrawn at every keystroke.
|
|
10
|
+
*/
|
|
11
|
+
declare const ValueEditor: ({ value, onChange }: ValueEditorProps) => import('react').JSX.Element;
|
|
12
|
+
export default ValueEditor;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ValueJsonProps = {
|
|
2
|
+
value: unknown;
|
|
3
|
+
onChange: (value: unknown) => void;
|
|
4
|
+
};
|
|
5
|
+
/** An object or a list, edited whole as JSON; applied when it is valid and left. */
|
|
6
|
+
declare const ValueJson: ({ value, onChange }: ValueJsonProps) => import('react').JSX.Element;
|
|
7
|
+
export default ValueJson;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who the canvas shows the page to: the editor's own session, a guest, or one of the space's test accounts — its roles,
|
|
3
|
+
* and what they give, as a visitor holding them. What the page then reads of its visitor (`auth`) is shown under it.
|
|
4
|
+
*/
|
|
5
|
+
declare const VisitorTab: () => import('react').JSX.Element;
|
|
6
|
+
export default VisitorTab;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Schema } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* A path of `runtime.state` the space uses — a top-level key or one under it (`cart.items.0.name`) — with the elements
|
|
4
|
+
* that read it or anything under it, those whose steps write it or anything under it, and the keys under it the space
|
|
5
|
+
* names. `path` joins the keys with dots.
|
|
6
|
+
*/
|
|
7
|
+
export type StatePathUse = {
|
|
8
|
+
path: string;
|
|
9
|
+
reads: string[];
|
|
10
|
+
writes: string[];
|
|
11
|
+
children: string[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The keys a path into the state names: `state.cart.items[0].name` → `cart`, `items`, `0`, `name`. A template stops it
|
|
15
|
+
* (`cart.{{ props.key }}` names `cart` alone) and one that starts with a template names none.
|
|
16
|
+
*/
|
|
17
|
+
export declare const segmentsOf: (path: string) => string[];
|
|
18
|
+
/**
|
|
19
|
+
* The paths of `runtime.state` the space uses, each with what reads it — a binding, a template, a `when` — and what
|
|
20
|
+
* writes it: a step of the state's (`setState`, `toggleState`…, by the params `STATE_PATH_PARAMS` names). A use counts
|
|
21
|
+
* for its path and every path above it, so `cart` says what `cart.total` does too. Read off the documents, so a path
|
|
22
|
+
* shows here before the page has ever set it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const statePathsOf: (schema: Pick<Schema, "flat" | "components">) => Map<string, StatePathUse>;
|
|
25
|
+
/** The top-level keys among the paths the space uses: the rows of the table. */
|
|
26
|
+
export declare const topKeysOf: (paths: Map<string, StatePathUse>) => Map<string, StatePathUse>;
|
|
27
|
+
/** The deepest paths the space names under a key, with their uses: `cart` → `cart.items.0.name`, `cart.total`. */
|
|
28
|
+
export declare const subPathsOf: (paths: Map<string, StatePathUse>, key: string) => StatePathUse[];
|
|
29
|
+
/** An object or a list: a value with keys under it. */
|
|
30
|
+
export declare const isBranch: (value: unknown) => value is Record<string, unknown> | unknown[];
|
|
31
|
+
/** The value under one key of an object or one index of a list; nothing under anything else. */
|
|
32
|
+
export declare const childOf: (value: unknown, key: string) => unknown;
|
|
33
|
+
/** The value at a path: `cart`, `items`, `0` → the cart's first item. */
|
|
34
|
+
export declare const valueAt: (value: unknown, segments: string[]) => unknown;
|
|
35
|
+
/**
|
|
36
|
+
* The state with one path set — every object and list on the way copied, a missing one made an object — so the page
|
|
37
|
+
* sees a new state and only that path changed.
|
|
38
|
+
*/
|
|
39
|
+
export declare const setInState: (state: Record<string, unknown>, [key, ...rest]: [string, ...string[]], value: unknown) => Record<string, unknown>;
|
|
40
|
+
/** What a branch holds, in a few characters: `{3}` for an object of 3 keys, `[12]` for a list of 12. */
|
|
41
|
+
export declare const shapeOf: (value: unknown) => string | undefined;
|
|
42
|
+
/** How a key of the state outlives the page, as the space's settings say (`keepState` and its lists). */
|
|
43
|
+
export type Persistence = {
|
|
44
|
+
kept: boolean;
|
|
45
|
+
painted: boolean;
|
|
46
|
+
browser: boolean;
|
|
47
|
+
reason: string;
|
|
48
|
+
};
|
|
49
|
+
/** What the space's settings keep of one top-level key of the state. */
|
|
50
|
+
export declare const persistenceOf: (settings: Schema["settings"], key: string) => Persistence;
|
|
51
|
+
/** A value read as what was typed: JSON when it is (a number, true, a list), the words themselves otherwise. */
|
|
52
|
+
export declare const parseTyped: (text: string) => unknown;
|
|
53
|
+
/** A value in a line: what a change or a computed value shows. */
|
|
54
|
+
export declare const preview: (value: unknown) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Who the canvas shows the page to: the editor's own session, a guest, or one of the space's test accounts. */
|
|
2
|
+
export type CanvasVisitor = {
|
|
3
|
+
kind: 'editor';
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'guest';
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'account';
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The canvas's visitor, as the State Manager chooses it. An account is laid over the page as the Tests' journeys lay
|
|
12
|
+
* theirs (`runtime.testAccount`, its roles' permissions worked out by `journeyAccount`); a guest is `canvasGuest`. A
|
|
13
|
+
* journey on the canvas decides its own visitor, and the choice waits until it is closed.
|
|
14
|
+
*/
|
|
15
|
+
declare const useCanvasVisitor: () => {
|
|
16
|
+
visitor: CanvasVisitor;
|
|
17
|
+
choose: (next: CanvasVisitor) => string | undefined;
|
|
18
|
+
accounts: import('@plitzi/sdk-shared').E2eAccount[];
|
|
19
|
+
journeyOnCanvas: boolean;
|
|
20
|
+
};
|
|
21
|
+
export default useCanvasVisitor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** One path of the state changed as the canvas ran: from what, to what — in order, newest first. */
|
|
2
|
+
export type StateChange = {
|
|
3
|
+
id: number;
|
|
4
|
+
path: string;
|
|
5
|
+
from: unknown;
|
|
6
|
+
to: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The changes the state goes through while the panel is open, newest first — each at the path that changed
|
|
10
|
+
* (`cart.total`, not the whole `cart`) — and the last change under each path and the paths above it, so a row can say it
|
|
11
|
+
* or something under it moved. Worked out as the state arrives (no effect, no clock: a render is pure), so a change is
|
|
12
|
+
* never shown a render late.
|
|
13
|
+
*/
|
|
14
|
+
declare const useStateChanges: (state: Record<string, unknown>) => {
|
|
15
|
+
changes: StateChange[];
|
|
16
|
+
lastOf: Map<string, StateChange>;
|
|
17
|
+
clear: () => void;
|
|
18
|
+
};
|
|
19
|
+
export default useStateChanges;
|
package/dist/modules/Usages/components/UsageRow/components/UsageTreeGroup/UsageTreeGroup.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TreeGroup } from '../../../../helpers/grouping';
|
|
2
2
|
export type UsageTreeGroupProps = {
|
|
3
3
|
group: TreeGroup;
|
|
4
|
+
/** Unfolded from the start; folded, its name and count alone — a long list of places reads as its pages first. */
|
|
5
|
+
defaultOpen?: boolean;
|
|
4
6
|
};
|
|
5
|
-
/** The uses in one page, layout or component, under its name. */
|
|
6
|
-
declare const UsageTreeGroup: ({ group }: UsageTreeGroupProps) => import('react').JSX.Element;
|
|
7
|
+
/** The uses in one page, layout or component, under its name — which folds them away and back. */
|
|
8
|
+
declare const UsageTreeGroup: ({ group, defaultOpen }: UsageTreeGroupProps) => import('react').JSX.Element;
|
|
7
9
|
export default UsageTreeGroup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema, Style } from '@plitzi/sdk-shared';
|
|
1
|
+
import { Element, Schema, Style } from '@plitzi/sdk-shared';
|
|
2
2
|
export type UsageCategory = 'components' | 'classes' | 'variables' | 'dataSources';
|
|
3
3
|
export type UsageTreeKind = 'page' | 'layout' | 'component';
|
|
4
4
|
/** A tree of the document an element lives in: a page or a layout of `schema.flat`, or a component's own `flat`. */
|
|
@@ -48,6 +48,11 @@ export type UsageSource = {
|
|
|
48
48
|
*/
|
|
49
49
|
providerTypes?: Readonly<Record<string, string>>;
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* The source paths an element reads — in its bindings, its steps, its attributes, its `when`s — read as the usage index
|
|
53
|
+
* reads them: what another view asks of one element (the State Manager's keys) without a second reading of the schema.
|
|
54
|
+
*/
|
|
55
|
+
export declare const elementPaths: (element: Element) => ReadonlySet<string>;
|
|
51
56
|
/**
|
|
52
57
|
* Where everything the space declares is used: each component's instances, the elements wearing each class, what
|
|
53
58
|
* reads each style token and space variable, and what binds to each data source — in one pass over the document.
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { default as Usages } from './Usages';
|
|
2
2
|
export * from './Usages';
|
|
3
|
+
export { default as UsageTreeGroup } from './components/UsageRow/components/UsageTreeGroup';
|
|
4
|
+
export { groupByTree } from './helpers/grouping';
|
|
5
|
+
export { default as useUsageIndex } from './hooks/useUsageIndex';
|
|
3
6
|
export default Usages;
|