@supernova-studio/supernova-sdk-beta 2.4.11 → 2.4.12

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.
@@ -82,6 +82,9 @@ export type DocsExportDestinationModel = {
82
82
  changes: DocsExportDestinationChanges | null;
83
83
  };
84
84
  export type DocsExportDestinationChanges = {
85
+ /** What the build publishes, absent on builds that publish everything */
86
+ pagePersistentIds?: string[];
87
+ groupPersistentIds?: string[];
85
88
  selectivePublishing: boolean | null;
86
89
  };
87
90
  /**
@@ -1,48 +1,22 @@
1
1
  import { Brand } from "../../../model/base/SDKBrand";
2
2
  import { DTOriginalTokenType } from "../../../model/enums/SDKTokenType";
3
3
  import { AnyToken } from "../../../model/tokens/SDKTokenValue";
4
- import { DTParsedNode, DTParsedThemeSetPriority, DTParsedTokenSet } from "./SDKDTJSONLoader";
5
- import { DTPluginSourceMode, DTPluginToSupernovaMapPack, DTPluginUnresolvableFallback, DTPluginUnresolvableRefMode } from "./SDKDTMapLoader";
4
+ import { DTParsedNode } from "./SDKDTJSONLoader";
5
+ import { DTPluginToSupernovaMapPack } from "./SDKDTMapLoader";
6
6
  import { DTTokenReferenceResolver } from "./SDKDTTokenReferenceResolver";
7
7
  export type DTProcessedTokenNode<T extends AnyToken = AnyToken> = {
8
8
  token: T;
9
9
  originalType: DTOriginalTokenType;
10
10
  path: Array<string>;
11
11
  key: string;
12
- /** Originating set's status in `$themes.json`; absent for explicit-`tokenSets` mappings */
13
- sourcePriority?: DTParsedThemeSetPriority;
14
- };
15
- export type DTJSONConverterOptions = {
16
- /** How to handle references that can't resolve; defaults to `strict` (throw). */
17
- unresolvableRefMode?: DTPluginUnresolvableRefMode;
18
- /** Per-type fallback values used by `placeholder` and `lenientResolve` modes. */
19
- unresolvableFallback?: Required<DTPluginUnresolvableFallback>;
20
- /** Full input token sets — used only by `lenientResolve` for wider-scope lookup. */
21
- allLoadedSets?: Array<DTParsedTokenSet>;
22
- /** Attribution label included in warnings — usually `"<brand>/<theme>"`. */
23
- mappingKey?: string;
24
- /** How to handle `source`-statused sets (Fix B). Defaults to `emit`. */
25
- sourceMode?: DTPluginSourceMode;
26
12
  };
27
13
  /** Utility to DS Tokens plugin JSON to Supernova entities */
28
14
  export declare class DTJSONConverter {
29
15
  versionId: string;
30
16
  mapping: DTPluginToSupernovaMapPack;
31
17
  referenceResolver: DTTokenReferenceResolver;
32
- unresolvableRefMode: DTPluginUnresolvableRefMode;
33
- unresolvableFallback: Required<DTPluginUnresolvableFallback>;
34
- allLoadedSets: Array<DTParsedTokenSet>;
35
- mappingKey: string;
36
- sourceMode: DTPluginSourceMode;
37
- /** Warnings surfaced during resolution (emitted by non-strict unresolvable modes). Consumed by the plugin and folded into logs[]. */
38
- warnings: Array<string>;
39
- /** Keys of processed nodes that should be dropped before emission (populated by `preserve` mode and Fix B source filtering). */
40
- skippedKeys: Set<string>;
41
- constructor(versionId: string, mapping: DTPluginToSupernovaMapPack, options?: DTJSONConverterOptions);
18
+ constructor(versionId: string, mapping: DTPluginToSupernovaMapPack);
42
19
  convertNodesToTokens(nodes: Array<DTParsedNode>, brand: Brand): Array<DTProcessedTokenNode>;
43
- private applySourceModeSkip;
44
- /** Single-pass cascade: mark tokens whose referencedTokenId targets are in `skipIds`. Returns true if any new skip was added. */
45
- private markCascadingSkips;
46
20
  private restoreInitialTokenOrder;
47
21
  private remapRootNodeKey;
48
22
  private remapRootNodeKeys;
@@ -7,8 +7,6 @@ export type DTParsedNode = {
7
7
  type: DTOriginalTokenType;
8
8
  value: JSONValue;
9
9
  description: string | null;
10
- /** Originating set's status in `$themes.json`; absent for explicit-`tokenSets` mappings */
11
- sourcePriority?: DTParsedThemeSetPriority;
12
10
  };
13
11
  export type DTParsedTokenSet = {
14
12
  name: string;
@@ -15,31 +15,6 @@ export declare enum DTPluginPreciseCopyStrategy {
15
15
  deleteAll = "deleteAll",// preciseCopy = true
16
16
  keepManualTokens = "keepManualTokens"
17
17
  }
18
- /** Controls how `source`-statused sets in `$themes.json` are handled during sync. */
19
- export declare enum DTPluginSourceMode {
20
- /** Source sets contribute tokens AND resolve references (current SDK behavior) */
21
- emit = "emit",
22
- /** Source sets are used for reference resolution only; their tokens are inlined into referring enabled tokens and not emitted separately */
23
- referenceOnly = "referenceOnly"
24
- }
25
- /** Controls what happens when a `{...}` reference can't be resolved within the mapping's set pool. */
26
- export declare enum DTPluginUnresolvableRefMode {
27
- /** Throw the enriched error listing missing refs (current SDK behavior) */
28
- strict = "strict",
29
- /** Substitute unresolvable refs with configured fallback values; emit warnings to logs */
30
- placeholder = "placeholder",
31
- /** Keep the `{...}` literal in the token value; self-heals on next sync when target exists */
32
- preserve = "preserve",
33
- /** Try to resolve against all loaded sets (not just mapping's subset); fall back to placeholder if still unresolvable */
34
- lenientResolve = "lenientResolve"
35
- }
36
- /** Per-type fallback values used by `placeholder` mode (and `lenientResolve` fallback). */
37
- export type DTPluginUnresolvableFallback = {
38
- color?: string;
39
- dimension?: number;
40
- string?: string;
41
- };
42
- export declare const DEFAULT_UNRESOLVABLE_FALLBACK: Required<DTPluginUnresolvableFallback>;
43
18
  export declare const isPreciseCopyEnabled: (preciseCopy: DTPluginPreciseCopyStrategy) => preciseCopy is DTPluginPreciseCopyStrategy.deleteAll | DTPluginPreciseCopyStrategy.keepManualTokens;
44
19
  export declare const toPreciseCopyStrategy: (preciseCopy?: boolean | DTPluginPreciseCopyStrategy) => DTPluginPreciseCopyStrategy;
45
20
  export type DTPluginToSupernovaMap = {
@@ -67,9 +42,6 @@ export type DTPluginToSupernovaMappingFile = {
67
42
  dryRun?: boolean;
68
43
  preciseCopy?: boolean | DTPluginPreciseCopyStrategy;
69
44
  themeOverridesStrategy?: DTPluginThemeOverrideStrategy;
70
- sourceMode?: DTPluginSourceMode;
71
- unresolvableRefMode?: DTPluginUnresolvableRefMode;
72
- unresolvableFallback?: DTPluginUnresolvableFallback;
73
45
  };
74
46
  };
75
47
  export type DTPluginToSupernovaSettings = {
@@ -77,7 +49,4 @@ export type DTPluginToSupernovaSettings = {
77
49
  dryRun: boolean;
78
50
  preciseCopy: DTPluginPreciseCopyStrategy;
79
51
  themeOverridesStrategy: DTPluginThemeOverrideStrategy;
80
- sourceMode: DTPluginSourceMode;
81
- unresolvableRefMode: DTPluginUnresolvableRefMode;
82
- unresolvableFallback: Required<DTPluginUnresolvableFallback>;
83
52
  };
@@ -45,6 +45,4 @@ export declare class DTTokenReferenceResolver {
45
45
  dollarTypeReference: boolean;
46
46
  }[];
47
47
  isDollarIdentifier(value: string): boolean;
48
- /** Extract references appearing in `value` that aren't defined in the atomic table. Returns bracket-normalized keys (e.g. `{color.base.foo}`). */
49
- unresolvedReferencesIn(value: unknown): Array<string>;
50
48
  }
@@ -74,6 +74,8 @@ export type TokenUtilPreviewReferenceInfo = {
74
74
  export type TokenUtilPreviewReferenceInfoPiece = {
75
75
  key?: Array<TokenUtilPreviewTokenValueSegment>;
76
76
  value?: Array<TokenUtilPreviewTokenValueSegment>;
77
+ /** Opaque hex of a colour row, for a swatch beside it. Opacity has its own row */
78
+ swatchColor?: string;
77
79
  icon?: string;
78
80
  fullWidth?: boolean;
79
81
  wrapSegments?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/supernova-sdk-beta",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "Supernova.io SDK",
5
5
  "main": "./build/supernova-sdk-typescript.js",
6
6
  "types": "./build/types/index.d.ts",
@@ -1,4 +0,0 @@
1
- import { DTPluginUnresolvableRefMode } from "../SDKDTMapLoader";
2
- import { UnresolvableModeHandler } from "./types";
3
- export * from "./types";
4
- export declare const UNRESOLVABLE_MODE_HANDLERS: Record<DTPluginUnresolvableRefMode, UnresolvableModeHandler>;
@@ -1,2 +0,0 @@
1
- import { UnresolvableModeHandler } from "./types";
2
- export declare const lenientResolveHandler: UnresolvableModeHandler;
@@ -1,2 +0,0 @@
1
- import { UnresolvableModeHandler } from "./types";
2
- export declare const placeholderHandler: UnresolvableModeHandler;
@@ -1,2 +0,0 @@
1
- import { UnresolvableModeHandler } from "./types";
2
- export declare const preserveHandler: UnresolvableModeHandler;
@@ -1,2 +0,0 @@
1
- import { UnresolvableModeHandler } from "./types";
2
- export declare const strictHandler: UnresolvableModeHandler;
@@ -1,33 +0,0 @@
1
- import { Brand } from "../../../../model/base/SDKBrand";
2
- import { DTParsedNode, DTParsedTokenSet } from "../SDKDTJSONLoader";
3
- import { DTPluginUnresolvableFallback } from "../SDKDTMapLoader";
4
- import { DTTokenReferenceResolver } from "../SDKDTTokenReferenceResolver";
5
- /** Context passed to each unresolvable-ref handler. */
6
- export type UnresolvableModeContext = {
7
- /** Nodes that failed to resolve within the depth limit, paired with their original processing index. */
8
- unresolvedTokens: Array<[DTParsedNode, number]>;
9
- /** All token sets loaded from the input file (used by `lenientResolve`; other handlers ignore). */
10
- allLoadedSets: Array<DTParsedTokenSet>;
11
- /** The atomic-token table built during resolution; used to check what IS known. */
12
- atomicResolver: DTTokenReferenceResolver;
13
- /** Fully-populated fallback values (defaults merged with any user overrides). */
14
- fallback: Required<DTPluginUnresolvableFallback>;
15
- /** Brand context — passed to per-token conversion. */
16
- brand: Brand;
17
- /** Short label used in warning strings for attribution (e.g. "Jetstar/jq-web-light"). */
18
- mappingKey: string;
19
- };
20
- /**
21
- * Result from a handler. Instead of directly writing tokens, handlers return
22
- * substituted nodes (whose values may have been rewritten) and/or skipped nodes.
23
- * The caller re-runs the atomic-conversion path on substituted nodes.
24
- */
25
- export type UnresolvableModeResult = {
26
- /** Nodes whose values were substituted; re-run conversion on these. */
27
- substitutedNodes: Array<[DTParsedNode, number]>;
28
- /** Nodes to skip entirely — not emitted this sync. */
29
- skippedNodes: Array<[DTParsedNode, number]>;
30
- /** `[WARN]`-prefixed lines appended to the existing `logs[]` return value. */
31
- warnings: Array<string>;
32
- };
33
- export type UnresolvableModeHandler = (context: UnresolvableModeContext) => UnresolvableModeResult;