@fps-games/editor 0.1.0 → 0.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/local-editor-harness.d.ts +70 -26
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +455 -21
- package/dist/local-editor-harness.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +4 -4
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.d.ts +15 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js +163 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts +28 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js +164 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +20 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +483 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts +56 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +216 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +13 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +138 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.d.ts +3 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.js +29 -5
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-input-router.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +10 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +554 -93
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js +7 -3
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shortcuts.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shortcuts.js +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shortcuts.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +148 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +11 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +206 -173
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.d.ts +2 -0
- package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.js +2 -0
- package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts +138 -0
- package/node_modules/@fps-games/editor-core/dist/inspector.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/inspector.js +298 -0
- package/node_modules/@fps-games/editor-core/dist/inspector.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts +28 -0
- package/node_modules/@fps-games/editor-core/dist/scene-graph.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/scene-graph.js +143 -2
- package/node_modules/@fps-games/editor-core/dist/scene-graph.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/transform-math.d.ts +30 -0
- package/node_modules/@fps-games/editor-core/dist/transform-math.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/transform-math.js +339 -0
- package/node_modules/@fps-games/editor-core/dist/transform-math.js.map +1 -0
- package/node_modules/@fps-games/editor-core/package.json +2 -2
- package/node_modules/@fps-games/editor-forge-play/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
export function createLocalEditorHierarchyTreeModel(items, selectedIds = [], activeId = null, options = {}) {
|
|
2
|
+
const selected = new Set(selectedIds);
|
|
3
|
+
const byRawId = new Map(items.map((item, inputIndex) => [item.id, { item, inputIndex }]));
|
|
4
|
+
const childrenByParentId = new Map();
|
|
5
|
+
const provisionalNodes = new Map();
|
|
6
|
+
for (const { item, inputIndex } of byRawId.values()) {
|
|
7
|
+
const parentId = item.parentId && byRawId.has(item.parentId) ? item.parentId : null;
|
|
8
|
+
const role = resolveHierarchyNodeRole(item);
|
|
9
|
+
provisionalNodes.set(item.id, {
|
|
10
|
+
id: item.id,
|
|
11
|
+
label: item.label,
|
|
12
|
+
item,
|
|
13
|
+
parentId,
|
|
14
|
+
inputIndex,
|
|
15
|
+
role,
|
|
16
|
+
protected: item.protected === true,
|
|
17
|
+
selected: selected.has(item.id),
|
|
18
|
+
active: activeId === item.id,
|
|
19
|
+
});
|
|
20
|
+
const children = childrenByParentId.get(parentId) ?? [];
|
|
21
|
+
children.push(item.id);
|
|
22
|
+
childrenByParentId.set(parentId, children);
|
|
23
|
+
}
|
|
24
|
+
for (const childIds of childrenByParentId.values()) {
|
|
25
|
+
childIds.sort((a, b) => {
|
|
26
|
+
const left = provisionalNodes.get(a);
|
|
27
|
+
const right = provisionalNodes.get(b);
|
|
28
|
+
return (left?.inputIndex ?? 0) - (right?.inputIndex ?? 0);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const expanded = normalizeIdSet(options.expandedIds);
|
|
32
|
+
const collapsed = normalizeIdSet(options.collapsedIds);
|
|
33
|
+
const defaultExpanded = options.defaultExpanded ?? true;
|
|
34
|
+
const nodesById = new Map();
|
|
35
|
+
const visibleRows = [];
|
|
36
|
+
const visited = new Set();
|
|
37
|
+
const appendNode = (id, depth, visible) => {
|
|
38
|
+
if (visited.has(id))
|
|
39
|
+
return;
|
|
40
|
+
const provisional = provisionalNodes.get(id);
|
|
41
|
+
if (!provisional)
|
|
42
|
+
return;
|
|
43
|
+
visited.add(id);
|
|
44
|
+
const childIds = childrenByParentId.get(id) ?? [];
|
|
45
|
+
const parentChildren = childrenByParentId.get(provisional.parentId) ?? [];
|
|
46
|
+
const nodeExpanded = childIds.length > 0 && (expanded.has(id) || (defaultExpanded && !collapsed.has(id)));
|
|
47
|
+
const node = {
|
|
48
|
+
...provisional,
|
|
49
|
+
childIds: [...childIds],
|
|
50
|
+
depth,
|
|
51
|
+
siblingIndex: Math.max(0, parentChildren.indexOf(id)),
|
|
52
|
+
expanded: nodeExpanded,
|
|
53
|
+
visible,
|
|
54
|
+
};
|
|
55
|
+
nodesById.set(id, node);
|
|
56
|
+
if (visible)
|
|
57
|
+
visibleRows.push(node);
|
|
58
|
+
for (const childId of childIds)
|
|
59
|
+
appendNode(childId, depth + 1, visible && nodeExpanded);
|
|
60
|
+
};
|
|
61
|
+
const rootIds = [...(childrenByParentId.get(null) ?? [])];
|
|
62
|
+
for (const rootId of rootIds)
|
|
63
|
+
appendNode(rootId, 0, true);
|
|
64
|
+
for (const id of provisionalNodes.keys()) {
|
|
65
|
+
if (visited.has(id))
|
|
66
|
+
continue;
|
|
67
|
+
rootIds.push(id);
|
|
68
|
+
appendNode(id, 0, true);
|
|
69
|
+
}
|
|
70
|
+
const nodes = [...nodesById.values()].sort((a, b) => a.inputIndex - b.inputIndex);
|
|
71
|
+
return {
|
|
72
|
+
nodes,
|
|
73
|
+
visibleRows,
|
|
74
|
+
rootIds,
|
|
75
|
+
byId: nodesById,
|
|
76
|
+
childrenByParentId,
|
|
77
|
+
getNode(id) {
|
|
78
|
+
return id ? nodesById.get(id) ?? null : null;
|
|
79
|
+
},
|
|
80
|
+
getChildren(parentId) {
|
|
81
|
+
return (childrenByParentId.get(parentId ?? null) ?? [])
|
|
82
|
+
.map(id => nodesById.get(id) ?? null)
|
|
83
|
+
.filter((node) => !!node);
|
|
84
|
+
},
|
|
85
|
+
getAncestors(id) {
|
|
86
|
+
const ancestors = [];
|
|
87
|
+
const seen = new Set();
|
|
88
|
+
let cursor = id ? nodesById.get(id) ?? null : null;
|
|
89
|
+
while (cursor?.parentId && !seen.has(cursor.parentId)) {
|
|
90
|
+
seen.add(cursor.parentId);
|
|
91
|
+
cursor = nodesById.get(cursor.parentId) ?? null;
|
|
92
|
+
if (cursor)
|
|
93
|
+
ancestors.push(cursor);
|
|
94
|
+
}
|
|
95
|
+
return ancestors;
|
|
96
|
+
},
|
|
97
|
+
isDescendant(candidateId, ancestorId) {
|
|
98
|
+
if (candidateId === ancestorId)
|
|
99
|
+
return false;
|
|
100
|
+
return this.getAncestors(candidateId).some(ancestor => ancestor.id === ancestorId);
|
|
101
|
+
},
|
|
102
|
+
getTopLevelSelection(ids) {
|
|
103
|
+
const selectedIds = new Set(ids.filter(id => nodesById.has(id)));
|
|
104
|
+
return ids.filter((id, index) => {
|
|
105
|
+
if (!selectedIds.has(id) || ids.indexOf(id) !== index)
|
|
106
|
+
return false;
|
|
107
|
+
return !this.getAncestors(id).some(ancestor => selectedIds.has(ancestor.id));
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
resolveDrop(input) {
|
|
111
|
+
return resolveHierarchyDrop(nodesById, childrenByParentId, input, this.getTopLevelSelection.bind(this), this.isDescendant.bind(this));
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export function isLocalEditorHierarchyNodeMovable(node) {
|
|
116
|
+
return !!node
|
|
117
|
+
&& node.protected !== true
|
|
118
|
+
&& node.item.locked !== true
|
|
119
|
+
&& node.item.draggable !== false;
|
|
120
|
+
}
|
|
121
|
+
export function canLocalEditorHierarchyNodeHaveChildren(node) {
|
|
122
|
+
if (!node)
|
|
123
|
+
return false;
|
|
124
|
+
if (node.item.locked === true && node.protected !== true)
|
|
125
|
+
return false;
|
|
126
|
+
return node.item.canHaveChildren === true;
|
|
127
|
+
}
|
|
128
|
+
function resolveHierarchyNodeRole(item) {
|
|
129
|
+
if (item.role)
|
|
130
|
+
return item.role;
|
|
131
|
+
if (item.parentId == null && item.selectable === false)
|
|
132
|
+
return 'root';
|
|
133
|
+
if (item.canHaveChildren === true)
|
|
134
|
+
return 'group';
|
|
135
|
+
return 'object';
|
|
136
|
+
}
|
|
137
|
+
function normalizeIdSet(value) {
|
|
138
|
+
if (!value)
|
|
139
|
+
return new Set();
|
|
140
|
+
return value instanceof Set ? value : new Set(value);
|
|
141
|
+
}
|
|
142
|
+
function resolveHierarchyDrop(nodesById, childrenByParentId, input, getTopLevelSelection, isDescendant) {
|
|
143
|
+
const draggedIds = getTopLevelSelection(input.draggedIds);
|
|
144
|
+
if (draggedIds.length === 0)
|
|
145
|
+
return invalidDrop(input, 'empty-drag');
|
|
146
|
+
for (const id of draggedIds) {
|
|
147
|
+
if (!isLocalEditorHierarchyNodeMovable(nodesById.get(id) ?? null))
|
|
148
|
+
return invalidDrop(input, 'dragged-node-protected');
|
|
149
|
+
}
|
|
150
|
+
if (input.placement === 'root') {
|
|
151
|
+
return {
|
|
152
|
+
ok: true,
|
|
153
|
+
placement: 'root',
|
|
154
|
+
draggedIds,
|
|
155
|
+
targetId: null,
|
|
156
|
+
parentId: null,
|
|
157
|
+
beforeId: null,
|
|
158
|
+
afterId: null,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const targetId = input.targetId ?? null;
|
|
162
|
+
const target = targetId ? nodesById.get(targetId) ?? null : null;
|
|
163
|
+
if (!target)
|
|
164
|
+
return invalidDrop(input, 'missing-target');
|
|
165
|
+
if (draggedIds.includes(target.id))
|
|
166
|
+
return invalidDrop(input, 'cannot-drop-on-self');
|
|
167
|
+
if (draggedIds.some(id => isDescendant(target.id, id)))
|
|
168
|
+
return invalidDrop(input, 'cannot-drop-on-descendant');
|
|
169
|
+
if (input.placement === 'inside') {
|
|
170
|
+
if (!canLocalEditorHierarchyNodeHaveChildren(target))
|
|
171
|
+
return invalidDrop(input, 'target-cannot-have-children');
|
|
172
|
+
const draggedSet = new Set(draggedIds);
|
|
173
|
+
const children = (childrenByParentId.get(target.id) ?? []).filter(id => !draggedSet.has(id));
|
|
174
|
+
return {
|
|
175
|
+
ok: true,
|
|
176
|
+
placement: 'inside',
|
|
177
|
+
draggedIds,
|
|
178
|
+
targetId: target.id,
|
|
179
|
+
parentId: target.id,
|
|
180
|
+
beforeId: null,
|
|
181
|
+
afterId: children[children.length - 1] ?? null,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
if (target.role === 'root' || target.protected)
|
|
185
|
+
return invalidDrop(input, 'cannot-reorder-root');
|
|
186
|
+
if (target.item.locked === true)
|
|
187
|
+
return invalidDrop(input, 'target-node-locked');
|
|
188
|
+
const parent = target.parentId ? nodesById.get(target.parentId) ?? null : null;
|
|
189
|
+
if (parent?.item.locked === true && parent.protected !== true)
|
|
190
|
+
return invalidDrop(input, 'target-parent-locked');
|
|
191
|
+
const draggedSet = new Set(draggedIds);
|
|
192
|
+
const siblings = (childrenByParentId.get(target.parentId) ?? []).filter(id => !draggedSet.has(id));
|
|
193
|
+
const targetIndex = siblings.indexOf(target.id);
|
|
194
|
+
return {
|
|
195
|
+
ok: true,
|
|
196
|
+
placement: input.placement,
|
|
197
|
+
draggedIds,
|
|
198
|
+
targetId: target.id,
|
|
199
|
+
parentId: target.parentId,
|
|
200
|
+
beforeId: input.placement === 'before' ? target.id : siblings[targetIndex + 1] ?? null,
|
|
201
|
+
afterId: input.placement === 'after' ? target.id : siblings[targetIndex - 1] ?? null,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function invalidDrop(input, reason) {
|
|
205
|
+
return {
|
|
206
|
+
ok: false,
|
|
207
|
+
reason,
|
|
208
|
+
placement: input.placement,
|
|
209
|
+
draggedIds: [],
|
|
210
|
+
targetId: input.targetId ?? null,
|
|
211
|
+
parentId: null,
|
|
212
|
+
beforeId: null,
|
|
213
|
+
afterId: null,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=local-editor-ui-hierarchy-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-editor-ui-hierarchy-tree.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-tree.ts"],"names":[],"mappings":"AA2DA,MAAM,UAAU,mCAAmC,CACjD,KAAmD,EACnD,cAAiC,EAAE,EACnC,WAA0B,IAAI,EAC9B,UAA2C,EAAE;IAE7C,MAAM,QAAQ,GAAG,IAAI,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,CAAC,SAAS;QAC1B,UAAU;QACV,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,IAAI;QACtF,OAAO,EAAE,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,IAAI;KACrF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAClB,KAAoC,EACpC,MAAc;IAEd,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM;QACN,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI;QAChC,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LocalEditorBrowserSceneGraphDropIntent } from './local-editor-ui-types';
|
|
2
|
+
import type { LocalEditorHierarchyTreeModel } from './local-editor-ui-hierarchy-tree';
|
|
3
|
+
export interface LocalEditorHierarchyViewInput {
|
|
4
|
+
model: LocalEditorHierarchyTreeModel;
|
|
5
|
+
rename: {
|
|
6
|
+
id: string;
|
|
7
|
+
value: string;
|
|
8
|
+
} | null;
|
|
9
|
+
drop: LocalEditorBrowserSceneGraphDropIntent | null;
|
|
10
|
+
rootDrop: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function renderLocalEditorHierarchyPanel(doc: Document, panel: HTMLElement, input: LocalEditorHierarchyViewInput): void;
|
|
13
|
+
//# sourceMappingURL=local-editor-ui-hierarchy-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-editor-ui-hierarchy-view.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-view.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,6BAA6B,CAAC;IACrC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7C,IAAI,EAAE,sCAAsC,GAAG,IAAI,CAAC;IACpD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,6BAA6B,GACnC,IAAI,CAyBN"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { createPanelHeader, createToolbarButton, createTreeView, createTreeViewItem, } from './local-editor-ui-primitives';
|
|
2
|
+
import { clearElement } from './local-editor-ui-shared';
|
|
3
|
+
import { canLocalEditorHierarchyNodeHaveChildren } from './local-editor-ui-hierarchy-tree';
|
|
4
|
+
export function renderLocalEditorHierarchyPanel(doc, panel, input) {
|
|
5
|
+
clearElement(panel);
|
|
6
|
+
const createGroupButton = createToolbarButton(doc, '+ Group');
|
|
7
|
+
createGroupButton.dataset.editorHierarchyCreateGroup = 'true';
|
|
8
|
+
createGroupButton.style.padding = '3px 7px';
|
|
9
|
+
createGroupButton.style.fontSize = '11px';
|
|
10
|
+
panel.appendChild(createPanelHeader(doc, 'Graph', [createGroupButton]));
|
|
11
|
+
const list = createTreeView(doc);
|
|
12
|
+
list.dataset.editorHierarchyRootDrop = input.rootDrop ? 'active' : 'ready';
|
|
13
|
+
if (input.rootDrop) {
|
|
14
|
+
list.style.boxShadow = 'inset 0 -2px 0 rgba(248,196,79,0.95)';
|
|
15
|
+
list.style.background = 'rgba(248,196,79,0.08)';
|
|
16
|
+
}
|
|
17
|
+
if (input.model.visibleRows.length === 0) {
|
|
18
|
+
const empty = doc.createElement('div');
|
|
19
|
+
empty.textContent = 'No hierarchy nodes.';
|
|
20
|
+
empty.style.cssText = 'padding:8px;color:var(--fps-editor-muted);font-size:11px';
|
|
21
|
+
list.appendChild(empty);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
for (const node of input.model.visibleRows) {
|
|
25
|
+
list.appendChild(renderHierarchyRow(doc, node, input.rename, input.drop));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
panel.appendChild(list);
|
|
29
|
+
}
|
|
30
|
+
function renderHierarchyRow(doc, node, rename, drop) {
|
|
31
|
+
const isRenaming = rename?.id === node.id;
|
|
32
|
+
const dropPlacement = drop?.targetId === node.id ? drop.placement : null;
|
|
33
|
+
const canHaveChildren = canLocalEditorHierarchyNodeHaveChildren(node);
|
|
34
|
+
const button = createTreeViewItem(doc, {
|
|
35
|
+
id: node.id,
|
|
36
|
+
label: node.label,
|
|
37
|
+
depth: node.depth,
|
|
38
|
+
role: node.role,
|
|
39
|
+
selected: node.selected,
|
|
40
|
+
active: node.active,
|
|
41
|
+
locked: node.item.locked,
|
|
42
|
+
protected: node.protected,
|
|
43
|
+
selectable: node.item.selectable,
|
|
44
|
+
draggable: node.item.draggable,
|
|
45
|
+
dropPlacement,
|
|
46
|
+
});
|
|
47
|
+
button.dataset.editorHierarchyCanHaveChildren = canHaveChildren ? 'true' : 'false';
|
|
48
|
+
button.title = node.protected ? `${node.label} (protected)` : node.label;
|
|
49
|
+
appendDisclosure(doc, button, node);
|
|
50
|
+
appendRoleBadge(doc, button, node);
|
|
51
|
+
if (isRenaming)
|
|
52
|
+
appendRenameInput(doc, button, node, rename.value);
|
|
53
|
+
else
|
|
54
|
+
appendLabel(doc, button, node);
|
|
55
|
+
if (node.protected)
|
|
56
|
+
appendProtectedBadge(doc, button);
|
|
57
|
+
return button;
|
|
58
|
+
}
|
|
59
|
+
function appendDisclosure(doc, parent, node) {
|
|
60
|
+
const disclosure = doc.createElement('span');
|
|
61
|
+
if (node.childIds.length > 0)
|
|
62
|
+
disclosure.dataset.editorHierarchyToggle = node.id;
|
|
63
|
+
disclosure.textContent = node.childIds.length > 0 ? (node.expanded ? '▾' : '▸') : '';
|
|
64
|
+
disclosure.style.cssText = [
|
|
65
|
+
'width:12px',
|
|
66
|
+
'flex:0 0 12px',
|
|
67
|
+
'display:inline-flex',
|
|
68
|
+
'align-items:center',
|
|
69
|
+
'justify-content:center',
|
|
70
|
+
'color:var(--fps-editor-muted)',
|
|
71
|
+
'font-size:10px',
|
|
72
|
+
].join(';');
|
|
73
|
+
parent.appendChild(disclosure);
|
|
74
|
+
}
|
|
75
|
+
function appendRoleBadge(doc, parent, node) {
|
|
76
|
+
const badge = doc.createElement('span');
|
|
77
|
+
badge.textContent = node.role === 'root' ? 'R' : node.role === 'group' ? 'G' : 'O';
|
|
78
|
+
badge.style.cssText = [
|
|
79
|
+
'width:15px',
|
|
80
|
+
'height:15px',
|
|
81
|
+
'flex:0 0 15px',
|
|
82
|
+
'display:inline-flex',
|
|
83
|
+
'align-items:center',
|
|
84
|
+
'justify-content:center',
|
|
85
|
+
'border:1px solid var(--fps-editor-border)',
|
|
86
|
+
'border-radius:2px',
|
|
87
|
+
`background:${node.role === 'root' ? '#3a2f18' : node.role === 'group' ? '#243426' : '#252b34'}`,
|
|
88
|
+
'color:var(--fps-editor-muted-strong)',
|
|
89
|
+
'font-size:9px',
|
|
90
|
+
'font-weight:900',
|
|
91
|
+
].join(';');
|
|
92
|
+
parent.appendChild(badge);
|
|
93
|
+
}
|
|
94
|
+
function appendLabel(doc, parent, node) {
|
|
95
|
+
const label = doc.createElement('span');
|
|
96
|
+
label.textContent = node.item.locked && !node.protected ? `${node.label} [locked]` : node.label;
|
|
97
|
+
label.style.cssText = 'min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap';
|
|
98
|
+
parent.appendChild(label);
|
|
99
|
+
}
|
|
100
|
+
function appendProtectedBadge(doc, parent) {
|
|
101
|
+
const badge = doc.createElement('span');
|
|
102
|
+
badge.textContent = 'protected';
|
|
103
|
+
badge.style.cssText = [
|
|
104
|
+
'flex:0 0 auto',
|
|
105
|
+
'padding:1px 4px',
|
|
106
|
+
'border:1px solid rgba(229,180,84,0.45)',
|
|
107
|
+
'border-radius:2px',
|
|
108
|
+
'color:var(--fps-editor-warn)',
|
|
109
|
+
'font-size:9px',
|
|
110
|
+
'font-weight:900',
|
|
111
|
+
].join(';');
|
|
112
|
+
parent.appendChild(badge);
|
|
113
|
+
}
|
|
114
|
+
function appendRenameInput(doc, parent, node, value) {
|
|
115
|
+
const input = doc.createElement('input');
|
|
116
|
+
input.dataset.editorHierarchyRenameInput = node.id;
|
|
117
|
+
input.value = value;
|
|
118
|
+
input.style.cssText = [
|
|
119
|
+
'min-width:0',
|
|
120
|
+
'flex:1',
|
|
121
|
+
'height:22px',
|
|
122
|
+
'box-sizing:border-box',
|
|
123
|
+
'border:1px solid var(--fps-editor-accent-strong)',
|
|
124
|
+
'border-radius:2px',
|
|
125
|
+
'background:var(--fps-editor-field)',
|
|
126
|
+
'color:#fff',
|
|
127
|
+
'font-size:12px',
|
|
128
|
+
'font-weight:700',
|
|
129
|
+
'padding:2px 5px',
|
|
130
|
+
'outline:none',
|
|
131
|
+
].join(';');
|
|
132
|
+
parent.appendChild(input);
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
input.focus();
|
|
135
|
+
input.select();
|
|
136
|
+
}, 0);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=local-editor-ui-hierarchy-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-editor-ui-hierarchy-view.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-view.ts"],"names":[],"mappings":"AAAA,OA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5B,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAa,EAAE,MAAmB;IAC9D,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;IAChC,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG;QACpB,eAAe;QACf,iBAAiB;QACjB,wCAAwC;QACxC,mBAAmB;QACnB,8BAA8B;QAC9B,eAAe;QACf,iBAAiB;KAClB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,iBAAiB,CACxB,GAAa,EACb,MAAmB,EACnB,IAAkC,EAClC,KAAa;IAEb,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,KAAK,CAAC,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,EAAE,CAAC;IACnD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG;QACpB,aAAa;QACb,QAAQ;QACR,aAAa;QACb,uBAAuB;QACvB,kDAAkD;QAClD,mBAAmB;QACnB,oCAAoC;QACpC,YAAY;QACZ,gBAAgB;QAChB,iBAAiB;QACjB,iBAAiB;QACjB,cAAc;KACf,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1B,UAAU,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -2,8 +2,11 @@ export type LocalEditorWorkbenchInputRegion = 'top-bar' | 'left-dock' | 'right-d
|
|
|
2
2
|
export interface LocalEditorWorkbenchInputRouter {
|
|
3
3
|
getRegion(target: EventTarget | null): LocalEditorWorkbenchInputRegion;
|
|
4
4
|
isEditableTarget(target: EventTarget | null): boolean;
|
|
5
|
+
isEditorOwnedRegion(target: EventTarget | null): boolean;
|
|
5
6
|
isUiRegion(target: EventTarget | null): boolean;
|
|
7
|
+
setContextMenuOpen(open: boolean): void;
|
|
6
8
|
setModalOpen(open: boolean): void;
|
|
9
|
+
shouldPreventBrowserContextMenu(event: MouseEvent): boolean;
|
|
7
10
|
shouldHandleDocumentShortcut(event: KeyboardEvent): boolean;
|
|
8
11
|
shouldHandleGlobalShortcut(event: KeyboardEvent): boolean;
|
|
9
12
|
dispose(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-editor-ui-input-router.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-input-router.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GACvC,SAAS,GACT,WAAW,GACX,YAAY,GACZ,aAAa,GACb,cAAc,GACd,OAAO,GACP,YAAY,GACZ,SAAS,CAAC;AAEd,MAAM,WAAW,+BAA+B;IAC9C,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,+BAA+B,CAAC;IACvE,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;IACtD,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;IAChD,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAC5D,0BAA0B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAC1D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,QAAQ,GAAG,+BAA+B,
|
|
1
|
+
{"version":3,"file":"local-editor-ui-input-router.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-input-router.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GACvC,SAAS,GACT,WAAW,GACX,YAAY,GACZ,aAAa,GACb,cAAc,GACd,OAAO,GACP,YAAY,GACZ,SAAS,CAAC;AAEd,MAAM,WAAW,+BAA+B;IAC9C,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,+BAA+B,CAAC;IACvE,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;IACtD,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;IACzD,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC;IAChD,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,+BAA+B,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5D,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAC5D,0BAA0B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;IAC1D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,QAAQ,GAAG,+BAA+B,CA+CpG"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export function createLocalEditorWorkbenchInputRouter(doc) {
|
|
2
2
|
let modalOpen = false;
|
|
3
|
+
let contextMenuOpen = false;
|
|
3
4
|
const stopPanelWheel = (event) => {
|
|
4
5
|
if (!isUiRegion(event.target))
|
|
5
6
|
return;
|
|
6
7
|
event.stopPropagation();
|
|
7
8
|
};
|
|
8
9
|
const stopPanelContextMenu = (event) => {
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
event.stopPropagation();
|
|
10
|
+
if (shouldPreventBrowserContextMenu(event))
|
|
11
|
+
event.preventDefault();
|
|
12
12
|
};
|
|
13
13
|
const stopPanelPointer = (event) => {
|
|
14
14
|
if (!isUiRegion(event.target))
|
|
@@ -21,15 +21,24 @@ export function createLocalEditorWorkbenchInputRouter(doc) {
|
|
|
21
21
|
return {
|
|
22
22
|
getRegion,
|
|
23
23
|
isEditableTarget,
|
|
24
|
+
isEditorOwnedRegion,
|
|
24
25
|
isUiRegion,
|
|
26
|
+
setContextMenuOpen(open) {
|
|
27
|
+
contextMenuOpen = open;
|
|
28
|
+
},
|
|
25
29
|
setModalOpen(open) {
|
|
26
30
|
modalOpen = open;
|
|
27
31
|
},
|
|
32
|
+
shouldPreventBrowserContextMenu,
|
|
28
33
|
shouldHandleDocumentShortcut(event) {
|
|
29
|
-
return !modalOpen && getRegion(event.target) !== 'modal';
|
|
34
|
+
return !modalOpen && !contextMenuOpen && getRegion(event.target) !== 'modal';
|
|
30
35
|
},
|
|
31
36
|
shouldHandleGlobalShortcut(event) {
|
|
32
|
-
return !modalOpen
|
|
37
|
+
return !modalOpen
|
|
38
|
+
&& !contextMenuOpen
|
|
39
|
+
&& !isEditableTarget(event.target)
|
|
40
|
+
&& !isEditableTarget(doc.activeElement)
|
|
41
|
+
&& getRegion(event.target) !== 'modal';
|
|
33
42
|
},
|
|
34
43
|
dispose() {
|
|
35
44
|
doc.removeEventListener('wheel', stopPanelWheel, { capture: true });
|
|
@@ -44,6 +53,8 @@ function getRegion(target) {
|
|
|
44
53
|
return 'unknown';
|
|
45
54
|
if (element.closest('[data-editor-shortcut-help]'))
|
|
46
55
|
return 'modal';
|
|
56
|
+
if (element.closest('[data-editor-context-menu]'))
|
|
57
|
+
return 'modal';
|
|
47
58
|
const region = element.closest('[data-editor-workbench-region]')?.dataset.editorWorkbenchRegion;
|
|
48
59
|
if (region === 'scene-toolbar')
|
|
49
60
|
return 'scene-header';
|
|
@@ -58,6 +69,16 @@ function getRegion(target) {
|
|
|
58
69
|
return 'scene-view';
|
|
59
70
|
return 'unknown';
|
|
60
71
|
}
|
|
72
|
+
function isEditorOwnedRegion(target) {
|
|
73
|
+
const region = getRegion(target);
|
|
74
|
+
return region === 'top-bar'
|
|
75
|
+
|| region === 'left-dock'
|
|
76
|
+
|| region === 'right-dock'
|
|
77
|
+
|| region === 'bottom-dock'
|
|
78
|
+
|| region === 'scene-header'
|
|
79
|
+
|| region === 'modal'
|
|
80
|
+
|| region === 'scene-view';
|
|
81
|
+
}
|
|
61
82
|
function isUiRegion(target) {
|
|
62
83
|
const region = getRegion(target);
|
|
63
84
|
return region === 'top-bar'
|
|
@@ -67,6 +88,9 @@ function isUiRegion(target) {
|
|
|
67
88
|
|| region === 'scene-header'
|
|
68
89
|
|| region === 'modal';
|
|
69
90
|
}
|
|
91
|
+
function shouldPreventBrowserContextMenu(event) {
|
|
92
|
+
return isEditorOwnedRegion(event.target) && !isEditableTarget(event.target);
|
|
93
|
+
}
|
|
70
94
|
function isEditableTarget(target) {
|
|
71
95
|
const element = target instanceof HTMLElement ? target : null;
|
|
72
96
|
if (!element)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-editor-ui-input-router.js","sourceRoot":"","sources":["../src/local-editor-ui-input-router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-editor-ui-input-router.js","sourceRoot":"","sources":["../src/local-editor-ui-input-router.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,qCAAqC,CAAC,GAAa;IACjE,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAQ,EAAE;QACjD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;YAAE,OAAO;QACtC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC1B,CAAC,CAAC;IACF,MAAM,oBAAoB,GAAG,CAAC,KAAiB,EAAQ,EAAE;QACvD,IAAI,+BAA+B,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,cAAc,EAAE,CAAC;IACrE,CAAC,CAAC;IACF,MAAM,gBAAgB,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CAAC;AAED,SAAS,UAAU,CAAC,MAA0B;IAC5C,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,MAAM,KAAK,SAAS;WACtB,MAAM,KAAK,WAAW;WACtB,MAAM,KAAK,YAAY;WACvB,MAAM,KAAK,aAAa;WACxB,MAAM,KAAK,cAAc;WACzB,MAAM,KAAK,OAAO,CAAC;AAC1B,CAAC;AAED,SAAS,+BAA+B,CAAC,KAAiB;IACxD,OAAO,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,MAA0B;IAClD,MAAM,OAAO,GAAG,MAAM,YAAY,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,OAAO,KAAK,OAAO;WACrB,OAAO,KAAK,UAAU;WACtB,OAAO,KAAK,QAAQ;WACpB,OAAO,CAAC,iBAAiB,CAAC;AACjC,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type { LocalEditorBottomDockTab, LocalEditorBrowserSceneGraphDropIntent, LocalEditorBrowserUiState, LocalEditorWorkbenchPanelDescriptor } from './local-editor-ui-types';
|
|
1
|
+
import type { LocalEditorBottomDockTab, LocalEditorBrowserInspectorConflictStrategy, LocalEditorBrowserInspectorControlBindingOptions, LocalEditorBrowserInspectorControlRegistration, LocalEditorBrowserInspectorControlRenderContext, LocalEditorBrowserInspectorObject, LocalEditorBrowserInspectorProperty, LocalEditorBrowserSceneGraphDropIntent, LocalEditorBrowserUiState, LocalEditorWorkbenchPanelDescriptor } from './local-editor-ui-types';
|
|
2
|
+
export interface LocalEditorBrowserInspectorRenderOptions<TDocument = unknown> {
|
|
3
|
+
controls?: readonly LocalEditorBrowserInspectorControlRegistration<TDocument>[];
|
|
4
|
+
controlConflict?: LocalEditorBrowserInspectorConflictStrategy;
|
|
5
|
+
}
|
|
2
6
|
export declare function renderHierarchyPanel<TDocument>(doc: Document, panel: HTMLElement, state: LocalEditorBrowserUiState<TDocument>, rename: {
|
|
3
7
|
id: string;
|
|
4
8
|
value: string;
|
|
5
9
|
} | null, drop: LocalEditorBrowserSceneGraphDropIntent | null): void;
|
|
6
10
|
export declare function renderBottomDockPanel<TDocument>(doc: Document, panel: HTMLElement, state: LocalEditorBrowserUiState<TDocument>, activeTab: LocalEditorBottomDockTab): void;
|
|
7
11
|
export declare function renderWorkbenchBottomDockPanel<TDocument>(doc: Document, panel: HTMLElement, state: LocalEditorBrowserUiState<TDocument>, activeTab: LocalEditorBottomDockTab, panels?: LocalEditorWorkbenchPanelDescriptor[]): void;
|
|
8
|
-
export declare function renderInspectorPanel<TDocument>(doc: Document, panel: HTMLElement, state: LocalEditorBrowserUiState<TDocument>): void;
|
|
12
|
+
export declare function renderInspectorPanel<TDocument>(doc: Document, panel: HTMLElement, state: LocalEditorBrowserUiState<TDocument>, filter?: string, options?: LocalEditorBrowserInspectorRenderOptions<TDocument>): void;
|
|
13
|
+
export declare function createLocalEditorBrowserInspectorControlRegistry<TDocument>(controls?: readonly LocalEditorBrowserInspectorControlRegistration<TDocument>[], conflict?: LocalEditorBrowserInspectorConflictStrategy): LocalEditorBrowserInspectorControlRegistration<TDocument>[];
|
|
14
|
+
export declare function resolveLocalEditorBrowserInspectorControlRegistration<TDocument>(registrations: readonly LocalEditorBrowserInspectorControlRegistration<TDocument>[], context: LocalEditorBrowserInspectorControlRenderContext<TDocument>): LocalEditorBrowserInspectorControlRegistration<TDocument> | null;
|
|
15
|
+
export declare function applyLocalEditorBrowserInspectorControlBinding<TDocument>(element: HTMLElement, target: LocalEditorBrowserInspectorObject<TDocument>, property: LocalEditorBrowserInspectorProperty<TDocument>, options?: LocalEditorBrowserInspectorControlBindingOptions): void;
|
|
16
|
+
export declare function formatLocalEditorBrowserInspectorValue(value: unknown): string;
|
|
9
17
|
//# sourceMappingURL=local-editor-ui-panels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-editor-ui-panels.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,
|
|
1
|
+
{"version":3,"file":"local-editor-ui-panels.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAIxB,2CAA2C,EAC3C,gDAAgD,EAEhD,8CAA8C,EAC9C,+CAA+C,EAC/C,iCAAiC,EACjC,mCAAmC,EAEnC,sCAAsC,EAItC,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,yBAAyB,CAAC;AAYjC,MAAM,WAAW,wCAAwC,CAAC,SAAS,GAAG,OAAO;IAC3E,QAAQ,CAAC,EAAE,SAAS,8CAA8C,CAAC,SAAS,CAAC,EAAE,CAAC;IAChF,eAAe,CAAC,EAAE,2CAA2C,CAAC;CAC/D;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAC5C,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC3C,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAC5C,IAAI,EAAE,sCAAsC,GAAG,IAAI,GAClD,IAAI,CAqDN;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAC7C,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC3C,SAAS,EAAE,wBAAwB,GAClC,IAAI,CAKN;AAED,wBAAgB,8BAA8B,CAAC,SAAS,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