@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.
- package/LICENSE +21 -0
- package/README.md +29 -2
- package/dist/PrefConditionEditor/ConditionClipboard.d.ts +12 -0
- package/dist/PrefConditionEditor/ConditionClipboard.d.ts.map +1 -0
- package/dist/PrefConditionEditor/ConditionGroupRows.d.ts +20 -0
- package/dist/PrefConditionEditor/ConditionGroupRows.d.ts.map +1 -0
- package/dist/PrefConditionEditor/ConditionRow.d.ts +37 -0
- package/dist/PrefConditionEditor/ConditionRow.d.ts.map +1 -0
- package/dist/PrefConditionEditor/PrefConditionEditor.d.ts +52 -0
- package/dist/PrefConditionEditor/PrefConditionEditor.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/ActionList.d.ts +19 -0
- package/dist/PrefSchemaEditor/ActionList.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/AddNodeDialog.d.ts +23 -0
- package/dist/PrefSchemaEditor/AddNodeDialog.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/AssetEditor.d.ts +49 -0
- package/dist/PrefSchemaEditor/AssetEditor.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/AssetList.d.ts +20 -0
- package/dist/PrefSchemaEditor/AssetList.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/AttributesPane.d.ts +34 -0
- package/dist/PrefSchemaEditor/AttributesPane.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/BundlePreview.d.ts +7 -0
- package/dist/PrefSchemaEditor/BundlePreview.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/EditorBar.d.ts +20 -0
- package/dist/PrefSchemaEditor/EditorBar.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/EditorNotice.d.ts +12 -0
- package/dist/PrefSchemaEditor/EditorNotice.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/ExportPanel.d.ts +17 -0
- package/dist/PrefSchemaEditor/ExportPanel.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/IconAttrField.d.ts +11 -0
- package/dist/PrefSchemaEditor/IconAttrField.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/IconPicker.d.ts +8 -0
- package/dist/PrefSchemaEditor/IconPicker.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/IdentityForm.d.ts +10 -0
- package/dist/PrefSchemaEditor/IdentityForm.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/NodeGhost.d.ts +30 -0
- package/dist/PrefSchemaEditor/NodeGhost.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/NumberText.d.ts +12 -0
- package/dist/PrefSchemaEditor/NumberText.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/Palette.d.ts +49 -0
- package/dist/PrefSchemaEditor/Palette.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/PaneHeader.d.ts +18 -0
- package/dist/PrefSchemaEditor/PaneHeader.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/PartsList.d.ts +25 -0
- package/dist/PrefSchemaEditor/PartsList.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts +81 -0
- package/dist/PrefSchemaEditor/PrefSchemaEditor.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/PreviewPane.d.ts +35 -0
- package/dist/PrefSchemaEditor/PreviewPane.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/SettingsTree.d.ts +20 -0
- package/dist/PrefSchemaEditor/SettingsTree.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/Shelf.d.ts +26 -0
- package/dist/PrefSchemaEditor/Shelf.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/StoredArea.d.ts +13 -0
- package/dist/PrefSchemaEditor/StoredArea.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/StructurePane.d.ts +85 -0
- package/dist/PrefSchemaEditor/StructurePane.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/StructureTools.d.ts +19 -0
- package/dist/PrefSchemaEditor/StructureTools.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/UnitAttr.d.ts +10 -0
- package/dist/PrefSchemaEditor/UnitAttr.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/UnplacedTree.d.ts +29 -0
- package/dist/PrefSchemaEditor/UnplacedTree.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/aliasChoices.d.ts +6 -0
- package/dist/PrefSchemaEditor/aliasChoices.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/assetEdits.d.ts +37 -0
- package/dist/PrefSchemaEditor/assetEdits.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/attrRenderers.d.ts +3 -0
- package/dist/PrefSchemaEditor/attrRenderers.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/attributeForm.d.ts +39 -0
- package/dist/PrefSchemaEditor/attributeForm.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/attributeKey.d.ts +13 -0
- package/dist/PrefSchemaEditor/attributeKey.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/attributeRenderers.d.ts +20 -0
- package/dist/PrefSchemaEditor/attributeRenderers.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/autoValueRenderer.d.ts +6 -0
- package/dist/PrefSchemaEditor/autoValueRenderer.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/defaults.d.ts +7 -0
- package/dist/PrefSchemaEditor/defaults.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/editorActions.d.ts +13 -0
- package/dist/PrefSchemaEditor/editorActions.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/editorPrefs.d.ts +108 -0
- package/dist/PrefSchemaEditor/editorPrefs.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/heirAfter.d.ts +6 -0
- package/dist/PrefSchemaEditor/heirAfter.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/iconPickerModel.d.ts +20 -0
- package/dist/PrefSchemaEditor/iconPickerModel.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/nodeIcon.d.ts +14 -0
- package/dist/PrefSchemaEditor/nodeIcon.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/paneWidths.d.ts +37 -0
- package/dist/PrefSchemaEditor/paneWidths.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/panelPaths.d.ts +13 -0
- package/dist/PrefSchemaEditor/panelPaths.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/previewDrop.d.ts +32 -0
- package/dist/PrefSchemaEditor/previewDrop.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/rowSearch.d.ts +12 -0
- package/dist/PrefSchemaEditor/rowSearch.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/structureRows.d.ts +11 -0
- package/dist/PrefSchemaEditor/structureRows.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/treeDropRules.d.ts +11 -0
- package/dist/PrefSchemaEditor/treeDropRules.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useActionCatalog.d.ts +40 -0
- package/dist/PrefSchemaEditor/useActionCatalog.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useAssetChanges.d.ts +37 -0
- package/dist/PrefSchemaEditor/useAssetChanges.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useAssetView.d.ts +25 -0
- package/dist/PrefSchemaEditor/useAssetView.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useBundleView.d.ts +22 -0
- package/dist/PrefSchemaEditor/useBundleView.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useDocument.d.ts +40 -0
- package/dist/PrefSchemaEditor/useDocument.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useEditorSelection.d.ts +27 -0
- package/dist/PrefSchemaEditor/useEditorSelection.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useHeldPlace.d.ts +11 -0
- package/dist/PrefSchemaEditor/useHeldPlace.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useNodeAdder.d.ts +29 -0
- package/dist/PrefSchemaEditor/useNodeAdder.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/usePaletteDrop.d.ts +25 -0
- package/dist/PrefSchemaEditor/usePaletteDrop.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/usePreviewDrag.d.ts +35 -0
- package/dist/PrefSchemaEditor/usePreviewDrag.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts +29 -0
- package/dist/PrefSchemaEditor/usePreviewDropZone.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useRowMarks.d.ts +23 -0
- package/dist/PrefSchemaEditor/useRowMarks.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useSelectedNodes.d.ts +8 -0
- package/dist/PrefSchemaEditor/useSelectedNodes.d.ts.map +1 -0
- package/dist/PrefSchemaEditor/useTreeDragOut.d.ts +25 -0
- package/dist/PrefSchemaEditor/useTreeDragOut.d.ts.map +1 -0
- package/dist/icons.gen.d.ts +3 -0
- package/dist/icons.gen.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5445 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +615 -0
- package/package.json +70 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CustomKinds, type PrefTypes, type SchemaRoot } from '@weasel-js/prefs/edit';
|
|
2
|
+
import type { NewNode } from './AddNodeDialog.js';
|
|
3
|
+
import type { PaletteLanding } from './usePaletteDrop.js';
|
|
4
|
+
/** What a new node may be: the kinds and types a pref is made from, and what a custom kind starts with. */
|
|
5
|
+
export interface NodeMaking {
|
|
6
|
+
kinds: readonly string[];
|
|
7
|
+
types: PrefTypes;
|
|
8
|
+
custom?: CustomKinds;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The add of a pref or a branch at `lead`: `open` starts one, and `dialog` is the props of the `AddNodeDialog` that
|
|
12
|
+
* names it. The new node is selected, and its parent opened. `addsPref` is false where a new pref would sit under a
|
|
13
|
+
* root that holds pages, on none of them.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useNodeAdder(schema: SchemaRoot, lead: string | null, pageless: boolean, making: NodeMaking, landing: Omit<PaletteLanding, 'move'>): {
|
|
16
|
+
branch: "section" | "group";
|
|
17
|
+
parent: string | null;
|
|
18
|
+
addsPref: boolean;
|
|
19
|
+
open: import("react").Dispatch<import("react").SetStateAction<"pref" | "branch" | null>>;
|
|
20
|
+
dialog: {
|
|
21
|
+
what: "section" | "group" | "pref" | null;
|
|
22
|
+
kinds: import("@weasel-js/prefs/edit").KindChoice[];
|
|
23
|
+
onAdd: ({ key, name, kind }: NewNode) => void;
|
|
24
|
+
taken: import("@weasel-js/prefs/edit").ChildMap;
|
|
25
|
+
dottedKey: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useNodeAdder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodeAdder.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/useNodeAdder.ts"],"names":[],"mappings":"AAEA,OAAO,EACuD,KAAK,WAAW,EACnC,KAAK,SAAS,EAAmB,KAAK,UAAU,EAC1F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYvD,2GAA2G;AAC3G,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;;;;;;;;qCAU9G,OAAO;;;;;EAsB1C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** A drag from the structure pane's palette, its shelf or its unplaced list, and where it lands. */
|
|
2
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
3
|
+
import type { TreeDropHandle } from '@weasel-js/ui';
|
|
4
|
+
import { type SchemaRoot, type SchemaTarget } from '@weasel-js/prefs/edit';
|
|
5
|
+
import type { PaletteDrag } from './Palette.js';
|
|
6
|
+
import type { DropOutside } from './StructurePane.js';
|
|
7
|
+
/** What a drop does to the schema and the tree: write the schema, move what it holds, open rows and select one. */
|
|
8
|
+
export interface PaletteLanding {
|
|
9
|
+
onChange(next: SchemaRoot): void;
|
|
10
|
+
move(paths: readonly string[], target: SchemaTarget): void;
|
|
11
|
+
onExpandedChange: Dispatch<SetStateAction<Set<string>>>;
|
|
12
|
+
onSelect(paths: readonly string[]): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Over the tree a palette drag lands where the tree marks, and elsewhere wherever `outside` takes it. A node the
|
|
16
|
+
* schema holds is moved; a new one is added under a key of its own, with the rows above it opened and it selected.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePaletteDrop(schema: SchemaRoot, pageless: boolean, outside: DropOutside | undefined, landing: PaletteLanding): {
|
|
19
|
+
drag: PaletteDrag | null;
|
|
20
|
+
carrying: import("react").RefObject<PaletteDrag | null>;
|
|
21
|
+
treeDrop: import("react").RefObject<TreeDropHandle | null>;
|
|
22
|
+
onDrag: (d: PaletteDrag | null) => void;
|
|
23
|
+
onDrop: (d: PaletteDrag) => void;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=usePaletteDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaletteDrop.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/usePaletteDrop.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,EAAoB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACoE,KAAK,UAAU,EACxF,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMnD,mHAAmH;AACnH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,IAAI,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3D,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc;;;;gBAO1G,WAAW,GAAG,IAAI;gBAMlB,WAAW;EAgB/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PointerEvent as ReactPointerEvent, type RefObject } from 'react';
|
|
2
|
+
import { type SchemaNode, type SchemaRoot, type SchemaTarget } from '@weasel-js/prefs/edit';
|
|
3
|
+
import type { DropOutside } from './StructurePane.js';
|
|
4
|
+
export interface PreviewGhost {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
width: number;
|
|
8
|
+
node: SchemaNode;
|
|
9
|
+
/** The node sits directly under the root. */
|
|
10
|
+
topLevel: boolean;
|
|
11
|
+
/** How many nodes the drag carries; the one drawn is the one pressed. */
|
|
12
|
+
count: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Dragging what the live preview draws: a press on a row's label, on a group's heading, or on a group's entry in the
|
|
16
|
+
* rail picks that node up, and it drops wherever `place` takes it — the preview itself. A press on a row's control is
|
|
17
|
+
* the control's, but for a button in a bar, which has no label beside it to press. With Alt held the node stays and a copy of it drops; with Alt and Cmd (Ctrl off Apple platforms), an alias of a leaf.
|
|
18
|
+
* A press on one of several selected nodes picks them all up, and one let go without a drag picks that node alone.
|
|
19
|
+
*/
|
|
20
|
+
export declare function usePreviewDrag({ stage, schema, place, onMove, onCopy, onAlias, selected, onPick }: {
|
|
21
|
+
stage: RefObject<HTMLDivElement | null>;
|
|
22
|
+
schema(): SchemaRoot;
|
|
23
|
+
place: DropOutside;
|
|
24
|
+
onMove(paths: readonly string[], target: SchemaTarget): void;
|
|
25
|
+
onCopy(paths: readonly string[], target: SchemaTarget): void;
|
|
26
|
+
onAlias(paths: readonly string[], target: SchemaTarget): void;
|
|
27
|
+
/** The tree paths selected before the press. */
|
|
28
|
+
selected(): readonly string[];
|
|
29
|
+
/** One of several selected nodes was pressed and let go without a drag. */
|
|
30
|
+
onPick(path: string): void;
|
|
31
|
+
}): {
|
|
32
|
+
ghost: PreviewGhost | null;
|
|
33
|
+
onPointerDown(e: ReactPointerEvent): void;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=usePreviewDrag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePreviewDrag.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/usePreviewDrag.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,YAAY,IAAI,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5G,OAAO,EAC4D,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EACrH,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAClG,KAAK,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACxC,MAAM,IAAI,UAAU,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7D,MAAM,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7D,OAAO,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9D,gDAAgD;IAChD,QAAQ,IAAI,SAAS,MAAM,EAAE,CAAC;IAC9B,2EAA2E;IAC3E,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG;IAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAAC,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,CAwE5E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type PrefDrop } from '@weasel-js/ui';
|
|
3
|
+
import { type SchemaRoot } from '@weasel-js/prefs/edit';
|
|
4
|
+
import type { DropOutside } from './StructurePane.js';
|
|
5
|
+
export interface PreviewDropZone {
|
|
6
|
+
/** The element the form is drawn in, which a drag is hit-tested against. */
|
|
7
|
+
stage: RefObject<HTMLDivElement | null>;
|
|
8
|
+
/** What the form draws of the drag over it. */
|
|
9
|
+
drop: PrefDrop | null;
|
|
10
|
+
outside: DropOutside;
|
|
11
|
+
/** Set while a drop into the preview is being carried out, which every way of dropping there does in one task. */
|
|
12
|
+
dropping: RefObject<boolean>;
|
|
13
|
+
/** What was selected when a drag opened a rail page, which selects that page's group: a step back from the drop
|
|
14
|
+
* returns to this and not to the group. */
|
|
15
|
+
beforeOpening: RefObject<readonly string[] | null>;
|
|
16
|
+
}
|
|
17
|
+
/** The live preview as a place to drop: the form says what is under the pointer, the schema whether it fits there. */
|
|
18
|
+
export declare function usePreviewDropZone({ schema, selected, maxDepth, pageless, locked, onOpen }: {
|
|
19
|
+
schema(): SchemaRoot;
|
|
20
|
+
selected(): readonly string[];
|
|
21
|
+
maxDepth?: number;
|
|
22
|
+
/** `holdsPages`'s: the root's own rows are rows of it. */
|
|
23
|
+
pageless?: boolean;
|
|
24
|
+
/** Nothing lands: the schema takes no edit. */
|
|
25
|
+
locked?: boolean;
|
|
26
|
+
/** A drag rested on a rail entry: select these, the group whose page it is, or nothing for the root's. */
|
|
27
|
+
onOpen(paths: readonly string[]): void;
|
|
28
|
+
}): PreviewDropZone;
|
|
29
|
+
//# sourceMappingURL=usePreviewDropZone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePreviewDropZone.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/usePreviewDropZone.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,KAAK,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACxC,+CAA+C;IAC/C,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,kHAAkH;IAClH,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC7B;gDAC4C;IAC5C,aAAa,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;CACpD;AAED,sHAAsH;AACtH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAgB,EAAE,MAAc,EAAE,MAAM,EAAE,EAAE;IAC3G,MAAM,IAAI,UAAU,CAAC;IACrB,QAAQ,IAAI,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0GAA0G;IAC1G,MAAM,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACxC,GAAG,eAAe,CAqDlB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SchemaChange, type SchemaRoot } from '@weasel-js/prefs/edit';
|
|
3
|
+
import type { EditorAction } from './editorActions.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the structure tree draws on a row before its kind: the editor's own marks for a node that is wired to
|
|
6
|
+
* nothing, then the host's. `undefined` while there is nothing to draw on any row.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useRowMarks({ schema, over, changes, actions, bundles, rowMark }: {
|
|
9
|
+
schema: SchemaRoot;
|
|
10
|
+
/** The dialog a layout's pointers name settings in. */
|
|
11
|
+
over?: SchemaRoot;
|
|
12
|
+
/** The schema's changes from its baseline, which say where each node sat there. */
|
|
13
|
+
changes: readonly SchemaChange[];
|
|
14
|
+
/** The actions a pref may fire; `null` with no way to know which keys exist. */
|
|
15
|
+
actions: readonly EditorAction[] | null;
|
|
16
|
+
/** The schema is a bundle tree: its action leaves name presets' actions, not the registry's, and a bundle that
|
|
17
|
+
* includes itself or names what another loaded with it names is marked. */
|
|
18
|
+
bundles?: boolean;
|
|
19
|
+
/** The host's mark, asked by a node's path in the baseline. A layout's pointer is asked about by the path of
|
|
20
|
+
* the setting it names, and its other rows are not asked about: the host's marks are its settings'. */
|
|
21
|
+
rowMark?: (original: string) => ReactNode;
|
|
22
|
+
}): ((path: string) => ReactNode) | undefined;
|
|
23
|
+
//# sourceMappingURL=useRowMarks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRowMarks.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/useRowMarks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAEsC,KAAK,YAAY,EAAE,KAAK,UAAU,EAC9E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAe,EAAE,OAAO,EAAE,EAAE;IACxF,MAAM,EAAE,UAAU,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,mFAAmF;IACnF,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,gFAAgF;IAChF,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,IAAI,CAAC;IACxC;gFAC4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;4GACwG;IACxG,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;CAC3C,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,GAAG,SAAS,CAoC5C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SchemaNode, type SchemaRoot } from '@weasel-js/prefs/edit';
|
|
2
|
+
/** The nodes at `targets` in `schema`, and what a reference set on them may name. */
|
|
3
|
+
export declare function useSelectedNodes(schema: SchemaRoot, targets: ReadonlyArray<string | null>, over: SchemaRoot | undefined): {
|
|
4
|
+
nodes: SchemaNode[];
|
|
5
|
+
ownPaths: string[];
|
|
6
|
+
fields: import("@weasel-js/ui").PrefFieldChoice[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useSelectedNodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectedNodes.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/useSelectedNodes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAwB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE/F,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS;;;;EAcvH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TreeDragEffect } from '@weasel-js/ui';
|
|
2
|
+
import { type SchemaNode, type SchemaRoot, type SchemaTarget } from '@weasel-js/prefs/edit';
|
|
3
|
+
import type { DropOutside } from './StructurePane.js';
|
|
4
|
+
type Point = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
type Place = (paths: readonly string[], target: SchemaTarget) => void;
|
|
9
|
+
/** What a drag out of the tree can set down, as {@link treeDropRulesFor} gives it. */
|
|
10
|
+
export interface DragOutRules {
|
|
11
|
+
canLand(ids: readonly string[], effect: TreeDragEffect): boolean;
|
|
12
|
+
landing(ids: readonly string[], effect: TreeDragEffect): SchemaNode[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The tree's `onDragOutside` and `onDropOutside`, and the unplaced list they drop onto: `unplacedArea` is its box,
|
|
16
|
+
* and `unplacing` whether a drag held over it would come off its page. `place` does a drop by its effect.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useTreeDragOut(schema: SchemaRoot, pageless: boolean, readOnly: boolean, rules: DragOutRules, outside: DropOutside | undefined, place: Record<TreeDragEffect, Place>): {
|
|
19
|
+
unplacedArea: import("react").RefObject<HTMLDivElement | null>;
|
|
20
|
+
unplacing: boolean;
|
|
21
|
+
onDragOutside: (ids: readonly string[], point: Point | null, effect: TreeDragEffect) => boolean;
|
|
22
|
+
onDropOutside: (ids: readonly string[], point: Point, effect: TreeDragEffect) => void;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=useTreeDragOut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeDragOut.d.ts","sourceRoot":"","sources":["../../src/PrefSchemaEditor/useTreeDragOut.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAuC,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;AAEtE,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;IACjE,OAAO,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,UAAU,EAAE,CAAC;CACvE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,EAC/G,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC;;;yBAYR,SAAS,MAAM,EAAE,SAAS,KAAK,GAAG,IAAI,UAAU,cAAc,KAAG,OAAO;yBASxE,SAAS,MAAM,EAAE,SAAS,KAAK,UAAU,cAAc,KAAG,IAAI;EAO3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.gen.d.ts","sourceRoot":"","sources":["../src/icons.gen.ts"],"names":[],"mappings":"AAIA,yGAAyG;AACzG,eAAO,MAAM,IAAI,4FAAoC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @weasel-js/prefs-editor — an editor for preferences schemas: `PrefSchemaEditor` builds one schema's sections,
|
|
3
|
+
* fields, conditions, and kinds by hand and previews the form it draws; `AssetEditor` edits an asset set of schemas,
|
|
4
|
+
* layouts, actions, and bundles together and exports them; `PrefConditionEditor` edits one `showIf` or `enableIf`.
|
|
5
|
+
* The model they edit through, with no React, is `@weasel-js/prefs/edit`. Its styles are `@weasel-js/prefs-editor/style.css`.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { AssetEditor, type AssetEditorProps } from './PrefSchemaEditor/AssetEditor.js';
|
|
10
|
+
export { PrefSchemaEditor, type PrefSchemaEditorProps } from './PrefSchemaEditor/PrefSchemaEditor.js';
|
|
11
|
+
export type { EditorAction } from './PrefSchemaEditor/editorActions.js';
|
|
12
|
+
export { PREF_SCHEMA_EDITOR_PREFS, type PrefSchemaEditorPrefs } from './PrefSchemaEditor/editorPrefs.js';
|
|
13
|
+
export type { SubmitChanges } from './PrefSchemaEditor/ExportPanel.js';
|
|
14
|
+
export type { SentAsset, SubmitAssets } from './PrefSchemaEditor/useAssetChanges.js';
|
|
15
|
+
export { PrefConditionEditor, type PrefConditionEditorProps } from './PrefConditionEditor/PrefConditionEditor.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACnG,YAAY,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACtG,YAAY,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAC"}
|