@fps-games/editor 0.1.1-beta.3 → 0.1.1-beta.5
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/local-editor-harness.d.ts +33 -4
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +135 -13
- package/dist/local-editor-harness.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +21 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +189 -7
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-camera-preview.d.ts +23 -0
- package/node_modules/@fps-games/editor-babylon/dist/scene-camera-preview.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-babylon/dist/scene-camera-preview.js +122 -0
- package/node_modules/@fps-games/editor-babylon/dist/scene-camera-preview.js.map +1 -0
- 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 +3 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js +7 -3
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +23 -20
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +10 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +195 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -0
- 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 +52 -64
- 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 +13 -3
- 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 +107 -14
- 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-shared.d.ts +6 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js +28 -7
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shared.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-shortcuts.js +2 -2
- 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-theme.d.ts +4 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-theme.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-theme.js +100 -9
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-theme.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +13 -0
- 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-workbench.js +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +7 -3
- 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 +106 -28
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +2 -2
- package/node_modules/@fps-games/editor-core/package.json +2 -2
- package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-forge-play/dist/index.js +5 -1
- 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/dist/index.d.ts +4 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/index.js +4 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +6 -6
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { createPanelHeader, createToolbarButton, createTreeView, createTreeViewItem, } from './local-editor-ui-primitives';
|
|
1
|
+
import { createBadge, createPanelHeader, createToolbarButton, createTreeView, createTreeViewItem, } from './local-editor-ui-primitives';
|
|
2
|
+
import { createLocalEditorIcon } from './local-editor-ui-icons';
|
|
2
3
|
import { clearElement } from './local-editor-ui-shared';
|
|
3
4
|
import { canLocalEditorHierarchyNodeHaveChildren } from './local-editor-ui-hierarchy-tree';
|
|
5
|
+
const HIERARCHY_ROLE_ICONS = {
|
|
6
|
+
root: 'root',
|
|
7
|
+
group: 'group',
|
|
8
|
+
object: 'object',
|
|
9
|
+
};
|
|
4
10
|
export function renderLocalEditorHierarchyPanel(doc, panel, input) {
|
|
5
11
|
clearElement(panel);
|
|
6
|
-
const createGroupButton = createToolbarButton(doc, '+ Group');
|
|
12
|
+
const createGroupButton = createToolbarButton(doc, '+ Group', 'group');
|
|
7
13
|
createGroupButton.dataset.editorHierarchyCreateGroup = 'true';
|
|
8
14
|
createGroupButton.style.padding = '3px 7px';
|
|
9
15
|
createGroupButton.style.fontSize = '11px';
|
|
10
|
-
panel.appendChild(createPanelHeader(doc, 'Graph', [createGroupButton]));
|
|
16
|
+
panel.appendChild(createPanelHeader(doc, 'Graph', [createGroupButton], 'hierarchy'));
|
|
11
17
|
const list = createTreeView(doc);
|
|
12
18
|
list.dataset.editorHierarchyRootDrop = input.rootDrop ? 'active' : 'ready';
|
|
13
19
|
if (input.rootDrop) {
|
|
14
|
-
list.style.boxShadow = 'inset 0 -2px 0
|
|
15
|
-
list.style.background = '
|
|
20
|
+
list.style.boxShadow = 'inset 0 -2px 0 var(--fps-editor-warn-strong)';
|
|
21
|
+
list.style.background = 'var(--fps-editor-warn-soft)';
|
|
16
22
|
}
|
|
17
23
|
if (input.model.visibleRows.length === 0) {
|
|
18
24
|
const empty = doc.createElement('div');
|
|
@@ -60,7 +66,6 @@ function appendDisclosure(doc, parent, node) {
|
|
|
60
66
|
const disclosure = doc.createElement('span');
|
|
61
67
|
if (node.childIds.length > 0)
|
|
62
68
|
disclosure.dataset.editorHierarchyToggle = node.id;
|
|
63
|
-
disclosure.textContent = node.childIds.length > 0 ? (node.expanded ? '▾' : '▸') : '';
|
|
64
69
|
disclosure.style.cssText = [
|
|
65
70
|
'width:12px',
|
|
66
71
|
'flex:0 0 12px',
|
|
@@ -70,11 +75,17 @@ function appendDisclosure(doc, parent, node) {
|
|
|
70
75
|
'color:var(--fps-editor-muted)',
|
|
71
76
|
'font-size:10px',
|
|
72
77
|
].join(';');
|
|
78
|
+
if (node.childIds.length > 0) {
|
|
79
|
+
disclosure.appendChild(createLocalEditorIcon(doc, node.expanded ? 'chevron-down' : 'chevron-right', {
|
|
80
|
+
size: 12,
|
|
81
|
+
strokeWidth: 2.4,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
73
84
|
parent.appendChild(disclosure);
|
|
74
85
|
}
|
|
75
86
|
function appendRoleBadge(doc, parent, node) {
|
|
76
87
|
const badge = doc.createElement('span');
|
|
77
|
-
badge.
|
|
88
|
+
badge.title = node.role;
|
|
78
89
|
badge.style.cssText = [
|
|
79
90
|
'width:15px',
|
|
80
91
|
'height:15px',
|
|
@@ -84,11 +95,12 @@ function appendRoleBadge(doc, parent, node) {
|
|
|
84
95
|
'justify-content:center',
|
|
85
96
|
'border:1px solid var(--fps-editor-border)',
|
|
86
97
|
'border-radius:2px',
|
|
87
|
-
`background:${node.role === 'root' ? '
|
|
98
|
+
`background:${node.role === 'root' ? 'var(--fps-editor-role-root-bg)' : node.role === 'group' ? 'var(--fps-editor-role-group-bg)' : 'var(--fps-editor-role-object-bg)'}`,
|
|
88
99
|
'color:var(--fps-editor-muted-strong)',
|
|
89
100
|
'font-size:9px',
|
|
90
101
|
'font-weight:900',
|
|
91
102
|
].join(';');
|
|
103
|
+
badge.appendChild(createLocalEditorIcon(doc, HIERARCHY_ROLE_ICONS[node.role], { size: 11, strokeWidth: 2.3 }));
|
|
92
104
|
parent.appendChild(badge);
|
|
93
105
|
}
|
|
94
106
|
function appendLabel(doc, parent, node) {
|
|
@@ -98,17 +110,8 @@ function appendLabel(doc, parent, node) {
|
|
|
98
110
|
parent.appendChild(label);
|
|
99
111
|
}
|
|
100
112
|
function appendProtectedBadge(doc, parent) {
|
|
101
|
-
const badge = doc
|
|
102
|
-
badge.
|
|
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(';');
|
|
113
|
+
const badge = createBadge(doc, 'protected', { compact: true, tone: 'warning', icon: 'lock' });
|
|
114
|
+
badge.style.flex = '0 0 auto';
|
|
112
115
|
parent.appendChild(badge);
|
|
113
116
|
}
|
|
114
117
|
function appendRenameInput(doc, parent, node, value) {
|
|
@@ -123,7 +126,7 @@ function appendRenameInput(doc, parent, node, value) {
|
|
|
123
126
|
'border:1px solid var(--fps-editor-accent-strong)',
|
|
124
127
|
'border-radius:2px',
|
|
125
128
|
'background:var(--fps-editor-field)',
|
|
126
|
-
'color
|
|
129
|
+
'color:var(--fps-editor-text-strong)',
|
|
127
130
|
'font-size:12px',
|
|
128
131
|
'font-weight:700',
|
|
129
132
|
'padding:2px 5px',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-editor-ui-hierarchy-view.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,uCAAuC,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"local-editor-ui-hierarchy-view.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAA4B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,uCAAuC,EAAE,MAAM,kCAAkC,CAAC;AAM3F,MAAM,oBAAoB,GAAsE;IAC9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,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAa,EAAE,MAAmB;IAC9D,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9F,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;IAC9B,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,qCAAqC;QACrC,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const LOCAL_EDITOR_ICON_NAMES: readonly ["asset", "camera", "chevron-down", "chevron-right", "discard", "execute", "group", "help", "hierarchy", "history", "inspector", "local", "lock", "move", "object", "place-ground", "place-off", "place-surface", "redo", "root", "rotate", "save", "scale", "select", "snap", "theme", "undo", "world"];
|
|
2
|
+
export type LocalEditorIconName = typeof LOCAL_EDITOR_ICON_NAMES[number];
|
|
3
|
+
export interface LocalEditorIconOptions {
|
|
4
|
+
size?: number;
|
|
5
|
+
strokeWidth?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function isLocalEditorIconName(value: unknown): value is LocalEditorIconName;
|
|
8
|
+
export declare function resolveLocalEditorIconName(value: unknown, fallback?: LocalEditorIconName): LocalEditorIconName;
|
|
9
|
+
export declare function createLocalEditorIcon(doc: Document, name: LocalEditorIconName, options?: LocalEditorIconOptions): HTMLSpanElement;
|
|
10
|
+
//# sourceMappingURL=local-editor-ui-icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-editor-ui-icons.d.ts","sourceRoot":"","sources":["../src/local-editor-ui-icons.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,mTA6B1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAElF;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,mBAA8B,GACvC,mBAAmB,CAErB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,mBAAmB,EACzB,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAuCjB"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
export const LOCAL_EDITOR_ICON_NAMES = [
|
|
2
|
+
'asset',
|
|
3
|
+
'camera',
|
|
4
|
+
'chevron-down',
|
|
5
|
+
'chevron-right',
|
|
6
|
+
'discard',
|
|
7
|
+
'execute',
|
|
8
|
+
'group',
|
|
9
|
+
'help',
|
|
10
|
+
'hierarchy',
|
|
11
|
+
'history',
|
|
12
|
+
'inspector',
|
|
13
|
+
'local',
|
|
14
|
+
'lock',
|
|
15
|
+
'move',
|
|
16
|
+
'object',
|
|
17
|
+
'place-ground',
|
|
18
|
+
'place-off',
|
|
19
|
+
'place-surface',
|
|
20
|
+
'redo',
|
|
21
|
+
'root',
|
|
22
|
+
'rotate',
|
|
23
|
+
'save',
|
|
24
|
+
'scale',
|
|
25
|
+
'select',
|
|
26
|
+
'snap',
|
|
27
|
+
'theme',
|
|
28
|
+
'undo',
|
|
29
|
+
'world',
|
|
30
|
+
];
|
|
31
|
+
const LOCAL_EDITOR_ICON_SET = new Set(LOCAL_EDITOR_ICON_NAMES);
|
|
32
|
+
const LOCAL_EDITOR_ICON_DEFINITIONS = {
|
|
33
|
+
asset: [
|
|
34
|
+
{ tag: 'rect', attrs: { x: '4', y: '5', width: '16', height: '14', rx: '2' } },
|
|
35
|
+
{ tag: 'path', attrs: { d: 'M8 9h8M8 13h5' } },
|
|
36
|
+
{ tag: 'path', attrs: { d: 'M7 19l5-4 5 4' } },
|
|
37
|
+
],
|
|
38
|
+
camera: [
|
|
39
|
+
{ tag: 'path', attrs: { d: 'M4 8.5A2.5 2.5 0 0 1 6.5 6h2l1.5-2h4l1.5 2h2A2.5 2.5 0 0 1 20 8.5v7A2.5 2.5 0 0 1 17.5 18h-11A2.5 2.5 0 0 1 4 15.5z' } },
|
|
40
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '3' } },
|
|
41
|
+
],
|
|
42
|
+
'chevron-down': [
|
|
43
|
+
{ tag: 'polyline', attrs: { points: '7 10 12 15 17 10' } },
|
|
44
|
+
],
|
|
45
|
+
'chevron-right': [
|
|
46
|
+
{ tag: 'polyline', attrs: { points: '10 7 15 12 10 17' } },
|
|
47
|
+
],
|
|
48
|
+
discard: [
|
|
49
|
+
{ tag: 'path', attrs: { d: 'M6 6l12 12M18 6L6 18' } },
|
|
50
|
+
{ tag: 'path', attrs: { d: 'M5 12a7 7 0 0 1 7-7 7 7 0 0 1 5.2 2.3M19 12a7 7 0 0 1-7 7 7 7 0 0 1-5.2-2.3' } },
|
|
51
|
+
],
|
|
52
|
+
execute: [
|
|
53
|
+
{ tag: 'path', attrs: { d: 'M8 5l10 7-10 7z' } },
|
|
54
|
+
],
|
|
55
|
+
group: [
|
|
56
|
+
{ tag: 'rect', attrs: { x: '5', y: '5', width: '7', height: '7', rx: '1.5' } },
|
|
57
|
+
{ tag: 'rect', attrs: { x: '12', y: '12', width: '7', height: '7', rx: '1.5' } },
|
|
58
|
+
{ tag: 'path', attrs: { d: 'M8.5 12v3.5H12M12 8.5h3.5V12' } },
|
|
59
|
+
],
|
|
60
|
+
help: [
|
|
61
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '9' } },
|
|
62
|
+
{ tag: 'path', attrs: { d: 'M9.8 9.4a2.4 2.4 0 0 1 4.4 1.3c0 1.7-1.9 2.1-2.2 3.4' } },
|
|
63
|
+
{ tag: 'line', attrs: { x1: '12', y1: '17', x2: '12.01', y2: '17' } },
|
|
64
|
+
],
|
|
65
|
+
hierarchy: [
|
|
66
|
+
{ tag: 'path', attrs: { d: 'M12 5v5M6 14v-3h12v3' } },
|
|
67
|
+
{ tag: 'rect', attrs: { x: '9', y: '3', width: '6', height: '4', rx: '1' } },
|
|
68
|
+
{ tag: 'rect', attrs: { x: '3', y: '14', width: '6', height: '5', rx: '1' } },
|
|
69
|
+
{ tag: 'rect', attrs: { x: '15', y: '14', width: '6', height: '5', rx: '1' } },
|
|
70
|
+
],
|
|
71
|
+
history: [
|
|
72
|
+
{ tag: 'path', attrs: { d: 'M5 7v5h5' } },
|
|
73
|
+
{ tag: 'path', attrs: { d: 'M5.8 15.4A7 7 0 1 0 5 7' } },
|
|
74
|
+
{ tag: 'path', attrs: { d: 'M12 8v4l3 2' } },
|
|
75
|
+
],
|
|
76
|
+
inspector: [
|
|
77
|
+
{ tag: 'rect', attrs: { x: '5', y: '4', width: '14', height: '16', rx: '2' } },
|
|
78
|
+
{ tag: 'path', attrs: { d: 'M9 8h6M9 12h6M9 16h3' } },
|
|
79
|
+
],
|
|
80
|
+
local: [
|
|
81
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '3' } },
|
|
82
|
+
{ tag: 'path', attrs: { d: 'M12 3v3M12 18v3M3 12h3M18 12h3' } },
|
|
83
|
+
],
|
|
84
|
+
lock: [
|
|
85
|
+
{ tag: 'rect', attrs: { x: '6', y: '10', width: '12', height: '9', rx: '2' } },
|
|
86
|
+
{ tag: 'path', attrs: { d: 'M9 10V7a3 3 0 0 1 6 0v3' } },
|
|
87
|
+
],
|
|
88
|
+
move: [
|
|
89
|
+
{ tag: 'path', attrs: { d: 'M12 3v18M3 12h18' } },
|
|
90
|
+
{ tag: 'path', attrs: { d: 'M12 3l-3 3M12 3l3 3M12 21l-3-3M12 21l3-3M3 12l3-3M3 12l3 3M21 12l-3-3M21 12l-3 3' } },
|
|
91
|
+
],
|
|
92
|
+
object: [
|
|
93
|
+
{ tag: 'path', attrs: { d: 'M12 3l7 4v9l-7 4-7-4V7z' } },
|
|
94
|
+
{ tag: 'path', attrs: { d: 'M5 7l7 4 7-4M12 11v9' } },
|
|
95
|
+
],
|
|
96
|
+
'place-ground': [
|
|
97
|
+
{ tag: 'path', attrs: { d: 'M4 18h16' } },
|
|
98
|
+
{ tag: 'path', attrs: { d: 'M12 4v10' } },
|
|
99
|
+
{ tag: 'path', attrs: { d: 'M8 10l4 4 4-4' } },
|
|
100
|
+
],
|
|
101
|
+
'place-off': [
|
|
102
|
+
{ tag: 'path', attrs: { d: 'M4 18h16M12 4v10M8 10l4 4 4-4' } },
|
|
103
|
+
{ tag: 'path', attrs: { d: 'M5 5l14 14' } },
|
|
104
|
+
],
|
|
105
|
+
'place-surface': [
|
|
106
|
+
{ tag: 'path', attrs: { d: 'M4 16l5-5 4 4 7-7' } },
|
|
107
|
+
{ tag: 'path', attrs: { d: 'M12 4v10M8 10l4 4 4-4' } },
|
|
108
|
+
],
|
|
109
|
+
redo: [
|
|
110
|
+
{ tag: 'path', attrs: { d: 'M19 7v6h-6' } },
|
|
111
|
+
{ tag: 'path', attrs: { d: 'M18 13a6 6 0 1 1-1.7-4.2L19 11' } },
|
|
112
|
+
],
|
|
113
|
+
root: [
|
|
114
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '5', r: '2' } },
|
|
115
|
+
{ tag: 'path', attrs: { d: 'M12 7v11M7 12h10' } },
|
|
116
|
+
{ tag: 'circle', attrs: { cx: '7', cy: '18', r: '2' } },
|
|
117
|
+
{ tag: 'circle', attrs: { cx: '17', cy: '18', r: '2' } },
|
|
118
|
+
],
|
|
119
|
+
rotate: [
|
|
120
|
+
{ tag: 'path', attrs: { d: 'M18 8a7 7 0 1 0 1.3 6.1' } },
|
|
121
|
+
{ tag: 'path', attrs: { d: 'M18 4v4h-4' } },
|
|
122
|
+
],
|
|
123
|
+
save: [
|
|
124
|
+
{ tag: 'path', attrs: { d: 'M5 4h12l2 2v15H5z' } },
|
|
125
|
+
{ tag: 'path', attrs: { d: 'M8 4v6h9M8 21v-6h8v6' } },
|
|
126
|
+
],
|
|
127
|
+
scale: [
|
|
128
|
+
{ tag: 'path', attrs: { d: 'M4 14v6h6M20 10V4h-6' } },
|
|
129
|
+
{ tag: 'path', attrs: { d: 'M20 4l-7 7M4 20l7-7' } },
|
|
130
|
+
],
|
|
131
|
+
select: [
|
|
132
|
+
{ tag: 'path', attrs: { d: 'M5 4l10 10-5 1.5L8.5 20z' } },
|
|
133
|
+
],
|
|
134
|
+
snap: [
|
|
135
|
+
{ tag: 'path', attrs: { d: 'M8 4v6a4 4 0 0 0 8 0V4' } },
|
|
136
|
+
{ tag: 'path', attrs: { d: 'M8 8h4M16 8h-4M8 4h4M16 4h-4M12 14v6' } },
|
|
137
|
+
],
|
|
138
|
+
theme: [
|
|
139
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '9' } },
|
|
140
|
+
{ tag: 'path', attrs: { d: 'M12 3v18' } },
|
|
141
|
+
{ tag: 'path', attrs: { d: 'M12 5a7 7 0 0 1 0 14' } },
|
|
142
|
+
],
|
|
143
|
+
undo: [
|
|
144
|
+
{ tag: 'path', attrs: { d: 'M5 7v6h6' } },
|
|
145
|
+
{ tag: 'path', attrs: { d: 'M6 13a6 6 0 1 0 1.7-4.2L5 11' } },
|
|
146
|
+
],
|
|
147
|
+
world: [
|
|
148
|
+
{ tag: 'circle', attrs: { cx: '12', cy: '12', r: '9' } },
|
|
149
|
+
{ tag: 'path', attrs: { d: 'M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18' } },
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
export function isLocalEditorIconName(value) {
|
|
153
|
+
return typeof value === 'string' && LOCAL_EDITOR_ICON_SET.has(value);
|
|
154
|
+
}
|
|
155
|
+
export function resolveLocalEditorIconName(value, fallback = 'object') {
|
|
156
|
+
return isLocalEditorIconName(value) ? value : fallback;
|
|
157
|
+
}
|
|
158
|
+
export function createLocalEditorIcon(doc, name, options = {}) {
|
|
159
|
+
const resolvedName = resolveLocalEditorIconName(name);
|
|
160
|
+
const size = options.size ?? 14;
|
|
161
|
+
const strokeWidth = options.strokeWidth ?? 2;
|
|
162
|
+
const icon = doc.createElement('span');
|
|
163
|
+
icon.dataset.editorIcon = resolvedName;
|
|
164
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
165
|
+
icon.style.cssText = [
|
|
166
|
+
`width:${size}px`,
|
|
167
|
+
`height:${size}px`,
|
|
168
|
+
`flex:0 0 ${size}px`,
|
|
169
|
+
'display:inline-flex',
|
|
170
|
+
'align-items:center',
|
|
171
|
+
'justify-content:center',
|
|
172
|
+
'color:currentColor',
|
|
173
|
+
'pointer-events:none',
|
|
174
|
+
].join(';');
|
|
175
|
+
const svg = doc.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
176
|
+
svg.setAttribute('viewBox', '0 0 24 24');
|
|
177
|
+
svg.setAttribute('width', String(size));
|
|
178
|
+
svg.setAttribute('height', String(size));
|
|
179
|
+
svg.setAttribute('fill', 'none');
|
|
180
|
+
svg.setAttribute('stroke', 'currentColor');
|
|
181
|
+
svg.setAttribute('stroke-width', String(strokeWidth));
|
|
182
|
+
svg.setAttribute('stroke-linecap', 'round');
|
|
183
|
+
svg.setAttribute('stroke-linejoin', 'round');
|
|
184
|
+
svg.setAttribute('focusable', 'false');
|
|
185
|
+
for (const node of LOCAL_EDITOR_ICON_DEFINITIONS[resolvedName]) {
|
|
186
|
+
const element = doc.createElementNS('http://www.w3.org/2000/svg', node.tag);
|
|
187
|
+
for (const [key, value] of Object.entries(node.attrs)) {
|
|
188
|
+
element.setAttribute(key, value);
|
|
189
|
+
}
|
|
190
|
+
svg.appendChild(element);
|
|
191
|
+
}
|
|
192
|
+
icon.appendChild(svg);
|
|
193
|
+
return icon;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=local-editor-ui-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-editor-ui-icons.js","sourceRoot":"","sources":["../src/local-editor-ui-icons.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,QAAQ;IACR,cAAc;IACd,eAAe;IACf,SAAS;IACT,SAAS;IACT,OAAO;IACP,MAAM;IACN,WAAW;IACX,SAAS;IACT,WAAW;IACX,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,cAAc;IACd,WAAW;IACX,eAAe;IACf,MAAM;IACN,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;CACC,CAAC;AAgBX,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,CAAC;AAEvE,MAAM,6BAA6B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MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC5C,GAAG,CAAC,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC7C,GAAG,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAEvC,KAAK,MAAM,IAAI,IAAI,6BAA6B,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/D,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC,4BAA4B,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACtD,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;QACD,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -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,EAIxB,2CAA2C,EAC3C,gDAAgD,EAEhD,8CAA8C,EAC9C,+CAA+C,EAC/C,iCAAiC,EACjC,mCAAmC,EAEnC,sCAAsC,EAItC,yBAAyB,EACzB,mCAAmC,EACpC,MAAM,yBAAyB,CAAC;
|
|
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,iCAAi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QAAQ,GAAE,2CAAqD,GAC9D,8CAA8C,CAAC,SAAS,CAAC,EAAE,CAS7D;AA4CD,wBAAgB,qDAAqD,CAAC,SAAS,EAC7E,aAAa,EAAE,SAAS,8CAA8C,CAAC,SAAS,CAAC,EAAE,EACnF,OAAO,EAAE,+CAA+C,CAAC,SAAS,CAAC,GAClE,8CAA8C,CAAC,SAAS,CAAC,GAAG,IAAI,CAKlE;AAuMD,wBAAgB,8CAA8C,CAAC,SAAS,EACtE,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,iCAAiC,CAAC,SAAS,CAAC,EACpD,QAAQ,EAAE,mCAAmC,CAAC,SAAS,CAAC,EACxD,OAAO,CAAC,EAAE,gDAAgD,GACzD,IAAI,CAaN;AAiHD,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM7E"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createLocalEditorIcon } from './local-editor-ui-icons';
|
|
2
|
+
import { createBadge, createAssetList, createDockTab, createEditorInputStyle, createEmptyState, createListItemBlock, createPanelHeader, createPropertyRow, createToolbarButton, createTreeView, createTreeViewItem, } from './local-editor-ui-primitives';
|
|
2
3
|
import { clearElement, toTitle } from './local-editor-ui-shared';
|
|
4
|
+
const DOCK_TAB_ICONS = {
|
|
5
|
+
assets: 'asset',
|
|
6
|
+
history: 'history',
|
|
7
|
+
};
|
|
3
8
|
export function renderHierarchyPanel(doc, panel, state, rename, drop) {
|
|
4
9
|
clearElement(panel);
|
|
5
|
-
const createGroupButton = createToolbarButton(doc, '+ Group');
|
|
10
|
+
const createGroupButton = createToolbarButton(doc, '+ Group', 'group');
|
|
6
11
|
createGroupButton.dataset.editorHierarchyCreateGroup = 'true';
|
|
7
12
|
createGroupButton.style.padding = '3px 7px';
|
|
8
13
|
createGroupButton.style.fontSize = '11px';
|
|
9
|
-
panel.appendChild(createPanelHeader(doc, 'Graph', [createGroupButton]));
|
|
14
|
+
panel.appendChild(createPanelHeader(doc, 'Graph', [createGroupButton], 'hierarchy'));
|
|
10
15
|
const list = createTreeView(doc);
|
|
11
16
|
for (const item of state.hierarchy) {
|
|
12
17
|
const isRenaming = rename?.id === item.id;
|
|
@@ -35,7 +40,7 @@ export function renderHierarchyPanel(doc, panel, state, rename, drop) {
|
|
|
35
40
|
'border:1px solid var(--fps-editor-accent-strong)',
|
|
36
41
|
'border-radius:2px',
|
|
37
42
|
'background:var(--fps-editor-field)',
|
|
38
|
-
'color
|
|
43
|
+
'color:var(--fps-editor-text-strong)',
|
|
39
44
|
'font-size:12px',
|
|
40
45
|
'font-weight:700',
|
|
41
46
|
'padding:2px 5px',
|
|
@@ -80,7 +85,7 @@ export function renderWorkbenchBottomDockPanel(doc, panel, state, activeTab, pan
|
|
|
80
85
|
{ id: 'history', title: '历史', area: 'bottom' },
|
|
81
86
|
];
|
|
82
87
|
for (const tabPanel of dockTabs) {
|
|
83
|
-
const button = createDockTab(doc, tabPanel.title, activeTab === tabPanel.id);
|
|
88
|
+
const button = createDockTab(doc, tabPanel.title, activeTab === tabPanel.id, DOCK_TAB_ICONS[tabPanel.id]);
|
|
84
89
|
button.dataset.editorDockTab = tabPanel.id;
|
|
85
90
|
tabHeader.appendChild(button);
|
|
86
91
|
}
|
|
@@ -107,30 +112,29 @@ function appendDockTabs(doc, panel, activeTab) {
|
|
|
107
112
|
history: '历史',
|
|
108
113
|
};
|
|
109
114
|
for (const tab of ['assets', 'history']) {
|
|
110
|
-
const button = doc.createElement('button');
|
|
111
|
-
button.type = 'button';
|
|
112
|
-
button.dataset.editorDockTab = tab;
|
|
113
|
-
button.textContent = labels[tab];
|
|
114
115
|
const active = activeTab === tab;
|
|
115
|
-
button
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
'font-weight:900',
|
|
123
|
-
'padding:0 8px 8px',
|
|
124
|
-
'cursor:pointer',
|
|
125
|
-
].join(';');
|
|
116
|
+
const button = createDockTab(doc, labels[tab], active, DOCK_TAB_ICONS[tab]);
|
|
117
|
+
button.dataset.editorDockTab = tab;
|
|
118
|
+
button.style.border = '0';
|
|
119
|
+
button.style.borderBottom = `2px solid ${active ? 'var(--fps-editor-accent-strong)' : 'transparent'}`;
|
|
120
|
+
button.style.background = 'transparent';
|
|
121
|
+
button.style.color = active ? 'var(--fps-editor-text-strong)' : 'var(--fps-editor-muted)';
|
|
122
|
+
button.style.padding = '0 8px 8px';
|
|
126
123
|
tabs.appendChild(button);
|
|
127
124
|
}
|
|
128
125
|
panel.appendChild(tabs);
|
|
129
126
|
}
|
|
127
|
+
function createHeadingLabel(doc, text) {
|
|
128
|
+
const label = doc.createElement('span');
|
|
129
|
+
label.textContent = text;
|
|
130
|
+
label.style.cssText = 'min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap';
|
|
131
|
+
return label;
|
|
132
|
+
}
|
|
130
133
|
function renderAssetBrowserContent(doc, panel, state, variant = 'list') {
|
|
131
134
|
const title = doc.createElement('h2');
|
|
132
|
-
title.
|
|
133
|
-
title.
|
|
135
|
+
title.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;margin:0 0 8px;font-weight:800;color:var(--fps-editor-text-strong)';
|
|
136
|
+
title.appendChild(createLocalEditorIcon(doc, 'asset'));
|
|
137
|
+
title.appendChild(createHeadingLabel(doc, '资产浏览器'));
|
|
134
138
|
panel.appendChild(title);
|
|
135
139
|
const filter = doc.createElement('input');
|
|
136
140
|
filter.type = 'search';
|
|
@@ -177,19 +181,27 @@ function renderAssetBrowserContent(doc, panel, state, variant = 'list') {
|
|
|
177
181
|
'padding:6px 8px',
|
|
178
182
|
'border:1px solid var(--fps-editor-border)',
|
|
179
183
|
'border-radius:3px',
|
|
180
|
-
'background
|
|
184
|
+
'background:var(--fps-editor-asset-card-bg)',
|
|
181
185
|
'color:var(--fps-editor-text)',
|
|
186
|
+
'display:flex',
|
|
187
|
+
'align-items:center',
|
|
188
|
+
'gap:8px',
|
|
182
189
|
'font-size:12px',
|
|
183
190
|
'cursor:pointer',
|
|
184
191
|
].join(';');
|
|
192
|
+
const icon = createLocalEditorIcon(doc, 'asset', { size: 16 });
|
|
193
|
+
const body = doc.createElement('div');
|
|
194
|
+
body.style.cssText = 'min-width:0;flex:1';
|
|
185
195
|
const label = doc.createElement('div');
|
|
186
196
|
label.textContent = asset.label;
|
|
187
197
|
label.style.cssText = 'font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap';
|
|
188
198
|
const meta = doc.createElement('div');
|
|
189
199
|
meta.textContent = asset.meta ?? asset.id;
|
|
190
200
|
meta.style.cssText = 'color:var(--fps-editor-muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap';
|
|
191
|
-
|
|
192
|
-
|
|
201
|
+
body.appendChild(label);
|
|
202
|
+
body.appendChild(meta);
|
|
203
|
+
button.appendChild(icon);
|
|
204
|
+
button.appendChild(body);
|
|
193
205
|
list.appendChild(button);
|
|
194
206
|
}
|
|
195
207
|
panel.appendChild(list);
|
|
@@ -197,36 +209,21 @@ function renderAssetBrowserContent(doc, panel, state, variant = 'list') {
|
|
|
197
209
|
function renderHistoryPanel(doc, panel, history) {
|
|
198
210
|
const title = doc.createElement('h2');
|
|
199
211
|
const entries = history?.entries ?? [];
|
|
200
|
-
title.
|
|
201
|
-
title.
|
|
212
|
+
title.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;margin:0 0 8px;font-weight:800;color:var(--fps-editor-text-strong)';
|
|
213
|
+
title.appendChild(createLocalEditorIcon(doc, 'history'));
|
|
214
|
+
title.appendChild(createHeadingLabel(doc, `历史记录 (${entries.length})`));
|
|
202
215
|
panel.appendChild(title);
|
|
203
216
|
appendHistoryEntries(doc, panel, entries);
|
|
204
217
|
}
|
|
205
218
|
function appendHistoryEntries(doc, panel, entries) {
|
|
206
219
|
if (entries.length === 0) {
|
|
207
|
-
|
|
208
|
-
empty.textContent = '暂无文档修改。';
|
|
209
|
-
empty.style.cssText = [
|
|
210
|
-
'padding:8px',
|
|
211
|
-
'border:1px solid var(--fps-editor-border-soft)',
|
|
212
|
-
'border-radius:3px',
|
|
213
|
-
'background:var(--fps-editor-field)',
|
|
214
|
-
'color:var(--fps-editor-muted)',
|
|
215
|
-
'font-size:11px',
|
|
216
|
-
].join(';');
|
|
217
|
-
panel.appendChild(empty);
|
|
220
|
+
panel.appendChild(createEmptyState(doc, '暂无文档修改。'));
|
|
218
221
|
return;
|
|
219
222
|
}
|
|
220
223
|
const list = doc.createElement('div');
|
|
221
224
|
list.style.cssText = 'display:flex;flex-direction:column;gap:4px';
|
|
222
225
|
for (const entry of entries) {
|
|
223
|
-
const item = doc
|
|
224
|
-
item.style.cssText = [
|
|
225
|
-
'padding:7px 8px',
|
|
226
|
-
'border:1px solid var(--fps-editor-border-soft)',
|
|
227
|
-
'border-radius:3px',
|
|
228
|
-
'background:var(--fps-editor-panel-soft)',
|
|
229
|
-
].join(';');
|
|
226
|
+
const item = createListItemBlock(doc);
|
|
230
227
|
const label = doc.createElement('div');
|
|
231
228
|
label.textContent = entry.label;
|
|
232
229
|
label.style.cssText = 'font-size:12px;font-weight:900;color:var(--fps-editor-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap';
|
|
@@ -261,8 +258,9 @@ function formatHistoryTimestamp(createdAt) {
|
|
|
261
258
|
export function renderInspectorPanel(doc, panel, state, filter = '', options = {}) {
|
|
262
259
|
clearElement(panel);
|
|
263
260
|
const title = doc.createElement('h2');
|
|
264
|
-
title.
|
|
265
|
-
title.
|
|
261
|
+
title.style.cssText = 'display:flex;align-items:center;gap:6px;font-size:13px;margin:-8px -8px 8px;padding:7px 8px;border-bottom:1px solid var(--fps-editor-divider);background:var(--fps-editor-chrome-dark);font-weight:800;color:var(--fps-editor-text-strong)';
|
|
262
|
+
title.appendChild(createLocalEditorIcon(doc, 'inspector'));
|
|
263
|
+
title.appendChild(createHeadingLabel(doc, 'Inspector'));
|
|
266
264
|
panel.appendChild(title);
|
|
267
265
|
const search = createInspectorSearchInput(doc, filter);
|
|
268
266
|
panel.appendChild(search);
|
|
@@ -300,16 +298,10 @@ function createInspectorSearchInput(doc, value) {
|
|
|
300
298
|
input.value = value;
|
|
301
299
|
input.placeholder = 'Search...';
|
|
302
300
|
input.style.cssText = [
|
|
301
|
+
createEditorInputStyle(),
|
|
303
302
|
'width:100%',
|
|
304
303
|
'height:30px',
|
|
305
|
-
'box-sizing:border-box',
|
|
306
304
|
'margin:0 0 8px',
|
|
307
|
-
'border:1px solid var(--fps-editor-border)',
|
|
308
|
-
'border-radius:3px',
|
|
309
|
-
'background:var(--fps-editor-field)',
|
|
310
|
-
'color:var(--fps-editor-text)',
|
|
311
|
-
'font-size:12px',
|
|
312
|
-
'padding:0 8px',
|
|
313
305
|
'outline:none',
|
|
314
306
|
].join(';');
|
|
315
307
|
return input;
|
|
@@ -376,9 +368,11 @@ function createInspectorSectionBlock(doc, inspectorObject, section, controlRegis
|
|
|
376
368
|
meta.appendChild(summary);
|
|
377
369
|
}
|
|
378
370
|
if (section.persistence === 'runtime' || section.runtimeOnly || section.persistence === 'readonly') {
|
|
379
|
-
const badge = doc.
|
|
380
|
-
|
|
381
|
-
|
|
371
|
+
const badge = createBadge(doc, section.persistence === 'runtime' || section.runtimeOnly ? 'Runtime' : 'Readonly', {
|
|
372
|
+
compact: true,
|
|
373
|
+
tone: section.persistence === 'readonly' ? 'default' : 'warning',
|
|
374
|
+
});
|
|
375
|
+
badge.style.flex = '0 0 auto';
|
|
382
376
|
meta.appendChild(badge);
|
|
383
377
|
}
|
|
384
378
|
sectionTitle.appendChild(meta);
|
|
@@ -733,13 +727,7 @@ export function applyLocalEditorBrowserInspectorControlBinding(element, target,
|
|
|
733
727
|
}
|
|
734
728
|
function createInspectorInputStyle() {
|
|
735
729
|
return [
|
|
736
|
-
|
|
737
|
-
'height:28px',
|
|
738
|
-
'border:1px solid var(--fps-editor-border)',
|
|
739
|
-
'border-radius:3px',
|
|
740
|
-
'background:var(--fps-editor-field)',
|
|
741
|
-
'color:var(--fps-editor-text)',
|
|
742
|
-
'font-size:12px',
|
|
730
|
+
createEditorInputStyle(),
|
|
743
731
|
'padding:0 6px',
|
|
744
732
|
].join(';');
|
|
745
733
|
}
|