@cratis/event-models 0.180.0 → 0.181.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/dist/screen-editor/CascadeMenu/CascadeEntry.d.ts +44 -0
- package/dist/screen-editor/CascadeMenu/CascadeEntryKind.d.ts +15 -0
- package/dist/screen-editor/CascadeMenu/CascadeFilter.d.ts +9 -0
- package/dist/screen-editor/CascadeMenu/CascadeMenu.d.ts +25 -0
- package/dist/screen-editor/CascadeMenu/CascadePanel.d.ts +26 -0
- package/dist/screen-editor/CascadeMenu/OpenSubmenu.d.ts +8 -0
- package/dist/screen-editor/CascadeMenu/cascadeNavigation.d.ts +27 -0
- package/dist/screen-editor/CascadeMenu/index.d.ts +6 -0
- package/dist/screen-editor/CascadeMenu/keepInputInMenu.d.ts +18 -0
- package/dist/screen-editor/CascadeMenu/placeCascadePanel.d.ts +37 -0
- package/dist/screen-editor/{ColumnListEditor-Cku6GGLp.js → ColumnListEditor-BHLrr4WK.js} +1 -1
- package/dist/screen-editor/{FieldEditor-SquvComm.js → FieldEditor-4a_4uQit.js} +1 -1
- package/dist/screen-editor/{FieldListEditor-CNxskXPf.js → FieldListEditor-RGb59BLM.js} +1 -1
- package/dist/screen-editor/NavigationItemTargetEditor-C3epn45p.js +72 -0
- package/dist/screen-editor/{NavigationTargetEditor-DGnW5pVF.js → NavigationTargetEditor-BZ0uQnIl.js} +1 -1
- package/dist/screen-editor/{ReferenceEditor-BnI2Qd7H.js → ReferenceEditor-BGuaEvY7.js} +1 -1
- package/dist/screen-editor/ReferenceTargetEditors-kxd9SIuG.js +18 -0
- package/dist/screen-editor/{RenderingSlotEditor-Cani_PtT.js → RenderingSlotEditor-D0ppEIOx.js} +4 -4
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeChrome.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeFrames.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModePopover.d.ts +19 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +73 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/FloatingItemToolbar.d.ts +19 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/EditorLogoContext.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/EditorNavigationScope.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationDocument.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationItemOps.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/regionItemSource.d.ts +25 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/cloneWithNewIds.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/collectionItemSource.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeKeys.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeRules.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeTypes.d.ts +89 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/elementItemSource.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/placeFloatingToolbar.d.ts +18 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/resolveDesignMode.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignMode.d.ts +31 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignModeMeasurement.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +12 -2
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Inspector/DiagnosticList.d.ts +7 -2
- package/dist/screen-editor/ScreenEditor/Inspector/NavigationSection.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +4 -7
- package/dist/screen-editor/ScreenEditor/Inspector/ToolbarButtonSection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorHost.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorProps.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorStrings.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/SearchableSelect.d.ts +4 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/createEditorContext.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/NavigationItemTargetEditor.d.ts +16 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/ReferenceTargetEditors.d.ts +0 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/SliceEditor.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/TemplatePropertyEditor.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +4 -2
- package/dist/screen-editor/ScreenEditor/Surface/designTimePointer.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/elementRect.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Surface/useDesignTimePointer.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Templates/screenTemplateTarget.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/slicesOfStructure.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/toolbarDiagnostics.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/upgradeToolbarButton.d.ts +5 -0
- package/dist/screen-editor/ScreenTemplates/TemplateReference.d.ts +8 -0
- package/dist/screen-editor/ScreenTemplates/TemplateReferenceKind.d.ts +7 -0
- package/dist/screen-editor/ScreenTemplates/toTemplateSources.d.ts +18 -0
- package/dist/screen-editor/SearchableSelect-C4yzIyo_.js +110 -0
- package/dist/screen-editor/{SelectEditor-BuQPlIyf.js → SelectEditor-eeAE7a9p.js} +1 -1
- package/dist/screen-editor/SliceEditor-DLqvdYge.js +51 -0
- package/dist/screen-editor/{StateChangeEditors-9k3Gqtc0.js → StateChangeEditors-OQ-OUDrv.js} +1 -1
- package/dist/screen-editor/TemplatePicker/TemplatePicker.d.ts +28 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerHandlers.d.ts +14 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerLabels.d.ts +27 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerMenu.d.ts +26 -0
- package/dist/screen-editor/TemplatePicker/describeTemplatePicker.d.ts +26 -0
- package/dist/screen-editor/TemplatePicker/index.d.ts +6 -0
- package/dist/screen-editor/TemplatePicker/templateMatchesFilter.d.ts +11 -0
- package/dist/screen-editor/TemplatePropertyEditor-D_OaRTPe.js +38 -0
- package/dist/screen-editor/index.js +4671 -2982
- package/dist/screen-editor/screen-editor.css +1 -1
- package/dist/screen-editor/toTemplateSources-CN-BMZ39.js +492 -0
- package/package.json +12 -12
- package/dist/screen-editor/ReferenceTargetEditors-COKAWO5q.js +0 -19
- package/dist/screen-editor/ScreenEditor/Inspector/TemplateBrowser.d.ts +0 -13
- package/dist/screen-editor/ScreenEditor/Templates/TemplateInapplicability.d.ts +0 -4
- package/dist/screen-editor/ScreenEditor/Templates/templateBrowser.d.ts +0 -21
- package/dist/screen-editor/SearchableSelect-WUNlC3tk.js +0 -109
- package/dist/screen-editor/SliceEditor-Dle8OlsB.js +0 -45
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CascadeEntryKind } from './CascadeEntryKind';
|
|
2
|
+
/** A further action on a row, offered beside it - for example copying a blueprint template into the user's own. */
|
|
3
|
+
export interface CascadeSecondaryAction {
|
|
4
|
+
/** What the action is called. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Called when the action is chosen. The menu stays open unless `closes` is set. */
|
|
7
|
+
onActivate: () => void;
|
|
8
|
+
/** Whether the menu closes after the action. */
|
|
9
|
+
closes?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** A heading, subheading, separator or note: a row with a label and nothing to choose. */
|
|
12
|
+
export interface CascadeStaticEntry {
|
|
13
|
+
kind: CascadeEntryKind.Heading | CascadeEntryKind.Subheading | CascadeEntryKind.Separator | CascadeEntryKind.Note;
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/** A row that does something when chosen. */
|
|
18
|
+
export interface CascadeItemEntry {
|
|
19
|
+
kind: CascadeEntryKind.Item;
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
/** Text aligned to the right of the row, such as a locale. */
|
|
23
|
+
trailing?: string;
|
|
24
|
+
/** A line under the label. */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** Whether this is the current choice: it shows a check and the highlighted row. */
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
/** Why the row cannot be chosen, when it cannot. */
|
|
29
|
+
disabledReason?: string;
|
|
30
|
+
/** Further actions offered beside the row, in order. */
|
|
31
|
+
actions?: CascadeSecondaryAction[];
|
|
32
|
+
/** Called when the row is chosen. The menu closes afterwards. */
|
|
33
|
+
onActivate: () => void;
|
|
34
|
+
}
|
|
35
|
+
/** A row that opens a further panel. */
|
|
36
|
+
export interface CascadeSubmenuEntry {
|
|
37
|
+
kind: CascadeEntryKind.Submenu;
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
/** The rows of the panel it opens. */
|
|
41
|
+
entries: CascadeEntry[];
|
|
42
|
+
}
|
|
43
|
+
/** One row of a cascading menu. */
|
|
44
|
+
export type CascadeEntry = CascadeStaticEntry | CascadeItemEntry | CascadeSubmenuEntry;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What a row of a cascading menu is. */
|
|
2
|
+
export declare enum CascadeEntryKind {
|
|
3
|
+
/** A small-caps heading over the rows below it. */
|
|
4
|
+
Heading = "heading",
|
|
5
|
+
/** A sentence-case heading nested under a heading, such as a category. */
|
|
6
|
+
Subheading = "subheading",
|
|
7
|
+
/** A row that does something when chosen. */
|
|
8
|
+
Item = "item",
|
|
9
|
+
/** A row that opens a further panel beside the menu. */
|
|
10
|
+
Submenu = "submenu",
|
|
11
|
+
/** A thin rule between groups. */
|
|
12
|
+
Separator = "separator",
|
|
13
|
+
/** A line of explanation that cannot be chosen. */
|
|
14
|
+
Note = "note"
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The filter field at the top of a cascading menu. */
|
|
2
|
+
export interface CascadeFilter {
|
|
3
|
+
/** What has been typed. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** The field's placeholder, which is also its accessible name. */
|
|
6
|
+
placeholder: string;
|
|
7
|
+
/** Called as the text changes. */
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CascadeEntry } from './CascadeEntry';
|
|
2
|
+
import { CascadeFilter } from './CascadeFilter';
|
|
3
|
+
export interface CascadeMenuProps {
|
|
4
|
+
/** Where the menu opens: the control that was pressed. */
|
|
5
|
+
anchor: DOMRect;
|
|
6
|
+
/** The control that opened the menu. Pressing it again is its own to handle, so it does not count as clicking elsewhere. */
|
|
7
|
+
trigger?: HTMLElement | null;
|
|
8
|
+
/** The rows of the first panel. */
|
|
9
|
+
entries: CascadeEntry[];
|
|
10
|
+
/** The accessible name of the menu. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** The filter field at the top of the first panel, when there is one. */
|
|
13
|
+
filter?: CascadeFilter;
|
|
14
|
+
/** Called when the menu should go away: a row was chosen, the user pressed elsewhere or pressed Escape. */
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A cascading menu: a first panel whose rows may open further panels beside it, the way a desktop menu does.
|
|
19
|
+
*
|
|
20
|
+
* It is the one menu Studio draws for choosing among own things and blueprint things - templates and sample data -
|
|
21
|
+
* so the structure (own first, blueprints one level deeper) and the keyboard behaviour exist once. It is drawn on the
|
|
22
|
+
* page, not inside the region it belongs to, so nothing clips it; arrow keys move through rows, the right arrow opens a
|
|
23
|
+
* submenu and the left arrow or Escape closes it, Tab stays inside the menu, and focus returns to what opened it.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CascadeMenu: ({ anchor, trigger, entries, label, filter, onClose }: CascadeMenuProps) => import("react").ReactPortal;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CascadeEntry } from './CascadeEntry';
|
|
2
|
+
import { CascadeFilter } from './CascadeFilter';
|
|
3
|
+
import { OpenSubmenu } from './OpenSubmenu';
|
|
4
|
+
import { type PanelRect } from './placeCascadePanel';
|
|
5
|
+
export interface CascadePanelProps {
|
|
6
|
+
/** The rows of the panel. */
|
|
7
|
+
entries: CascadeEntry[];
|
|
8
|
+
/** How deep the panel is: 0 for the first. */
|
|
9
|
+
depth: number;
|
|
10
|
+
/** Where the panel opens: the control that opened the menu for the first panel, the opening row for the rest. */
|
|
11
|
+
anchor: PanelRect;
|
|
12
|
+
/** The submenus open at this moment, outermost first. */
|
|
13
|
+
openPath: OpenSubmenu[];
|
|
14
|
+
/** The accessible name of the panel. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** The filter field, on the first panel only. */
|
|
17
|
+
filter?: CascadeFilter;
|
|
18
|
+
/** Opens a submenu from a row. */
|
|
19
|
+
onOpen: (depth: number, submenu: OpenSubmenu) => void;
|
|
20
|
+
/** Closes every submenu from `depth` inward. */
|
|
21
|
+
onCollapse: (depth: number) => void;
|
|
22
|
+
/** Called when something was chosen. */
|
|
23
|
+
onChosen: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** One panel of a cascading menu: headings, rows, and the rows that open the next panel. */
|
|
26
|
+
export declare const CascadePanel: ({ entries, depth, anchor, openPath, label, filter, onOpen, onCollapse, onChosen }: CascadePanelProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PanelRect } from './placeCascadePanel';
|
|
2
|
+
/** A submenu that is open, and the row it opened from. */
|
|
3
|
+
export interface OpenSubmenu {
|
|
4
|
+
/** The identifier of the row that opened it. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Where that row is, which the panel is placed beside. */
|
|
7
|
+
rect: PanelRect;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** The key a cascading menu reacts to, as a direction through its rows or across its panels. */
|
|
2
|
+
export declare enum CascadeStep {
|
|
3
|
+
Previous = "previous",
|
|
4
|
+
Next = "next",
|
|
5
|
+
First = "first",
|
|
6
|
+
Last = "last",
|
|
7
|
+
Into = "into",
|
|
8
|
+
Out = "out"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a key press means to a cascading menu, or `undefined` when the menu leaves it alone.
|
|
12
|
+
*
|
|
13
|
+
* @param key The pressed key.
|
|
14
|
+
* @param isTextField Whether focus is in a text field, which keeps the arrow keys that move its caret.
|
|
15
|
+
* @returns The step.
|
|
16
|
+
*/
|
|
17
|
+
export declare function stepForKey(key: string, isTextField: boolean): CascadeStep | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Where focus lands after a step through a panel's rows. Moving past either end wraps round, so a keyboard user can
|
|
20
|
+
* never be left on a row with nowhere to go.
|
|
21
|
+
*
|
|
22
|
+
* @param step The step through the rows - `Previous`, `Next`, `First` or `Last`.
|
|
23
|
+
* @param current The row that has focus, or -1 when none does.
|
|
24
|
+
* @param count How many rows can take focus.
|
|
25
|
+
* @returns The index to focus, or -1 when there are no rows.
|
|
26
|
+
*/
|
|
27
|
+
export declare function focusTarget(step: CascadeStep, current: number, count: number): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SyntheticEvent } from 'react';
|
|
2
|
+
declare const keepInput: (event: SyntheticEvent) => void;
|
|
3
|
+
/** Every way a user reaches into a menu. Spread it on the menu's outermost element, inside the portal. */
|
|
4
|
+
export declare const menuInputBoundary: {
|
|
5
|
+
readonly onPointerDown: typeof keepInput;
|
|
6
|
+
readonly onPointerUp: typeof keepInput;
|
|
7
|
+
readonly onMouseDown: typeof keepInput;
|
|
8
|
+
readonly onMouseUp: typeof keepInput;
|
|
9
|
+
readonly onClick: typeof keepInput;
|
|
10
|
+
readonly onDoubleClick: typeof keepInput;
|
|
11
|
+
readonly onContextMenu: typeof keepInput;
|
|
12
|
+
readonly onWheel: typeof keepInput;
|
|
13
|
+
readonly onKeyUp: typeof keepInput;
|
|
14
|
+
readonly onDragStart: typeof keepInput;
|
|
15
|
+
};
|
|
16
|
+
/** Ends React's bubbling of a key press, for the one handler that needs to see it first. */
|
|
17
|
+
export declare const keepKeyInMenu: typeof keepInput;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** A rectangle in viewport coordinates. */
|
|
2
|
+
export interface PanelRect {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/** The size of the viewport. */
|
|
9
|
+
export interface PanelBounds {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
/** Where a panel is fixed, in viewport coordinates. */
|
|
14
|
+
export interface PanelPosition {
|
|
15
|
+
top: number;
|
|
16
|
+
left: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Places the first panel of a menu under (or, with no room, over) the control that opened it, aligned to its left
|
|
20
|
+
* edge, and keeps it inside the viewport.
|
|
21
|
+
*
|
|
22
|
+
* @param anchor The control's rectangle.
|
|
23
|
+
* @param size The panel's size once laid out.
|
|
24
|
+
* @param bounds The viewport.
|
|
25
|
+
* @returns The position.
|
|
26
|
+
*/
|
|
27
|
+
export declare function placePanelBelow(anchor: PanelRect, size: Pick<PanelRect, 'width' | 'height'>, bounds: PanelBounds): PanelPosition;
|
|
28
|
+
/**
|
|
29
|
+
* Places a submenu panel beside the row that opened it: to the right when there is room, otherwise to the left, with
|
|
30
|
+
* its top level with the row and pulled up when it would run off the bottom.
|
|
31
|
+
*
|
|
32
|
+
* @param row The row's rectangle.
|
|
33
|
+
* @param size The panel's size once laid out.
|
|
34
|
+
* @param bounds The viewport.
|
|
35
|
+
* @returns The position.
|
|
36
|
+
*/
|
|
37
|
+
export declare function placePanelBeside(row: PanelRect, size: Pick<PanelRect, 'width' | 'height'>, bounds: PanelBounds): PanelPosition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as m, o as _, v as N, y } from "./structuredValue-vqCZttsk.js";
|
|
2
|
-
import { FieldEditor as C } from "./FieldEditor-
|
|
2
|
+
import { FieldEditor as C } from "./FieldEditor-4a_4uQit.js";
|
|
3
3
|
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
var p = [
|
|
5
5
|
"start",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as c, t as g, v as w, y as m } from "./structuredValue-vqCZttsk.js";
|
|
2
|
-
import { FieldEditor as y } from "./FieldEditor-
|
|
2
|
+
import { FieldEditor as y } from "./FieldEditor-4a_4uQit.js";
|
|
3
3
|
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
var $ = ({ value: p, onChange: b, descriptor: h, context: l, disabled: a, problem: v, id: d }) => {
|
|
5
5
|
const s = l.strings.editors.list, o = g(p).filter((i) => typeof i == "string"), e = (i) => b(i.length === 0 ? void 0 : i), f = {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { o as f } from "./structuredValue-vqCZttsk.js";
|
|
2
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
var h = (t) => f(t) && typeof t.module == "string" && t.module !== "" ? {
|
|
4
|
+
module: t.module,
|
|
5
|
+
...typeof t.feature == "string" && t.feature !== "" ? { feature: t.feature } : {}
|
|
6
|
+
} : void 0, l = (t, e) => t?.module === e?.module && (t?.feature ?? "") === (e?.feature ?? "");
|
|
7
|
+
function m(t, e, d, s) {
|
|
8
|
+
return e.flatMap((a) => {
|
|
9
|
+
const i = d ? `${d}.${a.id}` : a.id;
|
|
10
|
+
return [{
|
|
11
|
+
key: `${t}.${i}`,
|
|
12
|
+
label: a.name,
|
|
13
|
+
depth: s,
|
|
14
|
+
target: {
|
|
15
|
+
module: t,
|
|
16
|
+
feature: i
|
|
17
|
+
},
|
|
18
|
+
module: !1
|
|
19
|
+
}, ...m(t, a.features, i, s + 1)];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
var v = (t) => t.modules.flatMap((e) => [{
|
|
23
|
+
key: e.id,
|
|
24
|
+
label: e.name,
|
|
25
|
+
depth: 0,
|
|
26
|
+
target: { module: e.id },
|
|
27
|
+
module: !0
|
|
28
|
+
}, ...m(e.id, e.features, "", 1)]), k = ({ value: t, onChange: e, context: d, disabled: s, id: a }) => {
|
|
29
|
+
const i = d.strings.editors.navigationItemTarget, p = d.lookups.structure ?? { modules: [] }, u = v(p), r = h(t), g = r !== void 0 && !u.some((o) => l(o.target, r));
|
|
30
|
+
return /* @__PURE__ */ c("div", {
|
|
31
|
+
id: a,
|
|
32
|
+
className: "studio-editor-target",
|
|
33
|
+
role: "listbox",
|
|
34
|
+
"aria-labelledby": `${a}-label`,
|
|
35
|
+
"aria-disabled": s,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ n("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
role: "option",
|
|
40
|
+
"aria-selected": r === void 0,
|
|
41
|
+
disabled: s,
|
|
42
|
+
className: "studio-editor-target__row",
|
|
43
|
+
"data-chosen": r === void 0 || void 0,
|
|
44
|
+
onClick: () => e(void 0),
|
|
45
|
+
children: i.notLinked
|
|
46
|
+
}),
|
|
47
|
+
u.map((o) => /* @__PURE__ */ c("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
role: "option",
|
|
50
|
+
"aria-selected": l(o.target, r),
|
|
51
|
+
disabled: s,
|
|
52
|
+
"data-module": o.module || void 0,
|
|
53
|
+
"data-chosen": l(o.target, r) || void 0,
|
|
54
|
+
className: "studio-editor-target__row",
|
|
55
|
+
style: { paddingInlineStart: `${12 + o.depth * 16}px` },
|
|
56
|
+
onClick: () => e(o.target),
|
|
57
|
+
children: [/* @__PURE__ */ n("span", { children: o.label }), o.module && /* @__PURE__ */ n("span", {
|
|
58
|
+
className: "studio-editor-target__kind",
|
|
59
|
+
children: i.module
|
|
60
|
+
})]
|
|
61
|
+
}, o.key)),
|
|
62
|
+
g && /* @__PURE__ */ n("span", {
|
|
63
|
+
className: "studio-editor-chip studio-editor-chip--error",
|
|
64
|
+
role: "alert",
|
|
65
|
+
children: i.unresolved([r.module, r.feature].filter(Boolean).join(" › "))
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
k as NavigationItemTargetEditor
|
|
72
|
+
};
|
package/dist/screen-editor/{NavigationTargetEditor-DGnW5pVF.js → NavigationTargetEditor-BZ0uQnIl.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as g } from "./structuredValue-vqCZttsk.js";
|
|
2
|
-
import { t as v } from "./SearchableSelect-
|
|
2
|
+
import { t as v } from "./SearchableSelect-C4yzIyo_.js";
|
|
3
3
|
import { Fragment as f, jsx as l, jsxs as y } from "react/jsx-runtime";
|
|
4
4
|
var T = (o) => typeof o == "string" && o !== "" ? o : g(o) && typeof o.screen == "string" && o.screen !== "" ? o.screen : void 0, C = ({ value: o, onChange: b, descriptor: t, context: n, disabled: h, id: c }) => {
|
|
5
5
|
const r = n.strings.editors, d = n.lookups.destinations, s = T(o), a = d.find((e) => e.id === s), i = s !== void 0 && a === void 0, m = t.valueType === "destination", p = d.map((e) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as h } from "./SearchableSelect-
|
|
1
|
+
import { t as h } from "./SearchableSelect-C4yzIyo_.js";
|
|
2
2
|
import { Fragment as v, jsx as p, jsxs as g } from "react/jsx-runtime";
|
|
3
3
|
var L = ({ value: s, onChange: d, descriptor: i, context: l, disabled: u, problem: b, id: n }) => {
|
|
4
4
|
const o = l.strings.editors.select, c = i.editorOptions?.reference, m = c ? l.lookups.references(c.target) : [], r = typeof s == "string" && s !== "" ? s : void 0, t = m.map((e) => ({
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReferenceEditor as t } from "./ReferenceEditor-BGuaEvY7.js";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
var i = (e) => (r) => /* @__PURE__ */ o(t, {
|
|
4
|
+
...r,
|
|
5
|
+
descriptor: {
|
|
6
|
+
...r.descriptor,
|
|
7
|
+
editorOptions: {
|
|
8
|
+
...r.descriptor.editorOptions,
|
|
9
|
+
reference: {
|
|
10
|
+
target: e,
|
|
11
|
+
...r.descriptor.editorOptions?.reference
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}), c = i("sampleData");
|
|
16
|
+
export {
|
|
17
|
+
c as SampleDataEditor
|
|
18
|
+
};
|
package/dist/screen-editor/{RenderingSlotEditor-Cani_PtT.js → RenderingSlotEditor-D0ppEIOx.js}
RENAMED
|
@@ -74,11 +74,11 @@ function u(i, n) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
var p = ({ value: i, onChange: n, context: o, disabled: h, id: r }) => {
|
|
77
|
-
const
|
|
77
|
+
const c = o.strings.editors.renderingSlot, l = o.lookups.slots, t = typeof i == "string" && i !== "" ? i : void 0, a = t !== void 0 && !l.includes(t) ? [...l, t] : l;
|
|
78
78
|
return a.length === 0 ? /* @__PURE__ */ s("p", {
|
|
79
79
|
id: r,
|
|
80
80
|
className: "studio-editor-properties__hint",
|
|
81
|
-
children:
|
|
81
|
+
children: c.none
|
|
82
82
|
}) : /* @__PURE__ */ g("div", {
|
|
83
83
|
id: r,
|
|
84
84
|
className: "studio-editor-slot",
|
|
@@ -93,13 +93,13 @@ var p = ({ value: i, onChange: n, context: o, disabled: h, id: r }) => {
|
|
|
93
93
|
disabled: h,
|
|
94
94
|
className: `studio-editor-chip${e === t ? " studio-editor-chip--chosen" : ""}`,
|
|
95
95
|
onClick: () => n(e === t ? void 0 : e),
|
|
96
|
-
children: e
|
|
96
|
+
children: c.names[e] ?? e
|
|
97
97
|
}, e))
|
|
98
98
|
}), /* @__PURE__ */ g("svg", {
|
|
99
99
|
className: "studio-editor-slot__diagram",
|
|
100
100
|
viewBox: "0 0 100 60",
|
|
101
101
|
role: "img",
|
|
102
|
-
"aria-label": t ?
|
|
102
|
+
"aria-label": t ? c.diagram(t) : "",
|
|
103
103
|
children: [/* @__PURE__ */ s("rect", {
|
|
104
104
|
x: "0.5",
|
|
105
105
|
y: "0.5",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
4
|
+
import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
|
|
5
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
6
|
+
import type { DesignModeState } from './useDesignMode';
|
|
7
|
+
export interface DesignModeChromeProps {
|
|
8
|
+
surface: RefObject<HTMLDivElement | null>;
|
|
9
|
+
state: DesignModeState;
|
|
10
|
+
controller: ScreenEditorController;
|
|
11
|
+
environment: ScreenEditorEnvironment;
|
|
12
|
+
editorStrings: ScreenEditorStrings;
|
|
13
|
+
strings: DesignModeStrings;
|
|
14
|
+
}
|
|
15
|
+
export declare const DesignModeChrome: ({ surface, state, controller, environment, editorStrings, strings }: DesignModeChromeProps) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
4
|
+
export interface DesignModeFramesProps {
|
|
5
|
+
surface: RefObject<HTMLDivElement | null>;
|
|
6
|
+
controller: ScreenEditorController;
|
|
7
|
+
strings: DesignModeStrings;
|
|
8
|
+
}
|
|
9
|
+
export declare const DesignModeFrames: ({ surface, controller, strings }: DesignModeFramesProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
import type { Rect } from '../Surface/dropRegionRects';
|
|
3
|
+
import type { EditorContext } from '../PropertyEditors/Registry/PropertyEditorProps';
|
|
4
|
+
import type { PropertyEditorRegistry } from '../PropertyEditors/Registry/PropertyEditorRegistry';
|
|
5
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
6
|
+
export interface DesignModePopoverProps {
|
|
7
|
+
registry: PropertyEditorRegistry;
|
|
8
|
+
property: InspectedProperty;
|
|
9
|
+
context: EditorContext;
|
|
10
|
+
componentId: string;
|
|
11
|
+
anchor: Rect;
|
|
12
|
+
opener: HTMLElement;
|
|
13
|
+
bounds: Rect;
|
|
14
|
+
title: string;
|
|
15
|
+
strings: DesignModeStrings;
|
|
16
|
+
onChange: (property: InspectedProperty, value: unknown) => void;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const DesignModePopover: ({ registry, property, context, componentId, anchor, opener, bounds, title, strings, onChange, onClose }: DesignModePopoverProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface DesignModeStrings {
|
|
2
|
+
toolbarLabel: (itemLabel: string) => string;
|
|
3
|
+
titleField: string;
|
|
4
|
+
notLinked: string;
|
|
5
|
+
chooseSlice: string;
|
|
6
|
+
mainArea: string;
|
|
7
|
+
emphasis: Record<string, string>;
|
|
8
|
+
noSliceWarning: string;
|
|
9
|
+
readOnlyReasons: Record<string, string>;
|
|
10
|
+
inheritedFrom: (origin: string) => string;
|
|
11
|
+
editAtOwner: string;
|
|
12
|
+
choiceLabel: (title: string) => string;
|
|
13
|
+
close: string;
|
|
14
|
+
toolbar: {
|
|
15
|
+
opensAsDialog: string;
|
|
16
|
+
dialogFromSlice: (template: string) => string;
|
|
17
|
+
dialogDefault: (template: string) => string;
|
|
18
|
+
sliceHelp: string;
|
|
19
|
+
stateChangeHeading: string;
|
|
20
|
+
notInvokableHeading: string;
|
|
21
|
+
upgrade: string;
|
|
22
|
+
upgradeNote: (slice: string) => string;
|
|
23
|
+
};
|
|
24
|
+
navigation: {
|
|
25
|
+
application: string;
|
|
26
|
+
extendsNotice: string;
|
|
27
|
+
overrideHere: string;
|
|
28
|
+
editAtApplication: string;
|
|
29
|
+
backToModule: (module: string) => string;
|
|
30
|
+
tagLong: (region: string, sources: string) => string;
|
|
31
|
+
regionName: Record<string, string>;
|
|
32
|
+
inheritedFromApplication: string;
|
|
33
|
+
inheritedNote: (module: string) => string;
|
|
34
|
+
definedIn: (scope: string) => string;
|
|
35
|
+
inheritedReadOnly: string;
|
|
36
|
+
navigationItem: string;
|
|
37
|
+
label: string;
|
|
38
|
+
navigateTo: string;
|
|
39
|
+
renderIntoSlot: string;
|
|
40
|
+
icon: string;
|
|
41
|
+
notLinked: string;
|
|
42
|
+
mainArea: string;
|
|
43
|
+
sidePanel: string;
|
|
44
|
+
modeTitle: (region: string, scope: string) => string;
|
|
45
|
+
modeDescription: (region: string) => string;
|
|
46
|
+
modes: Record<'inherit' | 'extend' | 'override', {
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
}>;
|
|
50
|
+
copyPrompt: string;
|
|
51
|
+
copyYes: string;
|
|
52
|
+
copyNo: string;
|
|
53
|
+
logo: string;
|
|
54
|
+
logoTitle: string;
|
|
55
|
+
logoImage: string;
|
|
56
|
+
logoLocked: string;
|
|
57
|
+
target: {
|
|
58
|
+
heading: string;
|
|
59
|
+
application: string;
|
|
60
|
+
module: string;
|
|
61
|
+
unresolved: (target: string) => string;
|
|
62
|
+
};
|
|
63
|
+
problems: Record<string, string>;
|
|
64
|
+
};
|
|
65
|
+
announce: {
|
|
66
|
+
added: (label: string) => string;
|
|
67
|
+
moved: (label: string, position: number, of: number) => string;
|
|
68
|
+
duplicated: (label: string) => string;
|
|
69
|
+
removed: (label: string) => string;
|
|
70
|
+
refused: (reason: string) => string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export declare const defaultDesignModeStrings: DesignModeStrings;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Rect } from '../Surface/dropRegionRects';
|
|
2
|
+
import { type DesignModeItem, type DesignModeReadOnlyAction, type DesignModeSubject } from './designModeTypes';
|
|
3
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
4
|
+
export interface FloatingItemToolbarProps {
|
|
5
|
+
subject: DesignModeSubject;
|
|
6
|
+
item: DesignModeItem;
|
|
7
|
+
anchor: Rect;
|
|
8
|
+
bounds: Rect;
|
|
9
|
+
strings: DesignModeStrings;
|
|
10
|
+
renameToken: number;
|
|
11
|
+
chipLabel: (actionId: string, item: DesignModeItem) => string;
|
|
12
|
+
onRename: (label: string) => void;
|
|
13
|
+
onAction: (actionId: string) => void;
|
|
14
|
+
onChoice: (actionId: string, chip: HTMLElement) => void;
|
|
15
|
+
readOnlyActions: readonly DesignModeReadOnlyAction[];
|
|
16
|
+
onReadOnlyAction: (action: DesignModeReadOnlyAction) => void;
|
|
17
|
+
onLeave: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const FloatingItemToolbar: ({ subject, item, anchor, bounds, strings, renameToken, chipLabel, onRename, onAction, onChoice, readOnlyActions, onReadOnlyAction, onLeave }: FloatingItemToolbarProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ApplicationStructure, NavigationModel } from '@cratis/scene.model';
|
|
3
|
+
export interface EditorNavigationScopeProps {
|
|
4
|
+
structure: ApplicationStructure;
|
|
5
|
+
navigation: NavigationModel;
|
|
6
|
+
module: string | undefined;
|
|
7
|
+
logoLockedReason: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const EditorNavigationScope: ({ structure, navigation, module, logoLockedReason, children }: EditorNavigationScopeProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NavigationRegionKind, type NavigationModel, type NavItem, type SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
export type NavigationDocument = SceneDocument & {
|
|
3
|
+
navigation?: NavigationModel;
|
|
4
|
+
};
|
|
5
|
+
export declare const emptyNavigation: () => NavigationModel;
|
|
6
|
+
export declare const navigationOf: (document: SceneDocument) => NavigationModel;
|
|
7
|
+
export declare const withNavigation: (document: SceneDocument, navigation: NavigationModel) => SceneDocument;
|
|
8
|
+
export declare function ownItemsOf(navigation: NavigationModel, module: string | undefined, region: NavigationRegionKind): NavItem[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NavItem } from '@cratis/scene.model';
|
|
2
|
+
export declare const changeItem: (items: readonly NavItem[], id: string, change: Partial<NavItem>) => NavItem[];
|
|
3
|
+
export declare const removeItem: (items: readonly NavItem[], id: string) => NavItem[];
|
|
4
|
+
export declare function findItem(items: readonly NavItem[], id: string): NavItem | undefined;
|
|
5
|
+
export declare function siblingsOf(items: readonly NavItem[], id: string): readonly NavItem[] | undefined;
|
|
6
|
+
export declare function moveItem(items: readonly NavItem[], id: string, to: number): NavItem[];
|
|
7
|
+
export declare const cloneItem: (item: NavItem, newId: () => string) => NavItem;
|
|
8
|
+
export declare function duplicateItem(items: readonly NavItem[], id: string, newId: () => string): {
|
|
9
|
+
items: NavItem[];
|
|
10
|
+
copy?: NavItem;
|
|
11
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NavigationRegionKind, type ApplicationStructure, type NavigationModel } from '@cratis/scene.model';
|
|
2
|
+
import { type DesignModeItemSource } from '../designModeTypes';
|
|
3
|
+
export interface RegionSourceInputs {
|
|
4
|
+
region: NavigationRegionKind;
|
|
5
|
+
module: string | undefined;
|
|
6
|
+
navigation: NavigationModel;
|
|
7
|
+
structure: ApplicationStructure;
|
|
8
|
+
newId: () => string;
|
|
9
|
+
slots: readonly string[];
|
|
10
|
+
startingLabel: string;
|
|
11
|
+
strings: RegionStrings;
|
|
12
|
+
}
|
|
13
|
+
export interface RegionStrings {
|
|
14
|
+
tagLong: (region: NavigationRegionKind, sources: string) => string;
|
|
15
|
+
extendsNotice: string;
|
|
16
|
+
overrideHere: string;
|
|
17
|
+
editAtApplication: string;
|
|
18
|
+
application: string;
|
|
19
|
+
mainArea: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function targetLabel(structure: ApplicationStructure, target: {
|
|
22
|
+
module?: string;
|
|
23
|
+
feature?: string;
|
|
24
|
+
} | undefined): string | undefined;
|
|
25
|
+
export declare function createRegionItemSource(inputs: RegionSourceInputs): DesignModeItemSource;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DestinationReference, type InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
import { type DesignModeItemSource } from './designModeTypes';
|
|
3
|
+
export interface CollectionItemSourceInputs {
|
|
4
|
+
componentId: string;
|
|
5
|
+
property: InspectedProperty;
|
|
6
|
+
newId: () => string;
|
|
7
|
+
startingLabel: string;
|
|
8
|
+
startingDestination?: DestinationReference;
|
|
9
|
+
}
|
|
10
|
+
export declare function createCollectionItemSource({ componentId, property, newId, startingLabel, startingDestination }: CollectionItemSourceInputs): DesignModeItemSource;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DeleteKeyEvent } from '../Structure/isDeleteKey';
|
|
2
|
+
import type { DesignModeState } from './useDesignMode';
|
|
3
|
+
export interface DesignModeKeyEvent extends DeleteKeyEvent {
|
|
4
|
+
preventDefault: () => void;
|
|
5
|
+
stopPropagation: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function handleDesignModeKey(event: DesignModeKeyEvent, state: DesignModeState, focusTitle: () => boolean): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DesignModeItemAction } from '@cratis/scene.model';
|
|
2
|
+
import { type DesignModeItem } from './designModeTypes';
|
|
3
|
+
export declare function isAvailableOn(action: DesignModeItemAction, item: DesignModeItem): boolean;
|
|
4
|
+
export declare const inheritedReasonRule = "item.inherited";
|
|
5
|
+
export interface ActionState {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function actionStateOf(action: DesignModeItemAction, item: DesignModeItem): ActionState;
|