@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,130 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2022 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 { HostViewType } from "@aglyn/aglyn";
|
|
18
|
+
import { cloneDeep } from "@aglyn/shared-util-tools";
|
|
19
|
+
import defaultsDeep from "lodash-es/defaultsDeep.js";
|
|
20
|
+
import isEqual from "lodash-es/isEqual.js";
|
|
21
|
+
import { BehaviorSubject } from "rxjs";
|
|
22
|
+
import { BesignerDeviceFlag, BesignerPanelViewFlag, InteractionModeFlag } from "../constants/besigner.js";
|
|
23
|
+
const TAG = 'BesignerInterface';
|
|
24
|
+
const NS = 'com.aglyn.besigner.data.controller.interface';
|
|
25
|
+
export class BesignerInterfaceController {
|
|
26
|
+
static get [Symbol.toStringTag]() {
|
|
27
|
+
return TAG;
|
|
28
|
+
}
|
|
29
|
+
static get namespace() {
|
|
30
|
+
return NS;
|
|
31
|
+
}
|
|
32
|
+
get flags() {
|
|
33
|
+
var _this___store__;
|
|
34
|
+
return (_this___store__ = this.__store__) == null ? void 0 : _this___store__.flags;
|
|
35
|
+
}
|
|
36
|
+
get panels() {
|
|
37
|
+
var _this___store__;
|
|
38
|
+
return (_this___store__ = this.__store__) == null ? void 0 : _this___store__.panels;
|
|
39
|
+
}
|
|
40
|
+
setupInternal() {}
|
|
41
|
+
toJSON() {
|
|
42
|
+
var _this_app_getName, _this_app;
|
|
43
|
+
return {
|
|
44
|
+
tag: TAG,
|
|
45
|
+
namespace: NS,
|
|
46
|
+
appName: (_this_app = this.app) == null ? void 0 : (_this_app_getName = _this_app.getName) == null ? void 0 : _this_app_getName.call(_this_app)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
isDeepEqual(prev, now) {
|
|
50
|
+
return isEqual(prev, now);
|
|
51
|
+
}
|
|
52
|
+
setFlag(payload) {
|
|
53
|
+
var _this___store___flags, _this___store__, _this___store___flags1, _this___store__1;
|
|
54
|
+
const { flag, value } = payload || {};
|
|
55
|
+
const prev = (_this___store__ = this.__store__) == null ? void 0 : (_this___store___flags = _this___store__.flags) == null ? void 0 : _this___store___flags.getValue();
|
|
56
|
+
const prevValue = prev == null ? void 0 : prev[flag];
|
|
57
|
+
const nowValue = value(prevValue, prev);
|
|
58
|
+
const now = _extends({}, prev, {
|
|
59
|
+
[flag]: nowValue
|
|
60
|
+
});
|
|
61
|
+
!this.isDeepEqual(prevValue, nowValue) && ((_this___store__1 = this.__store__) == null ? void 0 : (_this___store___flags1 = _this___store__1.flags) == null ? void 0 : _this___store___flags1.next(now));
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
setFlags(payload) {
|
|
65
|
+
var _this___store___flags, _this___store__, _this___store___flags1, _this___store__1;
|
|
66
|
+
const { flags } = payload || {};
|
|
67
|
+
const prev = (_this___store__ = this.__store__) == null ? void 0 : (_this___store___flags = _this___store__.flags) == null ? void 0 : _this___store___flags.getValue();
|
|
68
|
+
const now = flags(prev);
|
|
69
|
+
!this.isDeepEqual(prev, now) && ((_this___store__1 = this.__store__) == null ? void 0 : (_this___store___flags1 = _this___store__1.flags) == null ? void 0 : _this___store___flags1.next(now));
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
setPanel(payload) {
|
|
73
|
+
var _this___store___panels, _this___store__, _this___store___panels1, _this___store__1;
|
|
74
|
+
const { panel, value } = payload || {};
|
|
75
|
+
const prev = cloneDeep((_this___store__ = this.__store__) == null ? void 0 : (_this___store___panels = _this___store__.panels) == null ? void 0 : _this___store___panels.getValue());
|
|
76
|
+
const prevPanel = prev == null ? void 0 : prev[panel];
|
|
77
|
+
const nowPanel = value(prevPanel, prev);
|
|
78
|
+
const now = _extends({}, prev, {
|
|
79
|
+
[panel]: nowPanel
|
|
80
|
+
});
|
|
81
|
+
!this.isDeepEqual(prevPanel, nowPanel) && ((_this___store__1 = this.__store__) == null ? void 0 : (_this___store___panels1 = _this___store__1.panels) == null ? void 0 : _this___store___panels1.next(now));
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
setPanels(payload) {
|
|
85
|
+
var _this___store___panels, _this___store__, _this___store___panels1, _this___store__1;
|
|
86
|
+
const { panels } = payload || {};
|
|
87
|
+
const prev = (_this___store__ = this.__store__) == null ? void 0 : (_this___store___panels = _this___store__.panels) == null ? void 0 : _this___store___panels.getValue();
|
|
88
|
+
const now = panels(prev);
|
|
89
|
+
!this.isDeepEqual(prev, now) && ((_this___store__1 = this.__store__) == null ? void 0 : (_this___store___panels1 = _this___store__1.panels) == null ? void 0 : _this___store___panels1.next(now));
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
constructor(app, options){
|
|
93
|
+
this.app = app;
|
|
94
|
+
this.options = options;
|
|
95
|
+
const state = defaultsDeep({}, options.defaults, {
|
|
96
|
+
flags: {
|
|
97
|
+
debug: true,
|
|
98
|
+
logLevel: 'info',
|
|
99
|
+
interactMode: InteractionModeFlag.SELECT,
|
|
100
|
+
devicePreview: BesignerDeviceFlag.RESPONSIVE,
|
|
101
|
+
canvasScheme: 'light',
|
|
102
|
+
viewType: HostViewType.SCREEN
|
|
103
|
+
},
|
|
104
|
+
panels: {
|
|
105
|
+
panelLeft: {
|
|
106
|
+
id: BesignerPanelViewFlag.PANEL_LEFT,
|
|
107
|
+
size: 290,
|
|
108
|
+
toggled: true
|
|
109
|
+
},
|
|
110
|
+
panelRight: {
|
|
111
|
+
id: BesignerPanelViewFlag.PANEL_RIGHT,
|
|
112
|
+
size: 375,
|
|
113
|
+
toggled: true
|
|
114
|
+
},
|
|
115
|
+
panelBottom: {
|
|
116
|
+
id: BesignerPanelViewFlag.PANEL_BOTTOM,
|
|
117
|
+
toggled: false
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
this.__store__ = {
|
|
122
|
+
flags: new BehaviorSubject(state.flags),
|
|
123
|
+
panels: new BehaviorSubject(state.panels)
|
|
124
|
+
};
|
|
125
|
+
this.setupInternal();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export default BesignerInterfaceController;
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=besigner-interface.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/controllers/besigner-interface.controller.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 { HostViewType } from '@aglyn/aglyn'\nimport { cloneDeep } from '@aglyn/shared-util-tools'\nimport defaultsDeep from 'lodash-es/defaultsDeep.js'\nimport isEqual from 'lodash-es/isEqual.js'\nimport { BehaviorSubject } from 'rxjs'\nimport {\n BesignerDeviceFlag,\n BesignerPanelViewFlag,\n InteractionModeFlag,\n} from '../constants/besigner'\nimport type {\n BesignerSetFlagPayload,\n BesignerSetFlagsPayload,\n BesignerSetPanelPayload,\n BesignerSetPanelsPayload,\n} from '../definitions/emitter.types'\nimport type { IBesignerAppController } from '../definitions/besigner-app.types'\nimport type {\n BesignerContext,\n BesignerInterfaceControllerOptions,\n IBesignerInterfaceController,\n} from '../definitions/besigner-interface.types'\n\nconst TAG = 'BesignerInterface'\nconst NS = 'com.aglyn.besigner.data.controller.interface'\n\nexport class BesignerInterfaceController\n implements IBesignerInterfaceController\n{\n public readonly __store__: {\n [K in keyof BesignerContext]: BehaviorSubject<BesignerContext[K]>\n }\n\n public static get [Symbol.toStringTag](): string {\n return TAG\n }\n public static get namespace(): string {\n return NS\n }\n public get flags(): this['__store__']['flags'] {\n return this.__store__?.flags\n }\n public get panels(): this['__store__']['panels'] {\n return this.__store__?.panels\n }\n\n constructor(\n protected readonly app: IBesignerAppController,\n protected readonly options: BesignerInterfaceControllerOptions,\n ) {\n const state = defaultsDeep({}, options.defaults, {\n flags: {\n debug: true,\n logLevel: 'info',\n interactMode: InteractionModeFlag.SELECT,\n devicePreview: BesignerDeviceFlag.RESPONSIVE,\n canvasScheme: 'light',\n viewType: HostViewType.SCREEN,\n },\n panels: {\n panelLeft: {\n id: BesignerPanelViewFlag.PANEL_LEFT,\n size: 290,\n toggled: true,\n },\n panelRight: {\n id: BesignerPanelViewFlag.PANEL_RIGHT,\n size: 375,\n toggled: true,\n },\n panelBottom: {\n id: BesignerPanelViewFlag.PANEL_BOTTOM,\n toggled: false,\n },\n },\n })\n\n this.__store__ = {\n flags: new BehaviorSubject(state.flags),\n panels: new BehaviorSubject(state.panels),\n }\n this.setupInternal()\n }\n private setupInternal() {}\n\n public toJSON() {\n return { tag: TAG, namespace: NS, appName: this.app?.getName?.() }\n }\n\n private isDeepEqual<T>(prev: unknown, now: T): prev is T {\n return isEqual(prev, now)\n }\n\n\n public setFlag(payload: BesignerSetFlagPayload): this {\n const { flag, value } = payload || {}\n const prev = this.__store__?.flags?.getValue()\n const prevValue = prev?.[flag]\n const nowValue = value(prevValue, prev)\n const now = { ...prev, [flag]: nowValue }\n !this.isDeepEqual(prevValue, nowValue) && this.__store__?.flags?.next(now)\n return this\n }\n public setFlags(payload: BesignerSetFlagsPayload): this {\n const { flags } = payload || {}\n const prev = this.__store__?.flags?.getValue()\n const now = flags(prev)\n !this.isDeepEqual(prev, now) && this.__store__?.flags?.next(now)\n return this\n }\n public setPanel(payload: BesignerSetPanelPayload): this {\n const { panel, value } = payload || {}\n const prev = cloneDeep(this.__store__?.panels?.getValue())\n const prevPanel = prev?.[panel]\n const nowPanel = value(prevPanel, prev)\n const now = { ...prev, [panel]: nowPanel }\n !this.isDeepEqual(prevPanel, nowPanel) && this.__store__?.panels?.next(now)\n return this\n }\n public setPanels(payload: BesignerSetPanelsPayload): this {\n const { panels } = payload || {}\n const prev = this.__store__?.panels?.getValue()\n const now = panels(prev)\n !this.isDeepEqual(prev, now) && this.__store__?.panels?.next(now)\n return this\n }\n}\n\nexport default BesignerInterfaceController\n"],"names":["HostViewType","cloneDeep","defaultsDeep","isEqual","BehaviorSubject","BesignerDeviceFlag","BesignerPanelViewFlag","InteractionModeFlag","TAG","NS","BesignerInterfaceController","Symbol","toStringTag","namespace","flags","__store__","panels","setupInternal","toJSON","tag","appName","app","getName","isDeepEqual","prev","now","setFlag","payload","flag","value","getValue","prevValue","nowValue","next","setFlags","setPanel","panel","prevPanel","nowPanel","setPanels","options","state","defaults","debug","logLevel","interactMode","SELECT","devicePreview","RESPONSIVE","canvasScheme","viewType","SCREEN","panelLeft","id","PANEL_LEFT","size","toggled","panelRight","PANEL_RIGHT","panelBottom","PANEL_BOTTOM"],"mappings":"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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { LogLevelString } from '@aglyn/shared-util-logger';
|
|
18
|
+
import type { BesignerInterfaceControllerOptions, IBesignerInterfaceController } from './besigner-interface.types';
|
|
19
|
+
/** Unique app name */
|
|
20
|
+
export type AppUUN = string;
|
|
21
|
+
export declare const DEFAULT_APP_UUN: AppUUN;
|
|
22
|
+
export interface BesignerAppOptions {
|
|
23
|
+
appName?: AppUUN;
|
|
24
|
+
logLevel?: LogLevelString;
|
|
25
|
+
modulesOptions?: {
|
|
26
|
+
interface?: BesignerInterfaceControllerOptions;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface IBesignerAppController {
|
|
30
|
+
readonly appName: AppUUN;
|
|
31
|
+
readonly deleted: boolean;
|
|
32
|
+
readonly options: BesignerAppOptions;
|
|
33
|
+
readonly interface?: IBesignerInterfaceController;
|
|
34
|
+
getName(): AppUUN;
|
|
35
|
+
getBesignerController(): IBesignerInterfaceController;
|
|
36
|
+
onDestroy?(): void;
|
|
37
|
+
setDeleted(value: boolean): void;
|
|
38
|
+
}
|
|
39
|
+
export interface BesignerAppControllerT {
|
|
40
|
+
new (options: BesignerAppOptions): IBesignerAppController;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
*/ export const DEFAULT_APP_UUN = '[DEFAULT]';
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=besigner-app.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/definitions/besigner-app.types.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 { LogLevelString } from '@aglyn/shared-util-logger'\nimport type {\n BesignerInterfaceControllerOptions,\n IBesignerInterfaceController,\n} from './besigner-interface.types'\n\n/** Unique app name */\nexport type AppUUN = string\n\nexport const DEFAULT_APP_UUN: AppUUN = '[DEFAULT]'\n\nexport interface BesignerAppOptions {\n appName?: AppUUN\n logLevel?: LogLevelString\n modulesOptions?: {\n interface?: BesignerInterfaceControllerOptions\n }\n}\n\nexport interface IBesignerAppController {\n readonly appName: AppUUN\n readonly deleted: boolean\n readonly options: BesignerAppOptions\n readonly interface?: IBesignerInterfaceController\n\n getName(): AppUUN\n getBesignerController(): IBesignerInterfaceController\n onDestroy?(): void\n setDeleted(value: boolean): void\n}\n\nexport interface BesignerAppControllerT {\n new (options: BesignerAppOptions): IBesignerAppController\n}\n"],"names":["DEFAULT_APP_UUN"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAWD,OAAO,MAAMA,kBAA0B,YAAW"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { HostViewType } from '@aglyn/aglyn';
|
|
18
|
+
import type { IBesignerAppController } from './besigner-app.types';
|
|
19
|
+
import type { HostThemeScheme } from '@aglyn/shared-data-types';
|
|
20
|
+
import type { LogLevelString } from '@aglyn/shared-util-logger';
|
|
21
|
+
import type { BehaviorSubject } from 'rxjs';
|
|
22
|
+
import type { BesignerDeviceFlag, BesignerStateFlag, BesignerPanelTabFlag, BesignerPanelViewFlag, InteractionModeFlag } from '../constants/besigner';
|
|
23
|
+
import type { BesignerSetFlagPayload, BesignerSetFlagsPayload, BesignerSetPanelPayload, BesignerSetPanelsPayload } from './emitter.types';
|
|
24
|
+
export type BesignerContext = {
|
|
25
|
+
flags: {
|
|
26
|
+
debug: boolean;
|
|
27
|
+
logLevel: LogLevelString;
|
|
28
|
+
interactMode: InteractionModeFlag;
|
|
29
|
+
activeView?: BesignerPanelViewFlag;
|
|
30
|
+
devicePreview?: BesignerDeviceFlag;
|
|
31
|
+
/** Color scheme the canvas previews the host theme in; console UI is unaffected. */
|
|
32
|
+
canvasScheme?: HostThemeScheme;
|
|
33
|
+
/**
|
|
34
|
+
* Interaction state held ON for the element being styled (AGL-2486).
|
|
35
|
+
* Canvas only, never persisted — see {@link BesignerStateFlag}.
|
|
36
|
+
*/
|
|
37
|
+
heldState?: BesignerStateFlag;
|
|
38
|
+
/** The node the held state applies to; every other leaf renders at rest. */
|
|
39
|
+
heldStateNodeId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Nodes the canvas shows even though they carry the hidden class
|
|
42
|
+
* (AGL-592) — a mega-menu panel or a drawer opened up for designing.
|
|
43
|
+
* Canvas only, never persisted and never written back to the document:
|
|
44
|
+
* showing a panel to work on it is a different act from publishing the
|
|
45
|
+
* site with it open.
|
|
46
|
+
*/
|
|
47
|
+
revealedNodeIds?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Style declarations the canvas is rendering without, so a layout can be
|
|
50
|
+
* compared against itself with one property switched off (AGL-2486).
|
|
51
|
+
* Encoded `nodeId|state|breakpoint|property` — see `muted-styles`. Canvas
|
|
52
|
+
* only: the declaration stays in the document exactly where it was
|
|
53
|
+
* written, and only the canvas's copy of the sx drops it.
|
|
54
|
+
*/
|
|
55
|
+
mutedStyles?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* Classes the canvas is rendering without, encoded `nodeId|className`
|
|
58
|
+
* (AGL-2486). Canvas only, like the style mutes: the element's class list
|
|
59
|
+
* in the document is untouched, so what the Classes chips show is what
|
|
60
|
+
* ships.
|
|
61
|
+
*/
|
|
62
|
+
mutedClasses?: string[];
|
|
63
|
+
/** What kind of host view the canvas is editing (screen or shared layout). */
|
|
64
|
+
viewType?: HostViewType;
|
|
65
|
+
/**
|
|
66
|
+
* WYSIWYG bindings (AGL-97): when not false, the canvas resolves
|
|
67
|
+
* variable/function binding tokens live; toggle off for raw tokens.
|
|
68
|
+
*/
|
|
69
|
+
resolveBindings?: boolean;
|
|
70
|
+
};
|
|
71
|
+
panels: {
|
|
72
|
+
panelLeft?: BesignerPanelItem;
|
|
73
|
+
panelRight?: BesignerPanelItem;
|
|
74
|
+
panelBottom?: BesignerPanelItem;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export type BesignerFlagsState = BesignerContext['flags'];
|
|
78
|
+
export type BesignerFlagKey = keyof BesignerFlagsState;
|
|
79
|
+
export type BesignerFlagValue<K extends BesignerFlagKey = BesignerFlagKey> = BesignerFlagsState[K];
|
|
80
|
+
export type BesignerPanelsState = BesignerContext['panels'];
|
|
81
|
+
export type BesignerPanelKey = keyof BesignerPanelsState;
|
|
82
|
+
export type BesignerPanelValue<K extends BesignerPanelKey = BesignerPanelKey> = BesignerPanelsState[K];
|
|
83
|
+
export type BesignerPanelItem = {
|
|
84
|
+
id?: BesignerPanelViewFlag;
|
|
85
|
+
size?: number | string;
|
|
86
|
+
toggled?: boolean;
|
|
87
|
+
tab?: BesignerPanelTabFlag;
|
|
88
|
+
};
|
|
89
|
+
export interface BesignerInterfaceControllerOptions {
|
|
90
|
+
logLevel?: LogLevelString;
|
|
91
|
+
defaults?: Partial<BesignerContext>;
|
|
92
|
+
}
|
|
93
|
+
export interface IBesignerInterfaceController {
|
|
94
|
+
readonly __store__: {
|
|
95
|
+
[K in keyof BesignerContext]: BehaviorSubject<BesignerContext[K]>;
|
|
96
|
+
};
|
|
97
|
+
readonly flags: this['__store__']['flags'];
|
|
98
|
+
readonly panels: this['__store__']['panels'];
|
|
99
|
+
setFlag(payload: BesignerSetFlagPayload): this;
|
|
100
|
+
setFlags(payload: BesignerSetFlagsPayload): this;
|
|
101
|
+
setPanel(payload: BesignerSetPanelPayload): this;
|
|
102
|
+
setPanels(payload: BesignerSetPanelsPayload): this;
|
|
103
|
+
}
|
|
104
|
+
export interface BesignerInterfaceControllerT {
|
|
105
|
+
new (app: IBesignerAppController, options: BesignerInterfaceControllerOptions): IBesignerInterfaceController;
|
|
106
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=besigner-interface.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/definitions/besigner-interface.types.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 { HostViewType } from '@aglyn/aglyn'\nimport type { IBesignerAppController } from './besigner-app.types'\nimport type { HostThemeScheme } from '@aglyn/shared-data-types'\n// eslint-disable-next-line @nx/enforce-module-boundaries\nimport type { LogLevelString } from '@aglyn/shared-util-logger'\nimport type { BehaviorSubject } from 'rxjs'\nimport type {\n BesignerDeviceFlag,\n BesignerStateFlag,\n BesignerPanelTabFlag,\n BesignerPanelViewFlag,\n InteractionModeFlag,\n} from '../constants/besigner'\nimport type {\n BesignerSetFlagPayload,\n BesignerSetFlagsPayload,\n BesignerSetPanelPayload,\n BesignerSetPanelsPayload,\n} from './emitter.types'\n\nexport type BesignerContext = {\n flags: {\n debug: boolean\n logLevel: LogLevelString\n interactMode: InteractionModeFlag\n activeView?: BesignerPanelViewFlag\n devicePreview?: BesignerDeviceFlag\n /** Color scheme the canvas previews the host theme in; console UI is unaffected. */\n canvasScheme?: HostThemeScheme\n /**\n * Interaction state held ON for the element being styled (AGL-2486).\n * Canvas only, never persisted — see {@link BesignerStateFlag}.\n */\n heldState?: BesignerStateFlag\n /** The node the held state applies to; every other leaf renders at rest. */\n heldStateNodeId?: string\n /**\n * Nodes the canvas shows even though they carry the hidden class\n * (AGL-592) — a mega-menu panel or a drawer opened up for designing.\n * Canvas only, never persisted and never written back to the document:\n * showing a panel to work on it is a different act from publishing the\n * site with it open.\n */\n revealedNodeIds?: string[]\n /**\n * Style declarations the canvas is rendering without, so a layout can be\n * compared against itself with one property switched off (AGL-2486).\n * Encoded `nodeId|state|breakpoint|property` — see `muted-styles`. Canvas\n * only: the declaration stays in the document exactly where it was\n * written, and only the canvas's copy of the sx drops it.\n */\n mutedStyles?: string[]\n /**\n * Classes the canvas is rendering without, encoded `nodeId|className`\n * (AGL-2486). Canvas only, like the style mutes: the element's class list\n * in the document is untouched, so what the Classes chips show is what\n * ships.\n */\n mutedClasses?: string[]\n /** What kind of host view the canvas is editing (screen or shared layout). */\n viewType?: HostViewType\n /**\n * WYSIWYG bindings (AGL-97): when not false, the canvas resolves\n * variable/function binding tokens live; toggle off for raw tokens.\n */\n resolveBindings?: boolean\n }\n panels: {\n panelLeft?: BesignerPanelItem\n panelRight?: BesignerPanelItem\n panelBottom?: BesignerPanelItem\n }\n}\nexport type BesignerFlagsState = BesignerContext['flags']\nexport type BesignerFlagKey = keyof BesignerFlagsState\nexport type BesignerFlagValue<K extends BesignerFlagKey = BesignerFlagKey> =\n BesignerFlagsState[K]\nexport type BesignerPanelsState = BesignerContext['panels']\nexport type BesignerPanelKey = keyof BesignerPanelsState\nexport type BesignerPanelValue<K extends BesignerPanelKey = BesignerPanelKey> =\n BesignerPanelsState[K]\nexport type BesignerPanelItem = {\n id?: BesignerPanelViewFlag\n size?: number | string\n toggled?: boolean\n tab?: BesignerPanelTabFlag\n}\n\nexport interface BesignerInterfaceControllerOptions {\n logLevel?: LogLevelString\n defaults?: Partial<BesignerContext>\n}\n\nexport interface IBesignerInterfaceController {\n readonly __store__: {\n [K in keyof BesignerContext]: BehaviorSubject<BesignerContext[K]>\n }\n readonly flags: this['__store__']['flags']\n readonly panels: this['__store__']['panels']\n\n setFlag(payload: BesignerSetFlagPayload): this\n setFlags(payload: BesignerSetFlagsPayload): this\n setPanel(payload: BesignerSetPanelPayload): this\n setPanels(payload: BesignerSetPanelsPayload): this\n}\n\nexport interface BesignerInterfaceControllerT {\n new (\n app: IBesignerAppController,\n options: BesignerInterfaceControllerOptions,\n ): IBesignerInterfaceController\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GA4GD,WAKC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { PayloadData } from '@aglyn/aglyn';
|
|
18
|
+
import type { BesignerFlagsState, BesignerPanelKey, BesignerPanelsState } from '../definitions/besigner-interface.types';
|
|
19
|
+
import { BesignerFlagValue, BesignerPanelValue } from '../definitions/besigner-interface.types';
|
|
20
|
+
export type BesignerSetFlagPayload<K extends keyof BesignerFlagsState = any> = PayloadData<{
|
|
21
|
+
flag: K;
|
|
22
|
+
value: (prev: BesignerFlagValue<K>, flags: BesignerFlagsState) => BesignerFlagValue<K>;
|
|
23
|
+
}>;
|
|
24
|
+
export type BesignerSetFlagsPayload = PayloadData<{
|
|
25
|
+
flags: (prev: BesignerFlagsState) => BesignerFlagsState;
|
|
26
|
+
}>;
|
|
27
|
+
export type BesignerSetPanelPayload<K extends BesignerPanelKey = any> = PayloadData<{
|
|
28
|
+
panel: K;
|
|
29
|
+
value: (prev: BesignerPanelValue<K>, panels: BesignerPanelsState) => BesignerPanelValue<K>;
|
|
30
|
+
}>;
|
|
31
|
+
export type BesignerSetPanelsPayload = PayloadData<{
|
|
32
|
+
panels: (prev: BesignerPanelsState) => BesignerPanelsState;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 { };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=emitter.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/besigner/core/src/lib/definitions/emitter.types.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 { PayloadData } from '@aglyn/aglyn'\nimport type {\n BesignerFlagsState,\n BesignerPanelKey,\n BesignerPanelsState,\n} from '../definitions/besigner-interface.types'\nimport {\n BesignerFlagValue,\n BesignerPanelValue,\n} from '../definitions/besigner-interface.types'\n\nexport type BesignerSetFlagPayload<K extends keyof BesignerFlagsState = any> =\n PayloadData<{\n flag: K\n value: (\n prev: BesignerFlagValue<K>,\n flags: BesignerFlagsState,\n ) => BesignerFlagValue<K>\n }>\nexport type BesignerSetFlagsPayload = PayloadData<{\n flags: (prev: BesignerFlagsState) => BesignerFlagsState\n}>\nexport type BesignerSetPanelPayload<K extends BesignerPanelKey = any> =\n PayloadData<{\n panel: K\n value: (\n prev: BesignerPanelValue<K>,\n panels: BesignerPanelsState,\n ) => BesignerPanelValue<K>\n }>\nexport type BesignerSetPanelsPayload = PayloadData<{\n panels: (prev: BesignerPanelsState) => BesignerPanelsState\n}>\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAgCD,WAEE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { BesignerDeviceFlag } from './constants/besigner';
|
|
18
|
+
/**
|
|
19
|
+
* The width of the artboard's phone frame, and the viewport width XS - Mobile
|
|
20
|
+
* previews a page at.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEVICE_PREVIEW_XS_WIDTH = 390;
|
|
23
|
+
/** A theme's breakpoint values, as `theme.breakpoints.values` holds them. */
|
|
24
|
+
export type DevicePreviewBreakpointValues = Partial<Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>>;
|
|
25
|
+
/**
|
|
26
|
+
* The viewport width the device switcher previews a page at (AGL-581), or
|
|
27
|
+
* null when no device is pinned (Fluid Responsive, scale to fit).
|
|
28
|
+
*
|
|
29
|
+
* XS is the artboard's phone frame; SM, MD, LG and XL sit exactly on the
|
|
30
|
+
* site theme's own breakpoints, so "SM - Tablet" activates the tablet band
|
|
31
|
+
* and the `sm` slice of responsive values. The defaults are MUI's, for a
|
|
32
|
+
* theme that names none.
|
|
33
|
+
*
|
|
34
|
+
* This is the one notion of what each device is. The canvas pins its theme to
|
|
35
|
+
* it, and the AI plugin's device-width audit renders every golden page at it
|
|
36
|
+
* (AGL-3020): a page the audit passed at a width the switcher does not show
|
|
37
|
+
* would be a page nobody looked at.
|
|
38
|
+
*/
|
|
39
|
+
export declare function devicePreviewWidth(flag: BesignerDeviceFlag | undefined, breakpointValues?: DevicePreviewBreakpointValues): number | null;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
*/ // By path, not the barrel: the flag enum alone, without the managers and
|
|
17
|
+
// controllers the barrel evaluates.
|
|
18
|
+
import { BesignerDeviceFlag } from "./constants/besigner.js";
|
|
19
|
+
/**
|
|
20
|
+
* The width of the artboard's phone frame, and the viewport width XS - Mobile
|
|
21
|
+
* previews a page at.
|
|
22
|
+
*/ export const DEVICE_PREVIEW_XS_WIDTH = 390;
|
|
23
|
+
/**
|
|
24
|
+
* The viewport width the device switcher previews a page at (AGL-581), or
|
|
25
|
+
* null when no device is pinned (Fluid Responsive, scale to fit).
|
|
26
|
+
*
|
|
27
|
+
* XS is the artboard's phone frame; SM, MD, LG and XL sit exactly on the
|
|
28
|
+
* site theme's own breakpoints, so "SM - Tablet" activates the tablet band
|
|
29
|
+
* and the `sm` slice of responsive values. The defaults are MUI's, for a
|
|
30
|
+
* theme that names none.
|
|
31
|
+
*
|
|
32
|
+
* This is the one notion of what each device is. The canvas pins its theme to
|
|
33
|
+
* it, and the AI plugin's device-width audit renders every golden page at it
|
|
34
|
+
* (AGL-3020): a page the audit passed at a width the switcher does not show
|
|
35
|
+
* would be a page nobody looked at.
|
|
36
|
+
*/ export function devicePreviewWidth(flag, breakpointValues = {}) {
|
|
37
|
+
switch(flag){
|
|
38
|
+
case BesignerDeviceFlag.XS:
|
|
39
|
+
return DEVICE_PREVIEW_XS_WIDTH;
|
|
40
|
+
case BesignerDeviceFlag.SM:
|
|
41
|
+
var _breakpointValues_sm;
|
|
42
|
+
return (_breakpointValues_sm = breakpointValues.sm) != null ? _breakpointValues_sm : 600;
|
|
43
|
+
case BesignerDeviceFlag.MD:
|
|
44
|
+
var _breakpointValues_md;
|
|
45
|
+
return (_breakpointValues_md = breakpointValues.md) != null ? _breakpointValues_md : 900;
|
|
46
|
+
case BesignerDeviceFlag.LG:
|
|
47
|
+
var _breakpointValues_lg;
|
|
48
|
+
return (_breakpointValues_lg = breakpointValues.lg) != null ? _breakpointValues_lg : 1200;
|
|
49
|
+
case BesignerDeviceFlag.XL:
|
|
50
|
+
var _breakpointValues_xl;
|
|
51
|
+
return (_breakpointValues_xl = breakpointValues.xl) != null ? _breakpointValues_xl : 1536;
|
|
52
|
+
default:
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=device-preview-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/besigner/core/src/lib/device-preview-width.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\n// By path, not the barrel: the flag enum alone, without the managers and\n// controllers the barrel evaluates.\nimport { BesignerDeviceFlag } from './constants/besigner'\n\n/**\n * The width of the artboard's phone frame, and the viewport width XS - Mobile\n * previews a page at.\n */\nexport const DEVICE_PREVIEW_XS_WIDTH = 390\n\n/** A theme's breakpoint values, as `theme.breakpoints.values` holds them. */\nexport type DevicePreviewBreakpointValues = Partial<\n Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>\n>\n\n/**\n * The viewport width the device switcher previews a page at (AGL-581), or\n * null when no device is pinned (Fluid Responsive, scale to fit).\n *\n * XS is the artboard's phone frame; SM, MD, LG and XL sit exactly on the\n * site theme's own breakpoints, so \"SM - Tablet\" activates the tablet band\n * and the `sm` slice of responsive values. The defaults are MUI's, for a\n * theme that names none.\n *\n * This is the one notion of what each device is. The canvas pins its theme to\n * it, and the AI plugin's device-width audit renders every golden page at it\n * (AGL-3020): a page the audit passed at a width the switcher does not show\n * would be a page nobody looked at.\n */\nexport function devicePreviewWidth(\n flag: BesignerDeviceFlag | undefined,\n breakpointValues: DevicePreviewBreakpointValues = {},\n): number | null {\n switch (flag) {\n case BesignerDeviceFlag.XS:\n return DEVICE_PREVIEW_XS_WIDTH\n case BesignerDeviceFlag.SM:\n return breakpointValues.sm ?? 600\n case BesignerDeviceFlag.MD:\n return breakpointValues.md ?? 900\n case BesignerDeviceFlag.LG:\n return breakpointValues.lg ?? 1200\n case BesignerDeviceFlag.XL:\n return breakpointValues.xl ?? 1536\n default:\n return null\n }\n}\n"],"names":["BesignerDeviceFlag","DEVICE_PREVIEW_XS_WIDTH","devicePreviewWidth","flag","breakpointValues","XS","SM","sm","MD","md","LG","lg","XL","xl"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,yEAAyE;AACzE,oCAAoC;AACpC,SAASA,kBAAkB,QAAQ,0BAAsB;AAEzD;;;CAGC,GACD,OAAO,MAAMC,0BAA0B,IAAG;AAO1C;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,mBACdC,IAAoC,EACpCC,mBAAkD,CAAC,CAAC;IAEpD,OAAQD;QACN,KAAKH,mBAAmBK,EAAE;YACxB,OAAOJ;QACT,KAAKD,mBAAmBM,EAAE;gBACjBF;YAAP,QAAOA,uBAAAA,iBAAiBG,EAAE,YAAnBH,uBAAuB;QAChC,KAAKJ,mBAAmBQ,EAAE;gBACjBJ;YAAP,QAAOA,uBAAAA,iBAAiBK,EAAE,YAAnBL,uBAAuB;QAChC,KAAKJ,mBAAmBU,EAAE;gBACjBN;YAAP,QAAOA,uBAAAA,iBAAiBO,EAAE,YAAnBP,uBAAuB;QAChC,KAAKJ,mBAAmBY,EAAE;gBACjBR;YAAP,QAAOA,uBAAAA,iBAAiBS,EAAE,YAAnBT,uBAAuB;QAChC;YACE,OAAO;IACX;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 * as Aglyn from '@aglyn/aglyn';
|
|
18
|
+
export declare enum InvalidLinealRelationFlag {
|
|
19
|
+
DISALLOW = 1,
|
|
20
|
+
LIMIT_TO = 2,
|
|
21
|
+
ITEM = 4,
|
|
22
|
+
PARENT = 8,
|
|
23
|
+
COMPONENT = 16,
|
|
24
|
+
BUNDLE = 32,
|
|
25
|
+
DISALLOW_COMPONENT = 17,
|
|
26
|
+
DISALLOW_BUNDLE = 33,
|
|
27
|
+
LIMIT_TO_COMPONENT = 18,
|
|
28
|
+
LIMIT_TO_BUNDLE = 34,
|
|
29
|
+
DISALLOW_COMPONENT_ITEM = 21,
|
|
30
|
+
DISALLOW_BUNDLE_ITEM = 37,
|
|
31
|
+
LIMIT_TO_COMPONENT_ITEM = 22,
|
|
32
|
+
LIMIT_TO_BUNDLE_ITEM = 38,
|
|
33
|
+
DISALLOW_COMPONENT_PARENT = 25,
|
|
34
|
+
DISALLOW_BUNDLE_PARENT = 41,
|
|
35
|
+
LIMIT_TO_COMPONENT_PARENT = 26,
|
|
36
|
+
LIMIT_TO_BUNDLE_PARENT = 42
|
|
37
|
+
}
|
|
38
|
+
export type ConfirmValidLinealRelationshipResponse = [
|
|
39
|
+
isValid: true
|
|
40
|
+
] | [isValid: false, reason: InvalidLinealRelationFlag];
|
|
41
|
+
export type LinealItem = {
|
|
42
|
+
componentId?: Aglyn.ComponentId;
|
|
43
|
+
pluginId?: Aglyn.PluginId;
|
|
44
|
+
restrictParent?: Aglyn.ComponentsLinealOrder;
|
|
45
|
+
restrictChildren?: Aglyn.ComponentsLinealOrder;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Human-readable explanation for a failed lineal validation, e.g.
|
|
49
|
+
* "Toolbar Content must be placed inside App Bar". Pair with the reason
|
|
50
|
+
* flag returned by {@link confirmValidLinealRelationship}.
|
|
51
|
+
*/
|
|
52
|
+
export declare function describeInvalidLinealRelationship(item: LinealItem, parent: LinealItem, reason: InvalidLinealRelationFlag): string;
|
|
53
|
+
export declare function confirmValidLinealRelationship(item: LinealItem, parent: LinealItem): ConfirmValidLinealRelationshipResponse;
|
|
54
|
+
export default confirmValidLinealRelationship;
|