@pairdraw/scene-graph 0.20.0 → 0.21.1
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/color/index.d.ts +28 -7
- package/dist/color/index.d.ts.map +1 -1
- package/dist/color/index.js +40 -15
- package/dist/color/index.js.map +1 -1
- package/dist/color/management.d.ts +19 -6
- package/dist/color/management.d.ts.map +1 -1
- package/dist/color/management.js +56 -1
- package/dist/color/management.js.map +1 -1
- package/dist/color/profile.d.ts +32 -0
- package/dist/color/profile.d.ts.map +1 -0
- package/dist/color/profile.js +140 -0
- package/dist/color/profile.js.map +1 -0
- package/dist/comments/index.d.ts +2 -2
- package/dist/comments/index.js +2 -2
- package/dist/comments/merge.d.ts.map +1 -1
- package/dist/comments/merge.js +1 -0
- package/dist/comments/merge.js.map +1 -1
- package/dist/comments/schema.d.ts +3 -1
- package/dist/comments/schema.d.ts.map +1 -1
- package/dist/comments/schema.js +19 -2
- package/dist/comments/schema.js.map +1 -1
- package/dist/comments/threads.d.ts +3 -1
- package/dist/comments/threads.d.ts.map +1 -1
- package/dist/comments/threads.js +2 -1
- package/dist/comments/threads.js.map +1 -1
- package/dist/components/properties.d.ts.map +1 -1
- package/dist/components/properties.js +7 -7
- package/dist/components/properties.js.map +1 -1
- package/dist/css/shadows.d.ts +2 -2
- package/dist/css/shadows.d.ts.map +1 -1
- package/dist/css/shadows.js +4 -4
- package/dist/css/shadows.js.map +1 -1
- package/dist/css/values.d.ts +7 -2
- package/dist/css/values.d.ts.map +1 -1
- package/dist/css/values.js +8 -4
- package/dist/css/values.js.map +1 -1
- package/dist/empty-values.js +9 -0
- package/dist/empty-values.js.map +1 -1
- package/dist/graph.d.ts +4 -0
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +11 -2
- package/dist/graph.js.map +1 -1
- package/dist/images.d.ts +3 -2
- package/dist/images.d.ts.map +1 -1
- package/dist/images.js +18 -2
- package/dist/images.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/instances/copies.js +2 -1
- package/dist/instances/copies.js.map +1 -1
- package/dist/instances/index.d.ts.map +1 -1
- package/dist/instances/index.js +12 -11
- package/dist/instances/index.js.map +1 -1
- package/dist/instances/overrides.d.ts +15 -1
- package/dist/instances/overrides.d.ts.map +1 -1
- package/dist/instances/overrides.js +37 -1
- package/dist/instances/overrides.js.map +1 -1
- package/dist/instances/swap-overrides.js +3 -3
- package/dist/instances/swap-overrides.js.map +1 -1
- package/dist/instances/sync.js +9 -7
- package/dist/instances/sync.js.map +1 -1
- package/dist/node-defaults.js +2 -2
- package/dist/node-defaults.js.map +1 -1
- package/dist/plugin-data/fields.d.ts +15 -0
- package/dist/plugin-data/fields.d.ts.map +1 -1
- package/dist/plugin-data/fields.js +15 -23
- package/dist/plugin-data/fields.js.map +1 -1
- package/dist/plugin-data/index.d.ts +2 -2
- package/dist/plugin-data/index.js +2 -2
- package/dist/plugin-data/schema.d.ts +6 -1
- package/dist/plugin-data/schema.d.ts.map +1 -1
- package/dist/plugin-data/schema.js +24 -1
- package/dist/plugin-data/schema.js.map +1 -1
- package/dist/shaders/animation.d.ts +21 -0
- package/dist/shaders/animation.d.ts.map +1 -0
- package/dist/shaders/animation.js +25 -0
- package/dist/shaders/animation.js.map +1 -0
- package/dist/shaders/index.d.ts +2 -1
- package/dist/shaders/index.js +2 -1
- package/dist/slots/content.d.ts.map +1 -1
- package/dist/slots/content.js +4 -4
- package/dist/slots/content.js.map +1 -1
- package/dist/statuses/index.d.ts +2 -2
- package/dist/statuses/index.js +2 -2
- package/dist/statuses/workflow.d.ts +3 -1
- package/dist/statuses/workflow.d.ts.map +1 -1
- package/dist/statuses/workflow.js +6 -2
- package/dist/statuses/workflow.js.map +1 -1
- package/dist/transfer/variables.d.ts.map +1 -1
- package/dist/transfer/variables.js +1 -1
- package/dist/transfer/variables.js.map +1 -1
- package/dist/types.d.ts +34 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/variables/bindings.d.ts +6 -5
- package/dist/variables/bindings.d.ts.map +1 -1
- package/dist/variables/bindings.js +24 -16
- package/dist/variables/bindings.js.map +1 -1
- package/dist/variables/formula/index.d.ts.map +1 -1
- package/dist/variables/formula/index.js +12 -6
- package/dist/variables/formula/index.js.map +1 -1
- package/dist/variables/index.d.ts +14 -1
- package/dist/variables/index.d.ts.map +1 -1
- package/dist/variables/index.js +38 -10
- package/dist/variables/index.js.map +1 -1
- package/dist/variables/paints.d.ts +9 -8
- package/dist/variables/paints.d.ts.map +1 -1
- package/dist/variables/paints.js +35 -26
- package/dist/variables/paints.js.map +1 -1
- package/dist/variables/resolver.d.ts +45 -0
- package/dist/variables/resolver.d.ts.map +1 -0
- package/dist/variables/resolver.js +106 -0
- package/dist/variables/resolver.js.map +1 -0
- package/package.json +1 -1
- package/src/color/index.ts +43 -9
- package/src/color/management.ts +54 -1
- package/src/color/profile.ts +131 -0
- package/src/comments/merge.ts +3 -0
- package/src/comments/schema.ts +32 -2
- package/src/comments/threads.ts +5 -2
- package/src/components/properties.ts +13 -7
- package/src/css/shadows.ts +8 -5
- package/src/css/values.ts +12 -5
- package/src/empty-values.ts +16 -0
- package/src/graph.ts +13 -1
- package/src/images.ts +27 -3
- package/src/instances/copies.ts +2 -1
- package/src/instances/index.ts +19 -11
- package/src/instances/overrides.ts +49 -0
- package/src/instances/swap-overrides.ts +3 -2
- package/src/instances/sync.ts +11 -7
- package/src/node-defaults.ts +2 -2
- package/src/plugin-data/fields.ts +16 -31
- package/src/plugin-data/index.ts +1 -0
- package/src/plugin-data/schema.ts +30 -0
- package/src/shaders/animation.ts +39 -0
- package/src/shaders/index.ts +1 -0
- package/src/slots/content.ts +8 -4
- package/src/statuses/workflow.ts +6 -4
- package/src/transfer/variables.ts +2 -1
- package/src/types.ts +30 -1
- package/src/variables/bindings.ts +35 -18
- package/src/variables/formula/index.ts +19 -18
- package/src/variables/index.ts +49 -10
- package/src/variables/paints.ts +64 -29
- package/src/variables/resolver.ts +178 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","names":[],"sources":["../../src/shaders/animation.ts"],"mappings":";;;;;;UAMiB;EACf;EACA;;;KAIU,gBAAgB,iBAAiB;;;;;;iBAwB7B,eAAe,QAAQ,cAAc,QAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/shaders/animation.ts
|
|
2
|
+
/**
|
|
3
|
+
* Whether `component` draws a picture that changes with time. An effect missing from the
|
|
4
|
+
* library's metadata counts as animated, so a newer effect plays rather than freezing; `speed: 0`
|
|
5
|
+
* and an `animated` switch turned off stop it.
|
|
6
|
+
*/
|
|
7
|
+
function componentAnimates(component, motion) {
|
|
8
|
+
const props = component.props ?? {};
|
|
9
|
+
if (props.animated === true) return true;
|
|
10
|
+
const known = motion(component.type);
|
|
11
|
+
if (typeof props.speed === "number" ? props.speed !== 0 : known === void 0 || known.animates || known.speed) return true;
|
|
12
|
+
return (component.children ?? []).some((child) => componentAnimates(child, motion));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Whether `preset` changes between frames: any of its effects animates. A preset of still
|
|
16
|
+
* effects, or one whose animated effects are all at `speed: 0`, draws one picture forever and
|
|
17
|
+
* does not need a player.
|
|
18
|
+
*/
|
|
19
|
+
function presetAnimates(preset, motion) {
|
|
20
|
+
return preset.components.some((component) => componentAnimates(component, motion));
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { presetAnimates };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.js","names":[],"sources":["../../src/shaders/animation.ts"],"sourcesContent":["import type { ShaderComponent, ShaderPreset } from './schema'\n\n/**\n * What the library says of an effect's motion: whether it is driven by time, and whether a\n * `speed` prop of its own decides how fast it moves.\n */\nexport interface ShaderEffectMotion {\n animates: boolean\n speed: boolean\n}\n\n/** What the caller knows of an effect's motion, or undefined for an effect it does not know yet. */\nexport type ShaderMotion = (type: string) => ShaderEffectMotion | undefined\n\n/**\n * Whether `component` draws a picture that changes with time. An effect missing from the\n * library's metadata counts as animated, so a newer effect plays rather than freezing; `speed: 0`\n * and an `animated` switch turned off stop it.\n */\nfunction componentAnimates(component: ShaderComponent, motion: ShaderMotion): boolean {\n const props = component.props ?? {}\n if (props.animated === true) return true\n const known = motion(component.type)\n const moves =\n typeof props.speed === 'number'\n ? props.speed !== 0\n : known === undefined || known.animates || known.speed\n if (moves) return true\n return (component.children ?? []).some((child) => componentAnimates(child, motion))\n}\n\n/**\n * Whether `preset` changes between frames: any of its effects animates. A preset of still\n * effects, or one whose animated effects are all at `speed: 0`, draws one picture forever and\n * does not need a player.\n */\nexport function presetAnimates(preset: ShaderPreset, motion: ShaderMotion): boolean {\n return preset.components.some((component) => componentAnimates(component, motion))\n}\n"],"mappings":";;;;;;AAmBA,SAAS,kBAAkB,WAA4B,QAA+B;CACpF,MAAM,QAAQ,UAAU,SAAS,CAAC;CAClC,IAAI,MAAM,aAAa,MAAM,OAAO;CACpC,MAAM,QAAQ,OAAO,UAAU,IAAI;CAKnC,IAHE,OAAO,MAAM,UAAU,WACnB,MAAM,UAAU,IAChB,UAAU,KAAA,KAAa,MAAM,YAAY,MAAM,OAC1C,OAAO;CAClB,QAAQ,UAAU,YAAY,CAAC,EAAA,CAAG,MAAM,UAAU,kBAAkB,OAAO,MAAM,CAAC;AACpF;;;;;;AAOA,SAAgB,eAAe,QAAsB,QAA+B;CAClF,OAAO,OAAO,WAAW,MAAM,cAAc,kBAAkB,WAAW,MAAM,CAAC;AACnF"}
|
package/dist/shaders/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ShaderComponent, ShaderPaint, ShaderPreset, ShaderPresetPaint, ShaderSourcePaint, ShaderUniformValue, shaderPaintSchema, shaderPresetPaintSchema, shaderPresetSchema, shaderSourcePaintSchema, shaderUniformValueSchema } from "./schema.js";
|
|
2
|
+
import { ShaderEffectMotion, ShaderMotion, presetAnimates } from "./animation.js";
|
|
2
3
|
import { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, ShaderAutomaticInput, ShaderUniform, ShaderUniformKind, ShaderUniforms, parseShaderUniforms } from "./directives.js";
|
|
3
4
|
import { createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, readShaderPaints, shaderFrameKey, shaderOfPaint, shaderPresetKey, shaderSourceKey, withShaderPaints } from "./model.js";
|
|
4
5
|
import { ShaderFrameEncoding, shaderFrameEncoding, shaderFramePixels } from "./still.js";
|
|
5
|
-
export { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, ShaderAutomaticInput, ShaderComponent, ShaderFrameEncoding, ShaderPaint, ShaderPreset, ShaderPresetPaint, ShaderSourcePaint, ShaderUniform, ShaderUniformKind, ShaderUniformValue, ShaderUniforms, createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, parseShaderUniforms, readShaderPaints, shaderFrameEncoding, shaderFrameKey, shaderFramePixels, shaderOfPaint, shaderPaintSchema, shaderPresetKey, shaderPresetPaintSchema, shaderPresetSchema, shaderSourceKey, shaderSourcePaintSchema, shaderUniformValueSchema, withShaderPaints };
|
|
6
|
+
export { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, ShaderAutomaticInput, ShaderComponent, ShaderEffectMotion, ShaderFrameEncoding, ShaderMotion, ShaderPaint, ShaderPreset, ShaderPresetPaint, ShaderSourcePaint, ShaderUniform, ShaderUniformKind, ShaderUniformValue, ShaderUniforms, createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, parseShaderUniforms, presetAnimates, readShaderPaints, shaderFrameEncoding, shaderFrameKey, shaderFramePixels, shaderOfPaint, shaderPaintSchema, shaderPresetKey, shaderPresetPaintSchema, shaderPresetSchema, shaderSourceKey, shaderSourcePaintSchema, shaderUniformValueSchema, withShaderPaints };
|
package/dist/shaders/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { shaderPaintSchema, shaderPresetPaintSchema, shaderPresetSchema, shaderSourcePaintSchema, shaderUniformValueSchema } from "./schema.js";
|
|
2
2
|
import { createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, readShaderPaints, shaderFrameKey, shaderOfPaint, shaderPresetKey, shaderSourceKey, withShaderPaints } from "./model.js";
|
|
3
|
+
import { presetAnimates } from "./animation.js";
|
|
3
4
|
import { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, parseShaderUniforms } from "./directives.js";
|
|
4
5
|
import { shaderFrameEncoding, shaderFramePixels } from "./still.js";
|
|
5
|
-
export { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, parseShaderUniforms, readShaderPaints, shaderFrameEncoding, shaderFrameKey, shaderFramePixels, shaderOfPaint, shaderPaintSchema, shaderPresetKey, shaderPresetPaintSchema, shaderPresetSchema, shaderSourceKey, shaderSourcePaintSchema, shaderUniformValueSchema, withShaderPaints };
|
|
6
|
+
export { SHADER_MAX_UNIFORMS, SHADER_MAX_UNIFORM_FLOATS, SHADER_SOURCE_MAX_BYTES, createShaderPaint, createShaderSourcePaint, hasShaderPaint, isShaderFrameCurrent, isShaderPresetPaint, isShaderSourcePaint, parseShaderUniforms, presetAnimates, readShaderPaints, shaderFrameEncoding, shaderFrameKey, shaderFramePixels, shaderOfPaint, shaderPaintSchema, shaderPresetKey, shaderPresetPaintSchema, shaderPresetSchema, shaderSourceKey, shaderSourcePaintSchema, shaderUniformValueSchema, withShaderPaints };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","names":[],"sources":["../../src/slots/content.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"content.d.ts","names":[],"sources":["../../src/slots/content.ts"],"mappings":";;;;;;;;;;KAmBY;EACN;;EACA;EAAc,OAAO;EAAW,UAAU;EAAW;;EACrD;EAAgB,OAAO;;iBAQb,UAAU,OAAO,YAAY,mBAAmB;;;;;;iBAiChD,iBACd,OAAO,YACP,OAAO,QAAQ;EAAa;;;iBAwCd,iBACd,OAAO,YACP,OAAO,QAAQ;EAAa;;;iBAcd,iBACd,OAAO,YACP,OAAO,QAAQ;EAAa"}
|
package/dist/slots/content.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getInstanceOverride, setInstanceOverride } from "../instances/overrides.js";
|
|
1
|
+
import { getInstanceOverride, ownInstanceOverrides, setInstanceOverride } from "../instances/overrides.js";
|
|
2
2
|
import { isGeneratedFrame } from "../generated/index.js";
|
|
3
3
|
import { ownsSlotContent, slotPropertyId } from "./frames.js";
|
|
4
4
|
import { applyBoundPaintColorsIn } from "../variables/paints.js";
|
|
@@ -45,7 +45,7 @@ function descendants(graph, node, enterInstances) {
|
|
|
45
45
|
function claimSlotContent(graph, scope) {
|
|
46
46
|
const { frame, instance, propertyId } = scope;
|
|
47
47
|
if (ownsSlotContent(graph, frame, propertyId)) return;
|
|
48
|
-
const overrides = instance
|
|
48
|
+
const overrides = ownInstanceOverrides(instance);
|
|
49
49
|
for (const node of descendants(graph, frame, false)) {
|
|
50
50
|
overrides.descendants.delete(node.id);
|
|
51
51
|
if (node.type !== "INSTANCE") {
|
|
@@ -55,10 +55,10 @@ function claimSlotContent(graph, scope) {
|
|
|
55
55
|
for (const inner of descendants(graph, node, true)) {
|
|
56
56
|
const fields = overrides.descendants.get(inner.id);
|
|
57
57
|
if (!fields) continue;
|
|
58
|
-
for (const [field, value] of fields) if (field !== "sourceComponentId") setInstanceOverride(node
|
|
58
|
+
for (const [field, value] of fields) if (field !== "sourceComponentId") setInstanceOverride(ownInstanceOverrides(node), node.id, inner.id, field, value);
|
|
59
59
|
overrides.descendants.delete(inner.id);
|
|
60
60
|
}
|
|
61
|
-
graph.updateNode(node.id, { instanceOverrides: node
|
|
61
|
+
graph.updateNode(node.id, { instanceOverrides: ownInstanceOverrides(node) });
|
|
62
62
|
}
|
|
63
63
|
graph.updateNode(instance.id, {
|
|
64
64
|
instanceOverrides: overrides,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","names":[],"sources":["../../src/slots/content.ts"],"sourcesContent":["import { isGeneratedFrame } from '../generated'\nimport type { SceneGraph } from '../graph'\nimport {
|
|
1
|
+
{"version":3,"file":"content.js","names":[],"sources":["../../src/slots/content.ts"],"sourcesContent":["import { isGeneratedFrame } from '../generated'\nimport type { SceneGraph } from '../graph'\nimport {\n getInstanceOverride,\n ownInstanceOverrides,\n setInstanceOverride\n} from '../instances/overrides'\nimport { cloneChildrenWithMapping } from '../instances/sync'\nimport type { SceneNode } from '../types'\nimport { applyBoundPaintColorsIn } from '../variables/paints'\nimport { ownsSlotContent, slotPropertyId } from './frames'\n\n/**\n * Where layers may be added, moved, or removed under a parent:\n * - `free`: outside any instance, or inside a component definition;\n * - `slot`: inside a slot of an instance, whose content the instance owns or can claim;\n * - `locked`: anywhere else inside an instance, whose layers come from its component, or inside a\n * generated frame such as a sticky note, whose layers come from its template.\n */\nexport type SlotScope =\n | { kind: 'free' }\n | { kind: 'slot'; frame: SceneNode; instance: SceneNode; propertyId: string }\n | { kind: 'locked'; owner: SceneNode }\n\nfunction nearestInstance(graph: SceneGraph, node: SceneNode): SceneNode | undefined {\n return node.parentId\n ? graph.closest(node.parentId, (current) => current.type === 'INSTANCE')\n : undefined\n}\n\nexport function slotScope(graph: SceneGraph, parentId: string): SlotScope {\n const owner = graph.closest(\n parentId,\n (current) =>\n !!slotPropertyId(current) || current.type === 'INSTANCE' || isGeneratedFrame(current)\n )\n if (!owner) return { kind: 'free' }\n const propertyId = slotPropertyId(owner)\n if (!propertyId) return { kind: 'locked', owner }\n const instance = nearestInstance(graph, owner)\n return instance ? { kind: 'slot', frame: owner, instance, propertyId } : { kind: 'free' }\n}\n\n/** Every layer below `node`; `enterInstances` also walks the layers of nested instances. */\nfunction descendants(graph: SceneGraph, node: SceneNode, enterInstances: boolean): SceneNode[] {\n const result: SceneNode[] = []\n const visit = (parent: SceneNode): void => {\n for (const childId of parent.childIds) {\n const child = graph.nodes.get(childId)\n if (!child) continue\n result.push(child)\n if (enterInstances || child.type !== 'INSTANCE') visit(child)\n }\n }\n visit(node)\n return result\n}\n\n/**\n * Make the instance own its slot's content, as Figma does on the first edit: the layers\n * stay where they are, but stop following the component. Overrides the instance held for\n * them become their own values, or move to the nested instance they belong to.\n */\nexport function claimSlotContent(\n graph: SceneGraph,\n scope: Extract<SlotScope, { kind: 'slot' }>\n): void {\n const { frame, instance, propertyId } = scope\n if (ownsSlotContent(graph, frame, propertyId)) return\n const overrides = ownInstanceOverrides(instance)\n for (const node of descendants(graph, frame, false)) {\n overrides.descendants.delete(node.id)\n if (node.type !== 'INSTANCE') {\n graph.updateNode(node.id, { componentId: null })\n continue\n }\n // A nested instance keeps the overrides its former owner applied inside it.\n for (const inner of descendants(graph, node, true)) {\n const fields = overrides.descendants.get(inner.id)\n if (!fields) continue\n for (const [field, value] of fields)\n if (field !== 'sourceComponentId')\n setInstanceOverride(ownInstanceOverrides(node), node.id, inner.id, field, value)\n overrides.descendants.delete(inner.id)\n }\n graph.updateNode(node.id, { instanceOverrides: ownInstanceOverrides(node) })\n }\n graph.updateNode(instance.id, {\n instanceOverrides: overrides,\n componentPropertyAssignments: { ...instance.componentPropertyAssignments, [propertyId]: '' }\n })\n}\n\n/** The component layer an instance layer was cloned from. */\nfunction componentSource(instance: SceneNode, node: SceneNode): string | null {\n const mapped = getInstanceOverride(\n instance.instanceOverrides,\n instance.id,\n node.id,\n 'sourceComponentId'\n )\n return typeof mapped === 'string' ? mapped : node.componentId\n}\n\n/** Return the slot to its component's content: the instance stops owning it. */\nexport function resetSlotContent(\n graph: SceneGraph,\n scope: Extract<SlotScope, { kind: 'slot' }>\n): void {\n const { frame, instance, propertyId } = scope\n for (const childId of Array.from(frame.childIds)) graph.deleteNode(childId)\n const assignments = { ...instance.componentPropertyAssignments }\n Reflect.deleteProperty(assignments, propertyId)\n graph.updateNode(instance.id, { componentPropertyAssignments: assignments })\n const source = componentSource(instance, frame)\n if (!source || !graph.nodes.has(source)) return\n cloneChildrenWithMapping(graph, source, frame.id)\n for (const childId of frame.childIds) applyBoundPaintColorsIn(graph, childId)\n}\n\n/** Remove everything from the slot; the instance keeps owning it, now empty. */\nexport function clearSlotContent(\n graph: SceneGraph,\n scope: Extract<SlotScope, { kind: 'slot' }>\n): void {\n claimSlotContent(graph, scope)\n for (const childId of Array.from(scope.frame.childIds)) graph.deleteNode(childId)\n}\n"],"mappings":";;;;;;AAwBA,SAAS,gBAAgB,OAAmB,MAAwC;CAClF,OAAO,KAAK,WACR,MAAM,QAAQ,KAAK,WAAW,YAAY,QAAQ,SAAS,UAAU,IACrE,KAAA;AACN;AAEA,SAAgB,UAAU,OAAmB,UAA6B;CACxE,MAAM,QAAQ,MAAM,QAClB,WACC,YACC,CAAC,CAAC,eAAe,OAAO,KAAK,QAAQ,SAAS,cAAc,iBAAiB,OAAO,CACxF;CACA,IAAI,CAAC,OAAO,OAAO,EAAE,MAAM,OAAO;CAClC,MAAM,aAAa,eAAe,KAAK;CACvC,IAAI,CAAC,YAAY,OAAO;EAAE,MAAM;EAAU;CAAM;CAChD,MAAM,WAAW,gBAAgB,OAAO,KAAK;CAC7C,OAAO,WAAW;EAAE,MAAM;EAAQ,OAAO;EAAO;EAAU;CAAW,IAAI,EAAE,MAAM,OAAO;AAC1F;;AAGA,SAAS,YAAY,O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AO,OAAO,WAAW,WAAW,SAAS,KAAK;AACpD;;AAGA,SAAgB,iBACd,OACA,OACM;CACN,MAAM,EAAE,OAAO,UAAU,eAAe;CACxC,KAAK,MAAM,WAAW,MAAM,KAAK,MAAM,QAAQ,GAAG,MAAM,WAAW,OAAO;CAC1E,MAAM,cAAc,EAAE,GAAG,SAAS,6BAA6B;CAC/D,QAAQ,eAAe,aAAa,UAAU;CAC9C,MAAM,WAAW,SAAS,IAAI,EAAE,8BAA8B,YAAY,CAAC;CAC3E,MAAM,SAAS,gBAAgB,UAAU,KAAK;CAC9C,IAAI,CAAC,UAAU,CAAC,MAAM,MAAM,IAAI,MAAM,GAAG;CACzC,yBAAyB,OAAO,QAAQ,MAAM,EAAE;CAChD,KAAK,MAAM,WAAW,MAAM,UAAU,wBAAwB,OAAO,OAAO;AAC9E;;AAGA,SAAgB,iBACd,OACA,OACM;CACN,iBAAiB,OAAO,KAAK;CAC7B,KAAK,MAAM,WAAW,MAAM,KAAK,MAAM,MAAM,QAAQ,GAAG,MAAM,WAAW,OAAO;AAClF"}
|
package/dist/statuses/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FIGMA_DEV_STATUSES, FigmaDevStatus, StatusState, StatusWorkflow, nodeStatusSchema, statusWorkflowSchema } from "./schema.js";
|
|
2
2
|
import { StatusWorkflowImpact, statusWorkflowImpact } from "./impact.js";
|
|
3
3
|
import { STATUS_NODE_TYPES, StatusPlacement, effectiveStatus, statusPlacement } from "./node.js";
|
|
4
|
-
import { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, StatusWorkflowPreset, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, shownStatusState, writeStatusWorkflow } from "./workflow.js";
|
|
5
|
-
export { FIGMA_DEV_STATUSES, FIGMA_STATUS_STATE_IDS, FigmaDevStatus, STATUS_NODE_TYPES, STATUS_WORKFLOW_PRESETS, StatusPlacement, StatusState, StatusWorkflow, StatusWorkflowImpact, StatusWorkflowPreset, cachedStatusWorkflow, effectiveStatus, figmaDevStatusOf, findStatusState, nodeStatusSchema, readStatusWorkflow, shownStatusState, statusPlacement, statusWorkflowImpact, statusWorkflowSchema, writeStatusWorkflow };
|
|
4
|
+
import { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, StatusWorkflowPreset, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, writeStatusWorkflow } from "./workflow.js";
|
|
5
|
+
export { FIGMA_DEV_STATUSES, FIGMA_STATUS_STATE_IDS, FigmaDevStatus, STATUS_NODE_TYPES, STATUS_WORKFLOW_PRESETS, StatusPlacement, StatusState, StatusWorkflow, StatusWorkflowImpact, StatusWorkflowPreset, cachedStatusWorkflow, effectiveStatus, figmaDevStatusOf, findStatusState, nodeStatusSchema, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, statusPlacement, statusWorkflowImpact, statusWorkflowSchema, writeStatusWorkflow };
|
package/dist/statuses/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FIGMA_DEV_STATUSES, nodeStatusSchema, statusWorkflowSchema } from "./schema.js";
|
|
2
2
|
import { STATUS_NODE_TYPES, effectiveStatus, statusPlacement } from "./node.js";
|
|
3
|
-
import { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, shownStatusState, writeStatusWorkflow } from "./workflow.js";
|
|
3
|
+
import { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, writeStatusWorkflow } from "./workflow.js";
|
|
4
4
|
import { statusWorkflowImpact } from "./impact.js";
|
|
5
|
-
export { FIGMA_DEV_STATUSES, FIGMA_STATUS_STATE_IDS, STATUS_NODE_TYPES, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, effectiveStatus, figmaDevStatusOf, findStatusState, nodeStatusSchema, readStatusWorkflow, shownStatusState, statusPlacement, statusWorkflowImpact, statusWorkflowSchema, writeStatusWorkflow };
|
|
5
|
+
export { FIGMA_DEV_STATUSES, FIGMA_STATUS_STATE_IDS, STATUS_NODE_TYPES, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, effectiveStatus, figmaDevStatusOf, findStatusState, nodeStatusSchema, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, statusPlacement, statusWorkflowImpact, statusWorkflowSchema, writeStatusWorkflow };
|
|
@@ -99,6 +99,8 @@ type StatusWorkflowPreset = keyof typeof STATUS_WORKFLOW_PRESETS;
|
|
|
99
99
|
* Ready for dev and Completed read as statuses without setup.
|
|
100
100
|
*/
|
|
101
101
|
declare function readStatusWorkflow(graph: SceneGraph): StatusWorkflow;
|
|
102
|
+
/** The workflow the document stored, or `undefined` when it never chose one. */
|
|
103
|
+
declare function readStoredStatusWorkflow(graph: SceneGraph): StatusWorkflow | undefined;
|
|
102
104
|
/** Stores the workflow on the document node, as an undoable document change. */
|
|
103
105
|
declare function writeStatusWorkflow(graph: SceneGraph, workflow: StatusWorkflow): void;
|
|
104
106
|
/**
|
|
@@ -116,5 +118,5 @@ declare function cachedStatusWorkflow(graph: SceneGraph): StatusWorkflow;
|
|
|
116
118
|
/** The state a layer shows, if any. */
|
|
117
119
|
declare function shownStatusState(graph: SceneGraph, node: SceneNode): StatusState | null;
|
|
118
120
|
//#endregion
|
|
119
|
-
export { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, StatusWorkflowPreset, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, shownStatusState, writeStatusWorkflow };
|
|
121
|
+
export { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, StatusWorkflowPreset, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, writeStatusWorkflow };
|
|
120
122
|
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","names":[],"sources":["../../src/statuses/workflow.ts"],"mappings":";;;;;;;;;cAca;WAAA;WAAA;;;;;;cAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuBD,oCAAoC;;;;;iBAMhC,mBAAmB,OAAO,aAAa;;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","names":[],"sources":["../../src/statuses/workflow.ts"],"mappings":";;;;;;;;;cAca;WAAA;WAAA;;;;;;cAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuBD,oCAAoC;;;;;iBAMhC,mBAAmB,OAAO,aAAa;;iBAKvC,yBAAyB,OAAO,aAAa;;iBAK7C,oBAAoB,OAAO,YAAY,UAAU;;;;;iBAYjD,gBACd,UAAU,gBACV,kBACC;;iBAQa,iBAAiB,kBAAkB;;;;;iBAYnC,qBAAqB,OAAO,aAAa;;iBAUzC,iBAAiB,OAAO,YAAY,MAAM,YAAY"}
|
|
@@ -87,7 +87,11 @@ const STATUS_WORKFLOW_PRESETS = {
|
|
|
87
87
|
* Ready for dev and Completed read as statuses without setup.
|
|
88
88
|
*/
|
|
89
89
|
function readStatusWorkflow(graph) {
|
|
90
|
-
return
|
|
90
|
+
return readStoredStatusWorkflow(graph) ?? STATUS_WORKFLOW_PRESETS.handoff;
|
|
91
|
+
}
|
|
92
|
+
/** The workflow the document stored, or `undefined` when it never chose one. */
|
|
93
|
+
function readStoredStatusWorkflow(graph) {
|
|
94
|
+
return readPluginData(graph.getNode(graph.rootId)?.pluginData, statuses);
|
|
91
95
|
}
|
|
92
96
|
/** Stores the workflow on the document node, as an undoable document change. */
|
|
93
97
|
function writeStatusWorkflow(graph, workflow) {
|
|
@@ -130,6 +134,6 @@ function shownStatusState(graph, node) {
|
|
|
130
134
|
return id === null ? null : findStatusState(cachedStatusWorkflow(graph), id) ?? null;
|
|
131
135
|
}
|
|
132
136
|
//#endregion
|
|
133
|
-
export { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, shownStatusState, writeStatusWorkflow };
|
|
137
|
+
export { FIGMA_STATUS_STATE_IDS, STATUS_WORKFLOW_PRESETS, cachedStatusWorkflow, figmaDevStatusOf, findStatusState, readStatusWorkflow, readStoredStatusWorkflow, shownStatusState, writeStatusWorkflow };
|
|
134
138
|
|
|
135
139
|
//# sourceMappingURL=workflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","names":[],"sources":["../../src/statuses/workflow.ts"],"sourcesContent":["import { parseColor } from '../color'\nimport type { SceneGraph } from '../graph'\nimport { readPluginData, withPluginData } from '../plugin-data/field'\nimport { PAIRDRAW_PLUGIN_DATA } from '../plugin-data/fields'\nimport type { SceneNode } from '../types'\nimport { effectiveStatus } from './node'\nimport type { FigmaDevStatus, StatusState, StatusWorkflow } from './schema'\n\nconst { statuses } = PAIRDRAW_PLUGIN_DATA\n\n/**\n * The states Figma shows, by fixed id. Teams rename them as they like, but a `.fig` file's\n * Ready for dev and Completed always read back as these, without the document's workflow.\n */\nexport const FIGMA_STATUS_STATE_IDS = {\n READY_FOR_DEV: 'ready-for-dev',\n COMPLETED: 'completed'\n} as const satisfies Record<FigmaDevStatus, string>\n\nconst READY_FOR_DEV: StatusState = {\n id: FIGMA_STATUS_STATE_IDS.READY_FOR_DEV,\n name: 'Ready for dev',\n color: parseColor('#14ae5c')\n}\n\nconst COMPLETED: StatusState = {\n id: FIGMA_STATUS_STATE_IDS.COMPLETED,\n name: 'Completed',\n color: parseColor('#8a8a8a')\n}\n\n/**\n * Workflows to start from. Their states keep fixed ids, so a document using a preset, or no\n * workflow of its own, reads the same states back.\n */\nexport const STATUS_WORKFLOW_PRESETS = {\n handoff: { preset: 'handoff', states: [READY_FOR_DEV, COMPLETED] },\n simple: {\n preset: 'simple',\n states: [\n { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },\n { id: 'in-progress', name: 'In progress', color: parseColor('#0d99ff') },\n { ...COMPLETED, name: 'Done', color: parseColor('#14ae5c') }\n ]\n },\n review: {\n preset: 'review',\n states: [\n { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },\n { id: 'in-review', name: 'In review', color: parseColor('#9747ff') },\n { id: 'changes-requested', name: 'Changes requested', color: parseColor('#f24822') },\n { id: 'approved', name: 'Approved', color: parseColor('#0d99ff') },\n READY_FOR_DEV,\n { ...COMPLETED, name: 'Shipped' }\n ]\n }\n} as const satisfies Record<string, StatusWorkflow>\n\nexport type StatusWorkflowPreset = keyof typeof STATUS_WORKFLOW_PRESETS\n\n/**\n * The document's statuses. A document that never chose any has Figma's own, so a `.fig` file's\n * Ready for dev and Completed read as statuses without setup.\n */\nexport function readStatusWorkflow(graph: SceneGraph): StatusWorkflow {\n return (\n
|
|
1
|
+
{"version":3,"file":"workflow.js","names":[],"sources":["../../src/statuses/workflow.ts"],"sourcesContent":["import { parseColor } from '../color'\nimport type { SceneGraph } from '../graph'\nimport { readPluginData, withPluginData } from '../plugin-data/field'\nimport { PAIRDRAW_PLUGIN_DATA } from '../plugin-data/fields'\nimport type { SceneNode } from '../types'\nimport { effectiveStatus } from './node'\nimport type { FigmaDevStatus, StatusState, StatusWorkflow } from './schema'\n\nconst { statuses } = PAIRDRAW_PLUGIN_DATA\n\n/**\n * The states Figma shows, by fixed id. Teams rename them as they like, but a `.fig` file's\n * Ready for dev and Completed always read back as these, without the document's workflow.\n */\nexport const FIGMA_STATUS_STATE_IDS = {\n READY_FOR_DEV: 'ready-for-dev',\n COMPLETED: 'completed'\n} as const satisfies Record<FigmaDevStatus, string>\n\nconst READY_FOR_DEV: StatusState = {\n id: FIGMA_STATUS_STATE_IDS.READY_FOR_DEV,\n name: 'Ready for dev',\n color: parseColor('#14ae5c')\n}\n\nconst COMPLETED: StatusState = {\n id: FIGMA_STATUS_STATE_IDS.COMPLETED,\n name: 'Completed',\n color: parseColor('#8a8a8a')\n}\n\n/**\n * Workflows to start from. Their states keep fixed ids, so a document using a preset, or no\n * workflow of its own, reads the same states back.\n */\nexport const STATUS_WORKFLOW_PRESETS = {\n handoff: { preset: 'handoff', states: [READY_FOR_DEV, COMPLETED] },\n simple: {\n preset: 'simple',\n states: [\n { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },\n { id: 'in-progress', name: 'In progress', color: parseColor('#0d99ff') },\n { ...COMPLETED, name: 'Done', color: parseColor('#14ae5c') }\n ]\n },\n review: {\n preset: 'review',\n states: [\n { id: 'draft', name: 'Draft', color: parseColor('#b3b3b3') },\n { id: 'in-review', name: 'In review', color: parseColor('#9747ff') },\n { id: 'changes-requested', name: 'Changes requested', color: parseColor('#f24822') },\n { id: 'approved', name: 'Approved', color: parseColor('#0d99ff') },\n READY_FOR_DEV,\n { ...COMPLETED, name: 'Shipped' }\n ]\n }\n} as const satisfies Record<string, StatusWorkflow>\n\nexport type StatusWorkflowPreset = keyof typeof STATUS_WORKFLOW_PRESETS\n\n/**\n * The document's statuses. A document that never chose any has Figma's own, so a `.fig` file's\n * Ready for dev and Completed read as statuses without setup.\n */\nexport function readStatusWorkflow(graph: SceneGraph): StatusWorkflow {\n return readStoredStatusWorkflow(graph) ?? STATUS_WORKFLOW_PRESETS.handoff\n}\n\n/** The workflow the document stored, or `undefined` when it never chose one. */\nexport function readStoredStatusWorkflow(graph: SceneGraph): StatusWorkflow | undefined {\n return readPluginData(graph.getNode(graph.rootId)?.pluginData, statuses)\n}\n\n/** Stores the workflow on the document node, as an undoable document change. */\nexport function writeStatusWorkflow(graph: SceneGraph, workflow: StatusWorkflow): void {\n const root = graph.getNode(graph.rootId)\n if (!root) return\n graph.updateNode(root.id, {\n pluginData: withPluginData(root.pluginData, statuses, structuredClone(workflow))\n })\n}\n\n/**\n * The state `stateId` names: the workflow's own, or Figma's when the workflow has no such state,\n * as a `.fig` file's Ready for dev reads in a document whose team removed it.\n */\nexport function findStatusState(\n workflow: StatusWorkflow,\n stateId: string\n): StatusState | undefined {\n return (\n workflow.states.find((state) => state.id === stateId) ??\n STATUS_WORKFLOW_PRESETS.handoff.states.find((state) => state.id === stateId)\n )\n}\n\n/** The Figma status a state shows as in Figma and the Plugin API's `devStatus`, if any. */\nexport function figmaDevStatusOf(stateId: string): FigmaDevStatus | null {\n if (stateId === FIGMA_STATUS_STATE_IDS.READY_FOR_DEV) return 'READY_FOR_DEV'\n if (stateId === FIGMA_STATUS_STATE_IDS.COMPLETED) return 'COMPLETED'\n return null\n}\n\nconst WORKFLOWS = new WeakMap<SceneGraph, { entries: unknown; workflow: StatusWorkflow }>()\n\n/**\n * The document's statuses, read once per change to the document node: canvas labels ask for\n * them on every frame.\n */\nexport function cachedStatusWorkflow(graph: SceneGraph): StatusWorkflow {\n const entries = graph.getNode(graph.rootId)?.pluginData\n const known = WORKFLOWS.get(graph)\n if (known && known.entries === entries) return known.workflow\n const workflow = readStatusWorkflow(graph)\n WORKFLOWS.set(graph, { entries, workflow })\n return workflow\n}\n\n/** The state a layer shows, if any. */\nexport function shownStatusState(graph: SceneGraph, node: SceneNode): StatusState | null {\n const id = effectiveStatus(graph, node)\n return id === null ? null : (findStatusState(cachedStatusWorkflow(graph), id) ?? null)\n}\n"],"mappings":";;;;;AAQA,MAAM,EAAE,aAAa;;;;;AAMrB,MAAa,yBAAyB;CACpC,eAAe;CACf,WAAW;AACb;AAEA,MAAM,gBAA6B;CACjC,IAAI,uBAAuB;CAC3B,MAAM;CACN,OAAO,WAAW,SAAS;AAC7B;AAEA,MAAM,YAAyB;CAC7B,IAAI,uBAAuB;CAC3B,MAAM;CACN,OAAO,WAAW,SAAS;AAC7B;;;;;AAMA,MAAa,0BAA0B;CACrC,SA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AO;CAC7D,IAAI,YAAY,uBAAuB,WAAW,OAAO;CACzD,OAAO;AACT;AAEA,MAAM,4BAAY,IAAI,QAAoE;;;;;AAM1F,SAAgB,qBAAqB,OAAmC;CACtE,MAAM,UAAU,MAAM,QAAQ,MAAM,MAAM,CAAC,EAAE;CAC7C,MAAM,QAAQ,UAAU,IAAI,KAAK;CACjC,IAAI,SAAS,MAAM,YAAY,SAAS,OAAO,MAAM;CACrD,MAAM,WAAW,mBAAmB,KAAK;CACzC,UAAU,IAAI,OAAO;EAAE;EAAS;CAAS,CAAC;CAC1C,OAAO;AACT;;AAGA,SAAgB,iBAAiB,OAAmB,MAAqC;CACvF,MAAM,KAAK,gBAAgB,OAAO,IAAI;CACtC,OAAO,OAAO,OAAO,OAAQ,gBAAgB,qBAAqB,KAAK,GAAG,EAAE,KAAK;AACnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","names":[],"sources":["../../src/transfer/variables.ts"],"mappings":";;UAIiB;EACf,WAAW;EACX,aAAa;EACb,OAAO;;;
|
|
1
|
+
{"version":3,"file":"variables.d.ts","names":[],"sources":["../../src/transfer/variables.ts"],"mappings":";;UAIiB;EACf,WAAW;EACX,aAAa;EACb,OAAO;;;iBAsCO,wBACd,oBAAoB,YACpB,sBAAsB,sBACtB,YAAY;EACT,WAAW;EAAY,aAAa"}
|
|
@@ -15,7 +15,7 @@ function assertResourceOwnership(variables, collections) {
|
|
|
15
15
|
}
|
|
16
16
|
for (const variable of variables) {
|
|
17
17
|
const collection = sets.get(variable.collectionId);
|
|
18
|
-
if (!collection
|
|
18
|
+
if (!collection || !variable.deleted && !collection.variableIds.includes(variable.id)) throw new Error(`Missing collection membership for ${variable.id}`);
|
|
19
19
|
const modes = new Set(collection.modes.map((mode) => mode.modeId));
|
|
20
20
|
for (const mode of Object.keys(variable.valuesByMode)) if (!modes.has(mode)) throw new Error(`Unknown mode ${mode} for ${variable.id}`);
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.js","names":["mapped"],"sources":["../../src/transfer/variables.ts"],"sourcesContent":["import type { Variable, VariableCollection, VariableValue } from '../types'\nimport { mapVariableValueReferences } from '../variables/value'\nimport { requireTransferReference as mapped } from './references'\n\nexport interface VariableTransferReferences {\n variables: ReadonlyMap<string, string>\n collections: ReadonlyMap<string, string>\n modes: ReadonlyMap<string, string>\n}\n\nfunction assertUniqueMappings(ids: ReadonlyMap<string, string>, kind: string): void {\n if (new Set(ids.values()).size !== ids.size)\n throw new Error(`Colliding ${kind} transfer mappings`)\n}\n\nfunction assertResourceOwnership(\n variables: readonly Variable[],\n collections: readonly VariableCollection[]\n): void {\n const sets = new Map(collections.map((collection) => [collection.id, collection]))\n const tokens = new Map(variables.map((variable) => [variable.id, variable]))\n if (sets.size !== collections.length || tokens.size !== variables.length)\n throw new Error('Duplicate source variable resource')\n for (const collection of collections) {\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n if (!modes.has(collection.defaultModeId) || modes.size !== collection.modes.length)\n throw new Error(`Invalid modes for collection ${collection.id}`)\n for (const id of collection.variableIds) {\n if (tokens.get(id)?.collectionId !== collection.id)\n throw new Error(`Invalid variable membership ${id} in ${collection.id}`)\n }\n }\n for (const variable of variables) {\n const collection = sets.get(variable.collectionId)\n if (!collection
|
|
1
|
+
{"version":3,"file":"variables.js","names":["mapped"],"sources":["../../src/transfer/variables.ts"],"sourcesContent":["import type { Variable, VariableCollection, VariableValue } from '../types'\nimport { mapVariableValueReferences } from '../variables/value'\nimport { requireTransferReference as mapped } from './references'\n\nexport interface VariableTransferReferences {\n variables: ReadonlyMap<string, string>\n collections: ReadonlyMap<string, string>\n modes: ReadonlyMap<string, string>\n}\n\nfunction assertUniqueMappings(ids: ReadonlyMap<string, string>, kind: string): void {\n if (new Set(ids.values()).size !== ids.size)\n throw new Error(`Colliding ${kind} transfer mappings`)\n}\n\nfunction assertResourceOwnership(\n variables: readonly Variable[],\n collections: readonly VariableCollection[]\n): void {\n const sets = new Map(collections.map((collection) => [collection.id, collection]))\n const tokens = new Map(variables.map((variable) => [variable.id, variable]))\n if (sets.size !== collections.length || tokens.size !== variables.length)\n throw new Error('Duplicate source variable resource')\n for (const collection of collections) {\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n if (!modes.has(collection.defaultModeId) || modes.size !== collection.modes.length)\n throw new Error(`Invalid modes for collection ${collection.id}`)\n for (const id of collection.variableIds) {\n if (tokens.get(id)?.collectionId !== collection.id)\n throw new Error(`Invalid variable membership ${id} in ${collection.id}`)\n }\n }\n for (const variable of variables) {\n const collection = sets.get(variable.collectionId)\n // A collection lists its live variables: a deleted one is kept out of the list (addVariable).\n if (!collection || (!variable.deleted && !collection.variableIds.includes(variable.id)))\n throw new Error(`Missing collection membership for ${variable.id}`)\n const modes = new Set(collection.modes.map((mode) => mode.modeId))\n for (const mode of Object.keys(variable.valuesByMode)) {\n if (!modes.has(mode)) throw new Error(`Unknown mode ${mode} for ${variable.id}`)\n }\n }\n}\n\n/** Prepare isolated resource copies; never mutate the source or destination graph. */\nexport function prepareVariableTransfer(\n variables: readonly Variable[],\n collections: readonly VariableCollection[],\n references: VariableTransferReferences\n): { variables: Variable[]; collections: VariableCollection[] } {\n assertResourceOwnership(variables, collections)\n assertUniqueMappings(references.variables, 'variable')\n assertUniqueMappings(references.collections, 'collection')\n assertUniqueMappings(references.modes, 'mode')\n const value = (input: VariableValue): VariableValue =>\n mapVariableValueReferences(\n input,\n (id) => mapped(references.variables, id, 'variable alias'),\n (id) => references.modes.get(id) ?? id\n )\n return {\n collections: collections.map((collection) => ({\n ...structuredClone(collection),\n id: mapped(references.collections, collection.id, 'collection'),\n defaultModeId: mapped(references.modes, collection.defaultModeId, 'mode'),\n modes: collection.modes.map((mode) => ({\n ...mode,\n modeId: mapped(references.modes, mode.modeId, 'mode')\n })),\n variableIds: collection.variableIds.map((id) => mapped(references.variables, id, 'variable'))\n })),\n variables: variables.map((variable) => ({\n ...structuredClone(variable),\n id: mapped(references.variables, variable.id, 'variable'),\n collectionId: mapped(references.collections, variable.collectionId, 'collection'),\n valuesByMode: Object.fromEntries(\n Object.entries(variable.valuesByMode).map(([mode, input]) => [\n mapped(references.modes, mode, 'mode'),\n value(input)\n ])\n )\n }))\n }\n}\n"],"mappings":";;;AAUA,SAAS,qBAAqB,KAAkC,MAAoB;CAClF,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,MACrC,MAAM,IAAI,MAAM,aAAa,KAAK,mBAAmB;AACzD;AAEA,SAAS,wBACP,WACA,aACM;CACN,MAAM,OAAO,IAAI,IAAI,YAAY,KAAK,eAAe,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC;CACjF,MAAM,SAAS,IAAI,IAAI,UAAU,KAAK,aAAa,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC;CAC3E,IAAI,KAAK,SAAS,YAAY,UAAU,OAAO,SAAS,UAAU,QAChE,MAAM,IAAI,MAAM,oCAAoC;CACtD,KAAK,MAAM,cAAc,aAAa;EACpC,MAAM,QAAQ,IAAI,IAAI,WAAW,MAAM,KAAK,SAAS,KAAK,MAAM,CAAC;EACjE,IAAI,CAAC,MAAM,IAAI,WAAW,aAAa,KAAK,MAAM,SAAS,WAAW,MAAM,QAC1E,MAAM,IAAI,MAAM,gCAAgC,WAAW,IAAI;EACjE,KAAK,MAAM,MAAM,WAAW,aAC1B,IAAI,OAAO,IAAI,EAAE,CAAC,EAAE,iBAAiB,WAAW,IAC9C,MAAM,IAAI,MAAM,+BAA+B,GAAG,MAAM,WAAW,IAAI;CAE7E;CACA,KAAK,MAAM,YAAY,WAAW;EAChC,MAAM,aAAa,KAAK,IAAI,SAAS,YAAY;EAEjD,IAAI,CAAC,cAAe,CAAC,SAAS,WAAW,CAAC,WAAW,YAAY,SAAS,SAAS,EAAE,GACnF,MAAM,IAAI,MAAM,qCAAqC,SAAS,IAAI;EACpE,MAAM,QAAQ,IAAI,IAAI,WAAW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 @@ interface NodeChangeObserver {
|
|
|
32
32
|
/** The wait ended, and what changed meanwhile belongs outside the edit. */
|
|
33
33
|
resume?: () => void;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* A color profile: the one a document's colors are stored in, or the one they are shown or
|
|
37
|
+
* exported in. Figma files are sRGB or Display P3.
|
|
38
|
+
*/
|
|
39
|
+
type ColorProfile = 'srgb' | 'display-p3';
|
|
40
|
+
/** @deprecated use `ColorProfile` */
|
|
41
|
+
type DocumentColorSpace = ColorProfile;
|
|
36
42
|
/** What a document is for, as Figma keeps design files and FigJam boards apart. */
|
|
37
43
|
type DocumentKind = 'design' | 'board';
|
|
38
44
|
interface FigmaSourcePayload {
|
|
@@ -518,6 +524,20 @@ interface CommentReply {
|
|
|
518
524
|
createdAt: string;
|
|
519
525
|
deleted?: boolean;
|
|
520
526
|
}
|
|
527
|
+
/** A stroke drawn over the commented area in Comment mode, kept with its thread. */
|
|
528
|
+
interface CommentRegion {
|
|
529
|
+
/** Stroke points, in canvas units relative to the thread's pin anchor. */
|
|
530
|
+
points: [number, number][];
|
|
531
|
+
/** Stroke width in canvas units. */
|
|
532
|
+
width: number;
|
|
533
|
+
/** Bounds of the stroke including its width, relative to the same anchor. */
|
|
534
|
+
bounds: {
|
|
535
|
+
minX: number;
|
|
536
|
+
minY: number;
|
|
537
|
+
maxX: number;
|
|
538
|
+
maxY: number;
|
|
539
|
+
};
|
|
540
|
+
}
|
|
521
541
|
/** A canvas comment thread, kept in the document's root plugin data. */
|
|
522
542
|
interface CommentThread {
|
|
523
543
|
id: string;
|
|
@@ -545,6 +565,8 @@ interface CommentThread {
|
|
|
545
565
|
resolvedAt?: string | null;
|
|
546
566
|
/** Deleted threads stay as tombstones so a stale copy cannot bring them back. */
|
|
547
567
|
deleted?: boolean;
|
|
568
|
+
/** The area the person circled, when the thread was drawn rather than pinned. */
|
|
569
|
+
region?: CommentRegion | null;
|
|
548
570
|
replies: CommentReply[];
|
|
549
571
|
}
|
|
550
572
|
/**
|
|
@@ -975,6 +997,11 @@ interface Variable {
|
|
|
975
997
|
key?: string;
|
|
976
998
|
/** Published library version (from NodeChange.version). Used for assetRef resolution in colorVar. */
|
|
977
999
|
version?: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* Deleted as Figma deletes a variable: gone from its collection's `variableIds` and from every
|
|
1002
|
+
* list of variables, while layers bound to it still resolve it and the file keeps it.
|
|
1003
|
+
*/
|
|
1004
|
+
deleted?: true;
|
|
978
1005
|
}
|
|
979
1006
|
/** Scalar numeric node fields accepted by numeric property controls. */
|
|
980
1007
|
type NumericNodeProperty = { [K in keyof SceneNode]-?: SceneNode[K] extends number ? K : never; }[keyof SceneNode];
|
|
@@ -1009,6 +1036,11 @@ interface VariableCollection {
|
|
|
1009
1036
|
key?: string;
|
|
1010
1037
|
/** Published library version, which references by key carry with it. */
|
|
1011
1038
|
version?: string;
|
|
1039
|
+
/**
|
|
1040
|
+
* Deleted as Figma deletes a collection: gone from every list of collections, with its variables
|
|
1041
|
+
* deleted too, while layers bound to them still resolve them and the file keeps them.
|
|
1042
|
+
*/
|
|
1043
|
+
deleted?: true;
|
|
1012
1044
|
}
|
|
1013
1045
|
/** Whether a collection is a library's copy, which takes no variables or modes of the file's. */
|
|
1014
1046
|
declare function isLibraryCollection(collection: Pick<VariableCollection, 'key'>): boolean;
|
|
@@ -1016,5 +1048,5 @@ declare function isLibraryCollection(collection: Pick<VariableCollection, 'key'>
|
|
|
1016
1048
|
declare const MODE_ATTRIBUTE_PATTERN: RegExp;
|
|
1017
1049
|
declare function isModeAttributeName(name: string): boolean;
|
|
1018
1050
|
//#endregion
|
|
1019
|
-
export { ArcData, AxisSizingMode, BlendMode, BooleanOperation, CODE_SYNTAX_PLATFORMS, CharacterStyleOverride, CodeSyntaxPlatform, CommentReply, CommentThread, ComponentPropertyDefinition, ComponentPropertyReference, ComponentPropertyReferenceField, ComponentPropertyType, ConnectorControlPoint, ConnectorEndpoint, ConnectorLabelPosition, ConnectorLineType, ConnectorMagnet, ConstraintType, DerivedTextGlyph, DocumentColorSpace, DocumentKind, DrawIOEdgeSource, Effect, EnabledLibraryBinding, ExportSetting, FigmaLayoutMetadata, FigmaSourcePayload, Fill, FillType, FontFeature, FontVariation, GeometryPath, GradientStop, GradientTransform, GridPosition, GridTrack, GridTrackSizing, HandleMirroring, HyperlinkTarget, ImageFilters, ImageScaleMode, LayoutAlign, LayoutAlignSelf, LayoutCounterAlign, LayoutDirection, LayoutGrid, LayoutMode, LayoutSizing, LayoutWrap, LeadingTrim, LibraryAssetIdentity, LibraryAssetSource, MODE_ATTRIBUTE_PATTERN, MaskType, MeshGradientPoint, NodeChangeObserver, NodeType, NoiseEffect, NoiseEffectParams, NoiseType, NumericNodeProperty, OverflowDirection, PatternAlignment, PatternTileType, PluginDataEntry, PluginRelaunchDataEntry, PrototypeAction, PrototypeActionType, PrototypeBackAction, PrototypeCloseAction, PrototypeEasingType, PrototypeNavigationType, PrototypeNodeAction, PrototypeOverlayPositionType, PrototypeReaction, PrototypeTransition, PrototypeTransitionType, PrototypeTrigger, PrototypeTriggerType, SceneGraphEventHandlers, SceneGraphEvents, SceneNode, ScrollBehavior, ShaderEffect, ShadowEffect, SharedStyle, SharedStyleKind, SharedStyleType, SlotSettings, SourceLibraryPublication, SourceMetadata, Stroke, StrokeCap, StrokeJoin, StyleRun, SymbolLink, TEXT_BINDABLE_FIELDS, TOKEN_UNITS, TextAlignVertical, TextAutoResize, TextBindableField, TextBoundVariables, TextCase, TextDecoration, TextDecorationStyle, TextDirection, TextLength, TextListType, TextParagraphSpacingField, TextParagraphStyle, TextPathData, TextureEffect, TextureEffectParams, TokenExpression, TokenUnit, VARIABLE_FORMULA_OPERATORS, VARIABLE_SCOPES, Variable, VariableAlias, VariableCollection, VariableCollectionMode, VariableColorExpression, VariableFormula, VariableFormulaNode, VariableFormulaOperation, VariableFormulaOperator, VariableLiteral, VariableModeMap, VariableScope, VariableType, VariableUnsupportedExpression, VariableValue, VariantPropSpec, VectorNetwork, VectorRegion, VectorSegment, VectorVertex, WindingRule, isLibraryCollection, isModeAttributeName };
|
|
1051
|
+
export { ArcData, AxisSizingMode, BlendMode, BooleanOperation, CODE_SYNTAX_PLATFORMS, CharacterStyleOverride, CodeSyntaxPlatform, ColorProfile, CommentRegion, CommentReply, CommentThread, ComponentPropertyDefinition, ComponentPropertyReference, ComponentPropertyReferenceField, ComponentPropertyType, ConnectorControlPoint, ConnectorEndpoint, ConnectorLabelPosition, ConnectorLineType, ConnectorMagnet, ConstraintType, DerivedTextGlyph, DocumentColorSpace, DocumentKind, DrawIOEdgeSource, Effect, EnabledLibraryBinding, ExportSetting, FigmaLayoutMetadata, FigmaSourcePayload, Fill, FillType, FontFeature, FontVariation, GeometryPath, GradientStop, GradientTransform, GridPosition, GridTrack, GridTrackSizing, HandleMirroring, HyperlinkTarget, ImageFilters, ImageScaleMode, LayoutAlign, LayoutAlignSelf, LayoutCounterAlign, LayoutDirection, LayoutGrid, LayoutMode, LayoutSizing, LayoutWrap, LeadingTrim, LibraryAssetIdentity, LibraryAssetSource, MODE_ATTRIBUTE_PATTERN, MaskType, MeshGradientPoint, NodeChangeObserver, NodeType, NoiseEffect, NoiseEffectParams, NoiseType, NumericNodeProperty, OverflowDirection, PatternAlignment, PatternTileType, PluginDataEntry, PluginRelaunchDataEntry, PrototypeAction, PrototypeActionType, PrototypeBackAction, PrototypeCloseAction, PrototypeEasingType, PrototypeNavigationType, PrototypeNodeAction, PrototypeOverlayPositionType, PrototypeReaction, PrototypeTransition, PrototypeTransitionType, PrototypeTrigger, PrototypeTriggerType, SceneGraphEventHandlers, SceneGraphEvents, SceneNode, ScrollBehavior, ShaderEffect, ShadowEffect, SharedStyle, SharedStyleKind, SharedStyleType, SlotSettings, SourceLibraryPublication, SourceMetadata, Stroke, StrokeCap, StrokeJoin, StyleRun, SymbolLink, TEXT_BINDABLE_FIELDS, TOKEN_UNITS, TextAlignVertical, TextAutoResize, TextBindableField, TextBoundVariables, TextCase, TextDecoration, TextDecorationStyle, TextDirection, TextLength, TextListType, TextParagraphSpacingField, TextParagraphStyle, TextPathData, TextureEffect, TextureEffectParams, TokenExpression, TokenUnit, VARIABLE_FORMULA_OPERATORS, VARIABLE_SCOPES, Variable, VariableAlias, VariableCollection, VariableCollectionMode, VariableColorExpression, VariableFormula, VariableFormulaNode, VariableFormulaOperation, VariableFormulaOperator, VariableLiteral, VariableModeMap, VariableScope, VariableType, VariableUnsupportedExpression, VariableValue, VariantPropSpec, VectorNetwork, VectorRegion, VectorSegment, VectorVertex, WindingRule, isLibraryCollection, isModeAttributeName };
|
|
1020
1052
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;UASiB;EACf,iBAAiB,MAAM;EACvB,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,wBAAwB,YAAY,SAAS,QAAQ;EACrD,iBAAiB,YAAY;EAC7B,oBAAoB,gBAAgB,4BAA4B;EAChE,mBACE,gBACA,kBACA,eACA;;KAIQ,0BAA0B;EACpC,UAAU,MAAM;EAChB,UAAU,YAAY,SAAS,QAAQ;EACvC,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,UAAU,YAAY;EACtB,aAAa,gBAAgB,4BAA4B;EACzD,YACE,gBACA,kBACA,eACA;;;UAKa;;EAEf,SAAS,MAAM;;EAEf,UAAU,MAAM;;EAEhB;;EAEA;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;UASiB;EACf,iBAAiB,MAAM;EACvB,iBAAiB,YAAY,SAAS,QAAQ;EAC9C,wBAAwB,YAAY,SAAS,QAAQ;EACrD,iBAAiB,YAAY;EAC7B,oBAAoB,gBAAgB,4BAA4B;EAChE,mBACE,gBACA,kBACA,eACA;;KAIQ,0BAA0B;EACpC,UAAU,MAAM;EAChB,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