@cratis/scene 0.105.6

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 (42) hide show
  1. package/README.md +96 -0
  2. package/dist/AnchorEdges.d.ts +11 -0
  3. package/dist/CategoryAttribute.d.ts +9 -0
  4. package/dist/Component.d.ts +38 -0
  5. package/dist/ComponentLibraryAttribute.d.ts +9 -0
  6. package/dist/ContentControl.d.ts +11 -0
  7. package/dist/Control.d.ts +43 -0
  8. package/dist/ExternalComponent.d.ts +15 -0
  9. package/dist/FrameworkElement.d.ts +41 -0
  10. package/dist/IComponent.d.ts +52 -0
  11. package/dist/IPrototypeComponentDiscovery.d.ts +2 -0
  12. package/dist/IUIElement.d.ts +5 -0
  13. package/dist/ItemsControl.d.ts +16 -0
  14. package/dist/Layout/HorizontalAlignment.d.ts +9 -0
  15. package/dist/Layout/PrototypeLayout.d.ts +9 -0
  16. package/dist/Layout/Thickness.d.ts +21 -0
  17. package/dist/Layout/VerticalAlignment.d.ts +9 -0
  18. package/dist/Layout/Visibility.d.ts +8 -0
  19. package/dist/Panel.d.ts +15 -0
  20. package/dist/Position.d.ts +4 -0
  21. package/dist/PrototypeComponentDiscovery.d.ts +22 -0
  22. package/dist/PrototypeComponentRegistry-FLUzIk5a.js +148 -0
  23. package/dist/PrototypeComponentRegistry.d.ts +28 -0
  24. package/dist/Prototypes/Editor/editorTypes.d.ts +35 -0
  25. package/dist/Prototypes/Rendering/PrototypeThumbnail.d.ts +21 -0
  26. package/dist/Prototypes/Rendering/SceneMessages.d.ts +6 -0
  27. package/dist/Prototypes/Rendering/SceneMessagesContext.d.ts +3 -0
  28. package/dist/Prototypes/Rendering/SceneMessagesProvider.d.ts +7 -0
  29. package/dist/Prototypes/Rendering/TrafficLights.d.ts +9 -0
  30. package/dist/Prototypes/Rendering/defaultSceneMessages.d.ts +2 -0
  31. package/dist/Prototypes/Rendering/index.d.ts +6 -0
  32. package/dist/Prototypes/index.d.ts +2 -0
  33. package/dist/Prototypes/index.js +151 -0
  34. package/dist/ResizeBevhavior.d.ts +1 -0
  35. package/dist/SceneObject.d.ts +14 -0
  36. package/dist/Size.d.ts +4 -0
  37. package/dist/UIElement.d.ts +36 -0
  38. package/dist/WellKnownCategories.d.ts +20 -0
  39. package/dist/index.d.ts +23 -0
  40. package/dist/index.js +261 -0
  41. package/dist/scene.css +2 -0
  42. package/package.json +76 -0
@@ -0,0 +1,35 @@
1
+ import { AnchorEdges } from '../../AnchorEdges';
2
+ import { PrototypeLayout } from '../../Layout/PrototypeLayout';
3
+ import type { IComponent } from '../../IComponent';
4
+ export type ResizeHandle = 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
5
+ export type PrototypeSurfaceElementType = string;
6
+ export type PrototypeElementType = PrototypeSurfaceElementType;
7
+ export type PrototypeTool = PrototypeSurfaceElementType | 'select';
8
+ export interface PrototypeComponentReference {
9
+ name: string;
10
+ category: string;
11
+ library: string;
12
+ bundlePath: string;
13
+ type: string;
14
+ }
15
+ export interface PrototypeComponentDefinition extends PrototypeComponentReference {
16
+ component?: IComponent;
17
+ }
18
+ export interface PrototypeComponentCategoryDefinition {
19
+ name: string;
20
+ components: PrototypeComponentDefinition[];
21
+ }
22
+ export interface PrototypeComponentLibraryDefinition {
23
+ name: string;
24
+ bundlePath: string;
25
+ categories: PrototypeComponentCategoryDefinition[];
26
+ }
27
+ /** The payload describing a component dragged from the toolbox onto the prototype surface. */
28
+ export interface PrototypeDropItem {
29
+ type: PrototypeSurfaceElementType;
30
+ component?: PrototypeComponentDefinition;
31
+ }
32
+ export type PrototypeSurfaceElement = IComponent;
33
+ export type PrototypeElement = PrototypeSurfaceElement;
34
+ export declare const allAnchorEdgesForEditor: AnchorEdges;
35
+ export { AnchorEdges, PrototypeLayout };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { IComponent } from '../../IComponent';
3
+ import type { UIElement } from '../../UIElement';
4
+ import { PrototypeLayout } from '../../Layout/PrototypeLayout';
5
+ export interface PrototypeThumbnailProps {
6
+ elements: readonly (UIElement | IComponent)[];
7
+ /**
8
+ * The size of the prototype editor window this thumbnail previews (the outer window size, including
9
+ * the title bar). The canvas region is scaled down uniformly to this aspect ratio so the preview is an
10
+ * exact, smaller copy. Falls back to the editor's default window size when the window has not been
11
+ * resized yet.
12
+ */
13
+ windowSize?: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ /** The layout the surface arranges its elements with, so the preview flows them the same way the editor does. */
18
+ layout?: PrototypeLayout;
19
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
20
+ }
21
+ export declare const PrototypeThumbnail: React.FC<PrototypeThumbnailProps>;
@@ -0,0 +1,6 @@
1
+ export interface SceneMessages {
2
+ prototypeThumbnail: {
3
+ openEditor: string;
4
+ windowTitle: string;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ import type { SceneMessages } from './SceneMessages';
2
+ export declare const SceneMessagesContext: import("react").Context<SceneMessages>;
3
+ export declare const useSceneMessages: () => SceneMessages;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { SceneMessages } from './SceneMessages';
3
+ export interface SceneMessagesProviderProps {
4
+ messages: SceneMessages;
5
+ children?: React.ReactNode;
6
+ }
7
+ export declare const SceneMessagesProvider: ({ messages, children }: SceneMessagesProviderProps) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface TrafficLightsProps {
2
+ /**
3
+ * Optional pixel diameter for each light. When omitted the lights use the CSS default (12px) of the
4
+ * full-size window. Pass a smaller value (e.g. for the thumbnail) to render the same colored lights at
5
+ * a fixed, legible size that does not scale with the window.
6
+ */
7
+ size?: number;
8
+ }
9
+ export declare const TrafficLights: ({ size }: TrafficLightsProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { SceneMessages } from './SceneMessages';
2
+ export declare const defaultSceneMessages: SceneMessages;
@@ -0,0 +1,6 @@
1
+ export * from './SceneMessages';
2
+ export * from './defaultSceneMessages';
3
+ export * from './SceneMessagesContext';
4
+ export * from './SceneMessagesProvider';
5
+ export * from './TrafficLights';
6
+ export * from './PrototypeThumbnail';
@@ -0,0 +1,2 @@
1
+ export * from './Rendering';
2
+ export * from './Editor/editorTypes';
@@ -0,0 +1,151 @@
1
+ import { l as n, o as A, p as q } from "../PrototypeComponentRegistry-FLUzIk5a.js";
2
+ import { createContext as M, useContext as P } from "react";
3
+ import { Fragment as x, jsx as i, jsxs as f } from "react/jsx-runtime";
4
+ var W = { prototypeThumbnail: {
5
+ openEditor: "Open prototype editor",
6
+ windowTitle: "Prototype"
7
+ } }, b = M(W), R = () => P(b), Q = ({ messages: e, children: t }) => /* @__PURE__ */ i(b.Provider, {
8
+ value: e,
9
+ children: t
10
+ }), C = [
11
+ "#f66",
12
+ "#fa0",
13
+ "#3c3"
14
+ ], D = ({ size: e }) => /* @__PURE__ */ i(x, { children: C.map((t, r) => /* @__PURE__ */ i("div", {
15
+ className: "prototype-window-traffic-light",
16
+ style: {
17
+ border: `${e ? Math.max(1, e / 8) : 1.5}px solid ${t}`,
18
+ ...e ? {
19
+ width: e,
20
+ height: e
21
+ } : {}
22
+ }
23
+ }, r)) }), F = (e) => {
24
+ switch (e) {
25
+ case n.flexRow:
26
+ return {
27
+ display: "flex",
28
+ flexDirection: "row",
29
+ flexWrap: "wrap",
30
+ gap: 12,
31
+ padding: 12,
32
+ alignContent: "flex-start"
33
+ };
34
+ case n.flexColumn:
35
+ return {
36
+ display: "flex",
37
+ flexDirection: "column",
38
+ gap: 12,
39
+ padding: 12
40
+ };
41
+ case n.grid:
42
+ return {
43
+ display: "grid",
44
+ gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
45
+ gap: 12,
46
+ padding: 12,
47
+ alignContent: "flex-start"
48
+ };
49
+ default:
50
+ return {};
51
+ }
52
+ }, O = 900, S = 640, B = 40, G = 150, v = 16, $ = (e) => {
53
+ const t = e;
54
+ if (t.position && typeof t.position.x == "number") return {
55
+ x: t.position.x,
56
+ y: t.position.y ?? 0
57
+ };
58
+ const r = t.properties?.canvas ?? {};
59
+ return {
60
+ x: r.x ?? 0,
61
+ y: r.y ?? 0
62
+ };
63
+ }, U = (e) => {
64
+ const t = e;
65
+ return t.size && typeof t.size.width == "number" ? {
66
+ width: t.size.width,
67
+ height: t.size.height ?? 0
68
+ } : {
69
+ width: t.width ?? 0,
70
+ height: t.height ?? 0
71
+ };
72
+ }, V = ({ elements: e, windowSize: t, layout: r = n.absolute, onClick: p }) => {
73
+ const s = R().prototypeThumbnail, w = t && t.width > 0 ? t.width : O, T = t && t.height > 0 ? t.height : S, E = r !== n.absolute, H = r === n.grid, l = w, d = Math.max(1, T - B), h = G / l, I = Math.round(l * h), _ = Math.round(d * h), c = /* @__PURE__ */ f(x, { children: [/* @__PURE__ */ f("div", {
74
+ className: "prototype-thumbnail-title-bar",
75
+ style: { height: v },
76
+ children: [/* @__PURE__ */ i(D, { size: 6 }), /* @__PURE__ */ i("span", {
77
+ className: "prototype-thumbnail-title",
78
+ children: s.windowTitle
79
+ })]
80
+ }), /* @__PURE__ */ i("div", {
81
+ className: "prototype-thumbnail-body",
82
+ inert: !0,
83
+ children: /* @__PURE__ */ i("div", {
84
+ className: "prototype-thumbnail-canvas-scaler",
85
+ style: {
86
+ width: l,
87
+ height: d,
88
+ transform: `scale(${h})`,
89
+ transformOrigin: "top left",
90
+ ...F(r)
91
+ },
92
+ children: e.filter(Boolean).map((L) => {
93
+ const o = A(L), y = String(o.id), g = $(o), a = U(o), u = E ? {
94
+ position: "relative",
95
+ width: H ? "100%" : a.width,
96
+ height: a.height,
97
+ flexShrink: 0
98
+ } : {
99
+ position: "absolute",
100
+ left: g.x,
101
+ top: g.y,
102
+ width: a.width,
103
+ height: a.height
104
+ };
105
+ if ("RenderPrototype" in o && typeof o.RenderPrototype == "function") return /* @__PURE__ */ i("div", {
106
+ style: {
107
+ ...u,
108
+ pointerEvents: "none",
109
+ overflow: "hidden"
110
+ },
111
+ children: o.RenderPrototype({
112
+ component: o,
113
+ label: o.label
114
+ })
115
+ }, y);
116
+ const N = "type" in o && typeof o.type == "string" ? ` prototype-thumbnail-element--${o.type}` : "";
117
+ return /* @__PURE__ */ i("div", {
118
+ className: `prototype-thumbnail-element${N}`,
119
+ style: u
120
+ }, y);
121
+ })
122
+ })
123
+ })] }), m = {
124
+ width: I,
125
+ height: v + _
126
+ };
127
+ return p ? /* @__PURE__ */ i("button", {
128
+ className: "prototype-thumbnail",
129
+ onClick: p,
130
+ title: s.openEditor,
131
+ style: m,
132
+ children: c
133
+ }) : /* @__PURE__ */ i("div", {
134
+ className: "prototype-thumbnail",
135
+ role: "img",
136
+ "aria-label": s.windowTitle,
137
+ style: m,
138
+ children: c
139
+ });
140
+ }, X = 15;
141
+ export {
142
+ q as AnchorEdges,
143
+ n as PrototypeLayout,
144
+ V as PrototypeThumbnail,
145
+ b as SceneMessagesContext,
146
+ Q as SceneMessagesProvider,
147
+ D as TrafficLights,
148
+ X as allAnchorEdgesForEditor,
149
+ W as defaultSceneMessages,
150
+ R as useSceneMessages
151
+ };
@@ -0,0 +1 @@
1
+ export type ResizeBevhavior = 'none' | 'horizontal' | 'vertical' | 'both';
@@ -0,0 +1,14 @@
1
+ import { Guid } from '@cratis/fundamentals';
2
+ /**
3
+ * Represents the abstract root of the Scene object model. Every object in a Scene has a stable {@link Id} and an open-ended {@link Properties} bag for low-code metadata, attached properties and values not covered by the typed API.
4
+ */
5
+ export declare class SceneObject {
6
+ /**
7
+ * Gets or sets the unique identifier of this scene object.
8
+ */
9
+ id: Guid;
10
+ /**
11
+ * Gets or sets an open-ended property bag used to represent values that are not modelled as typed properties. This is the primary extension point used by the Low Code environment to store attached properties, design-time metadata and values for external components.
12
+ */
13
+ properties: Record<string, Record<string, unknown>>;
14
+ }
package/dist/Size.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export interface Size {
2
+ width: number;
3
+ height: number;
4
+ }
@@ -0,0 +1,36 @@
1
+ import { AnchorEdges } from './AnchorEdges';
2
+ import { SceneObject } from './SceneObject';
3
+ import { Visibility } from './Layout/Visibility';
4
+ /**
5
+ * Represents the abstract base of every visual element in the Scene object model. A {@link UIElement} exposes the core visual behaviors — visibility, input responsiveness, opacity, size, z-order and anchoring — that are shared by every component.
6
+ */
7
+ export declare class UIElement extends SceneObject {
8
+ /**
9
+ * Gets or sets the visibility of the element.
10
+ */
11
+ visibility: Visibility;
12
+ /**
13
+ * Gets or sets a value indicating whether the element participates in user input.
14
+ */
15
+ isEnabled: boolean;
16
+ /**
17
+ * Gets or sets the opacity of the element on a scale from 0.0 (fully transparent) to 1.0 (fully opaque).
18
+ */
19
+ opacity: number;
20
+ /**
21
+ * Gets or sets the explicit width of the element. When `null` the width is auto-sized.
22
+ */
23
+ width?: number;
24
+ /**
25
+ * Gets or sets the explicit height of the element. When `null` the height is auto-sized.
26
+ */
27
+ height?: number;
28
+ /**
29
+ * Gets or sets the z-order index controlling the stacking position relative to sibling elements.
30
+ */
31
+ ZIndex: number;
32
+ /**
33
+ * Gets or sets the edges to which the element is anchored within its parent.
34
+ */
35
+ anchoring: AnchorEdges;
36
+ }
@@ -0,0 +1,20 @@
1
+ export declare const WellKnownCategories: {
2
+ readonly Layout: 'Layout';
3
+ readonly Containers: 'Containers';
4
+ readonly Form: 'Form';
5
+ readonly Button: 'Button';
6
+ readonly Buttons: 'Buttons';
7
+ readonly Data: 'Data';
8
+ readonly Panel: 'Panel';
9
+ readonly Panels: 'Panels';
10
+ readonly Overlay: 'Overlay';
11
+ readonly File: 'File';
12
+ readonly Menu: 'Menu';
13
+ readonly Menus: 'Menus';
14
+ readonly Chart: 'Chart';
15
+ readonly Charts: 'Charts';
16
+ readonly Messages: 'Messages';
17
+ readonly Media: 'Media';
18
+ readonly Misc: 'Misc';
19
+ };
20
+ export declare function getCategoryIcon(category: string): string;
@@ -0,0 +1,23 @@
1
+ export * from './CategoryAttribute';
2
+ export * from './ComponentLibraryAttribute';
3
+ export * from './ContentControl';
4
+ export * from './Control';
5
+ export * from './ExternalComponent';
6
+ export * from './FrameworkElement';
7
+ export * from './IComponent';
8
+ export * from './Component';
9
+ export * from './IPrototypeComponentDiscovery';
10
+ export * from './ItemsControl';
11
+ export * from './IUIElement';
12
+ export * from './Panel';
13
+ export * from './Position';
14
+ export * from './PrototypeComponentDiscovery';
15
+ export * from './SceneObject';
16
+ export * from './Size';
17
+ export * from './ResizeBevhavior';
18
+ export * from './AnchorEdges';
19
+ export * from './Layout/Visibility';
20
+ export * from './Layout/PrototypeLayout';
21
+ export * from './UIElement';
22
+ export * from './PrototypeComponentRegistry';
23
+ export * from './WellKnownCategories';
package/dist/index.js ADDED
@@ -0,0 +1,261 @@
1
+ import { a as O, c as I, d as j, f as E, g as o, h as t, i as B, l as F, m as L, n as k, o as z, p as D, r as _, s as w, t as W, u as a } from "./PrototypeComponentRegistry-FLUzIk5a.js";
2
+ import { derivedType as l, field as i } from "@cratis/fundamentals";
3
+ var S = class {
4
+ name;
5
+ };
6
+ t([i(String), o("design:type", String)], S.prototype, "name", void 0);
7
+ var C = class {
8
+ name;
9
+ };
10
+ t([i(String), o("design:type", String)], C.prototype, "name", void 0);
11
+ var b = /* @__PURE__ */ (function(e) {
12
+ return e[e.left = 0] = "left", e[e.center = 1] = "center", e[e.right = 2] = "right", e[e.stretch = 3] = "stretch", e;
13
+ })({}), n = class {
14
+ left;
15
+ top;
16
+ right;
17
+ bottom;
18
+ };
19
+ t([i(Number), o("design:type", Number)], n.prototype, "left", void 0);
20
+ t([i(Number), o("design:type", Number)], n.prototype, "top", void 0);
21
+ t([i(Number), o("design:type", Number)], n.prototype, "right", void 0);
22
+ t([i(Number), o("design:type", Number)], n.prototype, "bottom", void 0);
23
+ var f = /* @__PURE__ */ (function(e) {
24
+ return e[e.top = 0] = "top", e[e.center = 1] = "center", e[e.bottom = 2] = "bottom", e[e.stretch = 3] = "stretch", e;
25
+ })({}), p = class extends a {
26
+ name;
27
+ minWidth;
28
+ maxWidth;
29
+ minHeight;
30
+ maxHeight;
31
+ margin;
32
+ horizontalAlignment;
33
+ verticalAlignment;
34
+ };
35
+ t([i(String), o("design:type", String)], p.prototype, "name", void 0);
36
+ t([i(Number), o("design:type", Number)], p.prototype, "minWidth", void 0);
37
+ t([i(Number), o("design:type", Number)], p.prototype, "maxWidth", void 0);
38
+ t([i(Number), o("design:type", Number)], p.prototype, "minHeight", void 0);
39
+ t([i(Number), o("design:type", Number)], p.prototype, "maxHeight", void 0);
40
+ t([i(n), o("design:type", typeof n > "u" ? Object : n)], p.prototype, "margin", void 0);
41
+ t([i(Number), o("design:type", typeof b > "u" ? Object : b)], p.prototype, "horizontalAlignment", void 0);
42
+ t([i(Number), o("design:type", typeof f > "u" ? Object : f)], p.prototype, "verticalAlignment", void 0);
43
+ var s = class extends p {
44
+ background;
45
+ foreground;
46
+ borderBrush;
47
+ borderThickness;
48
+ padding;
49
+ fontFamily;
50
+ fontSize;
51
+ fontWeight;
52
+ tabIndex;
53
+ };
54
+ t([i(String), o("design:type", String)], s.prototype, "background", void 0);
55
+ t([i(String), o("design:type", String)], s.prototype, "foreground", void 0);
56
+ t([i(String), o("design:type", String)], s.prototype, "borderBrush", void 0);
57
+ t([i(n), o("design:type", typeof n > "u" ? Object : n)], s.prototype, "borderThickness", void 0);
58
+ t([i(n), o("design:type", typeof n > "u" ? Object : n)], s.prototype, "padding", void 0);
59
+ t([i(String), o("design:type", String)], s.prototype, "fontFamily", void 0);
60
+ t([i(Number), o("design:type", Number)], s.prototype, "fontSize", void 0);
61
+ t([i(String), o("design:type", String)], s.prototype, "fontWeight", void 0);
62
+ t([i(Number), o("design:type", Number)], s.prototype, "tabIndex", void 0);
63
+ var m = class extends s {
64
+ content;
65
+ };
66
+ t([i(a), o("design:type", typeof a > "u" ? Object : a)], m.prototype, "content", void 0);
67
+ m = t([l("contentControl")], m);
68
+ var g = class extends p {
69
+ componentName;
70
+ slots;
71
+ };
72
+ t([i(String), o("design:type", String)], g.prototype, "componentName", void 0);
73
+ t([i(Object), o("design:type", typeof Record > "u" ? Object : Record)], g.prototype, "slots", void 0);
74
+ g = t([l("externalComponent")], g);
75
+ var N = class extends g {
76
+ initialSize = {
77
+ width: 220,
78
+ height: 72
79
+ };
80
+ resizeBehavior = "both";
81
+ acceptsChildren = !1;
82
+ constructor() {
83
+ super();
84
+ let e = "";
85
+ Object.defineProperty(this, "id", {
86
+ get() {
87
+ return e;
88
+ },
89
+ set(h) {
90
+ e = String(h ?? "");
91
+ },
92
+ enumerable: !0,
93
+ configurable: !0
94
+ });
95
+ }
96
+ get label() {
97
+ return this.name ?? "";
98
+ }
99
+ set label(e) {
100
+ this.name = e;
101
+ }
102
+ get position() {
103
+ const e = this.properties?.canvas ?? {};
104
+ return {
105
+ x: e.x ?? 0,
106
+ y: e.y ?? 0
107
+ };
108
+ }
109
+ set position(e) {
110
+ this.properties = {
111
+ ...this.properties ?? {},
112
+ canvas: {
113
+ x: e.x,
114
+ y: e.y
115
+ }
116
+ };
117
+ }
118
+ get size() {
119
+ return {
120
+ width: this.width ?? 0,
121
+ height: this.height ?? 0
122
+ };
123
+ }
124
+ set size(e) {
125
+ this.width = Math.trunc(e.width), this.height = Math.trunc(e.height);
126
+ }
127
+ get children() {
128
+ return this.slots?.children ?? [];
129
+ }
130
+ set children(e) {
131
+ this.slots = {
132
+ ...this.slots ?? {},
133
+ children: e
134
+ };
135
+ }
136
+ get type() {
137
+ const e = this.componentName ?? "", h = e.split(".").pop() ?? e;
138
+ return this.library ? `${this.library}.${h}` : h;
139
+ }
140
+ initialize(e) {
141
+ return e.id !== void 0 && (this.id = e.id), e.label !== void 0 && (this.label = e.label), e.position !== void 0 && (this.position = e.position), e.size !== void 0 && (this.size = e.size), e.ZIndex !== void 0 && (this.ZIndex = e.ZIndex), e.anchoring !== void 0 && (this.anchoring = e.anchoring), e.children !== void 0 && (this.children = e.children), this.name || (this.name = this.componentName), e.size || (this.size = { ...this.initialSize }), this.componentName = this.type, this;
142
+ }
143
+ };
144
+ i(String)(N.prototype, "id");
145
+ var A = class {
146
+ }, y = class extends p {
147
+ children;
148
+ background;
149
+ };
150
+ t([i(a, !0), o("design:type", Array)], y.prototype, "children", void 0);
151
+ t([i(String), o("design:type", String)], y.prototype, "background", void 0);
152
+ var c = class extends s {
153
+ items;
154
+ itemsPanel;
155
+ };
156
+ t([i(a, !0), o("design:type", Array)], c.prototype, "items", void 0);
157
+ t([i(y), o("design:type", typeof y > "u" ? Object : y)], c.prototype, "itemsPanel", void 0);
158
+ c = t([l("itemsControl")], c);
159
+ var K = class {
160
+ }, d = class {
161
+ name;
162
+ namespace;
163
+ category;
164
+ library;
165
+ bundlePath;
166
+ type;
167
+ };
168
+ t([i(String), o("design:type", String)], d.prototype, "name", void 0);
169
+ t([i(String), o("design:type", String)], d.prototype, "namespace", void 0);
170
+ t([i(String), o("design:type", String)], d.prototype, "category", void 0);
171
+ t([i(String), o("design:type", String)], d.prototype, "library", void 0);
172
+ t([i(String), o("design:type", String)], d.prototype, "bundlePath", void 0);
173
+ t([i(String), o("design:type", String)], d.prototype, "type", void 0);
174
+ var U = class {
175
+ }, u = class {
176
+ name;
177
+ components;
178
+ };
179
+ t([i(String), o("design:type", String)], u.prototype, "name", void 0);
180
+ t([i(d, !0), o("design:type", Array)], u.prototype, "components", void 0);
181
+ var v = class {
182
+ name;
183
+ bundlePath;
184
+ categories;
185
+ };
186
+ t([i(String), o("design:type", String)], v.prototype, "name", void 0);
187
+ t([i(String), o("design:type", String)], v.prototype, "bundlePath", void 0);
188
+ t([i(u, !0), o("design:type", Array)], v.prototype, "categories", void 0);
189
+ var r = {
190
+ Layout: "Layout",
191
+ Containers: "Containers",
192
+ Form: "Form",
193
+ Button: "Button",
194
+ Buttons: "Buttons",
195
+ Data: "Data",
196
+ Panel: "Panel",
197
+ Panels: "Panels",
198
+ Overlay: "Overlay",
199
+ File: "File",
200
+ Menu: "Menu",
201
+ Menus: "Menus",
202
+ Chart: "Chart",
203
+ Charts: "Charts",
204
+ Messages: "Messages",
205
+ Media: "Media",
206
+ Misc: "Misc"
207
+ }, P = {
208
+ [r.Layout]: "pi pi-objects-column",
209
+ [r.Containers]: "pi pi-box",
210
+ [r.Form]: "pi pi-pencil",
211
+ [r.Button]: "pi pi-stop",
212
+ [r.Buttons]: "pi pi-stop",
213
+ [r.Data]: "pi pi-list",
214
+ [r.Panel]: "pi pi-table",
215
+ [r.Panels]: "pi pi-table",
216
+ [r.Overlay]: "pi pi-clone",
217
+ [r.File]: "pi pi-file",
218
+ [r.Menu]: "pi pi-bars",
219
+ [r.Menus]: "pi pi-bars",
220
+ [r.Chart]: "pi pi-chart-bar",
221
+ [r.Charts]: "pi pi-chart-bar",
222
+ [r.Messages]: "pi pi-envelope",
223
+ [r.Media]: "pi pi-image",
224
+ [r.Misc]: "pi pi-ellipsis-h"
225
+ }, x = "pi pi-folder-open";
226
+ function Y(e) {
227
+ return P[e] ?? x;
228
+ }
229
+ export {
230
+ D as AnchorEdges,
231
+ S as CategoryAttribute,
232
+ N as Component,
233
+ C as ComponentLibraryAttribute,
234
+ m as ContentControl,
235
+ s as Control,
236
+ g as ExternalComponent,
237
+ p as FrameworkElement,
238
+ A as IPrototypeComponentDiscovery,
239
+ K as IUIElement,
240
+ c as ItemsControl,
241
+ y as Panel,
242
+ u as PrototypeComponentCategoryDescriptor,
243
+ d as PrototypeComponentDescriptor,
244
+ U as PrototypeComponentDiscovery,
245
+ v as PrototypeComponentLibraryDescriptor,
246
+ F as PrototypeLayout,
247
+ E as SceneObject,
248
+ a as UIElement,
249
+ j as Visibility,
250
+ r as WellKnownCategories,
251
+ L as allAnchorEdges,
252
+ W as createPrototypeComponentInstance,
253
+ k as ensurePrototypeComponentBundle,
254
+ Y as getCategoryIcon,
255
+ _ as getPrototypeComponent,
256
+ B as hydrateElement,
257
+ O as hydrateElements,
258
+ z as hydratePrototypeElement,
259
+ w as loadPrototypeComponentLibraries,
260
+ I as registerPrototypeComponentLibrary
261
+ };
package/dist/scene.css ADDED
@@ -0,0 +1,2 @@
1
+ .prototype-window-traffic-light{box-sizing:border-box;background:0 0;border-radius:50%;width:12px;height:12px}.prototype-thumbnail{cursor:default;box-sizing:border-box;background:var(--surface-card);border:none;flex-direction:column;flex-shrink:0;padding:0;display:flex;position:relative;overflow:hidden}.prototype-thumbnail:is(button){cursor:pointer}.prototype-thumbnail-title-bar{border-bottom:1px solid var(--surface-200);background:var(--surface-50);flex-shrink:0;align-items:center;gap:3px;padding:0 5px;display:flex;position:relative}.prototype-thumbnail-title{text-align:center;color:var(--text-color-secondary);pointer-events:none;font-family:system-ui,sans-serif;font-size:8px;position:absolute;left:0;right:0}.prototype-thumbnail-body{background:var(--surface-ground);flex:1;position:relative;overflow:hidden}.prototype-thumbnail-canvas-scaler{position:absolute;top:0;left:0}.prototype-thumbnail-element{box-sizing:border-box;background:var(--surface-200);border:1px solid var(--surface-300);border-radius:2px;position:absolute}.prototype-thumbnail-element--button,.prototype-thumbnail-element--button-hot{background:var(--surface-200);border:1px solid var(--surface-300)}.prototype-thumbnail-element--button-hot{background:var(--primary-color);border-color:var(--primary-color);opacity:.7}.prototype-thumbnail-element--text-input{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--label{border-bottom:1px solid var(--surface-300);background:0 0}.prototype-thumbnail-element--checkbox,.prototype-thumbnail-element--radio,.prototype-thumbnail-element--dropdown{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--image{background:var(--surface-100);border:1px dashed var(--surface-300)}.prototype-thumbnail-element--panel{background:var(--surface-50);border:1px solid var(--surface-200)}.prototype-thumbnail-element--data-table{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--toolbar{background:var(--surface-100);border:1px solid var(--surface-200)}.prototype-thumbnail-element--kpi-card{background:var(--surface-100);border:1px solid var(--primary-300,var(--surface-300));border-radius:3px}.prototype-thumbnail-element--bar-chart{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to top, var(--primary-400,#7c6fe0) 0px, var(--primary-400,#7c6fe0) 60%, transparent 60%, transparent 100%);background-position:10% 0,35% 0,60% 0,85% 0;background-repeat:no-repeat;background-size:20% 100%}.prototype-thumbnail-element--line-chart{background:var(--surface-0);border:1px solid var(--surface-300)}.prototype-thumbnail-element--pie-chart{background:var(--surface-0);border:1px solid var(--surface-300);border-radius:50%}.prototype-thumbnail-element--progress-bar{background:var(--surface-100);border:1px solid var(--surface-300);background-image:linear-gradient(to right, var(--primary-400,#7c6fe0) 0%, var(--primary-400,#7c6fe0) 55%, transparent 55%)}.prototype-thumbnail-element--activity-feed{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, var(--surface-200) 3px, var(--surface-200) 4px);background-size:100% 8px}.prototype-thumbnail-element--nav-topbar{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:2px 2px 0 0}.prototype-thumbnail-element--nav-footer{background:var(--surface-100);border:1px solid var(--surface-200);border-radius:0 0 2px 2px}.prototype-thumbnail-element--nav-sidebar{background:var(--surface-50);border:1px solid var(--surface-200);border-radius:2px 0 0 2px}.prototype-thumbnail-element--content-area{background:var(--surface-ground);border:1.5px dashed var(--surface-300)}.prototype-thumbnail-element--command-form{background:var(--surface-0);border:1px solid var(--surface-300);background-image:repeating-linear-gradient(to bottom, transparent 0px, transparent 5px, var(--surface-100) 5px, var(--surface-100) 8px);background-position:0 4px;background-size:100% 12px}
2
+ /*$vite$:1*/