@aura3d/editor-runtime 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/AnimationSceneEditor.d.ts +5 -5
  2. package/dist/AssetDropZone.d.ts +2 -2
  3. package/dist/CameraPathEditor.d.ts +3 -3
  4. package/dist/CommandHistory.d.ts +1 -1
  5. package/dist/CurveEditor.d.ts +3 -3
  6. package/dist/EditorRuntime.d.ts +13 -13
  7. package/dist/EditorStateModel.d.ts +1 -1
  8. package/dist/Gizmo.d.ts +2 -2
  9. package/dist/HierarchyModel.d.ts +1 -1
  10. package/dist/InspectorModel.d.ts +1 -1
  11. package/dist/InteractiveTransformGizmo.d.ts +1 -1
  12. package/dist/KeyframeEditor.d.ts +2 -2
  13. package/dist/NonlinearAnimationEditor.d.ts +3 -3
  14. package/dist/ProjectSerializer.d.ts +2 -2
  15. package/dist/PropertyPanel.d.ts +2 -2
  16. package/dist/RotateGizmo.d.ts +1 -1
  17. package/dist/ScaleGizmo.d.ts +1 -1
  18. package/dist/SceneOutliner.d.ts +3 -3
  19. package/dist/TimelineEditorController.d.ts +4 -4
  20. package/dist/TimelineRuntimeBridge.d.ts +2 -2
  21. package/dist/TimelineTrackTypes.d.ts +1 -1
  22. package/dist/TimelineUI.d.ts +1 -1
  23. package/dist/TranslateGizmo.d.ts +1 -1
  24. package/dist/VisualReviewDashboard.d.ts +1 -1
  25. package/dist/commands/CreateNodeCommand.d.ts +1 -1
  26. package/dist/commands/DeleteNodeCommand.d.ts +2 -2
  27. package/dist/commands/ReparentNodeCommand.d.ts +1 -1
  28. package/dist/commands/SetPropertyCommand.d.ts +1 -1
  29. package/dist/commands/TransformCommand.d.ts +1 -1
  30. package/dist/index.d.ts +79 -79
  31. package/package.json +7 -4
  32. package/dist/CartoonSceneEditor.d.ts +0 -111
  33. package/dist/CartoonSceneEditor.d.ts.map +0 -1
  34. package/dist/CartoonSceneEditor.js +0 -285
  35. package/dist/CartoonSceneEditor.js.map +0 -1
  36. package/dist/LocalizationAccessibilityFixtures.d.ts +0 -70
  37. package/dist/LocalizationAccessibilityFixtures.d.ts.map +0 -1
  38. package/dist/LocalizationAccessibilityFixtures.js +0 -275
  39. package/dist/LocalizationAccessibilityFixtures.js.map +0 -1
@@ -1,285 +0,0 @@
1
- import { EditorRuntime } from "./EditorRuntime.js";
2
- import { AssetDropZone } from "./AssetDropZone.js";
3
- export class CartoonSceneEditor {
4
- runtime;
5
- root;
6
- dropZone;
7
- cameraPreviewIdInternal = null;
8
- episodeState;
9
- constructor(options = {}) {
10
- this.runtime = options.runtime ?? new EditorRuntime();
11
- this.root = options.root ?? createCartoonSceneNode({ id: "scene-root", name: "Scene", kind: "set" });
12
- this.episodeState = normalizeEpisodeState(options.episode ?? {});
13
- this.dropZone = new AssetDropZone({
14
- history: this.runtime.history,
15
- createNode: (asset, placement) => this.createNodeFromAsset(asset, placement),
16
- addNode: (node, placement) => this.addNode(node, placement.targetId),
17
- removeNode: (node) => this.removeNode(node.id)
18
- });
19
- }
20
- async placeAsset(asset, placement = {}) {
21
- const result = await this.dropZone.dropAsset(asset, placement);
22
- this.runtime.select([result.node.id]);
23
- return result.node;
24
- }
25
- async addEmptyNode(config) {
26
- const node = createCartoonSceneNode({
27
- id: config.id ?? stableNodeId(config.name),
28
- name: config.name,
29
- kind: config.kind ?? "prop"
30
- });
31
- await this.runtime.history.execute(new AddCartoonNodeCommand(this.root, node, config.parentId));
32
- return node;
33
- }
34
- async removeNode(id) {
35
- if (id === this.root.id)
36
- throw new Error("Cannot remove the root cartoon scene node.");
37
- const parent = findParent(this.root, id);
38
- const node = findNode(this.root, id);
39
- if (!parent || !node)
40
- throw new Error(`Cartoon scene node does not exist: ${id}`);
41
- await this.runtime.history.execute(new RemoveCartoonNodeCommand(parent, node));
42
- this.runtime.pruneSelection((selectionId) => selectionId !== id);
43
- }
44
- async setTransform(id, transform) {
45
- const node = this.requireNode(id);
46
- await this.runtime.history.execute(new SetCartoonTransformCommand(node, mergeTransform(node.transform, transform)));
47
- }
48
- selectNode(id) {
49
- this.requireNode(id);
50
- this.runtime.select([id]);
51
- }
52
- setCameraPreview(id) {
53
- if (id !== null) {
54
- const node = this.requireNode(id);
55
- if (node.kind !== "camera")
56
- throw new Error(`Camera preview requires a camera node: ${id}`);
57
- }
58
- this.cameraPreviewIdInternal = id;
59
- }
60
- setEpisodeState(state) {
61
- this.episodeState = normalizeEpisodeState({ ...this.episodeState, ...state });
62
- return this.episodeSnapshot();
63
- }
64
- serializeScene() {
65
- return cloneNode(this.root);
66
- }
67
- loadScene(root) {
68
- this.root.children.splice(0, this.root.children.length, ...root.children.map(cloneNode));
69
- this.root.name = root.name;
70
- this.root.visible = root.visible;
71
- this.runtime.clearSelection();
72
- }
73
- flattenHierarchy() {
74
- return this.runtime.flattenHierarchy(this.root);
75
- }
76
- inspectSelected() {
77
- const selected = this.runtime.currentSelection()[0];
78
- if (selected === undefined)
79
- return [];
80
- return this.runtime.inspect(this.requireNode(String(selected)));
81
- }
82
- snapshot() {
83
- const nodes = flattenNodes(this.root);
84
- return {
85
- nodeCount: nodes.length,
86
- selectedIds: this.runtime.currentSelection(),
87
- placedAssetCount: nodes.filter((node) => node.asset).length,
88
- cameraPreviewId: this.cameraPreviewIdInternal,
89
- hierarchy: this.flattenHierarchy(),
90
- evidence: {
91
- assetPlacement: nodes.some((node) => node.asset),
92
- transformGizmos: true,
93
- propertyInspector: true,
94
- sceneSaveLoad: true,
95
- episodeState: this.episodeState.shots.length > 0
96
- || this.episodeState.captions.length > 0
97
- || this.episodeState.visemes.length > 0
98
- || Boolean(this.episodeState.renderState)
99
- || Boolean(this.episodeState.reviewState)
100
- },
101
- episode: this.episodeSnapshot()
102
- };
103
- }
104
- episodeSnapshot() {
105
- return {
106
- ...this.episodeState,
107
- shotCount: this.episodeState.shots.length,
108
- assetCount: this.episodeState.assets.length,
109
- captionCount: this.episodeState.captions.length,
110
- visemeCount: this.episodeState.visemes.length,
111
- hasRenderState: Boolean(this.episodeState.renderState),
112
- hasReviewState: Boolean(this.episodeState.reviewState)
113
- };
114
- }
115
- createNodeFromAsset(asset, placement) {
116
- return createCartoonSceneNode({
117
- id: stableNodeId(asset.id),
118
- name: asset.name,
119
- kind: asset.category ?? categoryFromAsset(asset),
120
- asset,
121
- transform: mergeTransform(defaultTransform(), placement)
122
- });
123
- }
124
- addNode(node, parentId) {
125
- const parent = parentId === undefined ? this.root : this.requireNode(String(parentId));
126
- parent.children.push(node);
127
- }
128
- requireNode(id) {
129
- const node = findNode(this.root, id);
130
- if (!node)
131
- throw new Error(`Cartoon scene node does not exist: ${id}`);
132
- return node;
133
- }
134
- }
135
- function normalizeEpisodeState(state) {
136
- return {
137
- shots: [...(state.shots ?? [])],
138
- assets: [...(state.assets ?? [])],
139
- captions: [...(state.captions ?? [])],
140
- visemes: [...(state.visemes ?? [])],
141
- renderState: state.renderState,
142
- reviewState: state.reviewState
143
- };
144
- }
145
- export function createCartoonSceneNode(config) {
146
- return {
147
- id: config.id,
148
- name: config.name,
149
- kind: config.kind,
150
- visible: config.visible ?? true,
151
- asset: config.asset,
152
- transform: config.transform ?? defaultTransform(),
153
- animationClips: [...(config.animationClips ?? config.asset?.clips ?? [])],
154
- material: config.material,
155
- children: [...(config.children ?? [])]
156
- };
157
- }
158
- class AddCartoonNodeCommand {
159
- root;
160
- node;
161
- parentId;
162
- name;
163
- constructor(root, node, parentId) {
164
- this.root = root;
165
- this.node = node;
166
- this.parentId = parentId;
167
- this.name = `Add cartoon node ${node.id}`;
168
- }
169
- execute() {
170
- const parent = this.parentId ? findNode(this.root, this.parentId) : this.root;
171
- if (!parent)
172
- throw new Error(`Cartoon scene parent does not exist: ${this.parentId}`);
173
- if (!parent.children.includes(this.node))
174
- parent.children.push(this.node);
175
- }
176
- undo() {
177
- const parent = findParent(this.root, this.node.id);
178
- if (parent)
179
- removeChild(parent, this.node);
180
- }
181
- }
182
- class RemoveCartoonNodeCommand {
183
- parent;
184
- node;
185
- name;
186
- index = -1;
187
- constructor(parent, node) {
188
- this.parent = parent;
189
- this.node = node;
190
- this.name = `Remove cartoon node ${node.id}`;
191
- }
192
- execute() {
193
- this.index = this.parent.children.indexOf(this.node);
194
- removeChild(this.parent, this.node);
195
- }
196
- undo() {
197
- if (!this.parent.children.includes(this.node)) {
198
- this.parent.children.splice(this.index < 0 ? this.parent.children.length : this.index, 0, this.node);
199
- }
200
- }
201
- }
202
- class SetCartoonTransformCommand {
203
- node;
204
- after;
205
- name;
206
- before;
207
- constructor(node, after) {
208
- this.node = node;
209
- this.after = after;
210
- this.name = `Set cartoon transform ${node.id}`;
211
- this.before = cloneTransform(node.transform);
212
- }
213
- execute() {
214
- this.node.transform = cloneTransform(this.after);
215
- }
216
- undo() {
217
- this.node.transform = cloneTransform(this.before);
218
- }
219
- }
220
- function categoryFromAsset(asset) {
221
- if (asset.type === "audio")
222
- return "audio";
223
- if (asset.type === "material")
224
- return "material";
225
- if (asset.clips && asset.clips.length > 0)
226
- return "character";
227
- return "prop";
228
- }
229
- function findNode(root, id) {
230
- if (root.id === id)
231
- return root;
232
- for (const child of root.children) {
233
- const found = findNode(child, id);
234
- if (found)
235
- return found;
236
- }
237
- return undefined;
238
- }
239
- function findParent(root, id) {
240
- for (const child of root.children) {
241
- if (child.id === id)
242
- return root;
243
- const found = findParent(child, id);
244
- if (found)
245
- return found;
246
- }
247
- return undefined;
248
- }
249
- function flattenNodes(root) {
250
- return [root, ...root.children.flatMap((child) => flattenNodes(child))];
251
- }
252
- function removeChild(parent, node) {
253
- const index = parent.children.indexOf(node);
254
- if (index >= 0)
255
- parent.children.splice(index, 1);
256
- }
257
- function defaultTransform() {
258
- return {
259
- position: { x: 0, y: 0, z: 0 },
260
- rotation: { x: 0, y: 0, z: 0, w: 1 },
261
- scale: { x: 1, y: 1, z: 1 }
262
- };
263
- }
264
- function mergeTransform(base, next) {
265
- return {
266
- position: { ...base.position, ...(next.position ?? {}) },
267
- rotation: { ...base.rotation, ...(next.rotation ?? {}) },
268
- scale: { ...base.scale, ...(next.scale ?? {}) }
269
- };
270
- }
271
- function cloneTransform(transform) {
272
- return mergeTransform(defaultTransform(), transform);
273
- }
274
- function cloneNode(node) {
275
- return createCartoonSceneNode({
276
- ...node,
277
- transform: cloneTransform(node.transform),
278
- animationClips: [...node.animationClips],
279
- children: node.children.map(cloneNode)
280
- });
281
- }
282
- function stableNodeId(name) {
283
- return `node-${name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "item"}`;
284
- }
285
- //# sourceMappingURL=CartoonSceneEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CartoonSceneEditor.js","sourceRoot":"","sources":["../../../../packages/editor-runtime/src/CartoonSceneEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,EAAE,aAAa,EAAwF,MAAM,iBAAiB,CAAC;AA4DtI,MAAM,OAAO,kBAAkB;IACpB,OAAO,CAAgB;IACvB,IAAI,CAAmB;IACvB,QAAQ,CAAkC;IAC3C,uBAAuB,GAAkB,IAAI,CAAC;IAC9C,YAAY,CAA2B;IAE/C,YAAY,UAAqC,EAAE;QACjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,aAAa,EAAE,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,sBAAsB,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACrG,IAAI,CAAC,YAAY,GAAG,qBAAqB,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAAmB;YAClD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,UAAU,EAAE,CAAC,KAAK,EAAE,SAAS,E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,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE;QACxD,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE;KAChD,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,SAAgC;IACtD,OAAO,cAAc,CAAC,gBAAgB,EAAE,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,SAAS,CAAC,IAAsB;IACvC,OAAO,sBAAsB,CAAC;QAC5B,GAAG,IAAI;QACP,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC;QACzC,cAAc,EAAE,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC;KACvC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC;AAClG,CAAC"}
@@ -1,70 +0,0 @@
1
- export type EditorLocaleDirection = "ltr" | "rtl";
2
- export type EditorPluralCategory = "zero" | "one" | "two" | "few" | "many" | "other";
3
- export type EditorAccessibilityRole = "button" | "navigation" | "slider" | "textbox" | "status" | "dialog";
4
- export interface EditorLocaleDescriptor {
5
- readonly code: string;
6
- readonly displayName: string;
7
- readonly direction: EditorLocaleDirection;
8
- readonly currencySymbol: string;
9
- readonly decimalSeparator: string;
10
- readonly thousandsSeparator: string;
11
- readonly currencyPosition: "before" | "after";
12
- }
13
- export interface EditorLocalizedStringSample {
14
- readonly locale: string;
15
- readonly direction: EditorLocaleDirection;
16
- readonly title: string;
17
- readonly assetCount: string;
18
- readonly fallbackTitle: string;
19
- readonly missingKey: string;
20
- readonly formattedNumber: string;
21
- readonly formattedCurrency: string;
22
- readonly pluralCategory: EditorPluralCategory;
23
- }
24
- export interface EditorAccessibilityElementSample {
25
- readonly id: string;
26
- readonly role: EditorAccessibilityRole;
27
- readonly label: string;
28
- readonly tabIndex: number;
29
- readonly focusable: boolean;
30
- readonly disabled?: boolean;
31
- readonly ariaLive?: "polite" | "assertive";
32
- readonly contrastRatio: number;
33
- readonly contrastPassesAA: boolean;
34
- }
35
- export interface EditorLocalizationAccessibilityFixture {
36
- readonly source: "origin-master-localization-ui-accessibility-adapted";
37
- readonly sourceFiles: readonly string[];
38
- readonly localeCount: number;
39
- readonly rtlLocaleCount: number;
40
- readonly tableKeyCount: number;
41
- readonly jsonLoaderValidated: boolean;
42
- readonly csvLoaderValidated: boolean;
43
- readonly hotSwapLocale: {
44
- readonly from: string;
45
- readonly to: string;
46
- readonly directionChanged: boolean;
47
- readonly listenerNotifications: readonly string[];
48
- };
49
- readonly samples: readonly EditorLocalizedStringSample[];
50
- readonly missingKeys: readonly string[];
51
- readonly accessibility: {
52
- readonly elementCount: number;
53
- readonly labelledControls: number;
54
- readonly focusOrder: readonly string[];
55
- readonly focusWalk: readonly string[];
56
- readonly liveRegionAnnouncements: readonly string[];
57
- readonly highContrastMode: boolean;
58
- readonly minContrastRatio: number;
59
- readonly aaContrastPasses: boolean;
60
- };
61
- readonly blockedClaims: readonly string[];
62
- readonly claimBoundary: string;
63
- readonly hash: string;
64
- }
65
- export declare function sampleLocalizationAccessibilityFixture(options?: {
66
- readonly assetCount?: number;
67
- readonly hotSwapFrom?: string;
68
- readonly hotSwapTo?: string;
69
- }): EditorLocalizationAccessibilityFixture;
70
- //# sourceMappingURL=LocalizationAccessibilityFixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalizationAccessibilityFixtures.d.ts","sourceRoot":"","sources":["../../../../packages/editor-runtime/src/LocalizationAccessibilityFixtures.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,K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,MAAM,EAAE,CAAC;QACpD,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;KACpC,CAAC;IACF,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAwFD,wBAAgB,sCAAsC,CAAC,OAAO,GAAE;IAC9D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,sCAAsC,CAgD9C"}
@@ -1,275 +0,0 @@
1
- const sourceFiles = [
2
- "origin/master:src/localization/LocalizationManager.ts",
3
- "origin/master:src/localization/StringTable.ts",
4
- "origin/master:src/localization/Locale.ts",
5
- "origin/master:src/localization/Pluralization.ts",
6
- "origin/master:src/localization/loaders/JSONLocaleLoader.ts",
7
- "origin/master:src/localization/loaders/CSVLocaleLoader.ts",
8
- "origin/master:src/ui/UIAccessibility.ts"
9
- ];
10
- const blockedClaims = [
11
- "full localization pipeline",
12
- "ICU MessageFormat parity",
13
- "bidirectional text shaping parity",
14
- "screen-reader certification",
15
- "WCAG conformance certification",
16
- "Unity UI Toolkit parity",
17
- "Unreal UMG parity"
18
- ];
19
- const locales = [
20
- {
21
- code: "en-US",
22
- displayName: "English (United States)",
23
- direction: "ltr",
24
- currencySymbol: "$",
25
- decimalSeparator: ".",
26
- thousandsSeparator: ",",
27
- currencyPosition: "before"
28
- },
29
- {
30
- code: "es-ES",
31
- displayName: "Spanish (Spain)",
32
- direction: "ltr",
33
- currencySymbol: "EUR",
34
- decimalSeparator: ",",
35
- thousandsSeparator: ".",
36
- currencyPosition: "after"
37
- },
38
- {
39
- code: "ar-SA",
40
- displayName: "Arabic (Saudi Arabia)",
41
- direction: "rtl",
42
- currencySymbol: "SAR",
43
- decimalSeparator: ".",
44
- thousandsSeparator: ",",
45
- currencyPosition: "after"
46
- }
47
- ];
48
- const stringTables = {
49
- "en-US": {
50
- "editor.title": "Aura3D Editor",
51
- "assets.count.one": "{count} imported asset",
52
- "assets.count.other": "{count} imported assets",
53
- "status.saved": "Saved",
54
- "panel.inspector": "Inspector"
55
- },
56
- "es-ES": {
57
- "editor.title": "Editor Aura3D",
58
- "assets.count.one": "{count} recurso importado",
59
- "assets.count.other": "{count} recursos importados",
60
- "status.saved": "Guardado"
61
- },
62
- "ar-SA": {
63
- "editor.title": "Aura3D RTL Editor",
64
- "assets.count.zero": "no imported assets",
65
- "assets.count.one": "{count} imported asset",
66
- "assets.count.two": "{count} imported assets",
67
- "assets.count.few": "{count} imported assets",
68
- "assets.count.many": "{count} imported assets",
69
- "assets.count.other": "{count} imported assets",
70
- "status.saved": "Saved RTL"
71
- }
72
- };
73
- const accessibilityElements = [
74
- createAccessibilityElement("command-menu", "navigation", "Command menu", 1, "#f7fafc", "#101820"),
75
- createAccessibilityElement("viewport", "status", "Editor WebGL viewport", 2, "#f5f7fb", "#07111c", "polite"),
76
- createAccessibilityElement("inspector-name", "textbox", "Selected node name", 3, "#111827", "#f9fafb"),
77
- createAccessibilityElement("timeline-scrub", "slider", "Timeline scrub time", 4, "#0f172a", "#e0f2fe"),
78
- createAccessibilityElement("export-project", "button", "Export Project", 5, "#ffffff", "#1d4ed8")
79
- ];
80
- export function sampleLocalizationAccessibilityFixture(options = {}) {
81
- const assetCount = Math.max(0, Math.floor(options.assetCount ?? 2));
82
- const hotSwapFrom = options.hotSwapFrom ?? "en-US";
83
- const hotSwapTo = options.hotSwapTo ?? "ar-SA";
84
- const fromLocale = requireLocale(hotSwapFrom);
85
- const toLocale = requireLocale(hotSwapTo);
86
- const listenerNotifications = [fromLocale.code, toLocale.code];
87
- const samples = locales.map((locale) => sampleLocale(locale, assetCount));
88
- const missingKeys = findMissingKeys(stringTables["en-US"] ?? {}, stringTables["es-ES"] ?? {});
89
- const focusOrder = accessibilityElements
90
- .filter((element) => element.focusable && !element.disabled)
91
- .sort((left, right) => left.tabIndex - right.tabIndex)
92
- .map((element) => element.id);
93
- const focusWalk = [focusOrder[0], focusOrder[1], focusOrder[2], focusOrder[1]].filter((id) => Boolean(id));
94
- const minContrastRatio = Math.min(...accessibilityElements.map((element) => element.contrastRatio));
95
- const fixtureWithoutHash = {
96
- source: "origin-master-localization-ui-accessibility-adapted",
97
- sourceFiles,
98
- localeCount: locales.length,
99
- rtlLocaleCount: locales.filter((locale) => locale.direction === "rtl").length,
100
- tableKeyCount: Object.values(stringTables).reduce((sum, table) => sum + Object.keys(table).length, 0),
101
- jsonLoaderValidated: validateJsonTableShape(stringTables),
102
- csvLoaderValidated: validateCsvTableShape(toCsv(stringTables)),
103
- hotSwapLocale: {
104
- from: fromLocale.code,
105
- to: toLocale.code,
106
- directionChanged: fromLocale.direction !== toLocale.direction,
107
- listenerNotifications
108
- },
109
- samples,
110
- missingKeys,
111
- accessibility: {
112
- elementCount: accessibilityElements.length,
113
- labelledControls: accessibilityElements.filter((element) => element.label.trim().length > 0).length,
114
- focusOrder,
115
- focusWalk,
116
- liveRegionAnnouncements: ["Focused: Command menu", "Focused: Editor WebGL viewport", "Saved"],
117
- highContrastMode: true,
118
- minContrastRatio,
119
- aaContrastPasses: accessibilityElements.every((element) => element.contrastPassesAA)
120
- },
121
- blockedClaims,
122
- claimBoundary: "This fixture ports bounded old localization and UI accessibility concepts into deterministic editor-runtime evidence. It does not certify WCAG compliance, native assistive technology behavior, ICU parity, or Unity/Unreal UI parity."
123
- };
124
- return {
125
- ...fixtureWithoutHash,
126
- hash: stableHash(JSON.stringify(fixtureWithoutHash))
127
- };
128
- }
129
- function sampleLocale(locale, assetCount) {
130
- const pluralCategory = cardinalPluralCategory(locale.code, assetCount);
131
- const table = stringTables[locale.code] ?? {};
132
- const fallback = stringTables["en-US"] ?? {};
133
- return {
134
- locale: locale.code,
135
- direction: locale.direction,
136
- title: lookup(table, fallback, "editor.title", {}),
137
- assetCount: lookup(table, fallback, `assets.count.${pluralCategory}`, { count: assetCount }),
138
- fallbackTitle: lookup(table, fallback, "panel.inspector", {}),
139
- missingKey: lookup(table, fallback, "missing.key", {}),
140
- formattedNumber: formatNumber(locale, 1234.5, 2),
141
- formattedCurrency: formatCurrency(locale, 1234.5),
142
- pluralCategory
143
- };
144
- }
145
- function lookup(table, fallback, key, params) {
146
- const template = table[key] ?? fallback[key];
147
- if (!template)
148
- return `[${key}]`;
149
- return template.replace(/\{([^}]+)\}/g, (match, name) => String(params[name] ?? match));
150
- }
151
- function cardinalPluralCategory(localeCode, count) {
152
- const language = localeCode.split("-")[0] ?? localeCode;
153
- if (language === "ar") {
154
- if (count === 0)
155
- return "zero";
156
- if (count === 1)
157
- return "one";
158
- if (count === 2)
159
- return "two";
160
- if (count % 100 >= 3 && count % 100 <= 10)
161
- return "few";
162
- if (count % 100 >= 11 && count % 100 <= 99)
163
- return "many";
164
- return "other";
165
- }
166
- return count === 1 ? "one" : "other";
167
- }
168
- function formatNumber(locale, value, decimals) {
169
- const fixed = value.toFixed(decimals);
170
- const [integer = "0", decimal = ""] = fixed.split(".");
171
- const grouped = integer.replace(/\B(?=(\d{3})+(?!\d))/g, locale.thousandsSeparator);
172
- return decimal.length > 0 ? `${grouped}${locale.decimalSeparator}${decimal}` : grouped;
173
- }
174
- function formatCurrency(locale, value) {
175
- const formatted = formatNumber(locale, value, 2);
176
- return locale.currencyPosition === "before" ? `${locale.currencySymbol}${formatted}` : `${formatted} ${locale.currencySymbol}`;
177
- }
178
- function findMissingKeys(reference, target) {
179
- return Object.keys(reference).filter((key) => target[key] === undefined).sort();
180
- }
181
- function requireLocale(code) {
182
- const locale = locales.find((candidate) => candidate.code === code);
183
- if (!locale)
184
- throw new Error(`Unknown editor locale fixture: ${code}`);
185
- return locale;
186
- }
187
- function validateJsonTableShape(tables) {
188
- return Object.values(tables).every((table) => Object.values(table).every((value) => typeof value === "string" && value.length > 0));
189
- }
190
- function validateCsvTableShape(csv) {
191
- const rows = csv.split("\n").filter((line) => line.trim().length > 0);
192
- if (rows.length < 2)
193
- return false;
194
- const expectedColumns = parseCsvLine(rows[0] ?? "").length;
195
- return expectedColumns >= 2 && rows.slice(1).every((line) => parseCsvLine(line).length === expectedColumns);
196
- }
197
- function toCsv(tables) {
198
- const localeCodes = Object.keys(tables).sort();
199
- const keys = [...new Set(localeCodes.flatMap((locale) => Object.keys(tables[locale] ?? {})))].sort();
200
- return [
201
- ["Key", ...localeCodes].join(","),
202
- ...keys.map((key) => [key, ...localeCodes.map((locale) => escapeCsv(tables[locale]?.[key] ?? ""))].join(","))
203
- ].join("\n");
204
- }
205
- function parseCsvLine(line) {
206
- const columns = [];
207
- let current = "";
208
- let quoted = false;
209
- for (let index = 0; index < line.length; index += 1) {
210
- const char = line[index];
211
- const next = line[index + 1];
212
- if (char === "\"") {
213
- if (quoted && next === "\"") {
214
- current += "\"";
215
- index += 1;
216
- }
217
- else {
218
- quoted = !quoted;
219
- }
220
- }
221
- else if (char === "," && !quoted) {
222
- columns.push(current);
223
- current = "";
224
- }
225
- else {
226
- current += char;
227
- }
228
- }
229
- columns.push(current);
230
- return columns;
231
- }
232
- function escapeCsv(value) {
233
- return value.includes(",") || value.includes("\"") || value.includes("\n") ? `"${value.replace(/"/g, "\"\"")}"` : value;
234
- }
235
- function createAccessibilityElement(id, role, label, tabIndex, foreground, background, ariaLive) {
236
- const contrastRatio = Number(contrast(foreground, background).toFixed(2));
237
- return {
238
- id,
239
- role,
240
- label,
241
- tabIndex,
242
- focusable: true,
243
- ...(ariaLive ? { ariaLive } : {}),
244
- contrastRatio,
245
- contrastPassesAA: contrastRatio >= 4.5
246
- };
247
- }
248
- function contrast(foreground, background) {
249
- const foregroundLum = luminance(hexToRgb(foreground));
250
- const backgroundLum = luminance(hexToRgb(background));
251
- const light = Math.max(foregroundLum, backgroundLum);
252
- const dark = Math.min(foregroundLum, backgroundLum);
253
- return (light + 0.05) / (dark + 0.05);
254
- }
255
- function hexToRgb(hex) {
256
- const normalized = hex.replace("#", "");
257
- return [
258
- Number.parseInt(normalized.slice(0, 2), 16) / 255,
259
- Number.parseInt(normalized.slice(2, 4), 16) / 255,
260
- Number.parseInt(normalized.slice(4, 6), 16) / 255
261
- ];
262
- }
263
- function luminance(rgb) {
264
- const [r, g, b] = rgb.map((channel) => channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4);
265
- return 0.2126 * (r ?? 0) + 0.7152 * (g ?? 0) + 0.0722 * (b ?? 0);
266
- }
267
- function stableHash(value) {
268
- let hash = 0x811c9dc5;
269
- for (let index = 0; index < value.length; index += 1) {
270
- hash ^= value.charCodeAt(index);
271
- hash = Math.imul(hash, 0x01000193);
272
- }
273
- return (hash >>> 0).toString(16).padStart(8, "0");
274
- }
275
- //# sourceMappingURL=LocalizationAccessibilityFixtures.js.map