@yahoo/uds-create-config 4.10.2 → 4.10.4
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/configs/CanvasConfig.d.ts +165 -77
- package/dist/configs/documentation.d.ts +1 -1
- package/dist/configs/react-native-system.d.ts +111 -52
- package/dist/configs/system.d.ts +121 -87
- package/dist/configs/system.js +4 -0
- package/dist/entities/documentation/Documentation.d.ts +1 -1
- package/dist/entities/native/NativeModifier.d.ts +1 -1
- package/dist/entities/native/NativeSettings.d.ts +1 -1
- package/dist/entities/native/NativeStyleProperty.d.ts +2 -2
- package/dist/entities/native/NativeToken.d.ts +4 -3
- package/dist/entities/system/CanvasRole.d.ts +1 -1
- package/dist/entities/system/Component.d.ts +23 -13
- package/dist/entities/system/Component.js +41 -15
- package/dist/entities/system/Composite.d.ts +1 -1
- package/dist/entities/system/Device.d.ts +1 -1
- package/dist/entities/system/File.d.ts +2 -2
- package/dist/entities/system/Font.d.ts +1 -1
- package/dist/entities/system/GlobalStyle.d.ts +1 -1
- package/dist/entities/system/Guidance.d.ts +1 -1
- package/dist/entities/system/GuidanceStyle.d.ts +1 -1
- package/dist/entities/system/Icon.d.ts +63 -11
- package/dist/entities/system/Icon.js +70 -14
- package/dist/entities/system/LinkedSystem.d.ts +1 -1
- package/dist/entities/system/Modifier.d.ts +2 -2
- package/dist/entities/system/Motion.d.ts +1 -1
- package/dist/entities/system/Package.d.ts +1 -1
- package/dist/entities/system/Settings.d.ts +1 -1
- package/dist/entities/system/StyleProperty.d.ts +12 -19
- package/dist/entities/system/StyleProperty.js +7 -10
- package/dist/entities/system/Token.d.ts +4 -3
- package/dist/entities/system/defineComponent.d.ts +21 -6
- package/dist/entities/system/defineComponent.js +7 -12
- package/dist/entities/system/glyph-identity.d.ts +7 -0
- package/dist/entities/system/glyph-identity.js +153 -0
- package/dist/entities/system/icon-domain-invariants.d.ts +11 -0
- package/dist/entities/system/icon-domain-invariants.js +178 -0
- package/dist/entities/system/icon-library.d.ts +93 -34
- package/dist/entities/system/icon-library.js +218 -50
- package/dist/entities/system/icon-metadata.d.ts +10 -4
- package/dist/entities/system/icon-metadata.js +45 -5
- package/dist/entities/system/runtime-modules.js +5 -5
- package/dist/entities/system/style-bag.js +14 -2
- package/dist/framework/Config.d.ts +1 -1
- package/dist/framework/Config.js +34 -5
- package/dist/framework/defineConfig.d.ts +6 -3
- package/dist/framework/defineEntity.d.ts +54 -15
- package/dist/framework/defineEntity.js +56 -2
- package/dist/framework/projections.d.ts +40 -2
- package/dist/framework/projections.js +99 -5
- package/dist/framework/prop-surface.d.ts +6 -5
- package/dist/framework/prop-surface.js +12 -14
- package/dist/framework/registry.d.ts +17 -1
- package/dist/framework/registry.js +2 -1
- package/dist/framework/render-spec.d.ts +6 -5
- package/dist/framework/render-spec.js +16 -11
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/framework/signature.js +5 -1
- package/dist/framework/utils/group.d.ts +15 -1
- package/dist/framework/utils/ref-grammar.d.ts +35 -0
- package/dist/framework/utils/ref-grammar.js +76 -0
- package/dist/framework/utils/refs.d.ts +13 -45
- package/dist/framework/utils/refs.js +31 -94
- package/dist/framework/value-domain.js +53 -8
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -5
- package/dist/migrations/2.0.0/v1-artifact.d.ts +62 -45
- package/dist/migrations/2.0.0/v1-artifact.js +5 -7
- package/dist/migrations/20260921044042_icon_library_without_component.d.ts +19 -0
- package/dist/migrations/20260921044042_icon_library_without_component.js +86 -0
- package/dist/migrations/20260922013625_icon_libraries.d.ts +18 -0
- package/dist/migrations/20260922013625_icon_libraries.js +8 -0
- package/dist/renderer/UdsRenderer.d.ts +8 -1
- package/dist/renderer/UdsRenderer.js +7 -3
- package/dist/renderer/glyphEntries.d.ts +32 -0
- package/dist/renderer/glyphEntries.js +48 -0
- package/dist/renderer/glyphRenderable.d.ts +10 -0
- package/dist/renderer/glyphRenderable.js +40 -0
- package/dist/renderer/icon-library.d.ts +18 -11
- package/dist/renderer/index.d.ts +4 -2
- package/dist/renderer/index.js +4 -2
- package/dist/renderer/resolveGlyph.d.ts +47 -0
- package/dist/renderer/resolveGlyph.js +78 -0
- package/dist/renderer/wrapRegistry.d.ts +13 -4
- package/dist/renderer/wrapRegistry.js +7 -5
- package/dist/renderer/wrappers/component-refs.js +6 -2
- package/dist/renderer/wrappers/glyph-props.d.ts +15 -0
- package/dist/renderer/wrappers/glyph-props.js +65 -0
- package/dist/spec/glyph-jsx.d.ts +41 -0
- package/dist/spec/{asset-jsx.js → glyph-jsx.js} +7 -25
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +2 -2
- package/dist/spec/jsxToSpec.d.ts +10 -4
- package/dist/spec/jsxToSpec.js +21 -4
- package/dist/spec/specToJsx.d.ts +20 -9
- package/dist/spec/specToJsx.js +77 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/renderer/assetEntries.d.ts +0 -37
- package/dist/renderer/assetEntries.js +0 -38
- package/dist/renderer/assetRenderable.d.ts +0 -25
- package/dist/renderer/assetRenderable.js +0 -19
- package/dist/spec/asset-jsx.d.ts +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-config",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"files": [
|
|
89
89
|
"dist"
|
|
90
90
|
],
|
|
91
|
-
"udsSchemaVersion":
|
|
91
|
+
"udsSchemaVersion": 20260922013625
|
|
92
92
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { IconLibrary } from "./icon-library.js";
|
|
2
|
-
import { AssetRenderProps } from "./assetRenderable.js";
|
|
3
|
-
import { ComponentEntry } from "./componentEntry.js";
|
|
4
|
-
import React from "react";
|
|
5
|
-
|
|
6
|
-
//#region src/renderer/assetEntries.d.ts
|
|
7
|
-
/** Plain, provider-free asset renderables indexed `slug → name → component`.
|
|
8
|
-
* Each is `makeAssetRenderable(SystemComponent, member, name)` — the SAME
|
|
9
|
-
* component identity the registry keys under the namespaced asset type, but
|
|
10
|
-
* surfaced directly so callers (e.g. the icon picker) can render a single
|
|
11
|
-
* glyph without standing up a json-render engine per cell. */
|
|
12
|
-
type AssetMembers = ReadonlyMap<string, ReadonlyMap<string, React.ComponentType<AssetRenderProps>>>;
|
|
13
|
-
interface AssetEntriesResult {
|
|
14
|
-
/** One ctx-shaped entry per placed glyph, keyed by its spec `type` (`icon:icons/Trophy`). */
|
|
15
|
-
entries: Record<string, ComponentEntry>;
|
|
16
|
-
/** @see AssetMembers — empty when the config registers no placeable assets. */
|
|
17
|
-
assetMembers: AssetMembers;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Registry entries for a config's placeable asset libraries.
|
|
21
|
-
*
|
|
22
|
-
* Each glyph keys under the member's own ref (`icon:icons/Trophy`) — a `kind:path` key can't
|
|
23
|
-
* collide with a `component:` or `package:` key, so the entries merge into the registry's
|
|
24
|
-
* component map safely. In the same pass (`libraries` may be a one-shot iterator), each member is
|
|
25
|
-
* indexed by slug + name so a picker can render one glyph directly.
|
|
26
|
-
*/
|
|
27
|
-
declare function assetRegistryEntries({
|
|
28
|
-
libraries,
|
|
29
|
-
components
|
|
30
|
-
}: {
|
|
31
|
-
libraries: Iterable<IconLibrary>;
|
|
32
|
-
/** The registry's own component bindings — where a group's declared system component (its
|
|
33
|
-
* `Icon`, which owns the set-specific size/variant → glyph mapping) is resolved from. */
|
|
34
|
-
components: Record<string, React.ComponentType<any>>;
|
|
35
|
-
}): AssetEntriesResult;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { AssetEntriesResult, AssetMembers, assetRegistryEntries };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { makeAssetRenderable } from "./assetRenderable.js";
|
|
2
|
-
import { makeComponentEntry } from "./componentEntry.js";
|
|
3
|
-
//#region src/renderer/assetEntries.ts
|
|
4
|
-
/**
|
|
5
|
-
* Registry entries for a config's placeable asset libraries.
|
|
6
|
-
*
|
|
7
|
-
* Each glyph keys under the member's own ref (`icon:icons/Trophy`) — a `kind:path` key can't
|
|
8
|
-
* collide with a `component:` or `package:` key, so the entries merge into the registry's
|
|
9
|
-
* component map safely. In the same pass (`libraries` may be a one-shot iterator), each member is
|
|
10
|
-
* indexed by slug + name so a picker can render one glyph directly.
|
|
11
|
-
*/
|
|
12
|
-
function assetRegistryEntries({ libraries, components }) {
|
|
13
|
-
const entries = {};
|
|
14
|
-
const assetMembers = /* @__PURE__ */ new Map();
|
|
15
|
-
for (const group of libraries) {
|
|
16
|
-
const members = group.members;
|
|
17
|
-
if (!members) continue;
|
|
18
|
-
const SystemComponent = group.component !== void 0 ? components[group.component] : void 0;
|
|
19
|
-
const bySlug = /* @__PURE__ */ new Map();
|
|
20
|
-
for (const name of group.assetNames) {
|
|
21
|
-
const member = members[name];
|
|
22
|
-
if (member === void 0) continue;
|
|
23
|
-
const key = group.assetType(name);
|
|
24
|
-
entries[key] = makeComponentEntry({
|
|
25
|
-
component: makeAssetRenderable(void 0, member, name),
|
|
26
|
-
name: key
|
|
27
|
-
});
|
|
28
|
-
bySlug.set(name, makeAssetRenderable(SystemComponent, member, name));
|
|
29
|
-
}
|
|
30
|
-
assetMembers.set(group.name, bySlug);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
entries,
|
|
34
|
-
assetMembers
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
export { assetRegistryEntries };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/renderer/assetRenderable.d.ts
|
|
4
|
-
/** Props callers pass when rendering an asset member directly (icon picker
|
|
5
|
-
* grid, drag ghost). The member — or the system component it renders through —
|
|
6
|
-
* maps these to a glyph; the registry-derived `name` always wins.
|
|
7
|
-
*
|
|
8
|
-
* The type is deliberately CLOSED (no index signature), so a misspelled
|
|
9
|
-
* `variant` or `size` at a render site is a compile error rather than a glyph
|
|
10
|
-
* quietly drawn with its defaults. A caller that has resolved a
|
|
11
|
-
* system-component prop from the config (e.g. the prop that binds CSS `color`,
|
|
12
|
-
* so a chrome surface can make the glyph inherit its own text color) hands it
|
|
13
|
-
* through `systemProps` — one named channel, so this contract never has to
|
|
14
|
-
* name any system's props and never has to open up to admit them. */
|
|
15
|
-
type AssetRenderProps = {
|
|
16
|
-
variant?: string;
|
|
17
|
-
size?: string | number;
|
|
18
|
-
/** Props of the system component the member renders through, resolved from
|
|
19
|
-
* the config by the caller and spread onto it verbatim. Ignored when no
|
|
20
|
-
* system component is bound: they were resolved for that component, and a
|
|
21
|
-
* raw glyph has no use for them. */
|
|
22
|
-
systemProps?: Readonly<Record<string, string>>;
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { AssetRenderProps };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
//#region src/renderer/assetRenderable.tsx
|
|
3
|
-
function makeAssetRenderable(SystemComponent, member, name) {
|
|
4
|
-
if (SystemComponent === void 0) {
|
|
5
|
-
const Member = member;
|
|
6
|
-
return function RawAssetRenderable({ systemProps: _, ...props }) {
|
|
7
|
-
return /* @__PURE__ */ jsx(Member, { ...props });
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
return function AssetRenderable({ systemProps, ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(SystemComponent, {
|
|
12
|
-
...systemProps,
|
|
13
|
-
...props,
|
|
14
|
-
name
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { makeAssetRenderable };
|
package/dist/spec/asset-jsx.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//#region src/spec/asset-jsx.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* The identifier a type is KNOWN AS in JSX — `component:buttons/Primary` → `Primary`.
|
|
4
|
-
*
|
|
5
|
-
* A type is a ref (`component:buttons/Primary`), and neither half of it is JSX: the kind isn't part
|
|
6
|
-
* of the name, and a grouped path isn't a legal tag or import name. The leaf is what codegen names
|
|
7
|
-
* the export, so `<Primary />` and `import { Primary }` agree with the module that actually exists.
|
|
8
|
-
* An intrinsic tag has no kind and no group, so it passes through untouched.
|
|
9
|
-
*/
|
|
10
|
-
declare function jsxIdentifier(type: string): string;
|
|
11
|
-
/** Pull the library slug + member out of an asset node's type, or `null` for anything else — a
|
|
12
|
-
* component, a package export, an intrinsic tag. */
|
|
13
|
-
declare function parseAssetType(type: string): {
|
|
14
|
-
slug: string;
|
|
15
|
-
member: string;
|
|
16
|
-
} | null;
|
|
17
|
-
/**
|
|
18
|
-
* `slug → the component a placed member renders through` (e.g. `{ icons: 'Icon' }`).
|
|
19
|
-
* Derived from the asset groups that declare a `component`; a slug missing from
|
|
20
|
-
* the map has no authoring component and falls back to the bare member tag.
|
|
21
|
-
* A value may be the component's bare name OR its full path (`primitives/Icon`) —
|
|
22
|
-
* serialization reduces it to the JSX leaf either way ({@link jsxIdentifier}),
|
|
23
|
-
* since a grouped path is not a legal tag.
|
|
24
|
-
*/
|
|
25
|
-
type AssetComponentMap = Readonly<Record<string, string>>;
|
|
26
|
-
/** How a placed asset node should appear in exported JSX. */
|
|
27
|
-
interface AssetJsxForm {
|
|
28
|
-
/** The JSX tag — the authoring component (`Icon`) or the bare member. */
|
|
29
|
-
tag: string;
|
|
30
|
-
/**
|
|
31
|
-
* The `name` attribute value when the authoring component carries the
|
|
32
|
-
* member identity (`name="Trophy"`). Absent on the bare-member fallback,
|
|
33
|
-
* which IS the member.
|
|
34
|
-
*/
|
|
35
|
-
nameAttr?: string;
|
|
36
|
-
/** Identifier to import — the component when mapped, else the member. */
|
|
37
|
-
importName: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Resolve a spec element `type` to its exported-JSX form, or `null` when the
|
|
41
|
-
* type is not an asset node (a normal component — caller serializes as usual).
|
|
42
|
-
*
|
|
43
|
-
* - mapped slug → `<Icon name="Member" … />` (component-typed export);
|
|
44
|
-
* - unmapped slug → `<Member … />` (component-less fallback — a self-contained
|
|
45
|
-
* member renders itself; a bare-path glyph would need raw `<svg>`, which the
|
|
46
|
-
* string-only serializers can't synthesize, so the member tag is the best
|
|
47
|
-
* they can emit).
|
|
48
|
-
*/
|
|
49
|
-
declare function assetJsxForm(type: string, assetComponents?: AssetComponentMap): AssetJsxForm | null;
|
|
50
|
-
/**
|
|
51
|
-
* Inverse of `assetJsxForm` for the editor round-trip: given a parsed JSX tag
|
|
52
|
-
* and its props, reconstruct the asset-node `type` string — or `null` if the
|
|
53
|
-
* tag is a genuine component, not an authoring component placing a known member.
|
|
54
|
-
* The caller closes over its live config to find the group whose `component`
|
|
55
|
-
* matches `tag` and whose members include the `name` value, then returns
|
|
56
|
-
* `group.assetType(name)`. When it resolves, the parser drops the `name` prop
|
|
57
|
-
* (the member identity lives in the type) and keeps the rest (variant, size).
|
|
58
|
-
*/
|
|
59
|
-
type AssetNodeResolver = (tag: string, props: Readonly<Record<string, unknown>>) => string | null;
|
|
60
|
-
//#endregion
|
|
61
|
-
export { AssetComponentMap, AssetJsxForm, AssetNodeResolver, assetJsxForm, jsxIdentifier, parseAssetType };
|