@pixi-ui-editor/schema 0.1.1 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAgB,MAAM,mBAAmB,CAAC;AAKpE,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAGjD,eAAO,MAAM,qBAAqB,uIAAgE,CAAC;AACnG,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAKnE,QAAA,MAAM,SAAS,sgBAAuR,CAAC;AACvS,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AACvD,QAAA,MAAM,OAAO;;;;;EAAgK,CAAC;AAC9K,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;AACnD,QAAA,MAAM,UAAU;;;;;EAAuU,CAAC;AACxV,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAC7D,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;EAA+Q,CAAC;AAC1S,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;EAA2oB,CAAC;AACpqB,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAUnE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;EAAivB,CAAC;AACxxB,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI3E,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,qDAAsD,CAAC;AACrF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iB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package/dist/index.js CHANGED
@@ -1,13 +1,20 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import Ajv from "ajv";
3
3
  import addFormats from "ajv-formats";
4
- export const CURRENT_SCHEMA_VERSION = 7;
4
+ import { applyPrefabNodePatch, materializePrefabInstance, PREFAB_NODE_PATH_SEPARATOR, resolvePrefabInstanceBaseNodes } from "./prefabs.js";
5
+ export const CURRENT_SCHEMA_VERSION = 19;
5
6
  const Id = Type.String({ format: "uuid" });
6
7
  const Name = Type.String({ minLength: 1 });
8
+ /**
9
+ * Ссылка на узел внутри инстанса пресета: собственный id узла либо путь по вложенным пресетам
10
+ * (`idA::prefab-node::idB`). Обычная нода сцены всегда использует первую форму; вторая появляется
11
+ * только у `parentId` локально добавленного узла и у `nodeId` property override. Разрешимость
12
+ * адреса проверяет семантическая валидация, структурная — только его форму.
13
+ */
14
+ const NodeAddress = Type.Union([Id, Type.String({ pattern: `^.+${PREFAB_NODE_PATH_SEPARATOR}.+$` })]);
7
15
  export const LayoutProfileIdSchema = Type.Union([Type.Literal("desktop"), Type.Literal("mobile")]);
8
- // width/height допускают любые значения: на растянутой оси (anchorMin < anchorMax) они хранят
9
- // дельту к якорному прямоугольнику родителя и могут быть нулевыми или отрицательными.
10
- // Для нерастянутой оси положительность размера проверяет semantic-валидация (NON_POSITIVE_SIZE).
16
+ // Unity RectTransform semantics in logical Canvas units: x/y are anchoredPosition and width/height
17
+ // are sizeDelta. A point axis needs a positive sizeDelta; a stretched axis may use negative insets.
11
18
  const Transform = Type.Object({ x: Type.Number(), y: Type.Number(), width: Type.Number(), height: Type.Number(), scaleX: Type.Number(), scaleY: Type.Number(), rotation: Type.Number(), pivotX: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), pivotY: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), anchorMinX: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), anchorMinY: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), anchorMaxX: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), anchorMaxY: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })) });
12
19
  const Alignment = Type.Union([Type.Literal("upper-left"), Type.Literal("upper-center"), Type.Literal("upper-right"), Type.Literal("middle-left"), Type.Literal("middle-center"), Type.Literal("middle-right"), Type.Literal("lower-left"), Type.Literal("lower-center"), Type.Literal("lower-right")]);
13
20
  const Padding = Type.Object({ left: Type.Number({ minimum: 0 }), right: Type.Number({ minimum: 0 }), top: Type.Number({ minimum: 0 }), bottom: Type.Number({ minimum: 0 }) });
@@ -16,17 +23,40 @@ const LinearLayoutSettings = Type.Object({ padding: Padding, spacing: Type.Numbe
16
23
  const GridLayoutSettings = Type.Object({ padding: Padding, spacingX: Type.Number({ minimum: 0 }), spacingY: Type.Number({ minimum: 0 }), cellWidth: Type.Number({ exclusiveMinimum: 0 }), cellHeight: Type.Number({ exclusiveMinimum: 0 }), startCorner: Type.Union([Type.Literal("upper-left"), Type.Literal("upper-right"), Type.Literal("lower-left"), Type.Literal("lower-right")]), startAxis: Type.Union([Type.Literal("horizontal"), Type.Literal("vertical")]), childAlignment: Alignment, constraint: Type.Union([Type.Literal("flexible"), Type.Literal("fixed-column-count"), Type.Literal("fixed-row-count")]), constraintCount: Type.Optional(Type.Number({ exclusiveMinimum: 0 })) });
17
24
  const ProfiledLayout = (settings) => Type.Object({ base: settings, overrides: Type.Optional(Type.Partial(Type.Object({ desktop: Type.Partial(settings), mobile: Type.Partial(settings) }))) });
18
25
  const Override = Type.Object({ visible: Type.Optional(Type.Boolean()), transform: Type.Optional(Type.Partial(Transform)) });
19
- const NodeBase = Type.Object({ id: Id, name: Name, parentId: Type.Union([Id, Type.Null()]), children: Type.Array(Id), visible: Type.Boolean(), transform: Transform, layoutOverrides: Type.Optional(Type.Partial(Type.Object({ desktop: Override, mobile: Override }))), layoutItem: Type.Optional(LayoutItem), binding: Type.Optional(Type.String()) });
26
+ // `editorOnly` and `locked` are authoring metadata. `locked` protects the node and its descendants
27
+ // from editor mutations but deliberately has no runtime rendering semantics.
28
+ const NodeBase = Type.Object({ id: Id, name: Name, parentId: Type.Union([NodeAddress, Type.Null()]), children: Type.Array(Id), visible: Type.Boolean(), editorOnly: Type.Optional(Type.Boolean()), locked: Type.Optional(Type.Boolean()), transform: Transform, layoutOverrides: Type.Optional(Type.Partial(Type.Object({ desktop: Override, mobile: Override }))), layoutItem: Type.Optional(LayoutItem), binding: Type.Optional(Type.String()) });
20
29
  const Container = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("container") })]);
21
30
  const HorizontalLayout = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("horizontal-layout"), backgroundAssetId: Type.Optional(Id), layoutGroup: ProfiledLayout(LinearLayoutSettings) })]);
22
31
  const VerticalLayout = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("vertical-layout"), backgroundAssetId: Type.Optional(Id), layoutGroup: ProfiledLayout(LinearLayoutSettings) })]);
23
32
  const GridLayout = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("grid-layout"), backgroundAssetId: Type.Optional(Id), layoutGroup: ProfiledLayout(GridLayoutSettings) })]);
24
- const Image = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("image"), assetId: Id, opacity: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })) })]);
33
+ // assetId отсутствует нода без источника: рантайм и редактор рисуют белый прямоугольник её размера.
34
+ const Image = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("image"), assetId: Type.Optional(Id), opacity: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })) })]);
25
35
  const TextStroke = Type.Object({ color: Type.String({ pattern: "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" }), width: Type.Number({ minimum: 0 }) });
26
36
  export const TextStyleDefinitionSchema = Type.Object({ fontAssetId: Type.Optional(Id), fontFamily: Type.String({ minLength: 1 }), fontSize: Type.Number({ exclusiveMinimum: 0 }), fontWeight: Type.Union([Type.Literal("normal"), Type.Literal("bold")]), fontStyle: Type.Union([Type.Literal("normal"), Type.Literal("italic")]), fill: Type.String({ pattern: "^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" }), align: Type.Union([Type.Literal("left"), Type.Literal("center"), Type.Literal("right"), Type.Literal("justify")]), verticalAlign: Type.Union([Type.Literal("top"), Type.Literal("middle"), Type.Literal("bottom")]), wordWrap: Type.Boolean(), breakWords: Type.Boolean(), lineHeight: Type.Optional(Type.Number({ exclusiveMinimum: 0 })), letterSpacing: Type.Number(), stroke: Type.Optional(TextStroke) });
27
- const Text = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("text"), text: Type.String(), style: Type.Optional(TextStyleDefinitionSchema) })]);
28
- const Spine = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("spine"), assetId: Id, animation: Type.Optional(Type.String({ minLength: 1 })), loop: Type.Optional(Type.Boolean()) })]);
29
- const PrefabInstance = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("prefab-instance"), prefabId: Id })]);
37
+ const TextStyleOverrides = Type.Partial(Type.Object({ desktop: Type.Partial(TextStyleDefinitionSchema), mobile: Type.Partial(TextStyleDefinitionSchema) }));
38
+ const Text = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("text"), text: Type.String(), style: Type.Optional(TextStyleDefinitionSchema), textStyleOverrides: Type.Optional(TextStyleOverrides) })]);
39
+ // Optional preserves existing documents; omitted animationSpeed is interpreted as 1 by every runtime.
40
+ // `autoplay` is the serialized initial playback decision. Older documents are migrated to true,
41
+ // preserving the runtime behavior they had before this field became explicit.
42
+ const SpineProfileSettings = Type.Object({
43
+ // `null` explicitly removes an inherited base animation; an absent key inherits it.
44
+ animation: Type.Union([Type.String({ minLength: 1 }), Type.Null()]),
45
+ autoplay: Type.Boolean(),
46
+ loop: Type.Boolean(),
47
+ animationSpeed: Type.Number({ exclusiveMinimum: 0 }),
48
+ });
49
+ const SpineOverrides = Type.Partial(Type.Object({ desktop: Type.Partial(SpineProfileSettings), mobile: Type.Partial(SpineProfileSettings) }));
50
+ const Spine = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("spine"), assetId: Id, animation: Type.Optional(Type.String({ minLength: 1 })), autoplay: Type.Optional(Type.Boolean()), loop: Type.Optional(Type.Boolean()), animationSpeed: Type.Optional(Type.Number({ exclusiveMinimum: 0 })), spineOverrides: Type.Optional(SpineOverrides) })]);
51
+ export const PrefabNodeOverrideSchema = Type.Object({
52
+ /** Адрес переопределяемого узла внутри инстанса; для вложенных пресетов это путь. */
53
+ nodeId: NodeAddress,
54
+ /**
55
+ * RFC-7396-like merge patch. Semantic validation rejects structural fields and validates the
56
+ * effective node after applying it to the referenced prefab-definition node.
57
+ */
58
+ patch: Type.Record(Type.String(), Type.Unknown()),
59
+ });
30
60
  /** Состояния кнопки. `normal` обязателен; остальные при отсутствии используют его изображение. */
31
61
  export const BUTTON_STATE_KEYS = ["normal", "hover", "pressed", "disabled"];
32
62
  /** Discriminated transition: в v0 поддержан только `instant`, чтобы позже добавить bump/slide/fade без неявных полей. */
@@ -108,7 +138,26 @@ export const EffectDefinitionSchema = Type.Union([Type.Object({
108
138
  })]);
109
139
  export function isParticleEffect(effect) { return effect.type === "particles"; }
110
140
  const ParticleEmitter = Type.Composite([NodeBase, Type.Object({ type: Type.Literal("particle-emitter"), effectId: Id, autoplay: Type.Boolean(), simulationSpace: Type.Union([Type.Literal("local"), Type.Literal("world")]) })]);
111
- export const UINodeSchema = Type.Union([Container, HorizontalLayout, VerticalLayout, GridLayout, Image, Text, Spine, Button, PrefabInstance, ScrollView, Input, Slider, ProgressBar, ParticleEmitter]);
141
+ /**
142
+ * Локальное добавление внутри инстанса — обычный узел любого типа, включая другой инстанс пресета
143
+ * (как added GameObject в Unity). Поэтому схема узла рекурсивна: `prefab-instance` содержит массив
144
+ * таких же узлов.
145
+ */
146
+ const UI_NODE_SCHEMA_ID = "UINode";
147
+ export const UINodeSchema = Type.Recursive((Self) => Type.Union([Container, HorizontalLayout, VerticalLayout, GridLayout, Image, Text, Spine, Button, Type.Composite([NodeBase, Type.Object({
148
+ type: Type.Literal("prefab-instance"),
149
+ prefabId: Id,
150
+ propertyOverrides: Type.Optional(Type.Array(PrefabNodeOverrideSchema)),
151
+ locallyAddedNodes: Type.Optional(Type.Array(Self)),
152
+ })]), ScrollView, Input, Slider, ProgressBar, ParticleEmitter]), { $id: UI_NODE_SCHEMA_ID });
153
+ /**
154
+ * Ссылка на схему узла для владельцев (сцена, пресет). Встроить рекурсивную схему дважды нельзя:
155
+ * её `$id` оказался бы в документе в двух местах, и Ajv не смог бы разрешить внутренние `$ref`.
156
+ * Поэтому схема узла регистрируется в Ajv один раз, а владельцы ссылаются на неё.
157
+ */
158
+ const UINodeRef = Type.Unsafe({ $ref: UI_NODE_SCHEMA_ID });
159
+ /** Исторический псевдоним: локальное добавление больше ничем не ограничено по сравнению с узлом сцены. */
160
+ export const LocallyAddedNodeSchema = UINodeSchema;
112
161
  export function isLayoutGroup(node) { return node.type === "horizontal-layout" || node.type === "vertical-layout" || node.type === "grid-layout"; }
113
162
  export function resolveLayoutGroupSettings(node, profile) {
114
163
  return { ...node.layoutGroup.base, ...node.layoutGroup.overrides?.[profile] };
@@ -119,16 +168,22 @@ export function isPositionManagingContainer(node) { return isLayoutGroup(node) |
119
168
  export function isParticleEmitterNode(node) { return node.type === "particle-emitter"; }
120
169
  const Viewport = Type.Object({ width: Type.Number({ exclusiveMinimum: 0 }), height: Type.Number({ exclusiveMinimum: 0 }) });
121
170
  const SceneAudio = Type.Object({ backgroundMusicAssetId: Type.Optional(Id), volume: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })) });
122
- export const SceneSchema = Type.Object({ id: Id, name: Name, rootNodeIds: Type.Array(Id), nodes: Type.Array(UINodeSchema), layout: Type.Object({ referenceViewports: Type.Object({ desktop: Viewport, mobile: Viewport }) }), audio: Type.Optional(SceneAudio) });
171
+ export const SceneSchema = Type.Object({ id: Id, name: Name, rootNodeIds: Type.Array(Id), nodes: Type.Array(UINodeRef), layout: Type.Object({ referenceViewports: Type.Object({ desktop: Viewport, mobile: Viewport }), preferredViewports: Type.Object({ desktop: Viewport, mobile: Viewport }) }), audio: Type.Optional(SceneAudio) });
123
172
  export const AssetFileSchema = Type.Object({ name: Name, uri: Type.String({ minLength: 1 }), mediaType: Type.String({ minLength: 1 }) });
124
173
  const ImageAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("image"), source: Type.Object({ uri: Type.String({ minLength: 1 }), mediaType: Type.String({ minLength: 1 }), version: Type.Optional(Type.String({ minLength: 1 })) }) });
125
- const SpineAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("spine"), files: Type.Object({ skeleton: AssetFileSchema, atlas: AssetFileSchema, textures: Type.Array(AssetFileSchema, { minItems: 1 }) }) });
174
+ export const SpineReferenceFrameSchema = Type.Object({
175
+ x: Type.Number(),
176
+ y: Type.Number(),
177
+ width: Type.Number({ exclusiveMinimum: 0 }),
178
+ height: Type.Number({ exclusiveMinimum: 0 }),
179
+ });
180
+ const SpineAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("spine"), files: Type.Object({ skeleton: AssetFileSchema, atlas: AssetFileSchema, textures: Type.Array(AssetFileSchema, { minItems: 1 }) }), referenceFrame: Type.Optional(SpineReferenceFrameSchema) });
126
181
  const FontAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("font"), family: Name, weight: Type.Union([Type.Literal("normal"), Type.Literal("bold")]), style: Type.Union([Type.Literal("normal"), Type.Literal("italic")]), source: Type.Object({ uri: Type.String({ minLength: 1 }), mediaType: Type.String({ minLength: 1 }), version: Type.Optional(Type.String({ minLength: 1 })) }) });
127
182
  // Имя фрейма из spritesheet JSON → стабильный id фрейма; nodes ссылаются на этот id как на обычный image assetId.
128
183
  const AtlasAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("atlas"), files: Type.Object({ json: AssetFileSchema, texture: AssetFileSchema }), frames: Type.Record(Type.String({ minLength: 1 }), Id) });
129
184
  const SoundAsset = Type.Object({ id: Id, name: Name, type: Type.Literal("sound"), source: Type.Object({ uri: Type.String({ minLength: 1 }), mediaType: Type.String({ minLength: 1 }), version: Type.Optional(Type.String({ minLength: 1 })) }) });
130
185
  export const AssetSchema = Type.Union([ImageAsset, SpineAsset, FontAsset, AtlasAsset, SoundAsset]);
131
- export const PrefabDefinitionSchema = Type.Object({ id: Id, name: Name, rootNodeIds: Type.Array(Id), nodes: Type.Array(UINodeSchema), exposedProperties: Type.Array(Type.Object({ name: Name, type: Type.Union([Type.Literal("string"), Type.Literal("number"), Type.Literal("boolean"), Type.Literal("asset"), Type.Literal("visibility")]) })) });
186
+ export const PrefabDefinitionSchema = Type.Object({ id: Id, name: Name, rootNodeIds: Type.Array(Id), nodes: Type.Array(UINodeRef), exposedProperties: Type.Array(Type.Object({ name: Name, type: Type.Union([Type.Literal("string"), Type.Literal("number"), Type.Literal("boolean"), Type.Literal("asset"), Type.Literal("visibility")]) })) });
132
187
  export const ProjectDocumentSchema = Type.Object({ schemaVersion: Type.Literal(CURRENT_SCHEMA_VERSION), project: Type.Object({ id: Id, name: Name }), settings: Type.Object({ layoutProfileSelection: Type.Object({ mode: Type.Literal("aspect-ratio"), mobileMaxAspectRatio: Type.Number({ exclusiveMinimum: 0 }) }) }), assets: Type.Array(AssetSchema), effects: Type.Array(EffectDefinitionSchema), prefabs: Type.Array(PrefabDefinitionSchema), scenes: Type.Array(SceneSchema) });
133
188
  export class ProjectDocumentMigrationError extends Error {
134
189
  code = "UNSUPPORTED_SCHEMA_VERSION";
@@ -136,21 +191,27 @@ export class ProjectDocumentMigrationError extends Error {
136
191
  }
137
192
  const AjvConstructor = Ajv;
138
193
  const addAjvFormats = addFormats;
139
- const ajv = new AjvConstructor({ allErrors: true, strict: false });
140
- addAjvFormats(ajv);
141
- const structural = ajv.compile(ProjectDocumentSchema);
194
+ const createAjv = () => { const instance = new AjvConstructor({ allErrors: true, strict: false }); addAjvFormats(instance); return instance; };
195
+ // Рекурсивная схема узла несёт собственный `$id`, поэтому её нельзя компилировать дважды в одном
196
+ // экземпляре Ajv: документ уже зарегистрировал этот `$id` внутри себя.
197
+ const documentAjv = createAjv();
198
+ documentAjv.addSchema(UINodeSchema);
199
+ const structural = documentAjv.compile(ProjectDocumentSchema);
200
+ const structuralNode = createAjv().compile(UINodeSchema);
142
201
  export function createStableId() { return crypto.randomUUID(); }
143
202
  const add = (issues, code, path, message) => issues.push({ code, path, message, severity: "error" });
144
- /** На нерастянутой оси width/height абсолютный размер и обязан быть положительным; на растянутой это дельта к якорному прямоугольнику. */
203
+ /** A point-anchor sizeDelta is the whole rect and must be positive; stretch sizeDelta may be negative. */
145
204
  function checkResolvedSizes(node, nodePath, issues) {
146
205
  for (const profile of ["desktop", "mobile"]) {
147
206
  const merged = { ...node.transform, ...node.layoutOverrides?.[profile]?.transform };
148
- const minX = merged.anchorMinX ?? 0, maxX = merged.anchorMaxX ?? minX;
149
- const minY = merged.anchorMinY ?? 0, maxY = merged.anchorMaxY ?? minY;
150
- if (maxX <= minX && merged.width <= 0)
151
- add(issues, "NON_POSITIVE_SIZE", `${nodePath}/transform/width`, `Width must be positive when the '${profile}' X axis is not stretched.`);
152
- if (maxY <= minY && merged.height <= 0)
153
- add(issues, "NON_POSITIVE_SIZE", `${nodePath}/transform/height`, `Height must be positive when the '${profile}' Y axis is not stretched.`);
207
+ const minX = merged.anchorMinX ?? 0;
208
+ const minY = merged.anchorMinY ?? 0;
209
+ const maxX = merged.anchorMaxX ?? minX;
210
+ const maxY = merged.anchorMaxY ?? minY;
211
+ if (maxX === minX && merged.width <= 0)
212
+ add(issues, "NON_POSITIVE_SIZE", `${nodePath}/transform/width`, `Width must be positive on a non-stretched axis in the '${profile}' profile.`);
213
+ if (maxY === minY && merged.height <= 0)
214
+ add(issues, "NON_POSITIVE_SIZE", `${nodePath}/transform/height`, `Height must be positive on a non-stretched axis in the '${profile}' profile.`);
154
215
  }
155
216
  }
156
217
  function particleAssetIds(effect) { const source = effect.particle.visual.source; return source.type === "single" ? [source.assetId] : source.assetIds; }
@@ -183,7 +244,7 @@ function hierarchy(owner, path, assets, prefabs, effects, issues) {
183
244
  if (parent && !parent.children.includes(node.id))
184
245
  add(issues, "HIERARCHY_CHILD_MISMATCH", `${nodePath}/parentId`, `Parent '${node.parentId}' does not list node '${node.id}'.`);
185
246
  }
186
- if (node.type === "image" || node.type === "spine") {
247
+ if ((node.type === "image" || node.type === "spine") && node.assetId !== undefined) {
187
248
  const asset = assets.get(node.assetId);
188
249
  if (!asset)
189
250
  add(issues, "MISSING_ASSET_REFERENCE", `${nodePath}/assetId`, `Asset '${node.assetId}' does not exist.`);
@@ -215,12 +276,21 @@ function hierarchy(owner, path, assets, prefabs, effects, issues) {
215
276
  else if (asset.type !== "sound")
216
277
  add(issues, "INCOMPATIBLE_ASSET_REFERENCE", soundPath, `A button ${field} requires a sound asset.`);
217
278
  }
218
- if (node.type === "text" && node.style?.fontAssetId !== undefined) {
219
- const asset = assets.get(node.style.fontAssetId), path = `${nodePath}/style/fontAssetId`;
220
- if (!asset)
221
- add(issues, "MISSING_ASSET_REFERENCE", path, `Asset '${node.style.fontAssetId}' does not exist.`);
222
- else if (asset.type !== "font")
223
- add(issues, "INCOMPATIBLE_ASSET_REFERENCE", path, "A text node fontAssetId requires a font asset.");
279
+ if (node.type === "text") {
280
+ const fontReferences = [
281
+ [node.style?.fontAssetId, `${nodePath}/style/fontAssetId`],
282
+ [node.textStyleOverrides?.desktop?.fontAssetId, `${nodePath}/textStyleOverrides/desktop/fontAssetId`],
283
+ [node.textStyleOverrides?.mobile?.fontAssetId, `${nodePath}/textStyleOverrides/mobile/fontAssetId`],
284
+ ];
285
+ for (const [fontAssetId, fontPath] of fontReferences) {
286
+ if (fontAssetId === undefined)
287
+ continue;
288
+ const asset = assets.get(fontAssetId);
289
+ if (!asset)
290
+ add(issues, "MISSING_ASSET_REFERENCE", fontPath, `Asset '${fontAssetId}' does not exist.`);
291
+ else if (asset.type !== "font")
292
+ add(issues, "INCOMPATIBLE_ASSET_REFERENCE", fontPath, "A text node fontAssetId requires a font asset.");
293
+ }
224
294
  }
225
295
  if (node.type === "input" && node.backgroundAssetId !== undefined) {
226
296
  const asset = assets.get(node.backgroundAssetId);
@@ -317,8 +387,54 @@ function semantic(document) {
317
387
  add(issues, "INCOMPATIBLE_ASSET_REFERENCE", sourcePath, "Particle visual source requires an image asset or atlas frame."); }); });
318
388
  document.prefabs.forEach((prefab, i) => { register(prefab.id, `/prefabs/${i}/id`); prefabs.add(prefab.id); });
319
389
  document.scenes.forEach((scene, i) => register(scene.id, `/scenes/${i}/id`));
390
+ const prefabById = new Map(document.prefabs.map((prefab) => [prefab.id, prefab]));
391
+ const validateInstance = (instance, path, checkHierarchy = true) => {
392
+ const prefab = prefabById.get(instance.prefabId);
393
+ if (prefab === undefined)
394
+ return;
395
+ // База адресуется путём: у вложенных пресетов переопределяемый узел живёт не в `prefab.nodes`,
396
+ // а глубже, поэтому цель override резолвится через тот же материализатор.
397
+ const definitionNodes = resolvePrefabInstanceBaseNodes(document, instance);
398
+ const overridden = new Set();
399
+ for (const [index, override] of (instance.propertyOverrides ?? []).entries()) {
400
+ const overridePath = `${path}/propertyOverrides/${index}`;
401
+ if (overridden.has(override.nodeId))
402
+ add(issues, "DUPLICATE_PREFAB_NODE_OVERRIDE", `${overridePath}/nodeId`, `Prefab node '${override.nodeId}' has more than one property override.`);
403
+ overridden.add(override.nodeId);
404
+ const definitionNode = definitionNodes.get(override.nodeId);
405
+ if (definitionNode === undefined) {
406
+ add(issues, "MISSING_PREFAB_OVERRIDE_TARGET", `${overridePath}/nodeId`, `Prefab node '${override.nodeId}' does not exist in definition '${prefab.id}'.`);
407
+ continue;
408
+ }
409
+ for (const key of ["id", "type", "parentId", "children", "editorOnly", "locked", "prefabId", "propertyOverrides", "locallyAddedNodes"]) {
410
+ if (Object.hasOwn(override.patch, key))
411
+ add(issues, "STRUCTURAL_PREFAB_OVERRIDE", `${overridePath}/patch/${key}`, `Prefab instances cannot override structural field '${key}'.`);
412
+ }
413
+ // База развёрнута, поэтому несёт instance-scoped id и связи. Патч их менять не может, а
414
+ // структурная схема требует обычных uuid, поэтому идентичность подменяется на нейтральную.
415
+ const effective = applyPrefabNodePatch({ ...definitionNode, id: instance.id, parentId: null, children: [] }, override.patch);
416
+ if (!structuralNode(effective))
417
+ add(issues, "INVALID_PREFAB_NODE_OVERRIDE", `${overridePath}/patch`, "The property override produces an invalid UI node.");
418
+ }
419
+ // Локально добавленный инстанс сам владеет своей конфигурацией, поэтому проверяется рекурсивно.
420
+ // Иерархию при этом сверяет только внешний инстанс: его материализация уже включает вложенные.
421
+ for (const [index, localNode] of (instance.locallyAddedNodes ?? []).entries()) {
422
+ const localPath = `${path}/locallyAddedNodes/${index}`;
423
+ register(localNode.id, `${localPath}/id`);
424
+ if (localNode.type === "prefab-instance")
425
+ validateInstance(localNode, localPath, false);
426
+ }
427
+ if (!checkHierarchy)
428
+ return;
429
+ const materialized = materializePrefabInstance(document, instance);
430
+ if (materialized !== undefined)
431
+ hierarchy(materialized, `${path}/materialized`, assets, prefabs, effects, issues);
432
+ };
320
433
  document.prefabs.forEach((prefab, i) => { prefab.nodes.forEach((node, j) => register(node.id, `/prefabs/${i}/nodes/${j}/id`)); hierarchy(prefab, `/prefabs/${i}`, assets, prefabs, effects, issues); });
321
- document.scenes.forEach((scene, i) => { scene.nodes.forEach((node, j) => register(node.id, `/scenes/${i}/nodes/${j}/id`)); hierarchy(scene, `/scenes/${i}`, assets, prefabs, effects, issues); const musicAssetId = scene.audio?.backgroundMusicAssetId; if (musicAssetId !== undefined) {
434
+ document.prefabs.forEach((prefab, i) => prefab.nodes.forEach((node, j) => { if (node.type === "prefab-instance")
435
+ validateInstance(node, `/prefabs/${i}/nodes/${j}`); }));
436
+ document.scenes.forEach((scene, i) => { scene.nodes.forEach((node, j) => register(node.id, `/scenes/${i}/nodes/${j}/id`)); hierarchy(scene, `/scenes/${i}`, assets, prefabs, effects, issues); scene.nodes.forEach((node, j) => { if (node.type === "prefab-instance")
437
+ validateInstance(node, `/scenes/${i}/nodes/${j}`); }); const musicAssetId = scene.audio?.backgroundMusicAssetId; if (musicAssetId !== undefined) {
322
438
  const asset = assets.get(musicAssetId), musicPath = `/scenes/${i}/audio/backgroundMusicAssetId`;
323
439
  if (!asset)
324
440
  add(issues, "MISSING_ASSET_REFERENCE", musicPath, `Asset '${musicAssetId}' does not exist.`);
@@ -376,11 +492,276 @@ function migrateV1ToV2(document) {
376
492
  }
377
493
  }
378
494
  }
379
- export function migrateProjectDocument(input) { if (typeof input !== "object" || input === null || !Object.hasOwn(input, "schemaVersion"))
380
- throw new ProjectDocumentMigrationError("A schemaVersion is required for migration."); const version = input.schemaVersion; if (typeof version !== "number" || !Number.isInteger(version) || version < 1 || version > CURRENT_SCHEMA_VERSION)
381
- throw new ProjectDocumentMigrationError(`Unsupported schemaVersion '${String(version)}'.`); const migrated = structuredClone(input); if (version <= 1)
382
- migrateV1ToV2(migrated); if (version <= 6)
383
- migrated.effects = []; migrated.schemaVersion = CURRENT_SCHEMA_VERSION; assertProjectDocument(migrated); return migrated; }
495
+ function migrateOwnerToPreferredRects(owner, viewports, source = "legacy") {
496
+ const originalNodes = structuredClone(owner.nodes);
497
+ const nodesById = new Map(originalNodes.map((node) => [node.id, node]));
498
+ const convertedByProfile = new Map();
499
+ for (const profile of ["desktop", "mobile"]) {
500
+ const converted = new Map();
501
+ const visiting = new Set();
502
+ const visit = (nodeId) => {
503
+ const cached = converted.get(nodeId);
504
+ if (cached !== undefined)
505
+ return cached;
506
+ if (visiting.has(nodeId))
507
+ return undefined;
508
+ const node = nodesById.get(nodeId);
509
+ if (node === undefined)
510
+ return undefined;
511
+ visiting.add(nodeId);
512
+ const parent = node.parentId === null ? undefined : nodesById.get(node.parentId);
513
+ const convertedParent = parent === undefined ? undefined : visit(parent.id);
514
+ visiting.delete(nodeId);
515
+ const referenceRoot = viewports?.referenceViewports[profile];
516
+ const preferredRoot = viewports?.preferredViewports[profile];
517
+ const usesSceneBoundary = viewports !== undefined && parent?.parentId === null;
518
+ const currentParent = node.parentId === null || usesSceneBoundary ? referenceRoot : convertedParent?.currentSize;
519
+ const preferredParent = node.parentId === null || usesSceneBoundary ? preferredRoot : convertedParent?.preferredSize;
520
+ const override = node.layoutOverrides?.[profile]?.transform;
521
+ const merged = { ...node.transform, ...override };
522
+ const minX = typeof merged.anchorMinX === "number" ? merged.anchorMinX : 0;
523
+ const maxX = typeof merged.anchorMaxX === "number" ? merged.anchorMaxX : minX;
524
+ const minY = typeof merged.anchorMinY === "number" ? merged.anchorMinY : 0;
525
+ const maxY = typeof merged.anchorMaxY === "number" ? merged.anchorMaxY : minY;
526
+ const stretchX = maxX > minX;
527
+ const stretchY = maxY > minY;
528
+ const legacyResponsive = typeof merged.responsiveSize === "object" && merged.responsiveSize !== null
529
+ ? merged.responsiveSize
530
+ : undefined;
531
+ const fallbackWidth = typeof legacyResponsive?.referenceParentWidth === "number" ? legacyResponsive.referenceParentWidth : 1;
532
+ const fallbackHeight = typeof legacyResponsive?.referenceParentHeight === "number" ? legacyResponsive.referenceParentHeight : 1;
533
+ const current = currentParent ?? { width: fallbackWidth, height: fallbackHeight };
534
+ const preferred = preferredParent ?? current;
535
+ const oldScaleX = source === "v9"
536
+ ? stretchX ? current.width / preferred.width : 1
537
+ : stretchX && typeof legacyResponsive?.referenceParentWidth === "number"
538
+ ? current.width / legacyResponsive.referenceParentWidth
539
+ : 1;
540
+ const oldScaleY = source === "v9"
541
+ ? stretchY ? current.height / preferred.height : 1
542
+ : stretchY && typeof legacyResponsive?.referenceParentHeight === "number"
543
+ ? current.height / legacyResponsive.referenceParentHeight
544
+ : 1;
545
+ const renderedOffsetX = stretchX ? merged.x * oldScaleX : merged.x;
546
+ const renderedOffsetY = stretchY ? merged.y * oldScaleY : merged.y;
547
+ const renderedWidth = stretchX
548
+ ? source === "v9" || legacyResponsive !== undefined
549
+ ? merged.width * oldScaleX
550
+ : merged.width + (maxX - minX) * current.width
551
+ : merged.width;
552
+ const renderedHeight = stretchY
553
+ ? source === "v9" || legacyResponsive !== undefined
554
+ ? merged.height * oldScaleY
555
+ : merged.height + (maxY - minY) * current.height
556
+ : merged.height;
557
+ const currentWidth = current.width > 0 ? current.width : preferred.width;
558
+ const currentHeight = current.height > 0 ? current.height : preferred.height;
559
+ const next = { ...merged };
560
+ delete next.responsiveSize;
561
+ next.x = renderedOffsetX * preferred.width / currentWidth;
562
+ next.y = renderedOffsetY * preferred.height / currentHeight;
563
+ next.width = renderedWidth * preferred.width / currentWidth;
564
+ next.height = renderedHeight * preferred.height / currentHeight;
565
+ const result = {
566
+ transform: next,
567
+ currentSize: {
568
+ width: next.width * currentWidth / preferred.width,
569
+ height: next.height * currentHeight / preferred.height,
570
+ },
571
+ preferredSize: { width: next.width, height: next.height },
572
+ };
573
+ converted.set(nodeId, result);
574
+ return result;
575
+ };
576
+ owner.rootNodeIds.forEach(visit);
577
+ originalNodes.forEach((node) => visit(node.id));
578
+ convertedByProfile.set(profile, converted);
579
+ }
580
+ for (const node of owner.nodes) {
581
+ const desktop = convertedByProfile.get("desktop")?.get(node.id)?.transform;
582
+ const mobile = convertedByProfile.get("mobile")?.get(node.id)?.transform;
583
+ if (desktop !== undefined)
584
+ node.transform = desktop;
585
+ if (mobile !== undefined) {
586
+ const mobilePatch = Object.fromEntries(Object.entries(mobile).filter(([key, value]) => !Object.is(value, desktop?.[key])));
587
+ const existingMobile = node.layoutOverrides?.mobile;
588
+ if (Object.keys(mobilePatch).length > 0 || existingMobile !== undefined) {
589
+ node.layoutOverrides ??= {};
590
+ node.layoutOverrides.mobile ??= {};
591
+ if (Object.keys(mobilePatch).length > 0)
592
+ node.layoutOverrides.mobile.transform = mobilePatch;
593
+ else
594
+ delete node.layoutOverrides.mobile.transform;
595
+ if (Object.keys(node.layoutOverrides.mobile).length === 0)
596
+ delete node.layoutOverrides.mobile;
597
+ if (Object.keys(node.layoutOverrides).length === 0)
598
+ delete node.layoutOverrides;
599
+ }
600
+ }
601
+ const desktopOverride = node.layoutOverrides?.desktop?.transform;
602
+ if (desktopOverride !== undefined)
603
+ delete desktopOverride.responsiveSize;
604
+ }
605
+ }
606
+ function migrateToV10(document, source) {
607
+ for (const scene of document.scenes ?? []) {
608
+ migrateOwnerToPreferredRects(scene, scene.layout, source);
609
+ }
610
+ for (const prefab of document.prefabs ?? []) {
611
+ migrateOwnerToPreferredRects(prefab, undefined, source);
612
+ }
613
+ }
614
+ /** Converts v10 absolute preferred-space rects to anchoredPosition/sizeDelta without a visual jump. */
615
+ function migrateOwnerV10ToV11(owner, preferredViewports) {
616
+ const originalNodes = structuredClone(owner.nodes);
617
+ const nodesById = new Map(originalNodes.map((node) => [node.id, node]));
618
+ const convertedByProfile = new Map();
619
+ for (const profile of ["desktop", "mobile"]) {
620
+ const converted = new Map();
621
+ const visit = (nodeId) => {
622
+ const cached = converted.get(nodeId);
623
+ if (cached !== undefined)
624
+ return cached;
625
+ const node = nodesById.get(nodeId);
626
+ if (node === undefined)
627
+ return undefined;
628
+ const parent = node.parentId === null ? undefined : nodesById.get(node.parentId);
629
+ const convertedParent = parent === undefined ? undefined : visit(parent.id);
630
+ const merged = { ...node.transform, ...node.layoutOverrides?.[profile]?.transform };
631
+ const sceneBoundary = preferredViewports?.[profile];
632
+ const parentSize = sceneBoundary !== undefined && (node.parentId === null || parent?.parentId === null)
633
+ ? sceneBoundary
634
+ : convertedParent === undefined
635
+ ? { width: merged.width, height: merged.height }
636
+ : {
637
+ width: typeof convertedParent.__resolvedWidth === "number" ? convertedParent.__resolvedWidth : convertedParent.width,
638
+ height: typeof convertedParent.__resolvedHeight === "number" ? convertedParent.__resolvedHeight : convertedParent.height,
639
+ };
640
+ const minX = typeof merged.anchorMinX === "number" ? merged.anchorMinX : 0;
641
+ const minY = typeof merged.anchorMinY === "number" ? merged.anchorMinY : 0;
642
+ const maxX = typeof merged.anchorMaxX === "number" ? merged.anchorMaxX : minX;
643
+ const maxY = typeof merged.anchorMaxY === "number" ? merged.anchorMaxY : minY;
644
+ const pivotX = typeof merged.pivotX === "number" ? merged.pivotX : 0;
645
+ const pivotY = typeof merged.pivotY === "number" ? merged.pivotY : 0;
646
+ const resolvedWidth = merged.width;
647
+ const resolvedHeight = merged.height;
648
+ const next = {
649
+ ...merged,
650
+ x: merged.x - (maxX - minX) * pivotX * parentSize.width,
651
+ y: merged.y - (maxY - minY) * pivotY * parentSize.height,
652
+ width: resolvedWidth - (maxX - minX) * parentSize.width,
653
+ height: resolvedHeight - (maxY - minY) * parentSize.height,
654
+ __resolvedWidth: resolvedWidth,
655
+ __resolvedHeight: resolvedHeight,
656
+ };
657
+ converted.set(nodeId, next);
658
+ return next;
659
+ };
660
+ owner.rootNodeIds.forEach(visit);
661
+ originalNodes.forEach((node) => visit(node.id));
662
+ convertedByProfile.set(profile, converted);
663
+ }
664
+ for (const node of owner.nodes) {
665
+ const stripInternal = (transform) => {
666
+ if (transform === undefined)
667
+ return undefined;
668
+ const next = { ...transform };
669
+ delete next.__resolvedWidth;
670
+ delete next.__resolvedHeight;
671
+ return next;
672
+ };
673
+ const desktop = stripInternal(convertedByProfile.get("desktop")?.get(node.id));
674
+ const mobile = stripInternal(convertedByProfile.get("mobile")?.get(node.id));
675
+ if (desktop === undefined || mobile === undefined)
676
+ continue;
677
+ node.transform = desktop;
678
+ const desktopOverride = node.layoutOverrides?.desktop;
679
+ if (desktopOverride !== undefined) {
680
+ delete desktopOverride.transform;
681
+ if (Object.keys(desktopOverride).length === 0 && node.layoutOverrides !== undefined)
682
+ delete node.layoutOverrides.desktop;
683
+ }
684
+ const mobilePatch = Object.fromEntries(Object.entries(mobile).filter(([key, value]) => !Object.is(value, desktop[key])));
685
+ if (Object.keys(mobilePatch).length > 0) {
686
+ node.layoutOverrides ??= {};
687
+ node.layoutOverrides.mobile ??= {};
688
+ node.layoutOverrides.mobile.transform = mobilePatch;
689
+ }
690
+ else if (node.layoutOverrides?.mobile !== undefined) {
691
+ delete node.layoutOverrides.mobile.transform;
692
+ if (Object.keys(node.layoutOverrides.mobile).length === 0)
693
+ delete node.layoutOverrides.mobile;
694
+ }
695
+ if (node.layoutOverrides !== undefined && Object.keys(node.layoutOverrides).length === 0)
696
+ delete node.layoutOverrides;
697
+ }
698
+ }
699
+ function migrateV10ToV11(document) {
700
+ for (const scene of document.scenes ?? []) {
701
+ migrateOwnerV10ToV11(scene, scene.layout.preferredViewports);
702
+ }
703
+ for (const prefab of document.prefabs ?? []) {
704
+ migrateOwnerV10ToV11(prefab);
705
+ }
706
+ }
707
+ /** v15 makes Spine's initial playback explicit; previous runtime behavior always started it. */
708
+ function migrateV14ToV15(document) {
709
+ const visit = (node) => {
710
+ if (node.type === "spine" && typeof node.autoplay !== "boolean")
711
+ node.autoplay = true;
712
+ const localNodes = node.locallyAddedNodes;
713
+ if (Array.isArray(localNodes))
714
+ for (const localNode of localNodes)
715
+ if (typeof localNode === "object" && localNode !== null)
716
+ visit(localNode);
717
+ };
718
+ const owners = [...(document.scenes ?? []), ...(document.prefabs ?? [])];
719
+ for (const owner of owners)
720
+ for (const node of owner.nodes ?? [])
721
+ if (typeof node === "object" && node !== null)
722
+ visit(node);
723
+ }
724
+ /**
725
+ * v19 adds optional, sparse presentation overrides. v18 values already are the canonical base values,
726
+ * including nodes nested in prefab instances, so conversion deliberately preserves the complete node
727
+ * graph byte-for-byte and only the caller advances schemaVersion after this explicit migration step.
728
+ */
729
+ function migrateV18ToV19(_document) { }
730
+ export function migrateProjectDocument(input) {
731
+ if (typeof input !== "object" || input === null || !Object.hasOwn(input, "schemaVersion"))
732
+ throw new ProjectDocumentMigrationError("A schemaVersion is required for migration.");
733
+ const version = input.schemaVersion;
734
+ if (typeof version !== "number" || !Number.isInteger(version) || version < 1 || version > CURRENT_SCHEMA_VERSION)
735
+ throw new ProjectDocumentMigrationError(`Unsupported schemaVersion '${String(version)}'.`);
736
+ const migrated = structuredClone(input);
737
+ if (version <= 1)
738
+ migrateV1ToV2(migrated);
739
+ if (version <= 6)
740
+ migrated.effects = [];
741
+ if (version <= 7)
742
+ for (const scene of migrated.scenes ?? []) {
743
+ const layout = scene.layout;
744
+ if (layout?.referenceViewports !== undefined)
745
+ layout.preferredViewports = structuredClone(layout.referenceViewports);
746
+ }
747
+ if (version <= 9)
748
+ migrateToV10(migrated, version === 9 ? "v9" : "legacy");
749
+ if (version <= 10)
750
+ migrateV10ToV11(migrated);
751
+ if (version <= 14)
752
+ migrateV14ToV15(migrated);
753
+ if (version <= 18)
754
+ migrateV18ToV19(migrated);
755
+ // v17 → v18 (image без assetId) тоже не требует переписывания данных: старый формат — строгое
756
+ // подмножество нового, у каждой существующей image-ноды assetId просто остаётся на месте.
757
+ // v15 → v16 (вложенные пресеты) не требует переписывания данных: новый формат — надмножество
758
+ // старого. `propertyOverrides[].nodeId` и `parentId` локального узла стали путями, а путь длиной в
759
+ // один сегмент — это ровно прежний id узла определения; вложенных инстансов в `locallyAddedNodes`
760
+ // v15 хранить не мог, поэтому запрещённых значений в старых документах не бывает.
761
+ migrated.schemaVersion = CURRENT_SCHEMA_VERSION;
762
+ assertProjectDocument(migrated);
763
+ return migrated;
764
+ }
384
765
  function canonicalizeJson(value) {
385
766
  if (Array.isArray(value))
386
767
  return value.map(canonicalizeJson);
@@ -391,4 +772,5 @@ function canonicalizeJson(value) {
391
772
  export function serializeProjectDocument(document) { assertProjectDocument(document); return `${JSON.stringify(canonicalizeJson(document))}\n`; }
392
773
  export * from "./assetPaths.js";
393
774
  export * from "./manifest.js";
775
+ export * from "./prefabs.js";
394
776
  //# sourceMappingURL=index.js.map