@weasel-js/prefs-editor 1.19.1 → 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 (135) hide show
  1. package/README.md +26 -2
  2. package/dist/PrefConditionEditor/ConditionClipboard.d.ts +12 -0
  3. package/dist/PrefConditionEditor/ConditionClipboard.d.ts.map +1 -0
  4. package/dist/PrefConditionEditor/ConditionGroupRows.d.ts +20 -0
  5. package/dist/PrefConditionEditor/ConditionGroupRows.d.ts.map +1 -0
  6. package/dist/PrefConditionEditor/ConditionRow.d.ts +37 -0
  7. package/dist/PrefConditionEditor/ConditionRow.d.ts.map +1 -0
  8. package/dist/PrefConditionEditor/PrefConditionEditor.d.ts +52 -0
  9. package/dist/PrefConditionEditor/PrefConditionEditor.d.ts.map +1 -0
  10. package/dist/PrefSchemaEditor/ActionList.d.ts +19 -0
  11. package/dist/PrefSchemaEditor/ActionList.d.ts.map +1 -0
  12. package/dist/PrefSchemaEditor/AddNodeDialog.d.ts +23 -0
  13. package/dist/PrefSchemaEditor/AddNodeDialog.d.ts.map +1 -0
  14. package/dist/PrefSchemaEditor/AssetEditor.d.ts +49 -0
  15. package/dist/PrefSchemaEditor/AssetEditor.d.ts.map +1 -0
  16. package/dist/PrefSchemaEditor/AssetList.d.ts +20 -0
  17. package/dist/PrefSchemaEditor/AssetList.d.ts.map +1 -0
  18. package/dist/PrefSchemaEditor/AttributesPane.d.ts +34 -0
  19. package/dist/PrefSchemaEditor/AttributesPane.d.ts.map +1 -0
  20. package/dist/PrefSchemaEditor/BundlePreview.d.ts +7 -0
  21. package/dist/PrefSchemaEditor/BundlePreview.d.ts.map +1 -0
  22. package/dist/PrefSchemaEditor/EditorBar.d.ts +20 -0
  23. package/dist/PrefSchemaEditor/EditorBar.d.ts.map +1 -0
  24. package/dist/PrefSchemaEditor/EditorNotice.d.ts +12 -0
  25. package/dist/PrefSchemaEditor/EditorNotice.d.ts.map +1 -0
  26. package/dist/PrefSchemaEditor/ExportPanel.d.ts +17 -0
  27. package/dist/PrefSchemaEditor/ExportPanel.d.ts.map +1 -0
  28. package/dist/PrefSchemaEditor/IconAttrField.d.ts +11 -0
  29. package/dist/PrefSchemaEditor/IconAttrField.d.ts.map +1 -0
  30. package/dist/PrefSchemaEditor/IconPicker.d.ts +8 -0
  31. package/dist/PrefSchemaEditor/IconPicker.d.ts.map +1 -0
  32. package/dist/PrefSchemaEditor/IdentityForm.d.ts +10 -0
  33. package/dist/PrefSchemaEditor/IdentityForm.d.ts.map +1 -0
  34. package/dist/PrefSchemaEditor/NodeGhost.d.ts +30 -0
  35. package/dist/PrefSchemaEditor/NodeGhost.d.ts.map +1 -0
  36. package/dist/PrefSchemaEditor/NumberText.d.ts +12 -0
  37. package/dist/PrefSchemaEditor/NumberText.d.ts.map +1 -0
  38. package/dist/PrefSchemaEditor/Palette.d.ts +49 -0
  39. package/dist/PrefSchemaEditor/Palette.d.ts.map +1 -0
  40. package/dist/PrefSchemaEditor/PaneHeader.d.ts +18 -0
  41. package/dist/PrefSchemaEditor/PaneHeader.d.ts.map +1 -0
  42. package/dist/PrefSchemaEditor/PartsList.d.ts +25 -0
  43. package/dist/PrefSchemaEditor/PartsList.d.ts.map +1 -0
  44. package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts +81 -0
  45. package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts.map +1 -0
  46. package/dist/PrefSchemaEditor/PreviewPane.d.ts +35 -0
  47. package/dist/PrefSchemaEditor/PreviewPane.d.ts.map +1 -0
  48. package/dist/PrefSchemaEditor/SettingsTree.d.ts +20 -0
  49. package/dist/PrefSchemaEditor/SettingsTree.d.ts.map +1 -0
  50. package/dist/PrefSchemaEditor/Shelf.d.ts +26 -0
  51. package/dist/PrefSchemaEditor/Shelf.d.ts.map +1 -0
  52. package/dist/PrefSchemaEditor/StoredArea.d.ts +13 -0
  53. package/dist/PrefSchemaEditor/StoredArea.d.ts.map +1 -0
  54. package/dist/PrefSchemaEditor/StructurePane.d.ts +85 -0
  55. package/dist/PrefSchemaEditor/StructurePane.d.ts.map +1 -0
  56. package/dist/PrefSchemaEditor/StructureTools.d.ts +19 -0
  57. package/dist/PrefSchemaEditor/StructureTools.d.ts.map +1 -0
  58. package/dist/PrefSchemaEditor/UnitAttr.d.ts +10 -0
  59. package/dist/PrefSchemaEditor/UnitAttr.d.ts.map +1 -0
  60. package/dist/PrefSchemaEditor/UnplacedTree.d.ts +29 -0
  61. package/dist/PrefSchemaEditor/UnplacedTree.d.ts.map +1 -0
  62. package/dist/PrefSchemaEditor/aliasChoices.d.ts +6 -0
  63. package/dist/PrefSchemaEditor/aliasChoices.d.ts.map +1 -0
  64. package/dist/PrefSchemaEditor/assetEdits.d.ts +37 -0
  65. package/dist/PrefSchemaEditor/assetEdits.d.ts.map +1 -0
  66. package/dist/PrefSchemaEditor/attrRenderers.d.ts +3 -0
  67. package/dist/PrefSchemaEditor/attrRenderers.d.ts.map +1 -0
  68. package/dist/PrefSchemaEditor/attributeForm.d.ts +39 -0
  69. package/dist/PrefSchemaEditor/attributeForm.d.ts.map +1 -0
  70. package/dist/PrefSchemaEditor/attributeKey.d.ts +13 -0
  71. package/dist/PrefSchemaEditor/attributeKey.d.ts.map +1 -0
  72. package/dist/PrefSchemaEditor/attributeRenderers.d.ts +20 -0
  73. package/dist/PrefSchemaEditor/attributeRenderers.d.ts.map +1 -0
  74. package/dist/PrefSchemaEditor/autoValueRenderer.d.ts +6 -0
  75. package/dist/PrefSchemaEditor/autoValueRenderer.d.ts.map +1 -0
  76. package/dist/PrefSchemaEditor/defaults.d.ts +7 -0
  77. package/dist/PrefSchemaEditor/defaults.d.ts.map +1 -0
  78. package/dist/PrefSchemaEditor/editorActions.d.ts +13 -0
  79. package/dist/PrefSchemaEditor/editorActions.d.ts.map +1 -0
  80. package/dist/PrefSchemaEditor/editorPrefs.d.ts +108 -0
  81. package/dist/PrefSchemaEditor/editorPrefs.d.ts.map +1 -0
  82. package/dist/PrefSchemaEditor/heirAfter.d.ts +6 -0
  83. package/dist/PrefSchemaEditor/heirAfter.d.ts.map +1 -0
  84. package/dist/PrefSchemaEditor/iconPickerModel.d.ts +20 -0
  85. package/dist/PrefSchemaEditor/iconPickerModel.d.ts.map +1 -0
  86. package/dist/PrefSchemaEditor/nodeIcon.d.ts +14 -0
  87. package/dist/PrefSchemaEditor/nodeIcon.d.ts.map +1 -0
  88. package/dist/PrefSchemaEditor/paneWidths.d.ts +37 -0
  89. package/dist/PrefSchemaEditor/paneWidths.d.ts.map +1 -0
  90. package/dist/PrefSchemaEditor/panelPaths.d.ts +13 -0
  91. package/dist/PrefSchemaEditor/panelPaths.d.ts.map +1 -0
  92. package/dist/PrefSchemaEditor/previewDrop.d.ts +32 -0
  93. package/dist/PrefSchemaEditor/previewDrop.d.ts.map +1 -0
  94. package/dist/PrefSchemaEditor/rowSearch.d.ts +12 -0
  95. package/dist/PrefSchemaEditor/rowSearch.d.ts.map +1 -0
  96. package/dist/PrefSchemaEditor/structureRows.d.ts +11 -0
  97. package/dist/PrefSchemaEditor/structureRows.d.ts.map +1 -0
  98. package/dist/PrefSchemaEditor/treeDropRules.d.ts +11 -0
  99. package/dist/PrefSchemaEditor/treeDropRules.d.ts.map +1 -0
  100. package/dist/PrefSchemaEditor/useActionCatalog.d.ts +40 -0
  101. package/dist/PrefSchemaEditor/useActionCatalog.d.ts.map +1 -0
  102. package/dist/PrefSchemaEditor/useAssetChanges.d.ts +37 -0
  103. package/dist/PrefSchemaEditor/useAssetChanges.d.ts.map +1 -0
  104. package/dist/PrefSchemaEditor/useAssetView.d.ts +25 -0
  105. package/dist/PrefSchemaEditor/useAssetView.d.ts.map +1 -0
  106. package/dist/PrefSchemaEditor/useBundleView.d.ts +22 -0
  107. package/dist/PrefSchemaEditor/useBundleView.d.ts.map +1 -0
  108. package/dist/PrefSchemaEditor/useDocument.d.ts +40 -0
  109. package/dist/PrefSchemaEditor/useDocument.d.ts.map +1 -0
  110. package/dist/PrefSchemaEditor/useEditorSelection.d.ts +27 -0
  111. package/dist/PrefSchemaEditor/useEditorSelection.d.ts.map +1 -0
  112. package/dist/PrefSchemaEditor/useHeldPlace.d.ts +11 -0
  113. package/dist/PrefSchemaEditor/useHeldPlace.d.ts.map +1 -0
  114. package/dist/PrefSchemaEditor/useNodeAdder.d.ts +29 -0
  115. package/dist/PrefSchemaEditor/useNodeAdder.d.ts.map +1 -0
  116. package/dist/PrefSchemaEditor/usePaletteDrop.d.ts +25 -0
  117. package/dist/PrefSchemaEditor/usePaletteDrop.d.ts.map +1 -0
  118. package/dist/PrefSchemaEditor/usePreviewDrag.d.ts +35 -0
  119. package/dist/PrefSchemaEditor/usePreviewDrag.d.ts.map +1 -0
  120. package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts +29 -0
  121. package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts.map +1 -0
  122. package/dist/PrefSchemaEditor/useRowMarks.d.ts +23 -0
  123. package/dist/PrefSchemaEditor/useRowMarks.d.ts.map +1 -0
  124. package/dist/PrefSchemaEditor/useSelectedNodes.d.ts +8 -0
  125. package/dist/PrefSchemaEditor/useSelectedNodes.d.ts.map +1 -0
  126. package/dist/PrefSchemaEditor/useTreeDragOut.d.ts +25 -0
  127. package/dist/PrefSchemaEditor/useTreeDragOut.d.ts.map +1 -0
  128. package/dist/icons.gen.d.ts +3 -0
  129. package/dist/icons.gen.d.ts.map +1 -0
  130. package/dist/index.d.ts +16 -2
  131. package/dist/index.d.ts.map +1 -0
  132. package/dist/index.js +5443 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/style.css +615 -0
  135. package/package.json +31 -6
@@ -0,0 +1,25 @@
1
+ import { type PrefGroup } from '@weasel-js/prefs';
2
+ import { type PaletteDrag } from './Palette.js';
3
+ import { type SchemaNode } from '@weasel-js/prefs/edit';
4
+ /** Leaves to drag into the structure tree, each landing as a copy, and where each already sits. */
5
+ export interface PartsCatalog {
6
+ /** Groups of leaves. */
7
+ root: PrefGroup;
8
+ /** The places the tree already holds what `leaf` names, by name: none for one it holds nowhere. */
9
+ where(leaf: SchemaNode): readonly string[];
10
+ }
11
+ /**
12
+ * The parts a tree's leaves name, as a tree to drag them out of: a part lands as a copy of its leaf, and the list
13
+ * keeps it. Each row says where the tree already holds it.
14
+ */
15
+ export declare function PartsList({ parts, sought, ghost, onDrag, onDrop }: {
16
+ parts: PartsCatalog;
17
+ /** What the structure's filter holds, lowercased: only rows whose name, key, or a tag has it are listed. Empty for all. */
18
+ sought: string;
19
+ /** As `Tree`'s `ghost`. */
20
+ ghost?: boolean;
21
+ /** The drag left this tree and moved, or came back or ended (`null`). */
22
+ onDrag(drag: PaletteDrag | null): void;
23
+ onDrop(drag: PaletteDrag): void;
24
+ }): import("react").JSX.Element;
25
+ //# sourceMappingURL=PartsList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartsList.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/PartsList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAM7F,mGAAmG;AACnG,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,mGAAmG;IACnG,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,MAAM,EAAE,CAAC;CAC5C;AAuBD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAClE,KAAK,EAAE,YAAY,CAAC;IACpB,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,+BAmCA"}
@@ -0,0 +1,81 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { PrefGroup, PrefSection } from '@weasel-js/prefs';
3
+ import type { LeafRenderer } from '@weasel-js/ui';
4
+ import { type CustomKinds, type DraftStorage, type PrefTypes } from '@weasel-js/prefs/edit';
5
+ import { type EditorAction } from './editorActions.js';
6
+ import type { PrefSchemaEditorPrefs } from './editorPrefs.js';
7
+ import type { SubmitChanges } from './ExportPanel.js';
8
+ /** Props for {@link PrefSchemaEditor}. */
9
+ export interface PrefSchemaEditorProps<S extends PrefGroup | PrefSection = PrefGroup> {
10
+ /** A preferences schema, or a node's property schema. */
11
+ schema: S;
12
+ onChange(next: NoInfer<S>): void;
13
+ /** Baseline for the change list and the changed-row marks. Default: the first `schema` seen. */
14
+ original?: NoInfer<S>;
15
+ /** Attribute schemas for custom kinds, by kind. A leaf of an unlisted custom kind edits its base fields only. */
16
+ kinds?: CustomKinds;
17
+ /** The types the editor may place: leaves made with `namedPrefType`. Each is offered by name beside the kinds, for a
18
+ * pref and for the entry of a list or a map. A leaf made from one is a single row in the tree, edits only what
19
+ * its use sets (its key, name, description, default, and flags), and prints as the type's name, which the
20
+ * reader imports where the literal is pasted. An `object` leaf with no type keeps its editable children; a
21
+ * `union` comes only from a type. */
22
+ types?: PrefTypes;
23
+ /** Renderers for custom kinds: what a schema's preview draws them with, a preferences form's or a node
24
+ * property panel's, and a custom kind's attributes. */
25
+ renderers?: Record<string, LeafRenderer>;
26
+ /** Nodes that have no place in the schema yet, each whole already: its key, name, description and default. They
27
+ * are listed under the structure tree, to be dragged into it or onto the live preview, and one leaves the list
28
+ * once the schema holds a leaf of its key. Nested groups are drawn as branches and drag in whole. */
29
+ unplaced?: PrefGroup;
30
+ /** The actions a pref may fire, listed in the shelf under a group for each part of their key's path, to be
31
+ * dragged into the structure: each lands as an `action` pref that fires it by key. A row picked there shows
32
+ * its attributes. Left out, the editor lists what the `ActionsRegistry` above it can fire from a button, and
33
+ * with no registry it lists none. A pref firing a key not among them is marked in the tree. The reader sorts
34
+ * and groups the list by dragging its rows, which is kept in `actionCatalog`. */
35
+ actions?: readonly EditorAction[];
36
+ /** The catalog the Actions list is sorted and grouped in, as `actionCatalog()` starts one: each action it does not
37
+ * hold yet is filed into it by its key. Left out, the editor keeps its own, starting empty, so every action is
38
+ * filed by its key. Either way the reader's sorting is kept in the draft beside the schema, and undoes with it. */
39
+ actionCatalog?: PrefGroup;
40
+ /** Called with the catalog after the reader sorts, groups, or edits the Actions list: what a host keeps to hand
41
+ * back as `actionCatalog`. */
42
+ onActionCatalogChange?(next: PrefGroup): void;
43
+ /** A name to keep the edited schema under in this browser's `localStorage`, so a reload opens on the edits and
44
+ * not on `schema`, with the nearest steps still there to undo and redo. Code the schema holds is not stored: it is taken back from the baseline. Give each schema
45
+ * the editor opens a name of its own. */
46
+ draftKey?: string;
47
+ /** Where the draft under `draftKey` is kept, in place of `localStorage`: a file the host writes, say. It is read
48
+ * as the editor mounts, so it must already hold what it has. */
49
+ draftStorage?: DraftStorage;
50
+ /** Somewhere to send the changes: given, the Changes pane draws a Submit button that hands over the changes
51
+ * since `original` and the schema's literal. A promise it returns sets the button to "Sent" or "Failed". */
52
+ onSubmit?: SubmitChanges;
53
+ /** Nothing submitted is still waiting: what `onSubmit` last handed over is in `original` now. Once true, the
54
+ * editor drops those changes from its draft and keeps the edits made since. */
55
+ taken?: boolean;
56
+ /** What to draw on a node's row in the structure tree, before its kind: a mark the host keeps for some of
57
+ * the schema's nodes. It is asked by the node's path in `original`, keys joined with dots, so the mark follows
58
+ * a node the reader moves; a node the reader added has a path `original` does not hold. */
59
+ rowMark?: (original: string) => ReactNode;
60
+ /** The most levels of groups the schema may nest: 1 keeps every group at the top. A drag, a palette drop, or
61
+ * Add group that would nest deeper is refused. A schema already deeper is shown as it is. Default 2. */
62
+ maxDepth?: number;
63
+ /** Where the editor's own settings are kept: a prefs store the host opens over `PREF_SCHEMA_EDITOR_PREFS`.
64
+ * Left out, the settings last as long as the editor is mounted. */
65
+ prefs?: PrefSchemaEditorPrefs;
66
+ /** The host's own controls, set first in the bar across the editor's top. */
67
+ bar?: ReactNode;
68
+ className?: string;
69
+ }
70
+ /**
71
+ * An editor for a preferences schema or a node's property schema: its structure as a tree, the selected node's
72
+ * attributes as a form, a live preview of the result (a `PrefsForm` for the first, a `SelectionPanel` over one
73
+ * scratch node for the second), and an export of it as a TypeScript literal and a list of changes. Edits stay in
74
+ * `schema`; nothing is written back to source. Its own edits undo and redo, from its buttons or Mod+Z, Shift+Mod+Z,
75
+ * and Mod+Y anywhere inside it; a `schema` it did not write itself starts the history over, and a `draftKey` keeps the
76
+ * nearest steps with the draft. Swapping `schema` for an
77
+ * unrelated one without remounting keeps the selection, expansion and baseline; give the editor a `key` to start
78
+ * fresh.
79
+ */
80
+ export declare function PrefSchemaEditor<S extends PrefGroup | PrefSection = PrefGroup>({ schema, onChange, original, onSubmit, types, actionCatalog, onActionCatalogChange, ...rest }: PrefSchemaEditorProps<S>): import("react").JSX.Element;
81
+ //# sourceMappingURL=PrefSchemaEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrefSchemaEditor.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/PrefSchemaEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACkB,KAAK,WAAW,EAAE,KAAK,YAAY,EAC1D,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,E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AC,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,SAAS,GAAG,WAAW,GAAG,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAgB,EAAE,aAAa,EAAE,qBAAqB,EAAE,GAAG,IAAI,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC,+BAsBlN"}
@@ -0,0 +1,35 @@
1
+ import { type PointerEvent, type ReactNode, type RefObject } from 'react';
2
+ import { type LeafRenderer, type PrefDrop, type PrefSelectHow } from '@weasel-js/ui';
3
+ import type { DefaultEdit } from './defaults.js';
4
+ import { type SchemaRoot } from '@weasel-js/prefs/edit';
5
+ import type { PreviewGhost } from './usePreviewDrag.js';
6
+ export interface PreviewPaneProps {
7
+ schema: SchemaRoot;
8
+ renderers?: Record<string, LeafRenderer>;
9
+ /** Tree path of the node to mark and bring into view. */
10
+ selected?: readonly string[];
11
+ /** The reader picked a node in the preview; its tree path, or `null` for the root. */
12
+ onSelect?: (path: string | null, how: PrefSelectHow) => void;
13
+ /** The reader set values in the preview; each becomes its leaf's default. */
14
+ onDefaults(edits: readonly DefaultEdit[]): void;
15
+ /** Set to the element the preferences form is drawn in, for a drag to be hit-tested against. */
16
+ stageRef?: RefObject<HTMLDivElement | null>;
17
+ /** A drag over the form, which draws what is dragged where it would land. */
18
+ drop?: PrefDrop | null;
19
+ /** A press on the form, which may pick up what is under it. */
20
+ onStagePointerDown?(e: PointerEvent): void;
21
+ /** What follows the pointer while something from the form is dragged. */
22
+ ghost?: PreviewGhost | null;
23
+ /** The root files nothing onto pages, as a layout's does not: what sits directly under it is drawn, not left out as unplaced. */
24
+ pageless?: boolean;
25
+ /** The schema an alias is of a leaf in, where that is not `schema`: a layout's pointers name settings in its dialog. */
26
+ over?: SchemaRoot;
27
+ /** The host's own drawing of the schema, shown in place of the editor's. It takes no drop and marks no selection. */
28
+ hosted?: ReactNode;
29
+ }
30
+ /**
31
+ * The schema drawn the way its reader draws it: a preferences form for a group, a properties panel for a section,
32
+ * and a toolbar for a group drawn as a bar.
33
+ */
34
+ export declare function PreviewPane({ schema, renderers, selected, onSelect, onDefaults, stageRef, drop, onStagePointerDown, ghost, pageless, over, hosted }: PreviewPaneProps): import("react").JSX.Element;
35
+ //# sourceMappingURL=PreviewPane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreviewPane.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/PreviewPane.tsx"],"names":[],"mappings":"AAAA,OAAO,EACqD,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAC5G,MAAM,OAAO,CAAC;AAOf,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,QAAQ,EAEb,KAAK,aAAa,EASnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7D,6EAA6E;IAC7E,UAAU,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAAC;IAChD,gGAAgG;IAChG,QAAQ,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC5C,6EAA6E;IAC7E,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,+DAA+D;IAC/D,kBAAkB,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,yEAAyE;IACzE,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,iIAAiI;IACjI,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wHAAwH;IACxH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qHAAqH;IACrH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,gBAAgB,+BAarK"}
@@ -0,0 +1,20 @@
1
+ import { type PaletteDrag } from './Palette.js';
2
+ import { type SchemaRoot } from '@weasel-js/prefs/edit';
3
+ /**
4
+ * The settings of the dialog a layout is over, as a tree to drag them out of. A setting lands in the layout as a
5
+ * pointer to it, and a group as a heading over a pointer to each setting it holds; the dialog keeps them all. A
6
+ * setting the layout already points at is drawn muted, and can be pointed at again.
7
+ */
8
+ export declare function SettingsTree({ over, layout, sought, ghost, onDrag, onDrop }: {
9
+ over: SchemaRoot;
10
+ /** The layout shown, whose pointers say which settings it has. */
11
+ layout: SchemaRoot;
12
+ /** What the structure's filter holds, lowercased: only rows whose name, key, or a tag has it are listed. Empty for all. */
13
+ sought: string;
14
+ /** As `Tree`'s `ghost`. */
15
+ ghost?: boolean;
16
+ /** The drag left this tree and moved, or came back or ended (`null`). */
17
+ onDrag(drag: PaletteDrag | null): void;
18
+ onDrop(drag: PaletteDrag): void;
19
+ }): import("react").JSX.Element;
20
+ //# sourceMappingURL=SettingsTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsTree.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/SettingsTree.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EACwE,KAAK,UAAU,EAC7F,MAAM,uBAAuB,CAAC;AAwB/B;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAC5E,IAAI,EAAE,UAAU,CAAC;IACjB,kEAAkE;IAClE,MAAM,EAAE,UAAU,CAAC;IACnB,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,+BAwCA"}
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from 'react';
2
+ import { ActionList } from './ActionList.js';
3
+ import { type PartsCatalog } from './PartsList.js';
4
+ import type { ActionCatalog } from './useActionCatalog.js';
5
+ import type { SchemaRoot } from '@weasel-js/prefs/edit';
6
+ /**
7
+ * The row under the attributes and the preview, at a height the reader drags and the editor's prefs keep:
8
+ * whatever is drawn into `slot`, then what it is given.
9
+ */
10
+ export declare function Shelf({ slot, children }: {
11
+ slot(el: HTMLDivElement | null): void;
12
+ children: ReactNode;
13
+ }): import("react").JSX.Element;
14
+ type ListDrag = Pick<Parameters<typeof ActionList>[0], 'sought' | 'ghost' | 'onDrag' | 'onDrop'>;
15
+ /** The lists rows are dragged from into the structure tree, drawn into the shelf's `slot` once it is up. */
16
+ export declare function ShelfLists({ slot, over, layout, actions, parts, ...drag }: ListDrag & {
17
+ slot: HTMLElement | null;
18
+ /** The dialog a layout points into, whose settings are listed. */
19
+ over?: SchemaRoot;
20
+ layout: SchemaRoot;
21
+ actions?: ActionCatalog;
22
+ /** Leaves the tree takes copies of, listed before the actions. */
23
+ parts?: PartsCatalog;
24
+ }): import("react").ReactPortal | null;
25
+ export {};
26
+ //# sourceMappingURL=Shelf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shelf.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/Shelf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAWvG;AAED,KAAK,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAajG,4GAA4G;AAC5G,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,GAAG;IACrF,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,kEAAkE;IAClE,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kEAAkE;IAClE,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,sCAqBA"}
@@ -0,0 +1,13 @@
1
+ import type { ReactNode, Ref } from 'react';
2
+ import { type EditorSize } from './editorPrefs.js';
3
+ /** A list under the structure tree to drag rows out of, at a height the reader drags and the editor's prefs keep. */
4
+ export declare function StoredArea({ title, size, areaRef, dropping, children }: {
5
+ title: string;
6
+ /** The editor pref that keeps its height. */
7
+ size: EditorSize;
8
+ areaRef?: Ref<HTMLDivElement>;
9
+ /** A drag held over it would be let go here, so it is outlined. */
10
+ dropping?: boolean;
11
+ children: ReactNode;
12
+ }): import("react").JSX.Element;
13
+ //# sourceMappingURL=StoredArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoredArea.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/StoredArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAI/D,qHAAqH;AACrH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAUA"}
@@ -0,0 +1,85 @@
1
+ import { type Dispatch, type ReactNode, type SetStateAction } from 'react';
2
+ import { type PrefGroup } from '@weasel-js/prefs';
3
+ import { type LeafRenderer } from '@weasel-js/ui';
4
+ import type { ActionCatalog } from './useActionCatalog.js';
5
+ import { type CustomKinds, type LinkRule, type PrefTypes, type SchemaNode, type SchemaRoot, type SchemaTarget } from '@weasel-js/prefs/edit';
6
+ import type { PaletteItem } from './Palette.js';
7
+ import type { PartsCatalog } from './PartsList.js';
8
+ export interface StructurePaneProps {
9
+ schema: SchemaRoot;
10
+ onChange(next: SchemaRoot): void;
11
+ /** The selected paths; empty is the root. */
12
+ selected: readonly string[];
13
+ /** The path that stands for the selection: where an add lands and which row is brought into view. */
14
+ lead: string | null;
15
+ /** The tree's rows now selected. */
16
+ onPick(ids: Iterable<string>): void;
17
+ /** Select exactly these: after an add, or a pick among the unplaced. */
18
+ onSelect(paths: readonly string[]): void;
19
+ changed: ReadonlySet<string>;
20
+ kinds: readonly string[];
21
+ /** The custom kinds' attributes, which say what a new leaf of one starts with. */
22
+ custom?: CustomKinds;
23
+ /** Renderers for custom kinds, which a dragged node's ghost is drawn with. */
24
+ renderers?: Record<string, LeafRenderer>;
25
+ /** The types a new pref may be made from, offered beside the kinds. */
26
+ types: PrefTypes;
27
+ expanded: ReadonlySet<string>;
28
+ onExpandedChange: Dispatch<SetStateAction<Set<string>>>;
29
+ /** Where in the editor's bar the pane draws the tools that add and remove nodes; `null` until the bar is up. */
30
+ toolSlot: HTMLElement | null;
31
+ /** Where in the editor's shelf the pane draws the lists dragged from into the tree; `null` until the shelf is up. */
32
+ shelfSlot: HTMLElement | null;
33
+ /** Nodes the schema does not hold yet, listed under the tree with what it holds on no page, to be dragged into it. */
34
+ unplaced?: PrefGroup;
35
+ /** The actions the host has, listed in the shelf to be dragged into the tree as prefs that fire them. */
36
+ actions?: ActionCatalog;
37
+ /** Somewhere else a drag from this pane may end: the live preview. */
38
+ outside?: DropOutside;
39
+ /** `outside` is drawing what is dragged where it would land, so the palette and the trees draw no ghost of it. */
40
+ outsideDraws?: boolean;
41
+ /** The most levels of groups the schema may nest. */
42
+ maxDepth?: number;
43
+ /** The schema takes no edit: no tool adds or removes, and nothing is dropped here. Its rows can still be dragged out. */
44
+ readOnly?: boolean;
45
+ /** The dialog a layout's pointers name settings in. Given, the schema is a layout: what sits directly under its
46
+ * root is a row of it and not unplaced, a pointer's row is named as its setting, and nothing adds a pref or a page.
47
+ * Its settings are listed in the shelf, to be dragged into the tree as pointers. */
48
+ over?: SchemaRoot;
49
+ /** What sits directly under the root is a row of it and not unplaced, and nothing adds a pref or a page. Default:
50
+ * whether `over` is given. */
51
+ pageless?: boolean;
52
+ /** What the bar's palette makes, in place of the groups a form is laid out with. */
53
+ palette?: readonly PaletteItem[];
54
+ /** What a link drag, and the bar's tool for one, sets down. Default: an alias of a leaf that holds a value. */
55
+ links?: LinkRule;
56
+ /** Leaves listed in the shelf, to be dragged into the tree as copies. */
57
+ parts?: PartsCatalog;
58
+ /** What a host draws on a node's row before its kind, by the node's path in this tree. */
59
+ rowMark?: (path: string) => ReactNode;
60
+ /** Remove the selected nodes. */
61
+ onRemove(): void;
62
+ /** Move the nodes at `paths` to `target`, keeping them open and selected. */
63
+ onMove(paths: readonly string[], target: SchemaTarget): void;
64
+ /** Set copies of the nodes at `paths` at `target`, leaving the nodes where they are. */
65
+ onCopy(paths: readonly string[], target: SchemaTarget): void;
66
+ /** Set an alias of each leaf at `paths` at `target`. */
67
+ onAlias(paths: readonly string[], target: SchemaTarget): void;
68
+ }
69
+ /** A place outside the structure pane that takes drops of schema nodes. */
70
+ export interface DropOutside {
71
+ /** Whether it would take `nodes` (already at `paths`, or new with none) at this client point; it marks where. */
72
+ over(nodes: readonly SchemaNode[], paths: readonly string[], point: {
73
+ x: number;
74
+ y: number;
75
+ }): boolean;
76
+ /** Where a drop at the point lands in the schema, if it takes one. */
77
+ target(nodes: readonly SchemaNode[], paths: readonly string[], point: {
78
+ x: number;
79
+ y: number;
80
+ }): SchemaTarget | null;
81
+ /** The drag left or ended. */
82
+ end(): void;
83
+ }
84
+ export declare function StructurePane({ schema, onChange, selected, lead, onPick, onSelect, changed, kinds, custom, renderers, types, expanded, onExpandedChange, toolSlot, shelfSlot, unplaced, actions, outside, outsideDraws, onMove: move, onCopy: copy, onAlias: alias, onRemove, maxDepth, rowMark, readOnly, over, pageless, palette, links, parts }: StructurePaneProps): import("react").JSX.Element;
85
+ //# sourceMappingURL=StructurePane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StructurePane.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/StructurePane.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAuB,KAAK,YAAY,EAAuB,MAAM,eAAe,CAAC;AAI5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACmB,KAAK,WAAW,EAAqB,KAAK,QAAQ,EACtD,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAgB,KAAK,YAAY,EAEtG,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAchD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,6CAA6C;IAC7C,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,qGAAqG;IACrG,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpC,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACzC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,kFAAkF;IAClF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8EAA8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edit';
3
+ import { Palette } from './Palette.js';
4
+ /** Props for {@link StructureTools}: the palette's own, and what each tool beside it does. */
5
+ export interface StructureToolsProps extends Omit<ComponentProps<typeof Palette>, 'children'> {
6
+ /** What Add makes beside a pref: a `group` or a `section`. */
7
+ branch: string;
8
+ /** Open the dialog that adds a pref, or the branch; absent, that tool is disabled. */
9
+ onAddPref: (() => void) | null;
10
+ onAddBranch: (() => void) | null;
11
+ /** What the link tool is called. */
12
+ links: Pick<LinkRule, 'label' | 'title'>;
13
+ /** Set down a link of what is selected; absent, the link tool is disabled. */
14
+ onLink: (() => void) | null;
15
+ onRemove: (() => void) | null;
16
+ }
17
+ /** The structure pane's tools in the editor's bar: the palette, then add, link and remove. */
18
+ export declare function StructureTools({ branch, onAddPref, onAddBranch, links, onLink, onRemove, ...palette }: StructureToolsProps): import("react").JSX.Element;
19
+ //# sourceMappingURL=StructureTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StructureTools.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/StructureTools.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AAGhD,8FAA8F;AAC9F,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,UAAU,CAAC;IAC3F,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IACjC,oCAAoC;IACpC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;IACzC,8EAA8E;IAC9E,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CAC/B;AAED,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE,mBAAmB,+BAU1H"}
@@ -0,0 +1,10 @@
1
+ import { type LeafContext } from '@weasel-js/ui';
2
+ /**
3
+ * A number's display unit as data: its suffix, the scale and offset that take a shown number to the stored one,
4
+ * the places it shows, and the suffixes a person may type in its place. A row for a suffix not yet named is held
5
+ * here and written once it has a name.
6
+ */
7
+ export declare function UnitEditor({ ctx }: {
8
+ ctx: LeafContext;
9
+ }): import("react").JSX.Element;
10
+ //# sourceMappingURL=UnitAttr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitAttr.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/UnitAttr.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAwBpF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,WAAW,CAAA;CAAE,+BA+DvD"}
@@ -0,0 +1,29 @@
1
+ import { type PrefGroup } from '@weasel-js/prefs';
2
+ import { type TreeNode } from '@weasel-js/ui';
3
+ import { type PaletteDrag } from './Palette.js';
4
+ import { type SchemaNode } from '@weasel-js/prefs/edit';
5
+ /**
6
+ * Nodes waiting for a place in the schema, as a tree to drag them out of: what the schema holds on no page, then
7
+ * what its host says it does not hold yet. Each is whole already, with its key, its name and its description, and
8
+ * lands as it is wherever the structure tree or the live preview takes it. A group dragged brings what it holds.
9
+ */
10
+ export declare function UnplacedTree({ loose, looseAt, waiting, sought, selected, onPick, ghost, onDrag, onDrop }: {
11
+ /** The rows of what the schema holds on no page, each by its tree path. */
12
+ loose: readonly TreeNode[];
13
+ /** The schema's node at a tree path. */
14
+ looseAt(path: string): SchemaNode | undefined;
15
+ /** What the schema does not hold yet; `null` when nothing is left. */
16
+ waiting: PrefGroup | null;
17
+ /** What the structure's filter holds, lowercased: only rows whose name, key, or a tag has it are listed. Empty for all. */
18
+ sought: string;
19
+ /** The tree paths selected in the editor, each marked here when it is one of these rows. */
20
+ selected: readonly string[];
21
+ /** The selection after a pick here, as tree paths: a row of the other tree stays in it through a Cmd-click. */
22
+ onPick(paths: readonly string[]): void;
23
+ /** As `Tree`'s `ghost`. */
24
+ ghost?: boolean;
25
+ /** The drag left this tree and moved, or came back or ended (`null`). */
26
+ onDrag(drag: PaletteDrag | null): void;
27
+ onDrop(drag: PaletteDrag): void;
28
+ }): import("react").JSX.Element;
29
+ //# sourceMappingURL=UnplacedTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnplacedTree.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/UnplacedTree.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAA4C,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAS,KAAK,UAAU,EAAc,MAAM,uBAAuB,CAAC;AAqB3E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IACzG,2EAA2E;IAC3E,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,wCAAwC;IACxC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9C,sEAAsE;IACtE,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B,2HAA2H;IAC3H,MAAM,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,+GAA+G;IAC/G,MAAM,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACvC,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,+BAmDA"}
@@ -0,0 +1,6 @@
1
+ import { type PrefLeaf } from '@weasel-js/prefs';
2
+ import type { PrefFieldChoice } from '@weasel-js/ui';
3
+ import type { SchemaRoot } from '@weasel-js/prefs/edit';
4
+ /** The fields an alias's `of` may name: those that would leave each of `aliases` showing a pref. */
5
+ export declare function aliasChoices(schema: SchemaRoot, aliases: readonly PrefLeaf[], choices: readonly PrefFieldChoice[]): PrefFieldChoice[];
6
+ //# sourceMappingURL=aliasChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aliasChoices.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/aliasChoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAUrI"}
@@ -0,0 +1,37 @@
1
+ /** The edits the asset editor makes to the asset it shows, and how each one leaves the selection and the open rows. */
2
+ import type { Dispatch, SetStateAction } from 'react';
3
+ import { type AssetSet, type LinkRule, type SchemaRoot, type SchemaTarget } from '@weasel-js/prefs/edit';
4
+ import { type DefaultEdit } from './defaults.js';
5
+ import type { EditorSelection } from './useEditorSelection.js';
6
+ /** What an edit reads as it runs: the asset set, the shown asset's root, and the paths selected in it. */
7
+ export interface AssetEditTarget {
8
+ assetSet: AssetSet;
9
+ schema: SchemaRoot;
10
+ paths: readonly string[];
11
+ }
12
+ /** Where an edit's result is shown: the rows it selects and the branches it opens. */
13
+ export interface EditFollow {
14
+ selection: Pick<EditorSelection, 'set' | 'rebase'>;
15
+ setExpanded: Dispatch<SetStateAction<Set<string>>>;
16
+ /** Whether a drop leaves the selection where it was. */
17
+ keepsSelection(): boolean;
18
+ select(paths: readonly string[]): void;
19
+ /** Select `paths`, opening the branches above them. */
20
+ reveal(paths: readonly string[]): void;
21
+ }
22
+ /** The coalesce key of an edit to the attributes of the nodes at `paths`. */
23
+ export declare const attrKeyOf: (paths: readonly string[]) => string;
24
+ /**
25
+ * The edits to asset `assetId`, each written as one step with `write`. `expanded` is the rows open now, and `links`
26
+ * what an alias drop sets down.
27
+ */
28
+ export declare function createAssetEdits(assetId: string, current: () => AssetEditTarget, write: (next: AssetSet, coalesceKey?: string) => void, links: LinkRule, expanded: ReadonlySet<string>, follow: EditFollow): {
29
+ commit: (next: SchemaRoot, coalesceKey?: string) => boolean;
30
+ moveTo: (paths: readonly string[], target: SchemaTarget, restore?: readonly string[]) => void;
31
+ copyTo: (paths: readonly string[], target: SchemaTarget, restore?: readonly string[]) => void;
32
+ aliasTo: (paths: readonly string[], target: SchemaTarget, restore?: readonly string[]) => void;
33
+ setDefaultsFrom: (edits: readonly DefaultEdit[]) => boolean;
34
+ remove: () => void;
35
+ rename: (path: string, key: string) => void;
36
+ };
37
+ //# sourceMappingURL=assetEdits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetEdits.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/assetE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,UAAU;mBAMI,UAAU,gBAAgB,MAAM,KAAG,OAAO;oBAQzC,SAAS,MAAM,EAAE,UAAU,YAAY,YAAY,SAAS,MAAM,EAAE;oBAepE,SAAS,MAAM,EAAE,UAAU,YAAY,YAAY,SAAS,MAAM,EAAE;qBAMnE,SAAS,MAAM,EAAE,UAAU,YAAY,YAAY,SAAS,MAAM,EAAE;6BAS5D,SAAS,WAAW,EAAE;;mBAWhC,MAAM,OAAO,MAAM;EAU1C"}
@@ -0,0 +1,3 @@
1
+ import { type LeafRenderer } from '@weasel-js/ui';
2
+ export declare const ATTR_RENDERERS: Record<'optional-number' | 'enum-options' | 'pair' | 'symbol' | 'unit' | 'icon', LeafRenderer>;
3
+ //# sourceMappingURL=attrRenderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attrRenderers.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/attrRenderers.tsx"],"names":[],"mappings":"AACA,OAAO,EAC0D,KAAK,YAAY,EACjF,MAAM,eAAe,CAAC;AAiGvB,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,iBAAiB,GAAG,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,YAAY,CAczH,CAAC"}
@@ -0,0 +1,39 @@
1
+ /** The attributes pane's form: its rows beside the node's attributes, which of them are marked changed or mixed. */
2
+ import type { PrefGroup, PrefLeaf } from '@weasel-js/prefs';
3
+ import type { AttributeAggregate, AttributeSchema } from '@weasel-js/prefs/edit';
4
+ /** Form paths for the rows that are not attributes: the key, the kind, and the kind's own panel. */
5
+ export declare const KEY = "$key";
6
+ export declare const PATH = "$path";
7
+ export declare const KIND = "$kind";
8
+ export declare const OWN = "$own";
9
+ export declare const AUTO = "$auto";
10
+ /** The panel for a list's or a map's entry, which draws the fields of the leaf in `item`. */
11
+ export declare const ENTRY = "$entry";
12
+ export declare const ENTRY_IS = "$entry.$kind";
13
+ /** Kinds drawn by the pane's own renderers. */
14
+ export declare const KEY_KIND = "schema-key";
15
+ export declare const PATH_KIND = "schema-path";
16
+ export declare const KIND_KIND = "schema-kind";
17
+ export declare const NAME_KIND = "schema-name";
18
+ export declare const ENTRY_KIND = "schema-entry-kind";
19
+ export declare const AUTO_VALUE_KIND = "schema-auto-value";
20
+ /** The attribute a form path edits: the path itself, or its last part under a panel. */
21
+ export declare const attrOf: (p: string) => string;
22
+ /** What the form draws beyond the attributes themselves. */
23
+ export interface FormShows {
24
+ /** The key and the path it is stored under. */
25
+ keyed: boolean;
26
+ /** The Kind picker. */
27
+ leaf: boolean;
28
+ /** The Entry panel, for a list's or a map's entry. */
29
+ entry: boolean;
30
+ /** The kind every node is, or `null` when they differ and `undefined` when any is not a leaf: names the own panel. */
31
+ kind: string | null | undefined;
32
+ }
33
+ /** The form's rows for attributes `schema`: the name and what it says first, then the key, the kind and the panels. */
34
+ export declare function formRowsFor(schema: AttributeSchema, shows: FormShows): Record<string, PrefLeaf | PrefGroup>;
35
+ /** The rows of the attributes in `changed` (by name, `$key` for the key): an attribute's row sits at its own name, or under the panel that holds it. */
36
+ export declare function markedRowsFor(changed: ReadonlySet<string>, schema: AttributeSchema): Set<string>;
37
+ /** The rows whose values disagree among the nodes `agg` aggregates. */
38
+ export declare const mixedRowsFor: (agg: AttributeAggregate | null) => Set<string>;
39
+ //# sourceMappingURL=attributeForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributeForm.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/attributeForm.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEjF,oGAAoG;AACpG,eAAO,MAAM,GAAG,SAAS,CAAC;AAC1B,eAAO,MAAM,IAAI,UAAU,CAAC;AAC5B,eAAO,MAAM,IAAI,UAAU,CAA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it; both start over when `path` changes. */
3
+ export declare function useKeyDraft(path: string | null): {
4
+ key: string;
5
+ setKey: import("react").Dispatch<import("react").SetStateAction<string>>;
6
+ error: string | null;
7
+ setError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
8
+ };
9
+ /** Why `node`, at `path`, cannot be stored under `key`; `null` when it can. */
10
+ export declare function keyProblemFor(schema: SchemaRoot, path: string, node: SchemaNode, key: string): string | null;
11
+ /** The key `node`, at `path`, takes from its name; `null` when it keeps the one it has. */
12
+ export declare function followedKeyFor(schema: SchemaRoot, path: string, node: SchemaNode): string | null;
13
+ //# sourceMappingURL=attributeKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributeKey.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/attributeKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAC4D,KAAK,UAAU,EAAE,KAAK,UAAU,EAClG,MAAM,uBAAuB,CAAC;AAE/B,4GAA4G;AAC5G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;;;;;EAU9C;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI5G;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAMhG"}
@@ -0,0 +1,20 @@
1
+ import type { PrefList, PrefMap } from '@weasel-js/prefs';
2
+ import { type LeafRenderer } from '@weasel-js/ui';
3
+ import { type KindChoice, type SchemaRoot } from '@weasel-js/prefs/edit';
4
+ /**
5
+ * Draws a `showIf` or an `enableIf` as its editor. `holder` is the selected list or map: the condition of its
6
+ * entry may read the entry's own fields, where the node's own reads the schema's. A node at one of `targets` that is
7
+ * a field of an entry may read that entry's other fields, where every target is a field of the same one.
8
+ */
9
+ export declare function conditionRenderer(schema: SchemaRoot, exclude: readonly string[], holder: PrefList | PrefMap | undefined, targets: ReadonlyArray<string | null>, over: SchemaRoot | undefined): LeafRenderer;
10
+ /** The name's field; `onBlur` runs when it loses focus. */
11
+ export declare const nameRenderer: (onBlur: (() => void) | undefined) => LeafRenderer;
12
+ /** The key's field, holding the key typed so far: `commit` takes it on blur and on Enter. */
13
+ export declare const keyRenderer: (draft: {
14
+ key: string;
15
+ setKey(key: string): void;
16
+ error: string | null;
17
+ }, commit: () => void) => LeafRenderer;
18
+ /** A kind picker named `label`, on `selected` among `options` and mixed on `null`; draws nothing without options. */
19
+ export declare const kindPickerRenderer: (label: string, selected: string | null, options: readonly KindChoice[] | null, onPick: (kind: string) => void) => LeafRenderer;
20
+ //# sourceMappingURL=attributeRenderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributeRenderers.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/attributeRenderers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAS,KAAK,YAAY,EAAU,MAAM,eAAe,CAAC;AACjE,OAAO,EAAmC,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAK1G;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,CAa3M;AAED,2DAA2D;AAC3D,eAAO,MAAM,YAAY,GAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAG,YAE/D,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,WAAW,GAAI,OAAO;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,QAAQ,MAAM,IAAI,KAAG,YAGzH,CAAC;AAEF,qHAAqH;AACrH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,GAAG,IAAI,EAAE,SAAS,SAAS,UAAU,EAAE,GAAG,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAG,YAGlJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type LeafContext, type LeafRenderer } from '@weasel-js/ui';
3
+ /** The Auto panel's value row: a switch that sets it, beside its control. Unset, the control shows the default it would
4
+ * start from and takes no input. */
5
+ export declare function autoValueRenderer(unset: boolean, onSet: (on: boolean) => void, control: (ctx: LeafContext) => ReactNode): LeafRenderer;
6
+ //# sourceMappingURL=autoValueRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoValueRenderer.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/autoValueRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAU,MAAM,eAAe,CAAC;AAG5E;qCACqC;AACrC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,SAAS,GAAG,YAAY,CAStI"}
@@ -0,0 +1,7 @@
1
+ import { type SchemaRoot } from '@weasel-js/prefs/edit';
2
+ /** A value and where it is stored: the steps of its path, as a form or a node holds it. */
3
+ export type DefaultEdit = readonly [valuePath: readonly string[], value: unknown];
4
+ /** Make each value the default of the leaf that describes it, or a part of that default when its path runs
5
+ * into the leaf's value. An edit no leaf describes is dropped. */
6
+ export declare function setDefaults<R extends SchemaRoot>(root: R, edits: readonly DefaultEdit[]): R;
7
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/defaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsD,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5G,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAoBlF;mEACmE;AACnE,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,CAAC,CAY3F"}
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { SchemaAction } from '@weasel-js/prefs/edit';
3
+ /** An action a schema editor offers to place: one a host has registered, by the key an action pref fires. */
4
+ export interface EditorAction extends SchemaAction {
5
+ icon?: ReactNode;
6
+ shortcut?: string;
7
+ }
8
+ /**
9
+ * The actions an editor lists: `given`, or else every action the `ActionsRegistry` above it can fire from a button.
10
+ * `null` with neither, where the editor has no way to know which keys exist.
11
+ */
12
+ export declare function useEditorActions(given: readonly EditorAction[] | undefined): readonly EditorAction[] | null;
13
+ //# sourceMappingURL=editorActions.d.ts.map