@aglyn/besigner 1.0.0-beta.143
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 +201 -0
- package/README.md +7 -0
- package/package.json +48 -0
- package/src/besigner.d.ts +28 -0
- package/src/besigner.js +59 -0
- package/src/besigner.js.map +1 -0
- package/src/index.d.ts +17 -0
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/api/app.api.d.ts +22 -0
- package/src/lib/api/app.api.js +59 -0
- package/src/lib/api/app.api.js.map +1 -0
- package/src/lib/api/besigner.api.d.ts +24 -0
- package/src/lib/api/besigner.api.js +39 -0
- package/src/lib/api/besigner.api.js.map +1 -0
- package/src/lib/clipboard-manager/clipboard-manager.d.ts +89 -0
- package/src/lib/clipboard-manager/clipboard-manager.js +241 -0
- package/src/lib/clipboard-manager/clipboard-manager.js.map +1 -0
- package/src/lib/clipboard-manager/clipboard-mirror.d.ts +52 -0
- package/src/lib/clipboard-manager/clipboard-mirror.js +75 -0
- package/src/lib/clipboard-manager/clipboard-mirror.js.map +1 -0
- package/src/lib/clipboard-manager/index.d.ts +20 -0
- package/src/lib/clipboard-manager/index.js +23 -0
- package/src/lib/clipboard-manager/index.js.map +1 -0
- package/src/lib/clipboard-manager/style-clipboard.d.ts +77 -0
- package/src/lib/clipboard-manager/style-clipboard.js +173 -0
- package/src/lib/clipboard-manager/style-clipboard.js.map +1 -0
- package/src/lib/constants/_internal.d.ts +20 -0
- package/src/lib/constants/_internal.js +19 -0
- package/src/lib/constants/_internal.js.map +1 -0
- package/src/lib/constants/besigner.d.ts +78 -0
- package/src/lib/constants/besigner.js +69 -0
- package/src/lib/constants/besigner.js.map +1 -0
- package/src/lib/controllers/besigner-app.controller.d.ts +33 -0
- package/src/lib/controllers/besigner-app.controller.js +57 -0
- package/src/lib/controllers/besigner-app.controller.js.map +1 -0
- package/src/lib/controllers/besigner-interface.controller.d.ts +44 -0
- package/src/lib/controllers/besigner-interface.controller.js +130 -0
- package/src/lib/controllers/besigner-interface.controller.js.map +1 -0
- package/src/lib/definitions/besigner-app.types.d.ts +41 -0
- package/src/lib/definitions/besigner-app.types.js +18 -0
- package/src/lib/definitions/besigner-app.types.js.map +1 -0
- package/src/lib/definitions/besigner-interface.types.d.ts +106 -0
- package/src/lib/definitions/besigner-interface.types.js +18 -0
- package/src/lib/definitions/besigner-interface.types.js.map +1 -0
- package/src/lib/definitions/emitter.types.d.ts +33 -0
- package/src/lib/definitions/emitter.types.js +18 -0
- package/src/lib/definitions/emitter.types.js.map +1 -0
- package/src/lib/device-preview-width.d.ts +39 -0
- package/src/lib/device-preview-width.js +57 -0
- package/src/lib/device-preview-width.js.map +1 -0
- package/src/lib/dnd-manager/confirm-valid-lineal-relationship.d.ts +54 -0
- package/src/lib/dnd-manager/confirm-valid-lineal-relationship.js +109 -0
- package/src/lib/dnd-manager/confirm-valid-lineal-relationship.js.map +1 -0
- package/src/lib/dnd-manager/dnd-manager.d.ts +75 -0
- package/src/lib/dnd-manager/dnd-manager.js +337 -0
- package/src/lib/dnd-manager/dnd-manager.js.map +1 -0
- package/src/lib/dnd-manager/droppable-region-utils.d.ts +72 -0
- package/src/lib/dnd-manager/droppable-region-utils.js +115 -0
- package/src/lib/dnd-manager/droppable-region-utils.js.map +1 -0
- package/src/lib/dnd-manager/index.d.ts +20 -0
- package/src/lib/dnd-manager/index.js +21 -0
- package/src/lib/dnd-manager/index.js.map +1 -0
- package/src/lib/focus-manager/focus-manager.d.ts +104 -0
- package/src/lib/focus-manager/focus-manager.js +353 -0
- package/src/lib/focus-manager/focus-manager.js.map +1 -0
- package/src/lib/focus-manager/index.d.ts +18 -0
- package/src/lib/focus-manager/index.js +19 -0
- package/src/lib/focus-manager/index.js.map +1 -0
- package/src/lib/is-root-element-id.d.ts +19 -0
- package/src/lib/is-root-element-id.js +22 -0
- package/src/lib/is-root-element-id.js.map +1 -0
- package/src/lib/managers.d.ts +25 -0
- package/src/lib/managers.js +26 -0
- package/src/lib/managers.js.map +1 -0
- package/src/lib/node-move/index.d.ts +17 -0
- package/src/lib/node-move/index.js +18 -0
- package/src/lib/node-move/index.js.map +1 -0
- package/src/lib/node-move/node-move.d.ts +80 -0
- package/src/lib/node-move/node-move.js +134 -0
- package/src/lib/node-move/node-move.js.map +1 -0
- package/src/lib/node-refs/index.d.ts +1 -0
- package/src/lib/node-refs/index.js +3 -0
- package/src/lib/node-refs/index.js.map +1 -0
- package/src/lib/node-refs/node-refs.d.ts +24 -0
- package/src/lib/node-refs/node-refs.js +30 -0
- package/src/lib/node-refs/node-refs.js.map +1 -0
- package/src/lib/pick-manager/index.d.ts +18 -0
- package/src/lib/pick-manager/index.js +20 -0
- package/src/lib/pick-manager/index.js.map +1 -0
- package/src/lib/pick-manager/pick-manager.d.ts +64 -0
- package/src/lib/pick-manager/pick-manager.js +116 -0
- package/src/lib/pick-manager/pick-manager.js.map +1 -0
- package/src/lib/text-entry/index.d.ts +17 -0
- package/src/lib/text-entry/index.js +18 -0
- package/src/lib/text-entry/index.js.map +1 -0
- package/src/lib/text-entry/text-entry.d.ts +71 -0
- package/src/lib/text-entry/text-entry.js +103 -0
- package/src/lib/text-entry/text-entry.js.map +1 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { canvas } from "@aglyn/aglyn";
|
|
17
|
+
import { observable, runInAction } from "mobx";
|
|
18
|
+
import { localStore, parseMirrored, watchMirror } from "./clipboard-mirror.js";
|
|
19
|
+
/**
|
|
20
|
+
* Besigner STYLE clipboard.
|
|
21
|
+
*
|
|
22
|
+
* The element clipboard beside it carries whole subtrees. This carries a
|
|
23
|
+
* look: everything the Styles panel writes to one element, so a heading
|
|
24
|
+
* styled once can be applied to five more without rebuilding it field by
|
|
25
|
+
* field or duplicating an element and re-authoring its content.
|
|
26
|
+
*
|
|
27
|
+
* ## What a "style" is here
|
|
28
|
+
*
|
|
29
|
+
* `node.sx` and only `node.sx` — the Styles panel's entire output, including
|
|
30
|
+
* its responsive, `@scheme` and interaction-state slices, which are keys
|
|
31
|
+
* inside that object rather than separate storage.
|
|
32
|
+
*
|
|
33
|
+
* NOT classes. A class is a name pointing at rules the element does not own,
|
|
34
|
+
* and two of them carry behaviour rather than appearance: `aglyn-hidden`
|
|
35
|
+
* enrols an element in interaction choreography, and a theme utility class
|
|
36
|
+
* may be targeted by an interaction's class steps. Carrying those across on
|
|
37
|
+
* a "paste styles" would move behaviour under a label that promises looks.
|
|
38
|
+
*
|
|
39
|
+
* ## Paste REPLACES
|
|
40
|
+
*
|
|
41
|
+
* Merging would make the result depend on what the target already had, so
|
|
42
|
+
* pasting the same look onto two elements could produce two different
|
|
43
|
+
* elements — and there would be no way to paste "no styles". Undo is the way
|
|
44
|
+
* back, as it is for every other edit.
|
|
45
|
+
*
|
|
46
|
+
* Mirrored into `localStorage` on the same terms as the element clipboard, so
|
|
47
|
+
* a look copied in one document can be pasted in another after the full page
|
|
48
|
+
* navigation between two besigner routes.
|
|
49
|
+
*/ /** `localStorage` key holding the mirrored style entry. */ export const STYLE_CLIPBOARD_STORAGE_KEY = 'aglyn:besigner:style-clipboard';
|
|
50
|
+
/** Bumped when the persisted shape changes; an older entry is dropped. */ export const STYLE_CLIPBOARD_FORMAT_VERSION = 1;
|
|
51
|
+
const state = observable({
|
|
52
|
+
entry: null,
|
|
53
|
+
hydrated: false
|
|
54
|
+
});
|
|
55
|
+
const parseEntry = (raw)=>parseMirrored(raw, STYLE_CLIPBOARD_FORMAT_VERSION);
|
|
56
|
+
function hydrate() {
|
|
57
|
+
if (state.hydrated) return;
|
|
58
|
+
runInAction(()=>{
|
|
59
|
+
state.hydrated = true;
|
|
60
|
+
});
|
|
61
|
+
let parsed = null;
|
|
62
|
+
try {
|
|
63
|
+
var _ref;
|
|
64
|
+
var _localStore;
|
|
65
|
+
parsed = parseEntry((_ref = (_localStore = localStore()) == null ? void 0 : _localStore.getItem(STYLE_CLIPBOARD_STORAGE_KEY)) != null ? _ref : null);
|
|
66
|
+
} catch (unused) {
|
|
67
|
+
// A corrupt or foreign entry is no entry. Never throw on read.
|
|
68
|
+
}
|
|
69
|
+
if (!parsed) return;
|
|
70
|
+
runInAction(()=>{
|
|
71
|
+
state.entry = parsed;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A look copied in another besigner tab is this document's look too. Without
|
|
76
|
+
* this the mirror is read once and the document goes on pasting the first
|
|
77
|
+
* style it ever saw, however many times the tab next door copies a new one
|
|
78
|
+
* (AGL-2507).
|
|
79
|
+
*/ watchMirror(STYLE_CLIPBOARD_STORAGE_KEY, (raw)=>{
|
|
80
|
+
const entry = parseEntry(raw);
|
|
81
|
+
runInAction(()=>{
|
|
82
|
+
state.entry = entry;
|
|
83
|
+
// The mirror has now been consulted, whatever it held.
|
|
84
|
+
state.hydrated = true;
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
/** The copied look, or null. */ export function getStyleEntry() {
|
|
88
|
+
hydrate();
|
|
89
|
+
return state.entry;
|
|
90
|
+
}
|
|
91
|
+
/** Whether anything has been copied. Observed, so menus enable on copy. */ export function hasStyles() {
|
|
92
|
+
return Boolean(getStyleEntry());
|
|
93
|
+
}
|
|
94
|
+
/** The label of the element the look came from, for the menu. */ export function getStyleLabel() {
|
|
95
|
+
var _ref;
|
|
96
|
+
var _getStyleEntry;
|
|
97
|
+
return (_ref = (_getStyleEntry = getStyleEntry()) == null ? void 0 : _getStyleEntry.label) != null ? _ref : '';
|
|
98
|
+
}
|
|
99
|
+
/** Takes the look off one node. Returns false when there is no node. */ export function copyStyles(node) {
|
|
100
|
+
var _ref, _node_labelShort;
|
|
101
|
+
var _node_componentSchema;
|
|
102
|
+
if (!node) return false;
|
|
103
|
+
// Deep-cloned through JSON: `node.sx` is a MobX observable, and keeping a
|
|
104
|
+
// live reference would make the clipboard track later edits to the element
|
|
105
|
+
// it was copied from — a copy that changes under you is not a copy.
|
|
106
|
+
let sx;
|
|
107
|
+
try {
|
|
108
|
+
sx = node.sx ? JSON.parse(JSON.stringify(node.sx)) : null;
|
|
109
|
+
} catch (unused) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// The ELEMENT's own label. `labelShort` answers the document root with the
|
|
113
|
+
// document's name, which is a true answer to a different question and reads
|
|
114
|
+
// as "paste styles from this whole screen" on the menu below.
|
|
115
|
+
const label = canvas.isRootNode(node) ? (_ref = (_node_componentSchema = node.componentSchema) == null ? void 0 : _node_componentSchema.displayName) != null ? _ref : 'element' : (_node_labelShort = node.labelShort) != null ? _node_labelShort : 'element';
|
|
116
|
+
const entry = {
|
|
117
|
+
version: STYLE_CLIPBOARD_FORMAT_VERSION,
|
|
118
|
+
label,
|
|
119
|
+
sx
|
|
120
|
+
};
|
|
121
|
+
runInAction(()=>{
|
|
122
|
+
state.entry = entry;
|
|
123
|
+
state.hydrated = true;
|
|
124
|
+
});
|
|
125
|
+
const store = localStore();
|
|
126
|
+
try {
|
|
127
|
+
store == null ? void 0 : store.setItem(STYLE_CLIPBOARD_STORAGE_KEY, JSON.stringify(entry));
|
|
128
|
+
} catch (unused) {
|
|
129
|
+
// A full or unavailable store costs the cross-document paste, not the
|
|
130
|
+
// copy — the in-memory entry above is already set.
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Applies the copied look to a node, replacing whatever it had.
|
|
136
|
+
*
|
|
137
|
+
* Returns false when there is nothing to paste. A copied entry of `null`
|
|
138
|
+
* styles IS something to paste — it clears the target — which is why the
|
|
139
|
+
* check is on the entry rather than on its `sx`.
|
|
140
|
+
*/ export function pasteStyles(node) {
|
|
141
|
+
const entry = getStyleEntry();
|
|
142
|
+
if (!node || !entry) return false;
|
|
143
|
+
let sx;
|
|
144
|
+
try {
|
|
145
|
+
sx = entry.sx ? JSON.parse(JSON.stringify(entry.sx)) : null;
|
|
146
|
+
} catch (unused) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
// Through the canvas, not by assigning to `node.sx`. That records an undo
|
|
150
|
+
// step — a paste the author cannot take back is worse than no paste — and
|
|
151
|
+
// it re-resolves the node by `$id`, because a caller can be holding an
|
|
152
|
+
// instance the map replaced (an undo, a draft restore), and writing to that
|
|
153
|
+
// one loses the edit silently. Cloned per target as well: pasting onto
|
|
154
|
+
// three elements must give three independent objects.
|
|
155
|
+
canvas.updateNodeFields(node, {
|
|
156
|
+
sx: sx != null ? sx : undefined
|
|
157
|
+
});
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
/** Forgets the copied look. Tests, and a future "clear" affordance. */ export function clearStyles() {
|
|
161
|
+
runInAction(()=>{
|
|
162
|
+
state.entry = null;
|
|
163
|
+
state.hydrated = true;
|
|
164
|
+
});
|
|
165
|
+
try {
|
|
166
|
+
var _localStore;
|
|
167
|
+
(_localStore = localStore()) == null ? void 0 : _localStore.removeItem(STYLE_CLIPBOARD_STORAGE_KEY);
|
|
168
|
+
} catch (unused) {
|
|
169
|
+
// Ditto.
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=style-clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/clipboard-manager/style-clipboard.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as Aglyn from '@aglyn/aglyn'\nimport { canvas } from '@aglyn/aglyn'\nimport { observable, runInAction } from 'mobx'\nimport { localStore, parseMirrored, watchMirror } from './clipboard-mirror'\n\n/**\n * Besigner STYLE clipboard.\n *\n * The element clipboard beside it carries whole subtrees. This carries a\n * look: everything the Styles panel writes to one element, so a heading\n * styled once can be applied to five more without rebuilding it field by\n * field or duplicating an element and re-authoring its content.\n *\n * ## What a \"style\" is here\n *\n * `node.sx` and only `node.sx` — the Styles panel's entire output, including\n * its responsive, `@scheme` and interaction-state slices, which are keys\n * inside that object rather than separate storage.\n *\n * NOT classes. A class is a name pointing at rules the element does not own,\n * and two of them carry behaviour rather than appearance: `aglyn-hidden`\n * enrols an element in interaction choreography, and a theme utility class\n * may be targeted by an interaction's class steps. Carrying those across on\n * a \"paste styles\" would move behaviour under a label that promises looks.\n *\n * ## Paste REPLACES\n *\n * Merging would make the result depend on what the target already had, so\n * pasting the same look onto two elements could produce two different\n * elements — and there would be no way to paste \"no styles\". Undo is the way\n * back, as it is for every other edit.\n *\n * Mirrored into `localStorage` on the same terms as the element clipboard, so\n * a look copied in one document can be pasted in another after the full page\n * navigation between two besigner routes.\n */\n\n/** `localStorage` key holding the mirrored style entry. */\nexport const STYLE_CLIPBOARD_STORAGE_KEY = 'aglyn:besigner:style-clipboard'\n\n/** Bumped when the persisted shape changes; an older entry is dropped. */\nexport const STYLE_CLIPBOARD_FORMAT_VERSION = 1\n\nexport interface StyleClipboardEntry {\n version: number\n /** The element the look was taken from, for the menu (\"from Heading\"). */\n label: string\n /** The Styles panel's whole output. `null` is a real value: no styles. */\n sx: Record<string, unknown> | null\n}\n\ninterface StyleClipboardState {\n entry: StyleClipboardEntry | null\n hydrated: boolean\n}\n\nconst state = observable<StyleClipboardState>({ entry: null, hydrated: false })\n\nconst parseEntry = (raw: string | null): StyleClipboardEntry | null =>\n parseMirrored<StyleClipboardEntry>(raw, STYLE_CLIPBOARD_FORMAT_VERSION)\n\nfunction hydrate(): void {\n if (state.hydrated) return\n runInAction(() => {\n state.hydrated = true\n })\n let parsed: StyleClipboardEntry | null = null\n try {\n parsed = parseEntry(\n localStore()?.getItem(STYLE_CLIPBOARD_STORAGE_KEY) ?? null,\n )\n } catch {\n // A corrupt or foreign entry is no entry. Never throw on read.\n }\n if (!parsed) return\n runInAction(() => {\n state.entry = parsed\n })\n}\n\n/**\n * A look copied in another besigner tab is this document's look too. Without\n * this the mirror is read once and the document goes on pasting the first\n * style it ever saw, however many times the tab next door copies a new one\n * (AGL-2507).\n */\nwatchMirror(STYLE_CLIPBOARD_STORAGE_KEY, (raw) => {\n const entry = parseEntry(raw)\n runInAction(() => {\n state.entry = entry\n // The mirror has now been consulted, whatever it held.\n state.hydrated = true\n })\n})\n\n/** The copied look, or null. */\nexport function getStyleEntry(): StyleClipboardEntry | null {\n hydrate()\n return state.entry\n}\n\n/** Whether anything has been copied. Observed, so menus enable on copy. */\nexport function hasStyles(): boolean {\n return Boolean(getStyleEntry())\n}\n\n/** The label of the element the look came from, for the menu. */\nexport function getStyleLabel(): string {\n return getStyleEntry()?.label ?? ''\n}\n\n/** Takes the look off one node. Returns false when there is no node. */\nexport function copyStyles(node: Aglyn.NodeSchema<any> | undefined): boolean {\n if (!node) return false\n // Deep-cloned through JSON: `node.sx` is a MobX observable, and keeping a\n // live reference would make the clipboard track later edits to the element\n // it was copied from — a copy that changes under you is not a copy.\n let sx: Record<string, unknown> | null\n try {\n sx = node.sx ? (JSON.parse(JSON.stringify(node.sx)) as never) : null\n } catch {\n return false\n }\n // The ELEMENT's own label. `labelShort` answers the document root with the\n // document's name, which is a true answer to a different question and reads\n // as \"paste styles from this whole screen\" on the menu below.\n const label = canvas.isRootNode(node)\n ? (node.componentSchema?.displayName ?? 'element')\n : (node.labelShort ?? 'element')\n const entry: StyleClipboardEntry = {\n version: STYLE_CLIPBOARD_FORMAT_VERSION,\n label,\n sx,\n }\n runInAction(() => {\n state.entry = entry\n state.hydrated = true\n })\n const store = localStore()\n try {\n store?.setItem(STYLE_CLIPBOARD_STORAGE_KEY, JSON.stringify(entry))\n } catch {\n // A full or unavailable store costs the cross-document paste, not the\n // copy — the in-memory entry above is already set.\n }\n return true\n}\n\n/**\n * Applies the copied look to a node, replacing whatever it had.\n *\n * Returns false when there is nothing to paste. A copied entry of `null`\n * styles IS something to paste — it clears the target — which is why the\n * check is on the entry rather than on its `sx`.\n */\nexport function pasteStyles(node: Aglyn.NodeSchema<any> | undefined): boolean {\n const entry = getStyleEntry()\n if (!node || !entry) return false\n let sx: Record<string, unknown> | null\n try {\n sx = entry.sx ? (JSON.parse(JSON.stringify(entry.sx)) as never) : null\n } catch {\n return false\n }\n // Through the canvas, not by assigning to `node.sx`. That records an undo\n // step — a paste the author cannot take back is worse than no paste — and\n // it re-resolves the node by `$id`, because a caller can be holding an\n // instance the map replaced (an undo, a draft restore), and writing to that\n // one loses the edit silently. Cloned per target as well: pasting onto\n // three elements must give three independent objects.\n canvas.updateNodeFields(node, { sx: (sx ?? undefined) as never })\n return true\n}\n\n/** Forgets the copied look. Tests, and a future \"clear\" affordance. */\nexport function clearStyles(): void {\n runInAction(() => {\n state.entry = null\n state.hydrated = true\n })\n try {\n localStore()?.removeItem(STYLE_CLIPBOARD_STORAGE_KEY)\n } catch {\n // Ditto.\n }\n}\n"],"names":["canvas","observable","runInAction","localStore","parseMirrored","watchMirror","STYLE_CLIPBOARD_STORAGE_KEY","STYLE_CLIPBOARD_FORMAT_VERSION","state","entry","hydrated","parseEntry","raw","hydrate","parsed","getItem","getStyleEntry","hasStyles","Boolean","getStyleLabel","label","copyStyles","node","sx","JSON","parse","stringify","isRootNode","componentSchema","displayName","labelShort","version","store","setItem","pasteStyles","updateNodeFields","undefined","clearStyles","removeItem"],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { AppUUN, IBesignerAppController } from '../definitions/besigner-app.types';
|
|
18
|
+
import type { IBesignerInterfaceController } from '../definitions/besigner-interface.types';
|
|
19
|
+
export declare const _INTERNAL_BESIGNERS_: Map<AppUUN, IBesignerInterfaceController>;
|
|
20
|
+
export declare const _INTERNAL_BESIGNER_APPS_: Map<AppUUN, IBesignerAppController>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export const _INTERNAL_BESIGNERS_ = new Map();
|
|
17
|
+
export const _INTERNAL_BESIGNER_APPS_ = new Map();
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=_internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/constants/_internal.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AppUUN,\n IBesignerAppController,\n} from '../definitions/besigner-app.types'\nimport type { IBesignerInterfaceController } from '../definitions/besigner-interface.types'\n\nexport const _INTERNAL_BESIGNERS_: Map<AppUUN, IBesignerInterfaceController> =\n new Map()\n\nexport const _INTERNAL_BESIGNER_APPS_: Map<AppUUN, IBesignerAppController> =\n new Map()\n"],"names":["_INTERNAL_BESIGNERS_","Map","_INTERNAL_BESIGNER_APPS_"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAQD,OAAO,MAAMA,uBACX,IAAIC,MAAK;AAEX,OAAO,MAAMC,2BACX,IAAID,MAAK"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare enum InteractionModeFlag {
|
|
18
|
+
SELECT = 1,
|
|
19
|
+
REARRANGE = 2,
|
|
20
|
+
PREVIEW = 3
|
|
21
|
+
}
|
|
22
|
+
export declare enum BesignerPanelViewFlag {
|
|
23
|
+
PANEL_LEFT = 1,
|
|
24
|
+
PANEL_RIGHT = 2,
|
|
25
|
+
PANEL_BOTTOM = 3
|
|
26
|
+
}
|
|
27
|
+
export declare enum BesignerPanelTabFlag {
|
|
28
|
+
ELEMENTS_TREE = 1,
|
|
29
|
+
ELEMENT_BROWSE = 2,
|
|
30
|
+
/**
|
|
31
|
+
* Retired. The Info panel's two accordions — the component's own
|
|
32
|
+
* description, and the element/parent/component/plugin ids — moved to the
|
|
33
|
+
* bottom of Attributes, where they are reference detail beside the fields
|
|
34
|
+
* they describe rather than a tab of their own.
|
|
35
|
+
*
|
|
36
|
+
* The VALUE stays reserved. Panel state is persisted, so a reader whose
|
|
37
|
+
* last session ended on Info would otherwise come back to a tab id that now
|
|
38
|
+
* means something else.
|
|
39
|
+
*/
|
|
40
|
+
ELEMENT_INFO = 3,
|
|
41
|
+
ELEMENT_PROPS_FORM = 4,
|
|
42
|
+
ELEMENT_STYLES = 5,
|
|
43
|
+
ELEMENT_INTERACTIONS = 6
|
|
44
|
+
}
|
|
45
|
+
export declare enum DndDragType {
|
|
46
|
+
CANVAS = "canvas",
|
|
47
|
+
TEMPLATE = "template",
|
|
48
|
+
TREE = "tree"
|
|
49
|
+
}
|
|
50
|
+
export declare enum DndDropType {
|
|
51
|
+
BEFORE = 1,
|
|
52
|
+
INSIDE = 2,
|
|
53
|
+
AFTER = 3
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The interaction state the canvas is HOLDING ON for the element being
|
|
57
|
+
* styled (AGL-2486 item 39).
|
|
58
|
+
*
|
|
59
|
+
* You cannot hover an element while working in a side panel, so a state
|
|
60
|
+
* whose styles you cannot see is a state you cannot design. Selecting a
|
|
61
|
+
* state in the Styles panel's chip row holds it on the canvas for that one
|
|
62
|
+
* element; `undefined` is the resting state.
|
|
63
|
+
*
|
|
64
|
+
* Canvas UI context only — it is a flag, never a document field, so it
|
|
65
|
+
* cannot be saved, cannot reach Preview and cannot reach a published page.
|
|
66
|
+
* The union is declared HERE rather than in the designer so the flag store
|
|
67
|
+
* and the panel share one source of truth.
|
|
68
|
+
*/
|
|
69
|
+
export type BesignerStateFlag = 'hover' | 'active' | 'focusVisible' | 'disabled';
|
|
70
|
+
export declare enum BesignerDeviceFlag {
|
|
71
|
+
SCALE = 1,
|
|
72
|
+
RESPONSIVE = 2,
|
|
73
|
+
XS = 3,
|
|
74
|
+
SM = 4,
|
|
75
|
+
MD = 5,
|
|
76
|
+
LG = 6,
|
|
77
|
+
XL = 7
|
|
78
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export var InteractionModeFlag = /*#__PURE__*/ function(InteractionModeFlag) {
|
|
17
|
+
InteractionModeFlag[InteractionModeFlag["SELECT"] = 0x1] = "SELECT";
|
|
18
|
+
InteractionModeFlag[InteractionModeFlag["REARRANGE"] = 0x2] = "REARRANGE";
|
|
19
|
+
InteractionModeFlag[InteractionModeFlag["PREVIEW"] = 0x3] = "PREVIEW";
|
|
20
|
+
return InteractionModeFlag;
|
|
21
|
+
}({});
|
|
22
|
+
export var BesignerPanelViewFlag = /*#__PURE__*/ function(BesignerPanelViewFlag) {
|
|
23
|
+
BesignerPanelViewFlag[BesignerPanelViewFlag["PANEL_LEFT"] = 0x1] = "PANEL_LEFT";
|
|
24
|
+
BesignerPanelViewFlag[BesignerPanelViewFlag["PANEL_RIGHT"] = 0x2] = "PANEL_RIGHT";
|
|
25
|
+
BesignerPanelViewFlag[BesignerPanelViewFlag["PANEL_BOTTOM"] = 0x3] = "PANEL_BOTTOM";
|
|
26
|
+
return BesignerPanelViewFlag;
|
|
27
|
+
}({});
|
|
28
|
+
export var BesignerPanelTabFlag = /*#__PURE__*/ function(BesignerPanelTabFlag) {
|
|
29
|
+
BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENTS_TREE"] = 0x1] = "ELEMENTS_TREE";
|
|
30
|
+
BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENT_BROWSE"] = 0x2] = "ELEMENT_BROWSE";
|
|
31
|
+
/**
|
|
32
|
+
* Retired. The Info panel's two accordions — the component's own
|
|
33
|
+
* description, and the element/parent/component/plugin ids — moved to the
|
|
34
|
+
* bottom of Attributes, where they are reference detail beside the fields
|
|
35
|
+
* they describe rather than a tab of their own.
|
|
36
|
+
*
|
|
37
|
+
* The VALUE stays reserved. Panel state is persisted, so a reader whose
|
|
38
|
+
* last session ended on Info would otherwise come back to a tab id that now
|
|
39
|
+
* means something else.
|
|
40
|
+
*/ BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENT_INFO"] = 0x3] = "ELEMENT_INFO";
|
|
41
|
+
BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENT_PROPS_FORM"] = 0x4] = "ELEMENT_PROPS_FORM";
|
|
42
|
+
BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENT_STYLES"] = 0x5] = "ELEMENT_STYLES";
|
|
43
|
+
BesignerPanelTabFlag[BesignerPanelTabFlag["ELEMENT_INTERACTIONS"] = 0x6] = "ELEMENT_INTERACTIONS";
|
|
44
|
+
return BesignerPanelTabFlag;
|
|
45
|
+
}({});
|
|
46
|
+
export var DndDragType = /*#__PURE__*/ function(DndDragType) {
|
|
47
|
+
DndDragType["CANVAS"] = "canvas";
|
|
48
|
+
DndDragType["TEMPLATE"] = "template";
|
|
49
|
+
DndDragType["TREE"] = "tree";
|
|
50
|
+
return DndDragType;
|
|
51
|
+
}({});
|
|
52
|
+
export var DndDropType = /*#__PURE__*/ function(DndDropType) {
|
|
53
|
+
DndDropType[DndDropType["BEFORE"] = 0x1] = "BEFORE";
|
|
54
|
+
DndDropType[DndDropType["INSIDE"] = 0x2] = "INSIDE";
|
|
55
|
+
DndDropType[DndDropType["AFTER"] = 0x3] = "AFTER";
|
|
56
|
+
return DndDropType;
|
|
57
|
+
}({});
|
|
58
|
+
export var BesignerDeviceFlag = /*#__PURE__*/ function(BesignerDeviceFlag) {
|
|
59
|
+
BesignerDeviceFlag[BesignerDeviceFlag["SCALE"] = 0x1] = "SCALE";
|
|
60
|
+
BesignerDeviceFlag[BesignerDeviceFlag["RESPONSIVE"] = 0x2] = "RESPONSIVE";
|
|
61
|
+
BesignerDeviceFlag[BesignerDeviceFlag["XS"] = 0x3] = "XS";
|
|
62
|
+
BesignerDeviceFlag[BesignerDeviceFlag["SM"] = 0x4] = "SM";
|
|
63
|
+
BesignerDeviceFlag[BesignerDeviceFlag["MD"] = 0x5] = "MD";
|
|
64
|
+
BesignerDeviceFlag[BesignerDeviceFlag["LG"] = 0x6] = "LG";
|
|
65
|
+
BesignerDeviceFlag[BesignerDeviceFlag["XL"] = 0x7] = "XL";
|
|
66
|
+
return BesignerDeviceFlag;
|
|
67
|
+
}({});
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=besigner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/constants/besigner.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum InteractionModeFlag {\n SELECT = 0x1,\n REARRANGE = 0x2,\n PREVIEW = 0x3,\n}\n\nexport enum BesignerPanelViewFlag {\n PANEL_LEFT = 0x1,\n PANEL_RIGHT = 0x2,\n PANEL_BOTTOM = 0x3,\n}\n\nexport enum BesignerPanelTabFlag {\n ELEMENTS_TREE = 0x1,\n ELEMENT_BROWSE = 0x2,\n /**\n * Retired. The Info panel's two accordions — the component's own\n * description, and the element/parent/component/plugin ids — moved to the\n * bottom of Attributes, where they are reference detail beside the fields\n * they describe rather than a tab of their own.\n *\n * The VALUE stays reserved. Panel state is persisted, so a reader whose\n * last session ended on Info would otherwise come back to a tab id that now\n * means something else.\n */\n ELEMENT_INFO = 0x3,\n ELEMENT_PROPS_FORM = 0x4,\n ELEMENT_STYLES = 0x5,\n ELEMENT_INTERACTIONS = 0x6,\n}\n\nexport enum DndDragType {\n CANVAS = 'canvas',\n TEMPLATE = 'template',\n TREE = 'tree',\n}\n\nexport enum DndDropType {\n BEFORE = 0x1,\n INSIDE = 0x2,\n AFTER = 0x3,\n}\n\n/**\n * The interaction state the canvas is HOLDING ON for the element being\n * styled (AGL-2486 item 39).\n *\n * You cannot hover an element while working in a side panel, so a state\n * whose styles you cannot see is a state you cannot design. Selecting a\n * state in the Styles panel's chip row holds it on the canvas for that one\n * element; `undefined` is the resting state.\n *\n * Canvas UI context only — it is a flag, never a document field, so it\n * cannot be saved, cannot reach Preview and cannot reach a published page.\n * The union is declared HERE rather than in the designer so the flag store\n * and the panel share one source of truth.\n */\nexport type BesignerStateFlag =\n | 'hover'\n | 'active'\n | 'focusVisible'\n | 'disabled'\n\nexport enum BesignerDeviceFlag {\n SCALE = 0x1,\n RESPONSIVE = 0x2,\n XS = 0x3,\n SM = 0x4,\n MD = 0x5,\n LG = 0x6,\n XL = 0x7,\n}\n"],"names":["InteractionModeFlag","BesignerPanelViewFlag","BesignerPanelTabFlag","DndDragType","DndDropType","BesignerDeviceFlag"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA,6CAAAA;wDACD;2DACG;yDACF;WAHAA;MAIX;AAED,OAAO,IAAA,AAAKC,+CAAAA;gEACG;iEACC;kEACC;WAHLA;MAIX;AAED,OAAO,IAAA,AAAKC,8CAAAA;iEACM;kEACC;IACjB;;;;;;;;;GASC,+DACc;sEACM;kEACJ;wEACM;WAhBbA;MAiBX;AAED,OAAO,IAAA,AAAKC,qCAAAA;;;;WAAAA;MAIX;AAED,OAAO,IAAA,AAAKC,qCAAAA;wCACD;wCACA;uCACD;WAHEA;MAIX;AAsBD,OAAO,IAAA,AAAKC,4CAAAA;qDACF;0DACK;kDACR;kDACA;kDACA;kDACA;kDACA;WAPKA;MAQX"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type BesignerAppOptions, type IBesignerAppController } from '../definitions/besigner-app.types';
|
|
18
|
+
import type { IBesignerInterfaceController } from '../definitions/besigner-interface.types';
|
|
19
|
+
export declare class BesignerAppController implements IBesignerAppController {
|
|
20
|
+
readonly options: BesignerAppOptions;
|
|
21
|
+
readonly appName: string;
|
|
22
|
+
deleted: boolean;
|
|
23
|
+
interfaceController: IBesignerInterfaceController;
|
|
24
|
+
static get [Symbol.toStringTag](): string;
|
|
25
|
+
static get namespace(): string;
|
|
26
|
+
get interface(): IBesignerInterfaceController;
|
|
27
|
+
constructor(options: BesignerAppOptions);
|
|
28
|
+
getName(): string;
|
|
29
|
+
getBesignerController(): IBesignerInterfaceController;
|
|
30
|
+
onDestroy(): void;
|
|
31
|
+
setDeleted(value: boolean): void;
|
|
32
|
+
}
|
|
33
|
+
export default BesignerAppController;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { _INTERNAL_BESIGNERS_ } from "../constants/_internal.js";
|
|
18
|
+
import { DEFAULT_APP_UUN } from "../definitions/besigner-app.types.js";
|
|
19
|
+
import { BesignerInterfaceController } from "./besigner-interface.controller.js";
|
|
20
|
+
const TAG = 'BesignerApp';
|
|
21
|
+
const NS = 'com.aglyn.besigner.data.controller.app';
|
|
22
|
+
export class BesignerAppController {
|
|
23
|
+
static get [Symbol.toStringTag]() {
|
|
24
|
+
return TAG;
|
|
25
|
+
}
|
|
26
|
+
static get namespace() {
|
|
27
|
+
return NS;
|
|
28
|
+
}
|
|
29
|
+
get interface() {
|
|
30
|
+
return this.interfaceController;
|
|
31
|
+
}
|
|
32
|
+
getName() {
|
|
33
|
+
return this.appName;
|
|
34
|
+
}
|
|
35
|
+
getBesignerController() {
|
|
36
|
+
return this.interfaceController;
|
|
37
|
+
}
|
|
38
|
+
onDestroy() {
|
|
39
|
+
_INTERNAL_BESIGNERS_.delete(this.appName);
|
|
40
|
+
}
|
|
41
|
+
setDeleted(value) {
|
|
42
|
+
this.deleted = value;
|
|
43
|
+
}
|
|
44
|
+
constructor(options){
|
|
45
|
+
var _options_modulesOptions;
|
|
46
|
+
this.options = options;
|
|
47
|
+
this.deleted = false;
|
|
48
|
+
this.interfaceController = null;
|
|
49
|
+
this.appName = (options == null ? void 0 : options.appName) || DEFAULT_APP_UUN;
|
|
50
|
+
_INTERNAL_BESIGNERS_.set(this.appName, this.interfaceController = new BesignerInterfaceController(this, _extends({
|
|
51
|
+
logLevel: options == null ? void 0 : options.logLevel
|
|
52
|
+
}, options == null ? void 0 : (_options_modulesOptions = options.modulesOptions) == null ? void 0 : _options_modulesOptions.interface)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export default BesignerAppController;
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=besigner-app.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/controllers/besigner-app.controller.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { _INTERNAL_BESIGNERS_ } from '../constants/_internal'\nimport {\n type BesignerAppOptions,\n DEFAULT_APP_UUN,\n type IBesignerAppController,\n} from '../definitions/besigner-app.types'\nimport type { IBesignerInterfaceController } from '../definitions/besigner-interface.types'\nimport { BesignerInterfaceController } from './besigner-interface.controller'\n\nconst TAG = 'BesignerApp'\nconst NS = 'com.aglyn.besigner.data.controller.app'\n\nexport class BesignerAppController implements IBesignerAppController {\n public readonly appName: string\n public deleted = false\n public interfaceController: IBesignerInterfaceController = null\n\n public static get [Symbol.toStringTag](): string {\n return TAG\n }\n public static get namespace(): string {\n return NS\n }\n\n public get interface(): IBesignerInterfaceController {\n return this.interfaceController\n }\n\n constructor(public readonly options: BesignerAppOptions) {\n this.appName = options?.appName || DEFAULT_APP_UUN\n _INTERNAL_BESIGNERS_.set(\n this.appName,\n (this.interfaceController = new BesignerInterfaceController(this, {\n logLevel: options?.logLevel,\n ...options?.modulesOptions?.interface,\n })),\n )\n }\n\n public getName(): string {\n return this.appName\n }\n public getBesignerController(): IBesignerInterfaceController {\n return this.interfaceController\n }\n public onDestroy(): void {\n _INTERNAL_BESIGNERS_.delete(this.appName)\n }\n public setDeleted(value: boolean): void {\n this.deleted = value\n }\n}\nexport default BesignerAppController\n"],"names":["_INTERNAL_BESIGNERS_","DEFAULT_APP_UUN","BesignerInterfaceController","TAG","NS","BesignerAppController","Symbol","toStringTag","namespace","interface","interfaceController","getName","appName","getBesignerController","onDestroy","delete","setDeleted","value","deleted","options","set","logLevel","modulesOptions"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,oBAAoB,QAAQ,4BAAwB;AAC7D,SAEEC,eAAe,QAEV,uCAAmC;AAE1C,SAASC,2BAA2B,QAAQ,qCAAiC;AAE7E,MAAMC,MAAM;AACZ,MAAMC,KAAK;AAEX,OAAO,MAAMC;IAKX,WAAkB,CAACC,OAAOC,WAAW,CAAC,GAAW;QAC/C,OAAOJ;IACT;IACA,WAAkBK,YAAoB;QACpC,OAAOJ;IACT;IAEA,IAAWK,YAA0C;QACnD,OAAO,IAAI,CAACC,mBAAmB;IACjC;IAaOC,UAAkB;QACvB,OAAO,IAAI,CAACC,OAAO;IACrB;IACOC,wBAAsD;QAC3D,OAAO,IAAI,CAACH,mBAAmB;IACjC;IACOI,YAAkB;QACvBd,qBAAqBe,MAAM,CAAC,IAAI,CAACH,OAAO;IAC1C;IACOI,WAAWC,KAAc,EAAQ;QACtC,IAAI,CAACC,OAAO,GAAGD;IACjB;IAtBA,YAAY,AAAgBE,OAA2B,CAAE;YAMhDA;aANmBA,UAAAA;aAdrBD,UAAU;aACVR,sBAAoD;QAczD,IAAI,CAACE,OAAO,GAAGO,CAAAA,2BAAAA,QAASP,OAAO,KAAIX;QACnCD,qBAAqBoB,GAAG,CACtB,IAAI,CAACR,OAAO,EACX,IAAI,CAACF,mBAAmB,GAAG,IAAIR,4BAA4B,IAAI,EAAE;YAChEmB,QAAQ,EAAEF,2BAAAA,QAASE,QAAQ;WACxBF,4BAAAA,0BAAAA,QAASG,cAAc,qBAAvBH,wBAAyBV,SAAS;IAG3C;AAcF;AACA,eAAeJ,sBAAqB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { BehaviorSubject } from 'rxjs';
|
|
18
|
+
import type { BesignerSetFlagPayload, BesignerSetFlagsPayload, BesignerSetPanelPayload, BesignerSetPanelsPayload } from '../definitions/emitter.types';
|
|
19
|
+
import type { IBesignerAppController } from '../definitions/besigner-app.types';
|
|
20
|
+
import type { BesignerContext, BesignerInterfaceControllerOptions, IBesignerInterfaceController } from '../definitions/besigner-interface.types';
|
|
21
|
+
export declare class BesignerInterfaceController implements IBesignerInterfaceController {
|
|
22
|
+
protected readonly app: IBesignerAppController;
|
|
23
|
+
protected readonly options: BesignerInterfaceControllerOptions;
|
|
24
|
+
readonly __store__: {
|
|
25
|
+
[K in keyof BesignerContext]: BehaviorSubject<BesignerContext[K]>;
|
|
26
|
+
};
|
|
27
|
+
static get [Symbol.toStringTag](): string;
|
|
28
|
+
static get namespace(): string;
|
|
29
|
+
get flags(): this['__store__']['flags'];
|
|
30
|
+
get panels(): this['__store__']['panels'];
|
|
31
|
+
constructor(app: IBesignerAppController, options: BesignerInterfaceControllerOptions);
|
|
32
|
+
private setupInternal;
|
|
33
|
+
toJSON(): {
|
|
34
|
+
tag: string;
|
|
35
|
+
namespace: string;
|
|
36
|
+
appName: string;
|
|
37
|
+
};
|
|
38
|
+
private isDeepEqual;
|
|
39
|
+
setFlag(payload: BesignerSetFlagPayload): this;
|
|
40
|
+
setFlags(payload: BesignerSetFlagsPayload): this;
|
|
41
|
+
setPanel(payload: BesignerSetPanelPayload): this;
|
|
42
|
+
setPanels(payload: BesignerSetPanelsPayload): this;
|
|
43
|
+
}
|
|
44
|
+
export default BesignerInterfaceController;
|