@weasel-js/prefs-editor 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +29 -2
  3. package/dist/PrefConditionEditor/ConditionClipboard.d.ts +12 -0
  4. package/dist/PrefConditionEditor/ConditionClipboard.d.ts.map +1 -0
  5. package/dist/PrefConditionEditor/ConditionGroupRows.d.ts +20 -0
  6. package/dist/PrefConditionEditor/ConditionGroupRows.d.ts.map +1 -0
  7. package/dist/PrefConditionEditor/ConditionRow.d.ts +37 -0
  8. package/dist/PrefConditionEditor/ConditionRow.d.ts.map +1 -0
  9. package/dist/PrefConditionEditor/PrefConditionEditor.d.ts +52 -0
  10. package/dist/PrefConditionEditor/PrefConditionEditor.d.ts.map +1 -0
  11. package/dist/PrefSchemaEditor/ActionList.d.ts +19 -0
  12. package/dist/PrefSchemaEditor/ActionList.d.ts.map +1 -0
  13. package/dist/PrefSchemaEditor/AddNodeDialog.d.ts +23 -0
  14. package/dist/PrefSchemaEditor/AddNodeDialog.d.ts.map +1 -0
  15. package/dist/PrefSchemaEditor/AssetEditor.d.ts +49 -0
  16. package/dist/PrefSchemaEditor/AssetEditor.d.ts.map +1 -0
  17. package/dist/PrefSchemaEditor/AssetList.d.ts +20 -0
  18. package/dist/PrefSchemaEditor/AssetList.d.ts.map +1 -0
  19. package/dist/PrefSchemaEditor/AttributesPane.d.ts +34 -0
  20. package/dist/PrefSchemaEditor/AttributesPane.d.ts.map +1 -0
  21. package/dist/PrefSchemaEditor/BundlePreview.d.ts +7 -0
  22. package/dist/PrefSchemaEditor/BundlePreview.d.ts.map +1 -0
  23. package/dist/PrefSchemaEditor/EditorBar.d.ts +20 -0
  24. package/dist/PrefSchemaEditor/EditorBar.d.ts.map +1 -0
  25. package/dist/PrefSchemaEditor/EditorNotice.d.ts +12 -0
  26. package/dist/PrefSchemaEditor/EditorNotice.d.ts.map +1 -0
  27. package/dist/PrefSchemaEditor/ExportPanel.d.ts +17 -0
  28. package/dist/PrefSchemaEditor/ExportPanel.d.ts.map +1 -0
  29. package/dist/PrefSchemaEditor/IconAttrField.d.ts +11 -0
  30. package/dist/PrefSchemaEditor/IconAttrField.d.ts.map +1 -0
  31. package/dist/PrefSchemaEditor/IconPicker.d.ts +8 -0
  32. package/dist/PrefSchemaEditor/IconPicker.d.ts.map +1 -0
  33. package/dist/PrefSchemaEditor/IdentityForm.d.ts +10 -0
  34. package/dist/PrefSchemaEditor/IdentityForm.d.ts.map +1 -0
  35. package/dist/PrefSchemaEditor/NodeGhost.d.ts +30 -0
  36. package/dist/PrefSchemaEditor/NodeGhost.d.ts.map +1 -0
  37. package/dist/PrefSchemaEditor/NumberText.d.ts +12 -0
  38. package/dist/PrefSchemaEditor/NumberText.d.ts.map +1 -0
  39. package/dist/PrefSchemaEditor/Palette.d.ts +49 -0
  40. package/dist/PrefSchemaEditor/Palette.d.ts.map +1 -0
  41. package/dist/PrefSchemaEditor/PaneHeader.d.ts +18 -0
  42. package/dist/PrefSchemaEditor/PaneHeader.d.ts.map +1 -0
  43. package/dist/PrefSchemaEditor/PartsList.d.ts +25 -0
  44. package/dist/PrefSchemaEditor/PartsList.d.ts.map +1 -0
  45. package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts +81 -0
  46. package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts.map +1 -0
  47. package/dist/PrefSchemaEditor/PreviewPane.d.ts +35 -0
  48. package/dist/PrefSchemaEditor/PreviewPane.d.ts.map +1 -0
  49. package/dist/PrefSchemaEditor/SettingsTree.d.ts +20 -0
  50. package/dist/PrefSchemaEditor/SettingsTree.d.ts.map +1 -0
  51. package/dist/PrefSchemaEditor/Shelf.d.ts +26 -0
  52. package/dist/PrefSchemaEditor/Shelf.d.ts.map +1 -0
  53. package/dist/PrefSchemaEditor/StoredArea.d.ts +13 -0
  54. package/dist/PrefSchemaEditor/StoredArea.d.ts.map +1 -0
  55. package/dist/PrefSchemaEditor/StructurePane.d.ts +85 -0
  56. package/dist/PrefSchemaEditor/StructurePane.d.ts.map +1 -0
  57. package/dist/PrefSchemaEditor/StructureTools.d.ts +19 -0
  58. package/dist/PrefSchemaEditor/StructureTools.d.ts.map +1 -0
  59. package/dist/PrefSchemaEditor/UnitAttr.d.ts +10 -0
  60. package/dist/PrefSchemaEditor/UnitAttr.d.ts.map +1 -0
  61. package/dist/PrefSchemaEditor/UnplacedTree.d.ts +29 -0
  62. package/dist/PrefSchemaEditor/UnplacedTree.d.ts.map +1 -0
  63. package/dist/PrefSchemaEditor/aliasChoices.d.ts +6 -0
  64. package/dist/PrefSchemaEditor/aliasChoices.d.ts.map +1 -0
  65. package/dist/PrefSchemaEditor/assetEdits.d.ts +37 -0
  66. package/dist/PrefSchemaEditor/assetEdits.d.ts.map +1 -0
  67. package/dist/PrefSchemaEditor/attrRenderers.d.ts +3 -0
  68. package/dist/PrefSchemaEditor/attrRenderers.d.ts.map +1 -0
  69. package/dist/PrefSchemaEditor/attributeForm.d.ts +39 -0
  70. package/dist/PrefSchemaEditor/attributeForm.d.ts.map +1 -0
  71. package/dist/PrefSchemaEditor/attributeKey.d.ts +13 -0
  72. package/dist/PrefSchemaEditor/attributeKey.d.ts.map +1 -0
  73. package/dist/PrefSchemaEditor/attributeRenderers.d.ts +20 -0
  74. package/dist/PrefSchemaEditor/attributeRenderers.d.ts.map +1 -0
  75. package/dist/PrefSchemaEditor/autoValueRenderer.d.ts +6 -0
  76. package/dist/PrefSchemaEditor/autoValueRenderer.d.ts.map +1 -0
  77. package/dist/PrefSchemaEditor/defaults.d.ts +7 -0
  78. package/dist/PrefSchemaEditor/defaults.d.ts.map +1 -0
  79. package/dist/PrefSchemaEditor/editorActions.d.ts +13 -0
  80. package/dist/PrefSchemaEditor/editorActions.d.ts.map +1 -0
  81. package/dist/PrefSchemaEditor/editorPrefs.d.ts +108 -0
  82. package/dist/PrefSchemaEditor/editorPrefs.d.ts.map +1 -0
  83. package/dist/PrefSchemaEditor/heirAfter.d.ts +6 -0
  84. package/dist/PrefSchemaEditor/heirAfter.d.ts.map +1 -0
  85. package/dist/PrefSchemaEditor/iconPickerModel.d.ts +20 -0
  86. package/dist/PrefSchemaEditor/iconPickerModel.d.ts.map +1 -0
  87. package/dist/PrefSchemaEditor/nodeIcon.d.ts +14 -0
  88. package/dist/PrefSchemaEditor/nodeIcon.d.ts.map +1 -0
  89. package/dist/PrefSchemaEditor/paneWidths.d.ts +37 -0
  90. package/dist/PrefSchemaEditor/paneWidths.d.ts.map +1 -0
  91. package/dist/PrefSchemaEditor/panelPaths.d.ts +13 -0
  92. package/dist/PrefSchemaEditor/panelPaths.d.ts.map +1 -0
  93. package/dist/PrefSchemaEditor/previewDrop.d.ts +32 -0
  94. package/dist/PrefSchemaEditor/previewDrop.d.ts.map +1 -0
  95. package/dist/PrefSchemaEditor/rowSearch.d.ts +12 -0
  96. package/dist/PrefSchemaEditor/rowSearch.d.ts.map +1 -0
  97. package/dist/PrefSchemaEditor/structureRows.d.ts +11 -0
  98. package/dist/PrefSchemaEditor/structureRows.d.ts.map +1 -0
  99. package/dist/PrefSchemaEditor/treeDropRules.d.ts +11 -0
  100. package/dist/PrefSchemaEditor/treeDropRules.d.ts.map +1 -0
  101. package/dist/PrefSchemaEditor/useActionCatalog.d.ts +40 -0
  102. package/dist/PrefSchemaEditor/useActionCatalog.d.ts.map +1 -0
  103. package/dist/PrefSchemaEditor/useAssetChanges.d.ts +37 -0
  104. package/dist/PrefSchemaEditor/useAssetChanges.d.ts.map +1 -0
  105. package/dist/PrefSchemaEditor/useAssetView.d.ts +25 -0
  106. package/dist/PrefSchemaEditor/useAssetView.d.ts.map +1 -0
  107. package/dist/PrefSchemaEditor/useBundleView.d.ts +22 -0
  108. package/dist/PrefSchemaEditor/useBundleView.d.ts.map +1 -0
  109. package/dist/PrefSchemaEditor/useDocument.d.ts +40 -0
  110. package/dist/PrefSchemaEditor/useDocument.d.ts.map +1 -0
  111. package/dist/PrefSchemaEditor/useEditorSelection.d.ts +27 -0
  112. package/dist/PrefSchemaEditor/useEditorSelection.d.ts.map +1 -0
  113. package/dist/PrefSchemaEditor/useHeldPlace.d.ts +11 -0
  114. package/dist/PrefSchemaEditor/useHeldPlace.d.ts.map +1 -0
  115. package/dist/PrefSchemaEditor/useNodeAdder.d.ts +29 -0
  116. package/dist/PrefSchemaEditor/useNodeAdder.d.ts.map +1 -0
  117. package/dist/PrefSchemaEditor/usePaletteDrop.d.ts +25 -0
  118. package/dist/PrefSchemaEditor/usePaletteDrop.d.ts.map +1 -0
  119. package/dist/PrefSchemaEditor/usePreviewDrag.d.ts +35 -0
  120. package/dist/PrefSchemaEditor/usePreviewDrag.d.ts.map +1 -0
  121. package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts +29 -0
  122. package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts.map +1 -0
  123. package/dist/PrefSchemaEditor/useRowMarks.d.ts +23 -0
  124. package/dist/PrefSchemaEditor/useRowMarks.d.ts.map +1 -0
  125. package/dist/PrefSchemaEditor/useSelectedNodes.d.ts +8 -0
  126. package/dist/PrefSchemaEditor/useSelectedNodes.d.ts.map +1 -0
  127. package/dist/PrefSchemaEditor/useTreeDragOut.d.ts +25 -0
  128. package/dist/PrefSchemaEditor/useTreeDragOut.d.ts.map +1 -0
  129. package/dist/icons.gen.d.ts +3 -0
  130. package/dist/icons.gen.d.ts.map +1 -0
  131. package/dist/index.d.ts +16 -0
  132. package/dist/index.d.ts.map +1 -0
  133. package/dist/index.js +5445 -0
  134. package/dist/index.js.map +1 -0
  135. package/dist/style.css +615 -0
  136. package/package.json +70 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 orochi235
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # @weasel-js/prefs-editor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An editor for [`@weasel-js/prefs`](https://www.npmjs.com/package/@weasel-js/prefs) schemas: build a schema's
4
+ sections, fields, conditions, and kinds by hand, preview the form it draws, and export it.
5
+
6
+ Part of [weasel](https://github.com/orochi235/weasel). See the
7
+ [API reference](https://orochi235.github.io/weasel/#pkg/prefs-editor).
8
+
9
+ ```sh
10
+ npm install @weasel-js/prefs-editor
11
+ ```
12
+
13
+ ```tsx
14
+ import { PrefSchemaEditor } from '@weasel-js/prefs-editor';
15
+ import '@weasel-js/prefs-editor/style.css';
16
+
17
+ const [schema, setSchema] = useState(SETTINGS);
18
+
19
+ <PrefSchemaEditor schema={schema} onChange={setSchema} />;
20
+ ```
21
+
22
+ | Component | Edits |
23
+ |---|---|
24
+ | `PrefSchemaEditor` | one schema: its tree, each node's attributes, and a live preview of the form it draws |
25
+ | `AssetEditor` | an `AssetSet` of schemas, layouts over them, action catalogs, and feature-preset bundles, with drafts and an export of every change |
26
+ | `PrefConditionEditor` | one `showIf` or `enableIf` condition over a schema's fields |
27
+
28
+ The editors draw with `@weasel-js/ui`'s components, so load `@weasel-js/ui/style.css` too. What they edit through,
29
+ with no React and no DOM (the tree edits, printing and diffing a schema, the asset-set codec, and a condition's rows
30
+ and flow), is `@weasel-js/prefs/edit`.
@@ -0,0 +1,12 @@
1
+ import { type PrefCondition } from '@weasel-js/prefs';
2
+ /**
3
+ * Copy and Paste for a whole condition, which crosses the system clipboard as the JSON a schema holds it in: one
4
+ * copied here pastes into another editor, and one written by hand pastes here. What a press did is said until the
5
+ * condition changes.
6
+ */
7
+ export declare function ConditionClipboard({ clipboard, value, onPaste }: {
8
+ clipboard: Clipboard;
9
+ value: PrefCondition | undefined;
10
+ onPaste(next: PrefCondition): void;
11
+ }): import("react").JSX.Element;
12
+ //# sourceMappingURL=ConditionClipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConditionClipboard.d.ts","sourceRoot":"","sources":["../../src/PrefConditionEditor/ConditionClipboard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOvE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IAAC,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,+BA8B/J"}
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type ConditionScope } from './ConditionRow.js';
3
+ import { type ConditionGroup } from '@weasel-js/prefs/edit';
4
+ export interface ConditionGroupRowsProps {
5
+ /** Names the group's controls, for a group inside another: `Condition 2`. Unset for the editor's own. */
6
+ name?: string;
7
+ group: ConditionGroup;
8
+ scope: ConditionScope;
9
+ onChange(next: ConditionGroup): void;
10
+ /** Removes the group from the one it is in. */
11
+ onRemove?(): void;
12
+ /** Drawn at the end of the group's first line, which is then drawn whatever the group holds. */
13
+ tools?: ReactNode;
14
+ }
15
+ /**
16
+ * The rows of one group under its quantifier, and the controls that add to them. A row is a test, or a group
17
+ * drawn the same way inside this one: a combinator, and any `not` no single comparison says.
18
+ */
19
+ export declare function ConditionGroupRows({ name, group, scope, onChange, onRemove, tools }: ConditionGroupRowsProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=ConditionGroupRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConditionGroupRows.d.ts","sourceRoot":"","sources":["../../src/PrefConditionEditor/ConditionGroupRows.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAgB,KAAK,cAAc,EAAW,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACM,KAAK,cAAc,EAE/B,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,IAAI,CAAC;IAClB,gGAAgG;IAChG,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,uBAAuB,+BAsD5G"}
@@ -0,0 +1,37 @@
1
+ import { type PrefCondition, type PrefConditionSite, type PrefGroup, type PrefSection, type PrefTest } from '@weasel-js/prefs';
2
+ import { type ListOption } from '@weasel-js/ui';
3
+ import { type ConditionLeaf, type TestRow } from '@weasel-js/prefs/edit';
4
+ /** What every row of one editor is drawn against. */
5
+ export interface ConditionScope {
6
+ schema: PrefGroup | PrefSection;
7
+ /** The schema `schema` is drawn over, which a row is checked against as well. */
8
+ over?: PrefGroup | PrefSection;
9
+ /** Where the condition's node sits, which a row is checked against. */
10
+ site: PrefConditionSite;
11
+ /** Every pref a row may read, which is how a row finds its own. */
12
+ leaves: readonly ConditionLeaf[];
13
+ /** The prefs a row may be pointed at. */
14
+ prefOptions: readonly ListOption[];
15
+ }
16
+ /**
17
+ * The leaf `test` reads, and the test as read from the schema root: one read from its group (`from: 'group'`) reads
18
+ * the root at the group's path, where the editor is told it.
19
+ */
20
+ export declare function rowLeaf(scope: ConditionScope, test: PrefTest): {
21
+ read: PrefTest;
22
+ found: ConditionLeaf | undefined;
23
+ };
24
+ export interface ConditionRowProps {
25
+ /** Names the row's controls: `Condition 2.1`. */
26
+ name: string;
27
+ row: TestRow;
28
+ scope: ConditionScope;
29
+ onChange(next: PrefCondition): void;
30
+ onRemove(): void;
31
+ }
32
+ /**
33
+ * One test of a {@link PrefConditionEditor}: the pref it reads, then a comparison and its value for each operator
34
+ * the test holds. A test the controls cannot draw keeps its pref picker and says the rest in words.
35
+ */
36
+ export declare function ConditionRow({ name, row, scope, onChange, onRemove }: ConditionRowProps): import("react").JSX.Element;
37
+ //# sourceMappingURL=ConditionRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConditionRow.d.ts","sourceRoot":"","sources":["../../src/PrefConditionEditor/ConditionRow.tsx"],"names":[],"mappings":"AACA,OAAO,EACe,KAAK,aAAa,EAAwB,KAAK,iBAAiB,EAAiB,KAAK,SAAS,EACpG,KAAK,WAAW,EAAE,KAAK,QAAQ,EAC/C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAC4C,KAAK,UAAU,EACjE,MAAM,eAAe,CAAC;AACvB,OAAO,EACwE,KAAK,aAAa,EAClB,KAAK,OAAO,EAE1F,MAAM,uBAAuB,CAAC;AAG/B,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,iFAAiF;IACjF,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,uEAAuE;IACvE,IAAI,EAAE,iBAAiB,CAAC;IACxB,mEAAmE;IACnE,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,yCAAyC;IACzC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,CAInH;AAED,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,QAAQ,IAAI,IAAI,CAAC;CAClB;AAuCD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+BAwDvF"}
@@ -0,0 +1,52 @@
1
+ import { type PrefCondition, type PrefGroup, type PrefList, type PrefMap, type PrefSection } from '@weasel-js/prefs';
2
+ /** Props for {@link PrefConditionEditor}. */
3
+ export interface PrefConditionEditorProps {
4
+ /** The condition edited; `undefined` is none. */
5
+ value: PrefCondition | undefined;
6
+ /** Called with the condition after each edit, and with `undefined` once its last row is removed. */
7
+ onChange(next: PrefCondition | undefined): void;
8
+ /** The schema the condition belongs to: a row reads one of its leaves, and the condition is checked against it. */
9
+ schema: PrefGroup | PrefSection;
10
+ /**
11
+ * The schema `schema` is drawn over, as a layout is over its dialog's: a condition may read a pref of it at any
12
+ * path no leaf of `schema` holds. The pickers offer those prefs after `schema`'s own, each named for this schema,
13
+ * and a row on one is checked against it.
14
+ */
15
+ over?: PrefGroup | PrefSection;
16
+ /**
17
+ * Value paths no row is offered: the pref at one, and every pref beneath one, is left out of the pickers. For
18
+ * what the condition belongs to, which cannot sensibly be shown or enabled by its own value. A path through an
19
+ * entry (`phases.*.mode`) leaves out, from `entryOf`'s fields, the one at what follows its last `*` (`mode`). A row
20
+ * that already reads such a pref keeps it.
21
+ */
22
+ exclude?: readonly string[];
23
+ /**
24
+ * The list or map whose entry the condition's node is drawn in: the one it is the `item` of, or sits inside the
25
+ * item of. The pickers then offer that entry's own fields first, each named as the entry's, and a row on one
26
+ * writes a test that reads from the entry (`from: 'item'`). Unset, the node is in no entry.
27
+ */
28
+ entryOf?: PrefList | PrefMap;
29
+ /** The value path of the group the condition's node is declared in, empty at the root: a test read from its group
30
+ * (`from: 'group'`) is checked there. Unset, such a test is not checked. */
31
+ group?: string;
32
+ /** What the condition decides, which names the group of controls: `Shown if`. */
33
+ 'aria-label'?: string;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * An editor for one `PrefCondition` over a schema, as the `showIf` or `enableIf` of a pref, a group, or a section
38
+ * holds it. Each test is a row: the pref it reads, picked from the schema's leaves; a comparison, from the ones
39
+ * that leaf's kind offers; and a value, in the control that kind takes. A boolean is on or off; an enum is, is
40
+ * not, is one of, or is none of its own options; a number is compared with a number, or with two as a range; any
41
+ * other kind is set or not, which for a list or a map is to say it has an entry.
42
+ *
43
+ * Rows combine under a quantifier: all of, any of, none of, or not all of them. A group added among the rows
44
+ * holds rows of its own under its own quantifier, to any depth, and that is how an `all` inside an `any` and a
45
+ * `not` around either are drawn. Whatever `checkPrefCondition` finds wrong with a row is said on that row. With
46
+ * no rows left the condition is `undefined`.
47
+ *
48
+ * Copy puts the whole condition on the clipboard as JSON, and Paste replaces it with one read from there: how a
49
+ * condition gets from one pref to another. A pasted test that reads a pref this schema lacks says so on its row.
50
+ */
51
+ export declare function PrefConditionEditor({ value, onChange, schema, over, exclude, entryOf, group, 'aria-label': ariaLabel, className }: PrefConditionEditorProps): import("react").JSX.Element;
52
+ //# sourceMappingURL=PrefConditionEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrefConditionEditor.d.ts","sourceRoot":"","sources":["../../src/PrefConditionEditor/PrefConditionEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EACgC,KAAK,aAAa,EAA0B,KAAK,SAAS,EAAE,KAAK,QAAQ,EAC9G,KAAK,OAAO,EAAE,KAAK,WAAW,EAC/B,MAAM,kBAAkB,CAAC;AA0B1B,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,oGAAoG;IACpG,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC;IAChD,mHAAmH;IACnH,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B;iFAC6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,wBAAwB,+BAyCtK"}
@@ -0,0 +1,19 @@
1
+ import type { PaletteDrag } from './Palette.js';
2
+ import type { ActionCatalog } from './useActionCatalog.js';
3
+ /**
4
+ * The host's actions as a tree: the catalog's groups, and a pref for each action. A row is selected to see its
5
+ * attributes, dragged within the tree to sort it where the catalog takes edits, and dragged out onto the structure
6
+ * tree or the live preview to land there as a copy of its pref. An action stays listed however many prefs fire it:
7
+ * a toolbar and a menu may both hold one.
8
+ */
9
+ export declare function ActionList({ catalog, sought, ghost, onDrag, onDrop }: {
10
+ catalog: ActionCatalog;
11
+ /** What the structure's filter holds, lowercased: only rows whose name, key, or a tag has it are listed. Empty for all. */
12
+ sought: string;
13
+ /** As `Tree`'s `ghost`. */
14
+ ghost?: boolean;
15
+ /** The drag left this tree and moved, or came back or ended (`null`). */
16
+ onDrag(drag: PaletteDrag | null): void;
17
+ onDrop(drag: PaletteDrag): void;
18
+ }): import("react").JSX.Element;
19
+ //# sourceMappingURL=ActionList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionList.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/ActionList.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAuBxD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IACrE,OAAO,EAAE,aAAa,CAAC;IACvB,2HAA2H;IAC3H,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC,+BAoDA"}
@@ -0,0 +1,23 @@
1
+ import { type ChildMap, type KindChoice } from '@weasel-js/prefs/edit';
2
+ /** What a new node is called, and for a pref, the kind picker's value for what it is. */
3
+ export interface NewNode {
4
+ key: string;
5
+ name: string;
6
+ kind?: string;
7
+ }
8
+ export interface AddNodeDialogProps {
9
+ /** `'pref'` asks for a kind as well; a group or a section needs none, and its name may stay empty. */
10
+ what: 'pref' | 'group' | 'section' | null;
11
+ /** The ids the new node may not take, as `keysTakenAt` gives them for where it goes. */
12
+ taken: ChildMap;
13
+ /** Whether the id may be a dotted path, as a pref's is where sections nest. */
14
+ dottedKey?: boolean;
15
+ /** What a new pref may be: each kind, and each type by name. */
16
+ kinds: readonly KindChoice[];
17
+ onAdd(node: NewNode): void;
18
+ onClose(): void;
19
+ }
20
+ /** Asks for the least a new pref, group or section needs before it exists: a name, the id it is keyed by, and a pref's kind.
21
+ * The id follows the name until it is typed into. */
22
+ export declare function AddNodeDialog({ what, taken, dottedKey, kinds, onAdd, onClose }: AddNodeDialogProps): import("react").JSX.Element;
23
+ //# sourceMappingURL=AddNodeDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddNodeDialog.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/AddNodeDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAA2B,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGhG,yFAAyF;AACzF,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,sGAAsG;IACtG,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,wFAAwF;IACxF,KAAK,EAAE,QAAQ,CAAC;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gEAAgE;IAChE,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;sDACsD;AACtD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,kBAAkB,+BAUlG"}
@@ -0,0 +1,49 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { PrefGroup } from '@weasel-js/prefs';
3
+ import { type Asset, type DocumentCodec, type ListedAsset, type SchemaRoot, type AssetSet } from '@weasel-js/prefs/edit';
4
+ import type { PrefSchemaEditorProps } from './PrefSchemaEditor.js';
5
+ import { type SubmitAssets } from './useAssetChanges.js';
6
+ /** Props for {@link AssetEditor}: {@link PrefSchemaEditorProps} over an asset set in place of one schema. */
7
+ export interface AssetEditorProps extends Omit<PrefSchemaEditorProps<PrefGroup>, 'schema' | 'onChange' | 'original' | 'onSubmit' | 'actionCatalog' | 'onActionCatalogChange'> {
8
+ assetSet: AssetSet;
9
+ onChange(next: AssetSet): void;
10
+ /** Baseline for the change list. Default: the first `assetSet` seen. */
11
+ original?: AssetSet;
12
+ codec: DocumentCodec<AssetSet>;
13
+ /** Whether two asset sets are one: the editor's own from a host's, and the baseline from an edit. Default: they hold the same
14
+ * roots under the same ids, which is all a draft keeps, so a host may make its asset set anew each time it draws. */
15
+ same?: (a: AssetSet, b: AssetSet) => boolean;
16
+ /** List the assets in a pane at the editor's far edge, to pick the one shown. Left out, the editor shows the first. */
17
+ list?: boolean;
18
+ /** Assets another editor holds, listed after this one's under the same headings. */
19
+ elsewhere?: readonly ListedAsset[];
20
+ /** Asset ids in the order the list shows them under each heading, this editor's and `elsewhere`'s alike, so two
21
+ * editors that list each other's show one order. Left out, each heading's are sorted by name. */
22
+ order?: readonly string[];
23
+ /** The reader picked one of `elsewhere`; the host shows it, in whatever holds it. */
24
+ onElsewhere?(id: string): void;
25
+ /** Called with the ids of the assets that differ from the baseline, when the editor mounts and whenever the set
26
+ * changes: what a host needs to mark them `changed` in the `elsewhere` of another editor. */
27
+ onChangedAssets?(ids: ReadonlySet<string>): void;
28
+ /** The asset shown when the editor mounts. Default: the first. */
29
+ startOn?: string;
30
+ /** Draws the preview of an asset in place of the editor's own: a panel as the host's own panel, a toolbar as its
31
+ * bar. `over` is the dialog a layout's pointers name settings in. Nothing returned leaves the editor's preview. */
32
+ preview?(asset: Asset, over: SchemaRoot | undefined): ReactNode;
33
+ /** Somewhere to send the changes: given, the Changes pane draws a Submit button that hands over every changed asset. */
34
+ onSubmit?: SubmitAssets;
35
+ /** Whether an asset's changes are listed in the Changes pane and handed over by Submit. Default: every asset's. */
36
+ sends?(asset: Asset): boolean;
37
+ }
38
+ /**
39
+ * The editor {@link PrefSchemaEditorProps} describes, over an asset set: it shows and edits one asset's root, and its
40
+ * history and draft are the asset set's. With `list` its far pane lists the assets, to pick the one shown; picking is
41
+ * not an edit, and an undo or a redo shows the asset it changed. A setting re-keyed, moved, or removed in a dialog
42
+ * takes the pointers of every layout over that dialog with it, in the same step. A read-only asset takes no edit.
43
+ *
44
+ * An asset set's `actions` asset is the catalog its Actions pane lists: the reader drags its rows to sort and group
45
+ * them, and a row picked there shows its attributes, where what a pref dragged out of it carries is edited. Start
46
+ * one from `actionCatalog`. With none the pane lists the host's actions by their keys, and nothing sorts them.
47
+ */
48
+ export declare function AssetEditor({ assetSet, onChange, original, codec, same, list, elsewhere, order, onElsewhere, onChangedAssets, startOn, preview, kinds, types, renderers, unplaced, actions, draftKey, draftStorage, onSubmit, sends, taken, prefs, bar, maxDepth, rowMark, className }: AssetEditorProps): import("react").JSX.Element;
49
+ //# sourceMappingURL=AssetEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetEditor.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/AssetEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AASlD,OAAO,EACL,KAAK,KAAK,EAAoE,KAAK,aAAa,EAAE,KAAK,WAAW,EACrE,KAAK,UAAU,EAAuC,KAAK,QAAQ,EACjH,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAOhE,OAAO,EAAmB,KAAK,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AA+B7F,6GAA6G;AAC7G,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,uBAAuB,CAAC;IAC3K,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B;0HACsH;IACtH,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC;IAC7C,uHAAuH;IACvH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oFAAoF;IACpF,SAAS,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACnC;sGACkG;IAClG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,qFAAqF;IACrF,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;kGAC8F;IAC9F,eAAe,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACjD,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;wHACoH;IACpH,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAChE,wHAAwH;IACxH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,mHAAmH;IACnH,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CAC/B;AAYD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAgB,EAAE,IAAY,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,KAAgB,EAAE,KAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAa,EAAE,KAAK,EAAE,GAAG,EAAE,QAAY,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAmHpU"}
@@ -0,0 +1,20 @@
1
+ import { type ReactElement } from 'react';
2
+ import { type ListedAsset, type ShownAsset } from '@weasel-js/prefs/edit';
3
+ /**
4
+ * The editor's assets, to pick the one it shows: dialogs and node kinds' properties, then the panels, toolbars, and
5
+ * menus that point into them, then the feature bundles.
6
+ * Each heading's assets are sorted by name, this editor's and another's alike, unless `order` puts them otherwise;
7
+ * a pick of another editor's is the host's. Each heading folds its assets away, and unfolds again when the one
8
+ * shown moves under it.
9
+ */
10
+ export declare function AssetList({ assets, elsewhere, order, selected, changed, onSelect, onElsewhere }: {
11
+ assets: readonly ShownAsset[];
12
+ elsewhere?: readonly ListedAsset[];
13
+ order?: readonly string[];
14
+ selected: string;
15
+ /** The ids of the assets that differ from the baseline. */
16
+ changed: ReadonlySet<string>;
17
+ onSelect(id: string): void;
18
+ onElsewhere?(id: string): void;
19
+ }): ReactElement;
20
+ //# sourceMappingURL=AssetList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetList.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/AssetList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAKpD,OAAO,EAAgC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAmCxG;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,SAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE;IACvG,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GAAG,YAAY,CAoDf"}
@@ -0,0 +1,34 @@
1
+ import { type LeafRenderer } from '@weasel-js/ui';
2
+ import { type CustomKinds, type PrefTypes, type SchemaRoot } from '@weasel-js/prefs/edit';
3
+ import type { EditorAction } from './editorActions.js';
4
+ export interface AttributesPaneProps {
5
+ schema: SchemaRoot;
6
+ onChange(next: SchemaRoot): void;
7
+ /** The nodes to edit together; none is the root. */
8
+ paths: readonly string[];
9
+ /** Put the node at `path` under `key`. The host does it, since what else names the node has to follow. */
10
+ onRename(path: string, key: string): void;
11
+ /** The one node selected is not in the baseline, so nothing is stored under its key yet. */
12
+ added?: boolean;
13
+ /** The one selected node's attributes that differ from the baseline's, by name; `$key` for its key. Their rows are marked. */
14
+ changed?: ReadonlySet<string>;
15
+ kinds: readonly string[];
16
+ custom: CustomKinds;
17
+ /** The types a leaf, or a list's or a map's entry, may be made from. */
18
+ types: PrefTypes;
19
+ /** The actions an action pref may fire, offered as its `action` attribute's choices. */
20
+ actions?: readonly EditorAction[];
21
+ /** Renderers the consumer passes for its own kinds — a custom kind's `default` may need one. */
22
+ renderers?: Record<string, LeafRenderer>;
23
+ /** The dialog a layout's pointers name settings in. Given, an alias is a pointer: its form offers only where it points, among that
24
+ * dialog's settings. No leaf of a layout is offered another kind, which could make a setting of it. */
25
+ over?: SchemaRoot;
26
+ /** The schema is the catalog of the host's actions: a node's form offers what a pref dragged out of it carries,
27
+ * and lists what its action brings. Its key and its kind are the catalog's own to keep. */
28
+ catalog?: boolean;
29
+ /** The schema takes no edit: the form shows what the nodes hold, with every control disabled. */
30
+ readOnly?: boolean;
31
+ onNotice(text: string | null): void;
32
+ }
33
+ export declare function AttributesPane({ schema, onChange, paths, onRename, added, changed, kinds, custom, types, actions, renderers, over, catalog, readOnly: locked, onNotice }: AttributesPaneProps): import("react").JSX.Element;
34
+ //# sourceMappingURL=AttributesPane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttributesPane.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/AttributesPane.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,YAAY,EAAqB,MAAM,eAAe,CAAC;AAClG,OAAO,EAEL,KAAK,WAAW,EACC,KAAK,SAAS,EAAc,KAAK,UAAU,EAC7D,MAAM,uBAAuB,CAAC;AAS/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiBpD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,oDAAoD;IACpD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8HAA8H;IAC9H,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,wEAAwE;IACxE,KAAK,EAAE,SAAS,CAAC;IACjB,wFAAwF;IACxF,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC;4GACwG;IACxG,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;gGAC4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CACrC;AAgBD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAa,EAAE,OAAc,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAe,EAAE,QAAQ,EAAE,MAAc,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BAsG5N"}
@@ -0,0 +1,7 @@
1
+ import { type SchemaRoot } from '@weasel-js/prefs/edit';
2
+ /** What a canvas loading the selected bundle gets: every bundle and atom it reaches, and every action and tool those name. */
3
+ export declare function BundlePreview({ root, lead }: {
4
+ root: SchemaRoot;
5
+ lead: string | null;
6
+ }): import("react").JSX.Element;
7
+ //# sourceMappingURL=BundlePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundlePreview.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/BundlePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAarH,8HAA8H;AAC9H,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,+BAoBtF"}
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * The strip across the top of the editor: the host's own controls, the tools that add to and remove from the
4
+ * schema, and the steps back and forward through the edits.
5
+ */
6
+ export declare function EditorBar({ lead, toolSlot, canUndo, canRedo, onStep, draftSavedAt, onDiscard, prefs }: {
7
+ /** The host's controls, set first. */
8
+ lead?: ReactNode;
9
+ /** Takes the element the structure pane draws its tools into. */
10
+ toolSlot(el: HTMLDivElement | null): void;
11
+ canUndo: boolean;
12
+ canRedo: boolean;
13
+ onStep(to: 'undo' | 'redo'): void;
14
+ /** When the draft was last kept, or `null` with none. */
15
+ draftSavedAt: number | null;
16
+ onDiscard(): void;
17
+ /** The way into the editor's own settings. */
18
+ prefs: ReactNode;
19
+ }): import("react").JSX.Element;
20
+ //# sourceMappingURL=EditorBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBar.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/EditorBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE;IACtG,sCAAsC;IACtC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,yDAAyD;IACzD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,IAAI,IAAI,CAAC;IAClB,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;CAClB,+BAmBA"}
@@ -0,0 +1,12 @@
1
+ /** What the editor says of a draft that did not open on the source it was saved against. */
2
+ export declare const DRAFT_NOTICE: {
3
+ readonly same: null;
4
+ readonly carried: "The source changed since this draft was saved. Your edits were kept on top of it.";
5
+ readonly unknown: "This draft does not say which source it edited, so changes the source has made since may be listed as yours. Discard draft to start from the source.";
6
+ };
7
+ /** The line the editor tells the reader something on, with a button to dismiss it; empty with nothing to say. */
8
+ export declare function EditorNotice({ notice, onDismiss }: {
9
+ notice: string | null;
10
+ onDismiss(): void;
11
+ }): import("react").JSX.Element;
12
+ //# sourceMappingURL=EditorNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorNotice.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/EditorNotice.tsx"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,iHAAiH;AACjH,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,IAAI,IAAI,CAAA;CAAE,+BAW/F"}
@@ -0,0 +1,17 @@
1
+ import { type AssetExport, type PrefTypes, type SchemaChange, type SchemaRoot } from '@weasel-js/prefs/edit';
2
+ /** Where the changes go when the reader submits them; a promise it returns says whether they arrived. */
3
+ export type SubmitChanges = (changes: readonly SchemaChange[], literal: string) => void | Promise<void>;
4
+ /**
5
+ * The schema as a TypeScript literal, and the list of changes since the baseline, a tab each. `changesText` is the list where
6
+ * `changes` are not this schema's alone: an editor of several assets lists every one's, and submits them all.
7
+ * `exported` is what the asset exports in place of the literal, drawn and submitted as it is: a JSON document has its tab.
8
+ */
9
+ export declare function ExportPanel({ schema, types, exported, changes, changesText, onSubmit }: {
10
+ schema: SchemaRoot;
11
+ types?: PrefTypes;
12
+ exported?: AssetExport;
13
+ changes: readonly SchemaChange[];
14
+ changesText?: string;
15
+ onSubmit?: SubmitChanges;
16
+ }): import("react").JSX.Element;
17
+ //# sourceMappingURL=ExportPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExportPanel.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/ExportPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAAiB,KAAK,SAAS,EAAe,KAAK,YAAY,EAAE,KAAK,UAAU,EACjG,MAAM,uBAAuB,CAAC;AAO/B,yGAAyG;AACzG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAmBxG;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;CAAE,+BA+B3O"}
@@ -0,0 +1,11 @@
1
+ import { type IconSpec } from '@weasel-js/icons';
2
+ /** An icon by qualified name, with a mark set in its corner: the one held, and dialogs to choose another subject
3
+ * from every one registered, or a mark from the marks. Writes a name as a string, a name with a mark as
4
+ * `{ name, mark }`, and `undefined` to clear. `mixed` says the selection holds several icons, and `value` is then
5
+ * ignored. */
6
+ export declare function IconAttrField({ value, mixed, onChange }: {
7
+ value: unknown;
8
+ mixed?: boolean;
9
+ onChange: (next: string | IconSpec | undefined) => void;
10
+ }): import("react").JSX.Element;
11
+ //# sourceMappingURL=IconAttrField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconAttrField.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/IconAttrField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AASnF;;;eAGe;AACf,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAa,EAAE,QAAQ,EAAE,EAAE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;CACzD,+BAuCA"}
@@ -0,0 +1,8 @@
1
+ /** Every registered icon, searchable, to choose one from by qualified name. `value` is the one marked chosen, and
2
+ * `group` keeps to the glyphs filed under it. */
3
+ export declare function IconPicker({ value, group, onChange }: {
4
+ value: string | undefined;
5
+ group?: string;
6
+ onChange: (next: string) => void;
7
+ }): import("react").JSX.Element;
8
+ //# sourceMappingURL=IconPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/IconPicker.tsx"],"names":[],"mappings":"AAOA;kDACkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IACrD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,+BAwDA"}
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type PrefsFormProps } from '@weasel-js/ui';
3
+ /**
4
+ * An attributes form whose node has a glyph, drawn beside its name and description rows and as tall as the two.
5
+ * One form, so every row's label and control line up with the rest.
6
+ */
7
+ export declare function IdentityForm({ icon, ...form }: PrefsFormProps & {
8
+ icon: ReactNode;
9
+ }): import("react").JSX.Element;
10
+ //# sourceMappingURL=IdentityForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityForm.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/IdentityForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,GAAG;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,+BAmCnF"}
@@ -0,0 +1,30 @@
1
+ import { type LeafRenderer } from '@weasel-js/ui';
2
+ import type { SchemaNode, SchemaRoot } from '@weasel-js/prefs/edit';
3
+ /** How wide each kind of ghost is drawn. */
4
+ export declare const GHOST_WIDTH: {
5
+ readonly page: 176;
6
+ readonly node: 300;
7
+ };
8
+ /** Whether `node` is drawn as an entry in the form's rail. */
9
+ export declare function nodeIsPage(node: SchemaNode, topLevel: boolean): boolean;
10
+ /**
11
+ * A dragged node near enough to how the form will draw it: a leaf as its row, a page as a rail entry, and any
12
+ * other group as its tab, box, or heading, emptied, since what it holds comes along unseen.
13
+ */
14
+ export declare function NodeGhost({ node, topLevel, renderers, over }: {
15
+ node: SchemaNode;
16
+ /** The node sits, or will sit, directly under the root, where a group with no `as` is a page. */
17
+ topLevel?: boolean;
18
+ renderers?: Record<string, LeafRenderer>;
19
+ /** The schema a pointer names its setting in, which the ghost of one is drawn as. */
20
+ over?: SchemaRoot;
21
+ }): import("react").JSX.Element;
22
+ /** A drag's ghost: the one node it draws, and on its corner how many it carries when that is more. */
23
+ export declare function DraggedNodes({ node, topLevel, count, renderers, over }: {
24
+ node: SchemaNode;
25
+ topLevel: boolean;
26
+ count: number;
27
+ renderers?: Record<string, LeafRenderer>;
28
+ over?: SchemaRoot;
29
+ }): import("react").JSX.Element;
30
+ //# sourceMappingURL=NodeGhost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeGhost.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/NodeGhost.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,YAAY,EAAa,MAAM,eAAe,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGpE,4CAA4C;AAC5C,eAAO,MAAM,WAAW;;;CAAoC,CAAC;AAK7D,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEvE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;IACrE,IAAI,EAAE,UAAU,CAAC;IACjB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,qFAAqF;IACrF,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,+BAYA;AAED,sGAAsG;AACtG,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;IACvE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,+BAOA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A number typed as text and taken when the field is left, or on Enter. Empty text is taken as `undefined`; text
3
+ * that is no number, or a number `accept` refuses, is put back as it was.
4
+ */
5
+ export declare function NumberText({ label, value, placeholder, accept, onCommit }: {
6
+ label: string;
7
+ value: number | undefined;
8
+ placeholder?: string;
9
+ accept?(n: number): boolean;
10
+ onCommit(n: number | undefined): void;
11
+ }): import("react").JSX.Element;
12
+ //# sourceMappingURL=NumberText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberText.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/NumberText.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CACvC,+BAgBA"}
@@ -0,0 +1,49 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { PrefGroup } from '@weasel-js/prefs';
3
+ import type { IconRef } from '@weasel-js/icons';
4
+ import { type SchemaNode } from '@weasel-js/prefs/edit';
5
+ /** Something the palette makes: a kind of group, a label, or a separator. */
6
+ export interface PaletteItem {
7
+ id: string;
8
+ label: string;
9
+ icon: IconRef;
10
+ /** What the new node's key starts as; a number is added when a sibling holds it. */
11
+ key: string;
12
+ make(): SchemaNode;
13
+ }
14
+ /** The glyph for each way a group is drawn, on the palette's tools and beside a group in the tree. */
15
+ export declare const GROUP_ICON: Record<NonNullable<PrefGroup['as']>, IconRef>;
16
+ /** What a section root takes: the same, less the page, each a section. */
17
+ export declare const SECTION_PALETTE: readonly PaletteItem[];
18
+ export declare const PALETTE: readonly PaletteItem[];
19
+ export interface PaletteDrag {
20
+ item: PaletteItem;
21
+ node: SchemaNode;
22
+ /** The tree paths of what the drag carries, for nodes the schema holds already: the drop moves them and adds
23
+ * nothing. `node` is the first of them. */
24
+ from?: readonly string[];
25
+ x: number;
26
+ y: number;
27
+ }
28
+ /**
29
+ * Tool buttons to drag into the tree or the live preview, each making one new node where it is dropped. The drag is
30
+ * the palette's own, and what it is over is the owner's to work out.
31
+ */
32
+ export declare function Palette({ items, sections, ghost, disabled, pages, onDrag, onDrop, children }: {
33
+ /** What it makes, in place of the groups a form is laid out with. */
34
+ items?: readonly PaletteItem[];
35
+ /** The schema's root is a section, so what it makes are sections. */
36
+ sections?: boolean;
37
+ /** Draw the dragged node beside the pointer. Off while something else draws it where it would land. */
38
+ ghost?: boolean;
39
+ /** Nothing can be added: no tool is picked up. */
40
+ disabled?: boolean;
41
+ /** Whether a page can be added. A layout holds none, and its page tool is disabled. */
42
+ pages?: boolean;
43
+ /** The drag moved, or ended (`null`) without a drop. */
44
+ onDrag(drag: PaletteDrag | null): void;
45
+ onDrop(drag: PaletteDrag): void;
46
+ /** Tools that act on a press, set after a rule at the palette's end. */
47
+ children?: ReactNode;
48
+ }): import("react").JSX.Element;
49
+ //# sourceMappingURL=Palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/Palette.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvF,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKnE,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,IAAI,UAAU,CAAC;CACpB;AAED,sGAAsG;AACtG,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAQpE,CAAC;AAQF,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAQjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,SAAS,WAAW,EASzC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB;gDAC4C;IAC5C,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,QAAgB,EAAE,KAAY,EAAE,QAAgB,EAAE,KAAY,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC3H,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uGAAuG;IACvG,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BA0DA"}