@plitzi/plitzi-builder 0.37.7 → 0.37.9

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +277 -0
  2. package/dist/index.html +2 -2
  3. package/dist/modules/App/components/AppHeader/QuotaBreakdown.d.ts +7 -6
  4. package/dist/modules/App/components/VersionContents/PluginList.d.ts +7 -0
  5. package/dist/modules/App/components/VersionContents/VersionContents.d.ts +14 -0
  6. package/dist/modules/App/components/VersionContents/helpers.d.ts +8 -0
  7. package/dist/modules/App/components/VersionContents/helpers.test.d.ts +1 -0
  8. package/dist/modules/App/components/VersionContents/index.d.ts +2 -0
  9. package/dist/modules/App/components/VersionContents/useVersionContents.d.ts +8 -0
  10. package/dist/modules/Builder/BuilderProvider.d.ts +1 -1
  11. package/dist/modules/Components/Components.d.ts +6 -0
  12. package/dist/modules/Components/components/ComponentBanner/ComponentBanner.d.ts +7 -0
  13. package/dist/modules/Components/components/ComponentBanner/index.d.ts +1 -0
  14. package/dist/modules/Components/components/ComponentForm/ComponentForm.d.ts +19 -0
  15. package/dist/modules/Components/components/ComponentForm/SlotChoice.d.ts +8 -0
  16. package/dist/modules/Components/components/ComponentForm/index.d.ts +1 -0
  17. package/dist/modules/Components/components/ComponentItem/ComponentItem.d.ts +12 -0
  18. package/dist/modules/Components/components/ComponentItem/index.d.ts +1 -0
  19. package/dist/modules/Components/components/InstanceTools/InstanceTools.d.ts +10 -0
  20. package/dist/modules/Components/components/InstanceTools/SlotRow.d.ts +13 -0
  21. package/dist/modules/Components/components/InstanceTools/index.d.ts +1 -0
  22. package/dist/modules/Components/components/PropsEditor/PropRow.d.ts +14 -0
  23. package/dist/modules/Components/components/PropsEditor/PropsEditor.d.ts +11 -0
  24. package/dist/modules/Components/components/PropsEditor/index.d.ts +2 -0
  25. package/dist/modules/Components/helpers.d.ts +17 -0
  26. package/dist/modules/Components/helpers.test.d.ts +1 -0
  27. package/dist/modules/Components/index.d.ts +2 -0
  28. package/dist/modules/Components/slotChoices.d.ts +9 -0
  29. package/dist/modules/Components/useOpenComponent.d.ts +13 -0
  30. package/dist/modules/Components/useSaveAsComponent.d.ts +7 -0
  31. package/dist/modules/Elements/ElementHelper.d.ts +3 -2
  32. package/dist/modules/Elements/hooks/useDragElement.d.ts +3 -2
  33. package/dist/modules/Functions/Functions.d.ts +4 -3
  34. package/dist/modules/Functions/components/FunctionInspector/FunctionInspector.d.ts +20 -0
  35. package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/InspectorSection.d.ts +10 -0
  36. package/dist/modules/Functions/components/FunctionInspector/components/InspectorSection/index.d.ts +3 -0
  37. package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/TaskTest.d.ts +16 -0
  38. package/dist/modules/Functions/components/FunctionInspector/components/TaskTest/index.d.ts +3 -0
  39. package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/TimeLimit.d.ts +16 -0
  40. package/dist/modules/Functions/components/FunctionInspector/components/TimeLimit/index.d.ts +3 -0
  41. package/dist/modules/Functions/components/FunctionInspector/components/TryField/TryField.d.ts +10 -0
  42. package/dist/modules/Functions/components/FunctionInspector/components/TryField/index.d.ts +3 -0
  43. package/dist/modules/Functions/components/FunctionInspector/components/TryResult/TryResult.d.ts +9 -0
  44. package/dist/modules/Functions/components/FunctionInspector/components/TryResult/index.d.ts +3 -0
  45. package/dist/modules/Functions/components/FunctionInspector/index.d.ts +3 -0
  46. package/dist/modules/Functions/components/FunctionsEditor/FunctionsEditor.d.ts +20 -0
  47. package/dist/modules/Functions/components/FunctionsEditor/index.d.ts +3 -0
  48. package/dist/modules/Functions/components/FunctionsGuide/FunctionsGuide.d.ts +7 -0
  49. package/dist/modules/Functions/components/FunctionsGuide/index.d.ts +3 -0
  50. package/dist/modules/Functions/components/FunctionsHeader/FunctionsHeader.d.ts +17 -0
  51. package/dist/modules/Functions/components/FunctionsHeader/index.d.ts +3 -0
  52. package/dist/modules/Functions/components/FunctionsProblems/FunctionsProblems.d.ts +2 -1
  53. package/dist/modules/Functions/components/FunctionsSidebar/FunctionsSidebar.d.ts +30 -0
  54. package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/FileItem.d.ts +14 -0
  55. package/dist/modules/Functions/components/FunctionsSidebar/components/FileItem/index.d.ts +3 -0
  56. package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/FolderItem.d.ts +7 -0
  57. package/dist/modules/Functions/components/FunctionsSidebar/components/FolderItem/index.d.ts +3 -0
  58. package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/NewFile.d.ts +7 -0
  59. package/dist/modules/Functions/components/FunctionsSidebar/components/NewFile/index.d.ts +3 -0
  60. package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/NewTask.d.ts +13 -0
  61. package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/index.d.ts +3 -0
  62. package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/RouteItem.d.ts +9 -0
  63. package/dist/modules/Functions/components/FunctionsSidebar/components/RouteItem/index.d.ts +3 -0
  64. package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/SidebarSection.d.ts +13 -0
  65. package/dist/modules/Functions/components/FunctionsSidebar/components/SidebarSection/index.d.ts +3 -0
  66. package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/TaskItem.d.ts +16 -0
  67. package/dist/modules/Functions/components/FunctionsSidebar/components/TaskItem/index.d.ts +3 -0
  68. package/dist/modules/Functions/components/FunctionsSidebar/index.d.ts +3 -0
  69. package/dist/modules/Functions/components/FunctionsWelcome/FunctionsWelcome.d.ts +6 -0
  70. package/dist/modules/Functions/components/FunctionsWelcome/index.d.ts +3 -0
  71. package/dist/modules/Functions/editor/paths.d.ts +9 -0
  72. package/dist/modules/Functions/editor/source.d.ts +60 -0
  73. package/dist/modules/Functions/editor/source.test.d.ts +1 -0
  74. package/dist/modules/Functions/editor/typescriptWorker.d.ts +26 -0
  75. package/dist/modules/Functions/editor/useFunctionsTypeScript.d.ts +5 -2
  76. package/dist/modules/Functions/helpers.d.ts +119 -1
  77. package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.d.ts +22 -0
  78. package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.test.d.ts +1 -0
  79. package/dist/modules/Queue/QueueContext.d.ts +2 -5
  80. package/dist/modules/Space/hooks/useSpaceUsage.d.ts +36 -0
  81. package/dist/modules/Undoable/UndoableContext.d.ts +2 -5
  82. package/dist/package.json.d.ts +4 -3
  83. package/dist/plitzi-builder.css +1 -1
  84. package/dist/plitzi-builder.css.gz +0 -0
  85. package/dist/plitzi-builder.js +1564 -1519
  86. package/dist/plitzi-builder.js.gz +0 -0
  87. package/dist/plitzi-functions-worker.js +3 -3
  88. package/package.json +18 -17
  89. package/dist/modules/Builder/BuilderPopup.d.ts +0 -6
  90. package/dist/modules/Functions/components/FunctionsDeclared/FunctionsDeclared.d.ts +0 -10
  91. package/dist/modules/Functions/components/FunctionsDeclared/index.d.ts +0 -3
  92. package/dist/modules/Functions/components/FunctionsFiles/FunctionsFiles.d.ts +0 -11
  93. package/dist/modules/Functions/components/FunctionsFiles/index.d.ts +0 -3
  94. package/dist/modules/Functions/components/FunctionsTry/FunctionsTry.d.ts +0 -13
  95. package/dist/modules/Functions/components/FunctionsTry/index.d.ts +0 -3
  96. package/dist/modules/Segments/Segment.d.ts +0 -11
  97. package/dist/modules/Segments/Segments.d.ts +0 -2
  98. package/dist/modules/Segments/SegmentsContextProvider.d.ts +0 -7
  99. package/dist/modules/Segments/SegmentsReducer.d.ts +0 -133
  100. package/dist/modules/Segments/index.d.ts +0 -3
  101. package/dist/modules/Segments/models/PublishForm.d.ts +0 -19
  102. package/dist/modules/Segments/models/SegmentForm.d.ts +0 -17
  103. package/dist/modules/Space/hooks/useAccountUsage.d.ts +0 -60
@@ -0,0 +1,22 @@
1
+ import { Option, OptionGroup } from '@plitzi/plitzi-ui/Select2';
2
+ import { InteractionCallback, InteractionCallbackType } from '@plitzi/sdk-shared';
3
+ /** One step the picker offers, with what it takes to find its definition again once picked. */
4
+ export type NodeOption = Exclude<Option, OptionGroup> & {
5
+ type: InteractionCallbackType;
6
+ elementId?: string;
7
+ };
8
+ /** A heading of the picker and the steps under it — all of one type, though one type may have several headings. */
9
+ export type NodeOptionGroup = {
10
+ type: InteractionCallbackType;
11
+ label: string;
12
+ options: NodeOption[];
13
+ };
14
+ /** A step's value in the picker: `${elementId}_${action}`, an empty segment for a step on no element. */
15
+ export declare const nodeOptionValue: (definition: Pick<InteractionCallback, "elementId" | "action">) => string;
16
+ /**
17
+ * Every step but the triggers, under its heading: its own `group` when it has one — a space's functions are tasks to
18
+ * the run, and a category of their own to whoever picks one — or its type's.
19
+ */
20
+ export declare const nodeOptionGroups: (definitions: readonly InteractionCallback[]) => NodeOptionGroup[];
21
+ /** The option a node is set to, looked for under every heading of its type. */
22
+ export declare const selectedNodeOption: (groups: readonly NodeOptionGroup[], type: InteractionCallbackType, elementId: string, action: string) => NodeOption | undefined;
@@ -1,8 +1,7 @@
1
1
  import { ReducerMiddlewareCallback } from '@plitzi/plitzi-ui/hooks/useReducerWithMiddleware';
2
2
  import { SchemaReducerActions } from '@plitzi/sdk-schema/SchemaReducer';
3
- import { Schema, Segment, Style } from '@plitzi/sdk-shared';
3
+ import { Schema, Style } from '@plitzi/sdk-shared';
4
4
  import { StyleReducerActions } from '@plitzi/sdk-style/StyleReducer';
5
- import { SegmentsReducerActions } from '../Segments/SegmentsReducer';
6
5
  import { ActionDispatch } from 'react';
7
6
  export type QueueItem<TState = any, TDispatchAction = any> = {
8
7
  action: TDispatchAction;
@@ -11,9 +10,7 @@ export type QueueItem<TState = any, TDispatchAction = any> = {
11
10
  dispatch: ActionDispatch<[action: TDispatchAction]>;
12
11
  };
13
12
  export type QueueContextValue = {
14
- enqueueMiddleware: ReducerMiddlewareCallback<Schema | Style | Record<string, Segment>, [
15
- action: StyleReducerActions | SchemaReducerActions | SegmentsReducerActions
16
- ]>;
13
+ enqueueMiddleware: ReducerMiddlewareCallback<Schema | Style, [action: StyleReducerActions | SchemaReducerActions]>;
17
14
  };
18
15
  declare const QueueContext: import('react').Context<QueueContextValue>;
19
16
  export default QueueContext;
@@ -0,0 +1,36 @@
1
+ /** One page of the space and what it spent of the allowance this period. */
2
+ export interface UsagePage {
3
+ path: string;
4
+ views: number;
5
+ }
6
+ /** Where this space's page views went this period, as `/spaces/:spaceId/usage` answers it. */
7
+ export interface SpaceUsage {
8
+ planName: string;
9
+ periodEndsAt: string;
10
+ /** What this space spent; none where its plan sets no ceiling of its own. */
11
+ space: {
12
+ views: number;
13
+ } | null;
14
+ /** The heaviest pages, by page views. */
15
+ pages: UsagePage[];
16
+ /**
17
+ * What the page rows add up to, which is not the same as the space's views: an RSC refresh and a server action are
18
+ * charged to the space and answered at their own endpoints, so they belong to no page.
19
+ */
20
+ pagesTotal: number;
21
+ }
22
+ /**
23
+ * Where the allowance of the space being edited went, page by page — and only that space's: whoever edits a space is
24
+ * asking about that one, and may be a guest with no business reading the rest of its workspace.
25
+ *
26
+ * The ceilings themselves come over GraphQL (`SpaceQuota`) and are what the header meter is made of. This is the other
27
+ * half of the answer, asked for only while the panel showing it is mounted. It reads the API role, where the endpoint
28
+ * lives; the builder's user token rides in the header every other call uses. Fetched once per panel: these are period
29
+ * totals, not something that moves while somebody reads them.
30
+ */
31
+ declare const useSpaceUsage: (spaceId: number) => {
32
+ usage: SpaceUsage | undefined;
33
+ error: string | undefined;
34
+ loading: boolean;
35
+ };
36
+ export default useSpaceUsage;
@@ -1,9 +1,8 @@
1
1
  import { UndoableReducerActions } from './UndoableReducer';
2
2
  import { ReducerMiddlewareCallback } from '@plitzi/plitzi-ui/hooks/useReducerWithMiddleware';
3
3
  import { SchemaReducerActions } from '@plitzi/sdk-schema/SchemaReducer';
4
- import { Schema, Segment, Style } from '@plitzi/sdk-shared';
4
+ import { Schema, Style } from '@plitzi/sdk-shared';
5
5
  import { StyleReducerActions } from '@plitzi/sdk-style/StyleReducer';
6
- import { SegmentsReducerActions } from '../Segments/SegmentsReducer';
7
6
  import { ActionDispatch } from 'react';
8
7
  export type UndoableItem<TState = any, TDispatchAction = any> = {
9
8
  action: TDispatchAction;
@@ -19,9 +18,7 @@ export type UndoableContextValue = {
19
18
  undoableUndo: () => void;
20
19
  undoableRedo: () => void;
21
20
  undoableClearHistory: () => void;
22
- undoableMiddleware: ReducerMiddlewareCallback<Schema | Style | Record<string, Segment>, [
23
- action: StyleReducerActions | SchemaReducerActions | SegmentsReducerActions
24
- ]>;
21
+ undoableMiddleware: ReducerMiddlewareCallback<Schema | Style, [action: StyleReducerActions | SchemaReducerActions]>;
25
22
  };
26
23
  declare const UndoableContext: import('react').Context<UndoableContextValue>;
27
24
  export default UndoableContext;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@plitzi/plitzi-builder",
3
- "version": "0.37.7",
3
+ "version": "0.37.9",
4
4
  "homepage": "./",
5
5
  "license": "AGPL-3.0",
6
6
  "files": [
@@ -30,10 +30,11 @@ declare const _default: {
30
30
  "@codemirror/autocomplete": "^6",
31
31
  "@codemirror/lint": "^6",
32
32
  "@codemirror/state": "^6",
33
+ "@codemirror/view": "^6",
33
34
  "@fortawesome/fontawesome-free": "^7.3.1",
34
- "@plitzi/nexus": "^1.3.1",
35
+ "@plitzi/nexus": "^1.4.0",
35
36
  "@plitzi/plitzi-sdk": "workspace:*",
36
- "@plitzi/plitzi-ui": "^1.6.24",
37
+ "@plitzi/plitzi-ui": "^1.6.26",
37
38
  "@plitzi/sdk-auth": "workspace:*",
38
39
  "@plitzi/sdk-authoring": "workspace:*",
39
40
  "@plitzi/sdk-dev-tools": "workspace:*",