@plitzi/plitzi-builder 0.37.8 → 0.37.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +847 -0
- package/dist/config/index.d.ts +0 -4
- package/dist/index.html +4 -2
- package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/AITemplatePreview.d.ts → AISnippetPreview/AISnippetPreview.d.ts} +3 -3
- package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/components/AITemplateHeader/AITemplateHeader.d.ts → AISnippetPreview/components/AISnippetHeader/AISnippetHeader.d.ts} +3 -3
- package/dist/modules/AI/components/ChatMessage/components/AISnippetPreview/components/AISnippetHeader/index.d.ts +3 -0
- package/dist/modules/AI/components/ChatMessage/components/AISnippetPreview/index.d.ts +3 -0
- package/dist/modules/AI/hooks/useAiChat.d.ts +2 -1
- package/dist/modules/Actions/ActionsContext.d.ts +0 -1
- package/dist/modules/App/AppContainer/components/NotificationsSettings/NotificationsSettings.d.ts +7 -0
- package/dist/modules/App/AppContainer/components/NotificationsSettings/index.d.ts +2 -0
- package/dist/modules/App/AppContainer/containers/ContainerServer.d.ts +7 -0
- package/dist/modules/App/AppContainer/containers/ContainerSettings.d.ts +1 -0
- package/dist/modules/App/AppContainer/containers/GeneralSettings.d.ts +2 -0
- package/dist/modules/App/AppContext.d.ts +3 -0
- package/dist/modules/App/components/AppHeader/GridButton.d.ts +3 -0
- package/dist/modules/App/components/AppHeader/IssuesButton/helpers.d.ts +2 -0
- package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +7 -6
- package/dist/modules/App/components/EmptyState/EmptyState.d.ts +12 -0
- package/dist/modules/App/components/EmptyState/index.d.ts +3 -0
- package/dist/modules/App/components/PanelSections/PanelSections.d.ts +27 -0
- package/dist/modules/App/components/PanelSections/index.d.ts +3 -0
- package/dist/modules/App/components/ResourceRow/ResourceRow.d.ts +19 -0
- package/dist/modules/App/components/ResourceRow/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/SitemapDiagram.d.ts +25 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapChip/SitemapChip.d.ts +21 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapChip/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapLegend/SitemapLegend.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapLegend/index.d.ts +2 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapNode/SitemapNode.d.ts +15 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapNode/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapPath/SitemapPath.d.ts +6 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapPath/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapToolbar/SitemapToolbar.d.ts +16 -0
- package/dist/modules/App/components/SitemapDiagram/components/SitemapToolbar/index.d.ts +3 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/schemaToSitemap.d.ts +10 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/schemaToSitemap.test.d.ts +1 -0
- package/dist/modules/App/components/SitemapDiagram/helpers/searchSitemap.d.ts +12 -0
- package/dist/modules/App/components/SitemapDiagram/index.d.ts +4 -0
- package/dist/modules/App/components/SitemapDiagram/types.d.ts +36 -0
- package/dist/modules/App/components/VersionContents/PluginList.d.ts +7 -0
- package/dist/modules/App/components/VersionContents/VersionContents.d.ts +14 -0
- package/dist/modules/App/components/VersionContents/helpers.d.ts +8 -0
- package/dist/modules/App/components/VersionContents/helpers.test.d.ts +1 -0
- package/dist/modules/App/components/VersionContents/index.d.ts +2 -0
- package/dist/modules/App/components/VersionContents/useVersionContents.d.ts +8 -0
- package/dist/modules/App/components/ViewPage/ViewPage.d.ts +22 -0
- package/dist/modules/App/components/ViewPage/index.d.ts +3 -0
- package/dist/modules/App/components/ViewSection/ViewSection.d.ts +10 -0
- package/dist/modules/App/components/ViewSection/index.d.ts +3 -0
- package/dist/modules/App/helpers/utils.d.ts +10 -1
- package/dist/modules/App/hooks/useSitemapOpen.d.ts +7 -0
- package/dist/modules/Builder/BuilderHelper.d.ts +4 -4
- package/dist/modules/Builder/BuilderProvider.d.ts +1 -1
- package/dist/modules/Builder/Models/SnippetForm.d.ts +16 -0
- package/dist/modules/Builder/components/BuilderContextMenu/BuilderContextMenuItem.d.ts +6 -1
- package/dist/modules/Builder/components/BuilderElementTools/ElementAnchor.d.ts +11 -0
- package/dist/modules/Builder/components/BuilderElementTools/ElementDefinitionSettings.d.ts +3 -1
- package/dist/modules/Builder/components/BuilderElementTools/ElementFlagGate.d.ts +16 -0
- package/dist/modules/Builder/components/BuilderElementTools/NothingSelected.d.ts +6 -0
- package/dist/modules/Builder/helpers/reuse.d.ts +16 -0
- package/dist/modules/Builder/hooks/useSaveAsSnippet.d.ts +8 -0
- package/dist/modules/Components/Components.d.ts +11 -0
- package/dist/modules/Components/components/ComponentBanner/ComponentBanner.d.ts +7 -0
- package/dist/modules/Components/components/ComponentBanner/index.d.ts +1 -0
- package/dist/modules/Components/components/ComponentForm/ComponentForm.d.ts +19 -0
- package/dist/modules/Components/components/ComponentForm/SlotChoice.d.ts +8 -0
- package/dist/modules/Components/components/ComponentForm/index.d.ts +1 -0
- package/dist/modules/Components/components/ComponentItem/ComponentItem.d.ts +12 -0
- package/dist/modules/Components/components/ComponentItem/index.d.ts +1 -0
- package/dist/modules/Components/components/InstanceTools/InstanceTools.d.ts +10 -0
- package/dist/modules/Components/components/InstanceTools/SlotRow.d.ts +13 -0
- package/dist/modules/Components/components/InstanceTools/index.d.ts +1 -0
- package/dist/modules/Components/components/PropsEditor/PropRow.d.ts +14 -0
- package/dist/modules/Components/components/PropsEditor/PropsEditor.d.ts +11 -0
- package/dist/modules/Components/components/PropsEditor/index.d.ts +2 -0
- package/dist/modules/Components/helpers.d.ts +17 -0
- package/dist/modules/Components/helpers.test.d.ts +1 -0
- package/dist/modules/Components/index.d.ts +2 -0
- package/dist/modules/Components/slotChoices.d.ts +9 -0
- package/dist/modules/Components/useOpenComponent.d.ts +13 -0
- package/dist/modules/Components/useSaveAsComponent.d.ts +7 -0
- package/dist/modules/Connectors/ConnectorsContext.d.ts +0 -2
- package/dist/modules/Connectors/helpers/manifestDoc.d.ts +0 -1
- package/dist/modules/Credentials/Credentials.d.ts +0 -7
- package/dist/modules/Elements/ElementHelper.d.ts +3 -2
- package/dist/modules/Elements/hooks/useDragElement.d.ts +5 -4
- package/dist/modules/Flags/Flags.d.ts +9 -0
- package/dist/modules/Flags/components/FlagForm/FlagForm.d.ts +15 -0
- package/dist/modules/Flags/components/FlagForm/FlagRule.d.ts +11 -0
- package/dist/modules/Flags/components/FlagForm/index.d.ts +3 -0
- package/dist/modules/Flags/components/FlagForm/ruleGroup.d.ts +5 -0
- package/dist/modules/Flags/components/FlagForm/ruleGroup.test.d.ts +1 -0
- package/dist/modules/Flags/components/FlagItem/FlagItem.d.ts +14 -0
- package/dist/modules/Flags/components/FlagItem/FlagPreviewOption.d.ts +13 -0
- package/dist/modules/Flags/components/FlagItem/FlagPreviewToggle.d.ts +9 -0
- package/dist/modules/Flags/components/FlagItem/index.d.ts +3 -0
- package/dist/modules/Flags/components/PublishFlagsForm/PublishFlagsForm.d.ts +21 -0
- package/dist/modules/Flags/components/PublishFlagsForm/index.d.ts +3 -0
- package/dist/modules/Flags/helpers/flagRuleFields.d.ts +11 -0
- package/dist/modules/Flags/index.d.ts +3 -0
- package/dist/modules/Functions/Functions.d.ts +4 -3
- package/dist/modules/Functions/components/FunctionInspector/FunctionInspector.d.ts +20 -0
- package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/InspectorSection.d.ts +10 -0
- package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/TaskTest.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/TimeLimit.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryField/TryField.d.ts +10 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryField/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryResult/TryResult.d.ts +9 -0
- package/dist/modules/Functions/components/FunctionInspector/components/TryResult/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionInspector/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsEditor/FunctionsEditor.d.ts +20 -0
- package/dist/modules/Functions/components/FunctionsEditor/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsGuide/FunctionsGuide.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsGuide/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsHeader/FunctionsHeader.d.ts +17 -0
- package/dist/modules/Functions/components/FunctionsHeader/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsProblems/FunctionsProblems.d.ts +2 -1
- package/dist/modules/Functions/components/FunctionsSidebar/FunctionsSidebar.d.ts +30 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/FileItem.d.ts +14 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/FolderItem.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/NewFile.d.ts +7 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/NewTask.d.ts +13 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/RouteItem.d.ts +9 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/SidebarSection.d.ts +13 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/TaskItem.d.ts +16 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsWelcome/FunctionsWelcome.d.ts +6 -0
- package/dist/modules/Functions/components/FunctionsWelcome/index.d.ts +3 -0
- package/dist/modules/Functions/editor/paths.d.ts +9 -0
- package/dist/modules/Functions/editor/source.d.ts +60 -0
- package/dist/modules/Functions/editor/source.test.d.ts +1 -0
- package/dist/modules/Functions/editor/typescriptWorker.d.ts +26 -0
- package/dist/modules/Functions/editor/useFunctionsTypeScript.d.ts +5 -2
- package/dist/modules/Functions/helpers.d.ts +119 -1
- package/dist/modules/History/History.d.ts +5 -1
- package/dist/modules/History/components/ChangeGroup/ChangeGroup.d.ts +2 -1
- package/dist/modules/History/components/ChangeLine/ChangeLine.d.ts +3 -1
- package/dist/modules/History/components/SaveDetail/SaveDetail.d.ts +2 -1
- package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.d.ts +22 -0
- package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.test.d.ts +1 -0
- package/dist/modules/Keyboard/index.d.ts +4 -0
- package/dist/modules/Keyboard/platform.d.ts +7 -0
- package/dist/modules/Network/hooks/useBuilderNetwork.d.ts +12 -0
- package/dist/modules/Queue/QueueContext.d.ts +2 -5
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/ResourceSnippet.d.ts +13 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/SnippetContent.d.ts +8 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/UnreadableSnippet.d.ts +12 -0
- package/dist/modules/Resources/components/Resource/subTypes/ResourceSnippet/index.d.ts +3 -0
- package/dist/modules/Resources/components/ResourceManager/helpers/isSnippetFile.d.ts +3 -0
- package/dist/modules/Resources/components/ResourceManager/helpers/isSnippetFile.test.d.ts +1 -0
- package/dist/modules/Resources/components/ResourcesCdnBucket/ResourcesCdnBucket.d.ts +1 -1
- package/dist/modules/Runtime/components/RuntimeCodeNote/RuntimeCodeNote.d.ts +1 -4
- package/dist/modules/Space/components/SpaceIssues/SpaceIssues.d.ts +2 -1
- package/dist/modules/Space/components/SpaceIssues/components/ElementChip/ElementChip.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/ElementChip/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueFix/IssueFix.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueFix/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/IssueItem/IssueItem.d.ts +1 -5
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/SuggestionGroup.d.ts +8 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionGroup/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/SuggestionItem.d.ts +12 -0
- package/dist/modules/Space/components/SpaceIssues/components/SuggestionItem/index.d.ts +3 -0
- package/dist/modules/Space/components/SpaceIssues/helpers.d.ts +2 -0
- package/dist/modules/Space/hooks/useSpaceUsage.d.ts +36 -0
- package/dist/modules/Undoable/UndoableContext.d.ts +2 -5
- package/dist/package.json.d.ts +4 -4
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +2803 -2451
- package/dist/plitzi-builder.js.gz +0 -0
- package/dist/plitzi-functions-worker.js +3 -3
- package/package.json +18 -18
- package/dist/modules/AI/components/ChatInput/helpers.d.ts +0 -1
- package/dist/modules/AI/components/ChatMessage/components/AITemplatePreview/components/AITemplateHeader/index.d.ts +0 -3
- package/dist/modules/AI/components/ChatMessage/components/AITemplatePreview/index.d.ts +0 -3
- package/dist/modules/App/AppContainer/containers/ContainerActions.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerConnectors.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerCredentials.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerFunctions.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerRuntime.d.ts +0 -2
- package/dist/modules/App/AppContainer/containers/ContainerVisitors.d.ts +0 -2
- package/dist/modules/App/components/WorkflowDiagram/WorkflowDiagram.d.ts +0 -37
- package/dist/modules/App/components/WorkflowDiagram/components/CustomEdge.d.ts +0 -3
- package/dist/modules/App/components/WorkflowDiagram/components/CustomNode.d.ts +0 -5
- package/dist/modules/App/components/WorkflowDiagram/helpers/schemaToSitemap.d.ts +0 -11
- package/dist/modules/App/components/WorkflowDiagram/helpers/sitemapToFlow.d.ts +0 -20
- package/dist/modules/App/components/WorkflowDiagram/index.d.ts +0 -3
- package/dist/modules/Builder/BuilderPopup.d.ts +0 -6
- package/dist/modules/Builder/Models/TemplateForm.d.ts +0 -16
- package/dist/modules/Functions/components/FunctionsDeclared/FunctionsDeclared.d.ts +0 -10
- package/dist/modules/Functions/components/FunctionsDeclared/index.d.ts +0 -3
- package/dist/modules/Functions/components/FunctionsFiles/FunctionsFiles.d.ts +0 -11
- package/dist/modules/Functions/components/FunctionsFiles/index.d.ts +0 -3
- package/dist/modules/Functions/components/FunctionsTry/FunctionsTry.d.ts +0 -13
- package/dist/modules/Functions/components/FunctionsTry/index.d.ts +0 -3
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/ResourceTemplate.d.ts +0 -13
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/TemplateContent.d.ts +0 -8
- package/dist/modules/Resources/components/Resource/subTypes/ResourceTemplate/index.d.ts +0 -3
- package/dist/modules/Segments/Segment.d.ts +0 -11
- package/dist/modules/Segments/Segments.d.ts +0 -2
- package/dist/modules/Segments/SegmentsContextProvider.d.ts +0 -7
- package/dist/modules/Segments/SegmentsReducer.d.ts +0 -133
- package/dist/modules/Segments/index.d.ts +0 -3
- package/dist/modules/Segments/models/PublishForm.d.ts +0 -19
- package/dist/modules/Segments/models/SegmentForm.d.ts +0 -17
- package/dist/modules/Space/hooks/useAccountUsage.d.ts +0 -60
- package/dist/patches/useSyncExternalStoreWithSelector.d.ts +0 -4
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview/components/AITemplateHeader → AISnippetPreview/components/AISnippetHeader}/DisplayModeButton.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/components/ConfirmPanel/ConfirmPanel.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/components/ConfirmPanel/index.d.ts +0 -0
- /package/dist/modules/AI/components/ChatMessage/components/{AITemplatePreview → AISnippetPreview}/helpers.d.ts +0 -0
- /package/dist/modules/{AI/components → Keyboard}/KeyboardKey/KeyboardKey.d.ts +0 -0
- /package/dist/modules/{AI/components → Keyboard}/KeyboardKey/index.d.ts +0 -0
package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/TimeLimit.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TimeLimitProps = {
|
|
2
|
+
/** The CPU the task runs with now. */
|
|
3
|
+
ms: number;
|
|
4
|
+
/** Whether the task asked for it, or gets the default. */
|
|
5
|
+
asked: boolean;
|
|
6
|
+
/** Why it cannot be changed from here right now — the code is still being read, say — or nothing. */
|
|
7
|
+
disabledReason?: string;
|
|
8
|
+
/** A new limit, or `undefined` to take it out and run with the default. Written into the task's code. */
|
|
9
|
+
onChange: (cpuMs: number | undefined) => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* How much CPU one run of the task may use before it is stopped: a slider and the usual values, written into the task
|
|
13
|
+
* as `limits: { cpuMs }` — the code stays the one place it is said, and the panel follows it when it is typed there.
|
|
14
|
+
*/
|
|
15
|
+
declare const TimeLimit: ({ ms, asked, disabledReason, onChange }: TimeLimitProps) => import('react').JSX.Element;
|
|
16
|
+
export default TimeLimit;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionTaskManifest } from '@plitzi/sdk-shared';
|
|
2
|
+
export type TryFieldProps = {
|
|
3
|
+
name: string;
|
|
4
|
+
param: FunctionTaskManifest['params'][string];
|
|
5
|
+
value: unknown;
|
|
6
|
+
onChange: (name: string, value: unknown) => void;
|
|
7
|
+
};
|
|
8
|
+
/** One param of a task, drawn as its step would draw it: a choice from its options, a switch, or text. */
|
|
9
|
+
declare const TryField: ({ name, param, value, onChange }: TryFieldProps) => import('react').JSX.Element;
|
|
10
|
+
export default TryField;
|
package/dist/modules/Functions/components/FunctionInspector/components/TryResult/TryResult.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionRunReport } from '@plitzi/sdk-shared';
|
|
2
|
+
export type TryResultProps = {
|
|
3
|
+
report: ActionRunReport;
|
|
4
|
+
/** The task that was tried: its step in the report is what it answered. */
|
|
5
|
+
task: string;
|
|
6
|
+
};
|
|
7
|
+
/** What a try answered: how it ended and how long it took, what it logged, and its value — or why it failed. */
|
|
8
|
+
declare const TryResult: ({ report, task }: TryResultProps) => import('react').JSX.Element;
|
|
9
|
+
export default TryResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EditorTarget } from '../../helpers';
|
|
2
|
+
import { Extension } from '@codemirror/state';
|
|
3
|
+
export type FunctionsEditorProps = {
|
|
4
|
+
file: string;
|
|
5
|
+
value: string;
|
|
6
|
+
modified: boolean;
|
|
7
|
+
theme: 'light' | 'dark';
|
|
8
|
+
/** The language service's extensions for this file — none until it is ready. Kept stable by the caller. */
|
|
9
|
+
extensions: Extension[];
|
|
10
|
+
/** Whether the language service is checking the code as it is typed. */
|
|
11
|
+
checking: boolean;
|
|
12
|
+
/** A line to bring into view and put the cursor on: a new `key` asks again, even for the same line. */
|
|
13
|
+
target?: EditorTarget;
|
|
14
|
+
onChange: (code: string) => void;
|
|
15
|
+
/** Where the cursor is when the person moves it: the panel follows it to the task it is in. */
|
|
16
|
+
onCursor: (file: string, offset: number) => void;
|
|
17
|
+
};
|
|
18
|
+
/** The file being edited, under the path it is at — one editor per file, so each keeps its own undo history. */
|
|
19
|
+
declare const FunctionsEditor: ({ file, value, modified, theme, extensions, checking, target, onChange, onCursor }: FunctionsEditorProps) => import('react').JSX.Element;
|
|
20
|
+
export default FunctionsEditor;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type FunctionsGuideProps = {
|
|
2
|
+
/** Whether the code declares any task yet. */
|
|
3
|
+
hasTasks: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** The inspector's place with no task in it: how to get one there. */
|
|
6
|
+
declare const FunctionsGuide: ({ hasTasks }: FunctionsGuideProps) => import('react').JSX.Element;
|
|
7
|
+
export default FunctionsGuide;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SaveState } from '../../helpers';
|
|
2
|
+
export type FunctionsHeaderProps = {
|
|
3
|
+
/** Where the files stand — none for a space with no functions yet. */
|
|
4
|
+
state?: SaveState;
|
|
5
|
+
canSave: boolean;
|
|
6
|
+
isSaving: boolean;
|
|
7
|
+
/** Whether there are changes to discard. */
|
|
8
|
+
canDiscard: boolean;
|
|
9
|
+
/** Whether there is a saved draft to remove. */
|
|
10
|
+
canRemove: boolean;
|
|
11
|
+
onSave: () => void;
|
|
12
|
+
onDiscard: () => void;
|
|
13
|
+
onRemove: () => void;
|
|
14
|
+
};
|
|
15
|
+
/** The panel's name and what it is for, where the files stand, and saving them — the one thing done most. */
|
|
16
|
+
declare const FunctionsHeader: ({ state, canSave, isSaving, canDiscard, canRemove, onSave, onDiscard, onRemove }: FunctionsHeaderProps) => import('react').JSX.Element;
|
|
17
|
+
export default FunctionsHeader;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FunctionsProblem } from '@plitzi/sdk-shared';
|
|
2
2
|
export type FunctionsProblemsProps = {
|
|
3
3
|
problems: FunctionsProblem[];
|
|
4
|
-
|
|
4
|
+
/** Where a problem is, to open: its file, and its line when it has one. */
|
|
5
|
+
onSelect: (file: string, line?: number) => void;
|
|
5
6
|
};
|
|
6
7
|
/** What the last save found wrong, where it is: the build's and the platform's checks, before anything ran. */
|
|
7
8
|
declare const FunctionsProblems: ({ problems, onSelect }: FunctionsProblemsProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NewTask as NewTaskSpec } from '../../editor/source';
|
|
2
|
+
import { ListedRoute, ListedTask } from '../../helpers';
|
|
3
|
+
import { FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
4
|
+
export type FunctionsSidebarProps = {
|
|
5
|
+
tasks: ListedTask[];
|
|
6
|
+
/** What every task gets unless it asks for its own, from `defineFunctions`. */
|
|
7
|
+
sharedLimits?: FunctionTimeLimits;
|
|
8
|
+
selectedTask: string;
|
|
9
|
+
/** Tasks the code builds by calling something: there, but only a save can say what they are. */
|
|
10
|
+
unreadable: number;
|
|
11
|
+
/** Whether a new task can be written for you: the code has been read, and it calls `defineFunctions`. */
|
|
12
|
+
canCreateTask: boolean;
|
|
13
|
+
routes: ListedRoute[];
|
|
14
|
+
files: string[];
|
|
15
|
+
selectedFile: string;
|
|
16
|
+
/** The files whose text differs from what was last saved. */
|
|
17
|
+
modified: string[];
|
|
18
|
+
onSelectTask: (task: string) => void;
|
|
19
|
+
onCreateTask: (task: NewTaskSpec) => void;
|
|
20
|
+
onSelectRoute: (route: string) => void;
|
|
21
|
+
onSelectFile: (file: string) => void;
|
|
22
|
+
onAddFile: (file: string) => void;
|
|
23
|
+
onRemoveFile: (file: string) => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* What the functions are, as the code declares them right now: the tasks a step can run — a click from the code and
|
|
27
|
+
* the inspector — the routes they answer at, and the files they are written in.
|
|
28
|
+
*/
|
|
29
|
+
declare const FunctionsSidebar: ({ tasks, sharedLimits, selectedTask, unreadable, canCreateTask, routes, files, selectedFile, modified, onSelectTask, onCreateTask, onSelectRoute, onSelectFile, onAddFile, onRemoveFile }: FunctionsSidebarProps) => import('react').JSX.Element;
|
|
30
|
+
export default FunctionsSidebar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type FileItemProps = {
|
|
2
|
+
path: string;
|
|
3
|
+
name: string;
|
|
4
|
+
depth: number;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
modified: boolean;
|
|
7
|
+
/** `index.ts` is what everything starts from: it is never removed. */
|
|
8
|
+
removable: boolean;
|
|
9
|
+
onSelect: (file: string) => void;
|
|
10
|
+
onRemove: (file: string) => void;
|
|
11
|
+
};
|
|
12
|
+
/** One file in the list: opened with a click, marked while it has unsaved changes, removed from its own button. */
|
|
13
|
+
declare const FileItem: ({ path, name, depth, selected, modified, removable, onSelect, onRemove }: FileItemProps) => import('react').JSX.Element;
|
|
14
|
+
export default FileItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type NewFileProps = {
|
|
2
|
+
onAdd: (file: string) => void;
|
|
3
|
+
onCancel: () => void;
|
|
4
|
+
};
|
|
5
|
+
/** A new file's name, typed where the list starts: Enter adds it — `lib/feed.ts` makes the folder too — Escape lets it go. */
|
|
6
|
+
declare const NewFile: ({ onAdd, onCancel }: NewFileProps) => import('react').JSX.Element;
|
|
7
|
+
export default NewFile;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NewTask as NewTaskSpec } from '../../../../editor/source';
|
|
2
|
+
export type NewTaskProps = {
|
|
3
|
+
/** The namespace the others use, offered first: a space's tasks usually share one. */
|
|
4
|
+
namespace: string;
|
|
5
|
+
onCreate: (task: NewTaskSpec) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A new task, named where the list is: its namespace and action — what a step calls it, `seismic.feed` — and its title.
|
|
10
|
+
* Written into `defineFunctions` for you, with a `run` to start from.
|
|
11
|
+
*/
|
|
12
|
+
declare const NewTask: ({ namespace: usual, onCreate, onCancel }: NewTaskProps) => import('react').JSX.Element;
|
|
13
|
+
export default NewTask;
|
package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/RouteItem.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type RouteItemProps = {
|
|
2
|
+
routeKey: string;
|
|
3
|
+
method: string;
|
|
4
|
+
path: string;
|
|
5
|
+
onSelect: (route: string) => void;
|
|
6
|
+
};
|
|
7
|
+
/** One route: the method and the address it answers at, a click from where it is written. */
|
|
8
|
+
declare const RouteItem: ({ routeKey, method, path, onSelect }: RouteItemProps) => import('react').JSX.Element;
|
|
9
|
+
export default RouteItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type SidebarSectionProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
/** How many there are, beside the title — none for a section that is not a list. */
|
|
5
|
+
count?: number;
|
|
6
|
+
/** What its one button does, in words: its tooltip and its accessible name. */
|
|
7
|
+
actionTitle?: string;
|
|
8
|
+
onAction?: () => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/** One part of the sidebar: its title and how many it holds, the button that adds one, and the list. */
|
|
12
|
+
declare const SidebarSection: ({ title, count, actionTitle, onAction, children }: SidebarSectionProps) => import('react').JSX.Element;
|
|
13
|
+
export default SidebarSection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TaskItemProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
title: string;
|
|
4
|
+
/** The CPU it runs with, and whether it asked for it or gets the default. */
|
|
5
|
+
cpu: {
|
|
6
|
+
ms: number;
|
|
7
|
+
asked: boolean;
|
|
8
|
+
};
|
|
9
|
+
selected: boolean;
|
|
10
|
+
/** Written, but not in the saved draft yet: nothing can run it until it is saved. */
|
|
11
|
+
unsaved: boolean;
|
|
12
|
+
onSelect: (task: string) => void;
|
|
13
|
+
};
|
|
14
|
+
/** One task in the list: its title and its step's name, the time it asked for, and whether a save has it yet. */
|
|
15
|
+
declare const TaskItem: ({ name, title, cpu, selected, unsaved, onSelect }: TaskItemProps) => import('react').JSX.Element;
|
|
16
|
+
export default TaskItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type FunctionsWelcomeProps = {
|
|
2
|
+
onStart: () => void;
|
|
3
|
+
};
|
|
4
|
+
/** A space with no functions yet: what they are for, and one written already to change rather than a blank file. */
|
|
5
|
+
declare const FunctionsWelcome: ({ onStart }: FunctionsWelcomeProps) => import('react').JSX.Element;
|
|
6
|
+
export default FunctionsWelcome;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the worker keeps the space's files. Its own module, with nothing imported: the panel needs these paths, and
|
|
3
|
+
* `source.ts` beside them brings the TypeScript compiler, which belongs to the worker alone — imported from the panel it
|
|
4
|
+
* landed in the builder's bundle, and broke rendering the builder on the server.
|
|
5
|
+
*/
|
|
6
|
+
/** The root the worker keeps the space's files under — `/functions/lib/feed.ts` is `lib/feed.ts` to the panel. */
|
|
7
|
+
export declare const FUNCTIONS_ROOT = "/functions/";
|
|
8
|
+
/** Where a file of the space's functions lives in the worker. */
|
|
9
|
+
export declare const workerPathOf: (file: string) => string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FunctionTaskManifest, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
2
|
+
import { VirtualTypeScriptEnvironment } from '@typescript/vfs';
|
|
3
|
+
/**
|
|
4
|
+
* The space's functions as their SOURCE declares them, read while they are written — what the panel lists and edits
|
|
5
|
+
* before anything is saved. Static: the object literals `defineFunctions` is handed, followed through the constants and
|
|
6
|
+
* the files they come from; nothing is run. What cannot be read that way (a task built by a function call) is said, not
|
|
7
|
+
* guessed. Saving still asks the platform, which runs the bundle and is the one that decides.
|
|
8
|
+
*/
|
|
9
|
+
/** Where something is written: the file — as the panel names it, `lib/feed.ts` — and its place in it. */
|
|
10
|
+
/** Where something is written: its file, the line it starts on, and the offsets it spans there. */
|
|
11
|
+
export type SourcePlace = {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
export type SourceTask = Pick<FunctionTaskManifest, 'namespace' | 'action' | 'title' | 'description' | 'params'> & {
|
|
18
|
+
limits?: FunctionTimeLimits;
|
|
19
|
+
at: SourcePlace;
|
|
20
|
+
};
|
|
21
|
+
export type SourceRoute = {
|
|
22
|
+
key: string;
|
|
23
|
+
at: SourcePlace;
|
|
24
|
+
};
|
|
25
|
+
export type SourceFunctions = {
|
|
26
|
+
/** `index.ts` exports `defineFunctions(…)` — without it there is nothing declared to read. */
|
|
27
|
+
defined: boolean;
|
|
28
|
+
tasks: SourceTask[];
|
|
29
|
+
routes: SourceRoute[];
|
|
30
|
+
hosts: string[];
|
|
31
|
+
/** What every task and route asks for, unless one asks for its own. */
|
|
32
|
+
limits?: FunctionTimeLimits;
|
|
33
|
+
/** Entries that are there but cannot be read without running the code: what to look at, and where. */
|
|
34
|
+
unreadable: {
|
|
35
|
+
what: string;
|
|
36
|
+
at: SourcePlace;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
export declare const describeSource: (env: VirtualTypeScriptEnvironment) => SourceFunctions;
|
|
40
|
+
/** A file of the space's, written again: what a panel puts back in its files. */
|
|
41
|
+
export type SourceEdit = {
|
|
42
|
+
file: string;
|
|
43
|
+
code: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The task written at `place`, asking for `limits` — written into its own `limits`, or that taken out when it asks for
|
|
47
|
+
* nothing. Its other properties, comments and formatting are left as they are: the edit is the one property.
|
|
48
|
+
*/
|
|
49
|
+
export declare const withTaskLimits: (env: VirtualTypeScriptEnvironment, place: SourcePlace, limits: FunctionTimeLimits) => SourceEdit | undefined;
|
|
50
|
+
/** A new task, as `New task` writes it: what it is called, and a `run` that answers with something to see. */
|
|
51
|
+
export type NewTask = {
|
|
52
|
+
namespace: string;
|
|
53
|
+
action: string;
|
|
54
|
+
title: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* `index.ts` with a new task at the end of the list `defineFunctions` is handed — a list started for it when there is
|
|
58
|
+
* none. What it adds is answered too, so the panel can open it where it was written.
|
|
59
|
+
*/
|
|
60
|
+
export declare const withNewTask: (env: VirtualTypeScriptEnvironment, task: NewTask) => SourceEdit | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1,27 @@
|
|
|
1
|
+
import { NewTask, SourcePlace } from './source';
|
|
2
|
+
import { FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
3
|
+
declare const functionsWorker: {
|
|
4
|
+
describe: () => import('./source').SourceFunctions;
|
|
5
|
+
setTaskLimits: (place: SourcePlace, limits: FunctionTimeLimits) => import('./source').SourceEdit | undefined;
|
|
6
|
+
addTask: (task: NewTask) => import('./source').SourceEdit | undefined;
|
|
7
|
+
initialize(): Promise<void>;
|
|
8
|
+
updateFile({ path, code }: {
|
|
9
|
+
path: string;
|
|
10
|
+
code: string;
|
|
11
|
+
}): void;
|
|
12
|
+
getLints({ path, diagnosticCodesToIgnore, }: {
|
|
13
|
+
path: string;
|
|
14
|
+
diagnosticCodesToIgnore: number[];
|
|
15
|
+
}): import('@codemirror/lint').Diagnostic[];
|
|
16
|
+
getAutocompletion({ path, context, }: {
|
|
17
|
+
path: string;
|
|
18
|
+
context: Pick<import('@codemirror/autocomplete').CompletionContext, "pos" | "explicit">;
|
|
19
|
+
}): Promise<import('@codemirror/autocomplete').CompletionResult | null> | null;
|
|
20
|
+
getHover({ path, pos }: {
|
|
21
|
+
path: string;
|
|
22
|
+
pos: number;
|
|
23
|
+
}): import('@valtown/codemirror-ts').HoverInfo | null | undefined;
|
|
24
|
+
getEnv(): import('@typescript/vfs').VirtualTypeScriptEnvironment;
|
|
25
|
+
};
|
|
26
|
+
export type FunctionsWorker = typeof functionsWorker;
|
|
1
27
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { NewTask, SourceEdit, SourceFunctions, SourcePlace } from './source';
|
|
1
2
|
import { Extension } from '@codemirror/state';
|
|
2
|
-
|
|
3
|
-
export declare const workerPathOf: (file: string) => string;
|
|
3
|
+
import { FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
4
4
|
/**
|
|
5
5
|
* The TypeScript worker for one open panel: started from where the host serves it, given every file of the space so
|
|
6
6
|
* their imports of each other resolve, and turned into the editor extensions for the file being edited. Without a
|
|
@@ -9,5 +9,8 @@ export declare const workerPathOf: (file: string) => string;
|
|
|
9
9
|
declare const useFunctionsTypeScript: (workerUrl: string, files: Record<string, string>) => {
|
|
10
10
|
ready: boolean;
|
|
11
11
|
extensionsFor: (file: string) => Extension[];
|
|
12
|
+
source: SourceFunctions | undefined;
|
|
13
|
+
setTaskLimits: (place: SourcePlace, limits: FunctionTimeLimits) => Promise<SourceEdit | undefined>;
|
|
14
|
+
addTask: (task: NewTask) => Promise<SourceEdit | undefined>;
|
|
12
15
|
};
|
|
13
16
|
export default useFunctionsTypeScript;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SourceFunctions, SourcePlace, SourceRoute } from './editor/source';
|
|
2
|
+
import { Text } from '@codemirror/state';
|
|
3
|
+
import { FunctionsManifest, FunctionsProblem, FunctionTaskManifest, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
2
4
|
/** What a space's functions start as: one file and one task already written, to change rather than to learn from blank. */
|
|
3
5
|
export declare const STARTER_FILES: Record<string, string>;
|
|
4
6
|
/** Where a problem is, as a person reads it: `lib/feed.ts:12:4`. */
|
|
@@ -9,3 +11,119 @@ export declare const readParams: (text: string) => {
|
|
|
9
11
|
} | {
|
|
10
12
|
error: string;
|
|
11
13
|
};
|
|
14
|
+
/** A task's name, as a step addresses it: `seismic.feed`. */
|
|
15
|
+
export declare const taskNameOf: (task: Pick<FunctionTaskManifest, "namespace" | "action">) => string;
|
|
16
|
+
/** What a Try starts from: each param at the value the task declared for it — what a new step would start from. */
|
|
17
|
+
export declare const paramDefaults: (task: FunctionTaskManifest | undefined) => Record<string, unknown>;
|
|
18
|
+
/** A route key, read for showing: its method, and the address it answers at under `prefix`. */
|
|
19
|
+
export declare const routeParts: (route: string, prefix: string) => {
|
|
20
|
+
method: string;
|
|
21
|
+
path: string;
|
|
22
|
+
};
|
|
23
|
+
/** How far a file or a folder is indented for each folder it is in, in pixels. */
|
|
24
|
+
export declare const FILE_INDENT_PX = 12;
|
|
25
|
+
/** A new file's name as typed, made a file's: trimmed, and a TypeScript one when it says nothing else. */
|
|
26
|
+
export declare const newFileName: (typed: string) => string;
|
|
27
|
+
/** One row of the file list: a folder, or a file under the folders before it. */
|
|
28
|
+
export type FileRow = {
|
|
29
|
+
kind: 'folder';
|
|
30
|
+
path: string;
|
|
31
|
+
depth: number;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'file';
|
|
34
|
+
path: string;
|
|
35
|
+
name: string;
|
|
36
|
+
depth: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The files as a tree reads, top to bottom: each folder once, before what is in it, and every name indented by how
|
|
40
|
+
* deep it is — `index.ts` first, as the file everything starts from.
|
|
41
|
+
*/
|
|
42
|
+
export declare const fileRows: (files: readonly string[]) => FileRow[];
|
|
43
|
+
/** A param's value as a field shows it: text as it is, a number as its digits, anything else as nothing. */
|
|
44
|
+
export declare const fieldText: (value: unknown) => string;
|
|
45
|
+
/** Whether a key press is "save": ⌘S on a Mac, Ctrl+S elsewhere. */
|
|
46
|
+
export declare const isSaveKey: (event: KeyboardEvent) => boolean;
|
|
47
|
+
/** Where the files stand, in a few words and a tone: what the header shows. */
|
|
48
|
+
export type SaveState = {
|
|
49
|
+
label: string;
|
|
50
|
+
tone: 'unsaved' | 'problems' | 'saved';
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Where the files stand: what the last save found wrong, changes not saved yet — in how many files — or saved, which is
|
|
54
|
+
* what the builder runs. Nothing for a space with no functions.
|
|
55
|
+
*/
|
|
56
|
+
export declare const saveState: (modified: number, problems: number, saved: boolean) => SaveState | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The CPU a task may ask for from the panel, in milliseconds: from the default an invocation gets to a second, in steps
|
|
59
|
+
* a person can tell apart. More than that is asked for in the code, up to what the server allows.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TIME_LIMIT: {
|
|
62
|
+
readonly min: 100;
|
|
63
|
+
readonly max: 1000;
|
|
64
|
+
readonly step: 50;
|
|
65
|
+
readonly presets: readonly [100, 250, 500, 1000];
|
|
66
|
+
};
|
|
67
|
+
/** A task as the panel lists it: what the source declares right now, where, and whether a save has it yet. */
|
|
68
|
+
export type ListedTask = FunctionTaskManifest & {
|
|
69
|
+
limits?: FunctionTimeLimits;
|
|
70
|
+
/** Where it is written — none while the source has not been read, when the saved list is all there is. */
|
|
71
|
+
at?: SourcePlace;
|
|
72
|
+
/** In the saved draft too: what Try can run. A task only written so far is run once it is saved. */
|
|
73
|
+
saved: boolean;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The tasks to list: what the source declares as it is written — so the list follows the code — or, until the source
|
|
77
|
+
* has been read, what the last save declared.
|
|
78
|
+
*/
|
|
79
|
+
export declare const listedTasks: (source: SourceFunctions | undefined, manifest: FunctionsManifest | null) => ListedTask[];
|
|
80
|
+
/** A time as the panel says it: milliseconds under a second, seconds from one. */
|
|
81
|
+
export declare const timeLabel: (ms: number) => string;
|
|
82
|
+
/** What a new task is called as a step: lowercase words joined by dashes — `seismic`, `feed-week`. */
|
|
83
|
+
export declare const isTaskWord: (value: string) => boolean;
|
|
84
|
+
/** A step's title from its action, until somebody writes one: `feed-week` reads `Feed week`. */
|
|
85
|
+
export declare const titleFromAction: (action: string) => string;
|
|
86
|
+
/** A route as the panel lists it: its key, and where it is written once the source has been read. */
|
|
87
|
+
export type ListedRoute = Pick<SourceRoute, 'key'> & {
|
|
88
|
+
at?: SourcePlace;
|
|
89
|
+
};
|
|
90
|
+
/** The routes to list: the source's as written, or — until it has been read — the last save's. */
|
|
91
|
+
export declare const listedRoutes: (source: SourceFunctions | undefined, manifest: FunctionsManifest | null) => ListedRoute[];
|
|
92
|
+
/** The hosts `ctx.fetch` may reach: the source's as written, or the last save's until it has been read. */
|
|
93
|
+
export declare const listedHosts: (source: SourceFunctions | undefined, manifest: FunctionsManifest | null) => string[];
|
|
94
|
+
/** The namespace a new task is offered: the one the tasks already share, the first one's, or none. */
|
|
95
|
+
export declare const usualNamespace: (tasks: readonly ListedTask[]) => string;
|
|
96
|
+
/**
|
|
97
|
+
* The CPU a task runs with, and whether it chose it: its own `limits.cpuMs`, else the one every task of the space gets
|
|
98
|
+
* from `defineFunctions`, else the server's default.
|
|
99
|
+
*/
|
|
100
|
+
export declare const cpuOf: (task: ListedTask, shared: FunctionTimeLimits | undefined) => {
|
|
101
|
+
ms: number;
|
|
102
|
+
asked: boolean;
|
|
103
|
+
};
|
|
104
|
+
/** What the run button says: running, or whether it saves first. */
|
|
105
|
+
export declare const runLabel: (isRunning: boolean, needsSave: boolean) => string;
|
|
106
|
+
/** A place to bring the editor to: a file's line, asked for again whenever `key` changes. */
|
|
107
|
+
export type EditorTarget = {
|
|
108
|
+
file: string;
|
|
109
|
+
line: number;
|
|
110
|
+
key: number;
|
|
111
|
+
/** Whether the editor takes the keyboard too — not when the change came from a control the person is still on. */
|
|
112
|
+
focus: boolean;
|
|
113
|
+
};
|
|
114
|
+
/** Where a line starts and ends in a document, for line numbers that may run past its end. */
|
|
115
|
+
export declare const lineRange: (doc: Text, line: number) => {
|
|
116
|
+
from: number;
|
|
117
|
+
to: number;
|
|
118
|
+
};
|
|
119
|
+
/** A task's time limits with its CPU set — or taken out, to run with the default — and the rest as they were. */
|
|
120
|
+
export declare const withCpu: (limits: FunctionTimeLimits | undefined, cpuMs: number | undefined) => FunctionTimeLimits;
|
|
121
|
+
/** Why the panel cannot write a task's limits for you right now, or nothing when it can. */
|
|
122
|
+
export declare const limitsBlockedBy: (ready: boolean, task: ListedTask) => string;
|
|
123
|
+
/** The task written around an offset of a file — the one the cursor is in — or none. */
|
|
124
|
+
export declare const taskAt: (tasks: readonly ListedTask[], file: string, offset: number) => ListedTask | undefined;
|
|
125
|
+
/** The editor filling the space it is given, so CodeMirror scrolls its own lines and keeps its gutter in place. */
|
|
126
|
+
export declare const EDITOR_CLASS_NAME: {
|
|
127
|
+
root: string;
|
|
128
|
+
inputContainer: string;
|
|
129
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export type HistoryProps = {
|
|
2
|
+
/** Closes the dialog the history is read in, once a line has taken the author to its element. */
|
|
3
|
+
onDismiss: () => void;
|
|
4
|
+
};
|
|
1
5
|
/**
|
|
2
6
|
* The space's change history: every save of its schema and style, by whoever made it — a person, an agent, the
|
|
3
7
|
* autofix — newest first, with the published revisions marked where they fall. Read-only: it answers "what changed,
|
|
4
8
|
* who did it and what exactly", and never writes anything back.
|
|
5
9
|
*/
|
|
6
|
-
declare const History: () => import('react').JSX.Element;
|
|
10
|
+
declare const History: ({ onDismiss }: HistoryProps) => import('react').JSX.Element;
|
|
7
11
|
export default History;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ChangeGroup as Group } from '../../helpers';
|
|
2
2
|
export type ChangeGroupProps = {
|
|
3
3
|
group: Group;
|
|
4
|
+
onDismiss: () => void;
|
|
4
5
|
};
|
|
5
6
|
/**
|
|
6
7
|
* A row of the timeline: who, from where and when, and what it did — one line per thing. Unfolded, every save it groups
|
|
7
8
|
* on its own, with the fields each one changed.
|
|
8
9
|
*/
|
|
9
|
-
declare const ChangeGroup: ({ group }: ChangeGroupProps) => import('react').JSX.Element;
|
|
10
|
+
declare const ChangeGroup: ({ group, onDismiss }: ChangeGroupProps) => import('react').JSX.Element;
|
|
10
11
|
export default ChangeGroup;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ChangeLine as Line } from '@plitzi/sdk-shared/history';
|
|
2
2
|
export type ChangeLineProps = {
|
|
3
3
|
line: Line;
|
|
4
|
+
/** Makes way for the element once it is on screen: the history is read in a dialog over it. */
|
|
5
|
+
onDismiss: () => void;
|
|
4
6
|
};
|
|
5
7
|
/**
|
|
6
8
|
* One thing a save did. When it is about an element that is still in the space, the line is the way to it — the same
|
|
7
9
|
* way the problems list takes someone to an element.
|
|
8
10
|
*/
|
|
9
|
-
declare const ChangeLine: ({ line }: ChangeLineProps) => import('react').JSX.Element;
|
|
11
|
+
declare const ChangeLine: ({ line, onDismiss }: ChangeLineProps) => import('react').JSX.Element;
|
|
10
12
|
export default ChangeLine;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ChangeRecord } from '../../helpers';
|
|
2
2
|
export type SaveDetailProps = {
|
|
3
3
|
change: ChangeRecord;
|
|
4
|
+
onDismiss: () => void;
|
|
4
5
|
};
|
|
5
6
|
/** One save of a row: its number and time in a narrow column, what it did beside it, and the fields each edit changed. */
|
|
6
|
-
declare const SaveDetail: ({ change }: SaveDetailProps) => import('react').JSX.Element;
|
|
7
|
+
declare const SaveDetail: ({ change, onDismiss }: SaveDetailProps) => import('react').JSX.Element;
|
|
7
8
|
export default SaveDetail;
|