@yahoo/uds-create-config 5.96.6 → 5.98.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.
- package/dist/configs/system.js +2 -0
- package/dist/entities/system/Source.d.ts +1 -0
- package/dist/entities/system/Source.js +39 -3
- package/dist/entities/system/component-module.d.ts +15 -1
- package/dist/entities/system/component-module.js +76 -5
- package/dist/entities/system/copy-plan.js +2 -1
- package/dist/entities/system/defineComponent.d.ts +7 -1
- package/dist/entities/system/icon-library.js +9 -0
- package/dist/entities/system/vendor-conditions.d.ts +123 -0
- package/dist/entities/system/vendor-conditions.js +324 -0
- package/dist/framework/Config.d.ts +24 -2
- package/dist/framework/Config.js +44 -6
- package/dist/framework/class-names.js +7 -4
- package/dist/framework/module-views.d.ts +9 -1
- package/dist/framework/projections.js +56 -10
- package/dist/framework/prop-surface.d.ts +7 -1
- package/dist/framework/prop-surface.js +140 -37
- package/dist/framework/ref-integrity.js +1 -0
- package/dist/framework/registry.d.ts +3 -1
- package/dist/framework/render-spec.js +6 -0
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/framework/source-integrity.js +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +5 -4
- package/dist/lint/rules.d.ts +6 -0
- package/dist/lint/rules.js +6 -0
- package/dist/migrations/20261112163439_vendor_link_type.d.ts +8 -0
- package/dist/migrations/20261112163439_vendor_link_type.js +10 -0
- package/dist/spec/glyph-jsx.js +4 -2
- package/dist/spec/glyph-members.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/configs/system.js
CHANGED
|
@@ -51,6 +51,7 @@ import { computedVisibilityMigration } from "../migrations/20261110145811_comput
|
|
|
51
51
|
import { anatomyNodeStatesMigration } from "../migrations/20261110171151_anatomy_node_states.js";
|
|
52
52
|
import { nativeLintLocationsMigration } from "../migrations/20261112145536_native_lint_locations.js";
|
|
53
53
|
import { variantBooleansMigration } from "../migrations/20261112154943_variant_booleans.js";
|
|
54
|
+
import { vendorLinkTypeMigration } from "../migrations/20261112163439_vendor_link_type.js";
|
|
54
55
|
import { CanvasRole } from "../entities/system/CanvasRole.js";
|
|
55
56
|
import { GlobalStyle } from "../entities/system/GlobalStyle.js";
|
|
56
57
|
import { Guidance } from "../entities/system/Guidance.js";
|
|
@@ -238,5 +239,6 @@ if (!registeredSchemaMigrations().has(20261110145811)) registerSchemaMigrations(
|
|
|
238
239
|
if (!registeredSchemaMigrations().has(20261110171151)) registerSchemaMigrations(anatomyNodeStatesMigration);
|
|
239
240
|
if (!registeredSchemaMigrations().has(20261112145536)) registerSchemaMigrations(nativeLintLocationsMigration);
|
|
240
241
|
if (!registeredSchemaMigrations().has(20261112154943)) registerSchemaMigrations(variantBooleansMigration);
|
|
242
|
+
if (!registeredSchemaMigrations().has(20261112163439)) registerSchemaMigrations(vendorLinkTypeMigration);
|
|
241
243
|
//#endregion
|
|
242
244
|
export { System };
|
|
@@ -112,6 +112,7 @@ declare const LinkedSystemDefinition: EntityClass<z.ZodObject<{
|
|
|
112
112
|
type: z.ZodOptional<z.ZodEnum<{
|
|
113
113
|
linked: "linked";
|
|
114
114
|
hybrid: "hybrid";
|
|
115
|
+
vendor: "vendor";
|
|
115
116
|
}>>;
|
|
116
117
|
version: z.ZodOptional<z.ZodString>;
|
|
117
118
|
}, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "source", {
|
|
@@ -8,6 +8,7 @@ import { storedStyleRules } from "./Component.js";
|
|
|
8
8
|
import { foldRetiredFields } from "../../framework/retired-fields.js";
|
|
9
9
|
import { sourceUnreachable } from "../../framework/sources.js";
|
|
10
10
|
import { covers, directivesOf, excludes, includeOf } from "./link-declaration.js";
|
|
11
|
+
import { isVendorModifierMapping, vendorModifierMappingProblems } from "./vendor-conditions.js";
|
|
11
12
|
import { planCopy } from "./copy-plan.js";
|
|
12
13
|
import { planBreak, planExclude, planLink, planLinkApplied, planUnlink, sourceRowStates } from "./link-plan.js";
|
|
13
14
|
import { z } from "zod";
|
|
@@ -369,7 +370,8 @@ const LinkedSystemDefinition = defineEntity({
|
|
|
369
370
|
invariants: (config) => [
|
|
370
371
|
...config.list("source").filter(({ path }) => !isLinkSlug(path)).map(({ path }) => `Link "${path}": ${LINK_SLUG_MESSAGE}`),
|
|
371
372
|
...linkRedirects(config).filter((redirect) => redirect.problem !== void 0 && redirect.problem !== "missing").map(redirectSentence),
|
|
372
|
-
...excludedDirectives(config)
|
|
373
|
+
...excludedDirectives(config),
|
|
374
|
+
...vendorDirectives(config)
|
|
373
375
|
],
|
|
374
376
|
schemas: {
|
|
375
377
|
create: { example: ({ config }) => {
|
|
@@ -774,8 +776,19 @@ const LinkedSystemDefinition = defineEntity({
|
|
|
774
776
|
* The same holds for the motion presets and composites a taken component names: through a
|
|
775
777
|
* `hybrid` link it plays this system's of that name, and otherwise the source's own, emitted
|
|
776
778
|
* under the pin's names.
|
|
779
|
+
*
|
|
780
|
+
* `vendor` brings in only the entities its `options.include` names. Nothing they reference lands
|
|
781
|
+
* as a row: a taken component draws every value from its own source under the pin's names, and so
|
|
782
|
+
* do the components it renders. Its `options` take only `hidden`, since a product value laid over
|
|
783
|
+
* it would mix this system's vocabulary into the source's, and a modifier's `override` naming one
|
|
784
|
+
* of this system's modifiers, which says when the vendor's values apply and changes none of them
|
|
785
|
+
* (`vendor-conditions.ts`).
|
|
777
786
|
*/
|
|
778
|
-
type: z.enum([
|
|
787
|
+
type: z.enum([
|
|
788
|
+
"linked",
|
|
789
|
+
"hybrid",
|
|
790
|
+
"vendor"
|
|
791
|
+
]).optional().describe("How this source joins the system: `linked` (the default) brings in everything its entities reference and refuses a path another link offers differently; `hybrid` brings in only what no other link offers and uses this system's tokens, motion presets and composites wherever it has one of the same name; `vendor` brings in only what `options.include` names, drawn entirely from the source's own values, with no `override` or `extend` in `options` except a modifier's `override` naming the modifier of this system it stands for."),
|
|
779
792
|
/**
|
|
780
793
|
* The exact published version every ref through this link resolves against.
|
|
781
794
|
*
|
|
@@ -846,7 +859,10 @@ displayName: ({ member, path }) => typeof member.name === "string" && member.nam
|
|
|
846
859
|
accessor: accessor ?? kind,
|
|
847
860
|
path
|
|
848
861
|
}),
|
|
849
|
-
sourceType: (body) =>
|
|
862
|
+
sourceType: (body) => {
|
|
863
|
+
const { type } = body;
|
|
864
|
+
return type === "hybrid" || type === "vendor" ? type : "linked";
|
|
865
|
+
},
|
|
850
866
|
bulkExcludes: ({ body, kind, accessor, path }) => excludes({
|
|
851
867
|
declared: includeOf(body),
|
|
852
868
|
accessor: accessor ?? kind,
|
|
@@ -935,6 +951,26 @@ function excludedDirectives(config) {
|
|
|
935
951
|
})).map((path) => `Link "${slug}": options.${accessor}["${path}"] adjusts a path its \`options.include\` excludes, which derives no row. Drop the entry, or the exclusion.`) : []);
|
|
936
952
|
});
|
|
937
953
|
}
|
|
954
|
+
/**
|
|
955
|
+
* Each `options` entry that changes what a `vendor` source brings. A vendor's entities draw every value
|
|
956
|
+
* from their own source, so a product value laid over one would mix the two systems' vocabularies,
|
|
957
|
+
* and the typing of its props from that source would no longer hold. `hidden` changes nothing it
|
|
958
|
+
* draws, so it stays. So does a modifier pointed at one of this system's
|
|
959
|
+
* ({@link isVendorModifierMapping}): it changes when the vendor's values apply, and none of them.
|
|
960
|
+
*/
|
|
961
|
+
function vendorDirectives(config) {
|
|
962
|
+
return config.list("source").flatMap(({ path: slug }) => {
|
|
963
|
+
if (config.sourceTypeOf(slug) !== "vendor") return [];
|
|
964
|
+
return [...directivesOf(config.storedBody("source", slug)).flatMap(([accessor, entries]) => isPlainObject(entries) ? Object.entries(entries).filter(([, entry]) => isPlainObject(entry) && (entry.override !== void 0 || entry.extend !== void 0) && !isVendorModifierMapping({
|
|
965
|
+
config,
|
|
966
|
+
accessor,
|
|
967
|
+
entry
|
|
968
|
+
})).map(([path]) => `Link "${slug}": options.${accessor}["${path}"] changes what a vendor source brings, which is used as shipped. To change it, wrap it in a component of your own; a vendor entry takes only \`hidden\`, or for a modifier an \`override\` naming the modifier of this system it stands for.`) : []), ...vendorModifierMappingProblems({
|
|
969
|
+
config,
|
|
970
|
+
slug
|
|
971
|
+
})];
|
|
972
|
+
});
|
|
973
|
+
}
|
|
938
974
|
/** The `options` entry for one path, or `undefined` where the pin says nothing about it. */
|
|
939
975
|
function directiveAt(body, accessor, path) {
|
|
940
976
|
return body.options?.[accessor]?.[path];
|
|
@@ -125,6 +125,20 @@ declare function linkedModuleView({
|
|
|
125
125
|
readonly shadowed: boolean;
|
|
126
126
|
readonly route?: string;
|
|
127
127
|
}): Config;
|
|
128
|
+
/**
|
|
129
|
+
* A `vendor` pin's source as this config's stylesheet and runtime name its style props: the source's
|
|
130
|
+
* own style properties and values, under the pin's class prefix (`shop-acme`) and the variable
|
|
131
|
+
* namespace its tokens are declared under here. A value one of its components passes another
|
|
132
|
+
* (`<Box bg="paper">` in its render) paints the source's `paper`, and names no class of this config's.
|
|
133
|
+
* `undefined` for a pin that isn't `vendor`, or whose source isn't attached.
|
|
134
|
+
*/
|
|
135
|
+
declare function vendorStyleView({
|
|
136
|
+
consumer,
|
|
137
|
+
slug
|
|
138
|
+
}: {
|
|
139
|
+
readonly consumer: Config;
|
|
140
|
+
readonly slug: string;
|
|
141
|
+
}): Config | undefined;
|
|
128
142
|
/**
|
|
129
143
|
* A linked component's module source, and the config its module is built from.
|
|
130
144
|
*
|
|
@@ -138,4 +152,4 @@ declare function linkedComponentModule(config: Config, componentPathOrRef: strin
|
|
|
138
152
|
readonly view: Config;
|
|
139
153
|
} | undefined;
|
|
140
154
|
//#endregion
|
|
141
|
-
export { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView };
|
|
155
|
+
export { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView, vendorStyleView };
|
|
@@ -4,9 +4,12 @@ import { createSliceMemo } from "../../framework/memo.js";
|
|
|
4
4
|
import { moduleViewOf, registerModuleView } from "../../framework/module-views.js";
|
|
5
5
|
import { File } from "./File.js";
|
|
6
6
|
import { Settings, classPrefixOf, prefixed, varPrefixOf } from "./Settings.js";
|
|
7
|
+
import { sourceVarPrefix } from "../../framework/projections.js";
|
|
8
|
+
import { hasJsMotion } from "./motion-presets.js";
|
|
7
9
|
import { stylePropClassBase, stylePropOwnClasses } from "../../framework/class-names.js";
|
|
8
10
|
import { Component } from "./Component.js";
|
|
9
11
|
import { contentKey } from "../../framework/utils/content-key.js";
|
|
12
|
+
import { recordStatedModifiers, statedModifiersOf, vendorSource } from "./vendor-conditions.js";
|
|
10
13
|
//#region src/entities/system/component-module.ts
|
|
11
14
|
/**
|
|
12
15
|
* What names a compiled component module: a content key over the module's config-visible build
|
|
@@ -126,9 +129,31 @@ function componentRuntimeKey(config) {
|
|
|
126
129
|
settings: Settings.get(config)?.toJSON(),
|
|
127
130
|
entities: componentRuntimeEntitiesKey(config),
|
|
128
131
|
inputDir: Settings.get(config)?.inputDir,
|
|
129
|
-
...viewClassNamesKey(config)
|
|
132
|
+
...viewClassNamesKey(config),
|
|
133
|
+
...viewHostKey(config)
|
|
130
134
|
});
|
|
131
135
|
}
|
|
136
|
+
const viewHosts = /* @__PURE__ */ new WeakMap();
|
|
137
|
+
/**
|
|
138
|
+
* What a module view's consumer decides about the module beyond its class names: whether the
|
|
139
|
+
* consumer plays a JS motion preset (the module wraps itself in the motion module only then), and the
|
|
140
|
+
* pin the view was built for, whose type and `include` decide which of the source's components are
|
|
141
|
+
* the consumer's rows and which style properties the pin reaches. Empty for a config that isn't a view.
|
|
142
|
+
*/
|
|
143
|
+
function viewHostKey(config) {
|
|
144
|
+
const link = moduleViewOf(config);
|
|
145
|
+
if (!link) return {};
|
|
146
|
+
let key = viewHosts.get(config);
|
|
147
|
+
if (key === void 0) {
|
|
148
|
+
const [declared] = sourceHops(link.slug);
|
|
149
|
+
key = contentKey({
|
|
150
|
+
jsMotion: hasJsMotion(link.consumer),
|
|
151
|
+
pin: declared === void 0 ? void 0 : link.consumer.resolve("source", declared)?.toJSON()
|
|
152
|
+
});
|
|
153
|
+
viewHosts.set(config, key);
|
|
154
|
+
}
|
|
155
|
+
return { host: key };
|
|
156
|
+
}
|
|
132
157
|
const viewClassNames = /* @__PURE__ */ new WeakMap();
|
|
133
158
|
/**
|
|
134
159
|
* A module view's style-prop classes, which the consumer's rows name where it holds one
|
|
@@ -373,7 +398,7 @@ function linkedModuleView({ consumer, owner, slug, shadowed, route = slug }) {
|
|
|
373
398
|
prefix: classPrefixOf(consumer),
|
|
374
399
|
name: slug
|
|
375
400
|
}) : classPrefixOf(consumer);
|
|
376
|
-
const
|
|
401
|
+
const named = owner.apply({
|
|
377
402
|
kind: "settings",
|
|
378
403
|
operation: "update",
|
|
379
404
|
path: "settings",
|
|
@@ -382,7 +407,8 @@ function linkedModuleView({ consumer, owner, slug, shadowed, route = slug }) {
|
|
|
382
407
|
variables: varPrefixOf(owner)
|
|
383
408
|
} }
|
|
384
409
|
});
|
|
385
|
-
|
|
410
|
+
const view = named === owner ? owner.fork() : named;
|
|
411
|
+
registerModuleView({
|
|
386
412
|
view,
|
|
387
413
|
link: {
|
|
388
414
|
consumer,
|
|
@@ -391,6 +417,51 @@ function linkedModuleView({ consumer, owner, slug, shadowed, route = slug }) {
|
|
|
391
417
|
});
|
|
392
418
|
return view;
|
|
393
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* A `vendor` pin's source as this config's stylesheet and runtime name its style props: the source's
|
|
422
|
+
* own style properties and values, under the pin's class prefix (`shop-acme`) and the variable
|
|
423
|
+
* namespace its tokens are declared under here. A value one of its components passes another
|
|
424
|
+
* (`<Box bg="paper">` in its render) paints the source's `paper`, and names no class of this config's.
|
|
425
|
+
* `undefined` for a pin that isn't `vendor`, or whose source isn't attached.
|
|
426
|
+
*/
|
|
427
|
+
function vendorStyleView({ consumer, slug }) {
|
|
428
|
+
if (consumer.sourceTypeOf(slug) !== "vendor") return void 0;
|
|
429
|
+
const owner = consumer.sourceFor(slug);
|
|
430
|
+
if (!owner) return void 0;
|
|
431
|
+
let bySlug = vendorViews.get(consumer);
|
|
432
|
+
if (!bySlug) {
|
|
433
|
+
bySlug = /* @__PURE__ */ new Map();
|
|
434
|
+
vendorViews.set(consumer, bySlug);
|
|
435
|
+
}
|
|
436
|
+
const held = bySlug.get(slug);
|
|
437
|
+
if (held?.owner === owner) return held.view;
|
|
438
|
+
const stated = vendorSource({
|
|
439
|
+
consumer,
|
|
440
|
+
slug
|
|
441
|
+
}) ?? owner;
|
|
442
|
+
const view = stated.apply({
|
|
443
|
+
kind: "settings",
|
|
444
|
+
operation: "update",
|
|
445
|
+
path: "settings",
|
|
446
|
+
data: { "css.prefix": {
|
|
447
|
+
classNames: prefixed({
|
|
448
|
+
prefix: classPrefixOf(consumer),
|
|
449
|
+
name: slug
|
|
450
|
+
}),
|
|
451
|
+
variables: sourceVarPrefix(consumer, slug)
|
|
452
|
+
} }
|
|
453
|
+
});
|
|
454
|
+
recordStatedModifiers({
|
|
455
|
+
config: view,
|
|
456
|
+
bound: statedModifiersOf(stated)
|
|
457
|
+
});
|
|
458
|
+
bySlug.set(slug, {
|
|
459
|
+
owner,
|
|
460
|
+
view
|
|
461
|
+
});
|
|
462
|
+
return view;
|
|
463
|
+
}
|
|
464
|
+
const vendorViews = /* @__PURE__ */ new WeakMap();
|
|
394
465
|
/** Views are built per consumer, owner, slug and shadowing, since every linked component of one owner
|
|
395
466
|
* shares one. */
|
|
396
467
|
const views = /* @__PURE__ */ new WeakMap();
|
|
@@ -441,7 +512,7 @@ function linkedComponentModule(config, componentPathOrRef) {
|
|
|
441
512
|
const owner = config.configFor(fileRef);
|
|
442
513
|
const pin = publishedPin(config, slug);
|
|
443
514
|
if (!owner || !pin) return void 0;
|
|
444
|
-
const shadowed = askedSource !== void 0;
|
|
515
|
+
const shadowed = askedSource !== void 0 && parsed !== void 0 && config.resolve(Component.kind, parsed.path) !== void 0;
|
|
445
516
|
const view = cachedView(config, (shadowed && owner === config.sourceFor(slug) ? config.drawnSourceFor(slug) : void 0) ?? owner, slug, shadowed);
|
|
446
517
|
const moduleKey = componentModuleKey(view, filePath);
|
|
447
518
|
if (!moduleKey) return void 0;
|
|
@@ -492,4 +563,4 @@ function publishedPin(config, slug) {
|
|
|
492
563
|
}
|
|
493
564
|
}
|
|
494
565
|
//#endregion
|
|
495
|
-
export { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView };
|
|
566
|
+
export { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView, vendorStyleView };
|
|
@@ -2,8 +2,8 @@ import { MINTED, collectRefs, isMintedRow, kindOf, pathOf, rewriteRefs, sourceOf
|
|
|
2
2
|
import { rejectData } from "../../framework/rejection.js";
|
|
3
3
|
import { kindBorrowable } from "../../framework/registry.js";
|
|
4
4
|
import { File } from "./File.js";
|
|
5
|
-
import { componentModuleFilePaths, componentRegistryImports } from "./component-module.js";
|
|
6
5
|
import { PIN_KIND, covers, declarationOf, includeWrite, narrowDeclaration } from "./link-declaration.js";
|
|
6
|
+
import { componentModuleFilePaths, componentRegistryImports } from "./component-module.js";
|
|
7
7
|
//#region src/entities/system/copy-plan.ts
|
|
8
8
|
/**
|
|
9
9
|
* The source's entries one path names: every item of the kind for `'*'`, a folder's members for a
|
|
@@ -73,6 +73,7 @@ function planCopy({ config, input }) {
|
|
|
73
73
|
const wholesale = input.data === "*";
|
|
74
74
|
const source = config.sourceFor(slug);
|
|
75
75
|
if (!source) rejectData(`Cannot copy through "${slug}" — nothing has resolved that link.`);
|
|
76
|
+
if (config.sourceTypeOf(slug) === "vendor") rejectData(`Cannot copy through "${slug}" — it is a vendor source, which is used as shipped. Copied in, its components would draw from this system's entities of the same names. To take them as your own, make the source \`linked\` first.`);
|
|
76
77
|
/** The kinds named, with what to take of each. An accessor this config has no kind for is refused
|
|
77
78
|
* by name, since it is a typo rather than a source that offers nothing. */
|
|
78
79
|
const wanted = [];
|
|
@@ -970,6 +970,12 @@ type WidestComponentBuilder = ComponentBuilder<LayerMap, PropMap, unknown, unkno
|
|
|
970
970
|
type LinkedHandle<Handle, Props extends PropMap = Record<never, never>, Layers extends Record<string, LayerElement> = Record<never, never>> = Handle extends {
|
|
971
971
|
metadata(meta: never): infer Builder;
|
|
972
972
|
} ? Builder extends ComponentBuilder<infer L extends LayerMap, infer P extends PropMap, infer E, infer D, infer F extends string, infer S extends StateMap> ? WithStatics<ComponentBuilder<Without<L, keyof Layers> & Layers extends infer Swapped extends LayerMap ? Swapped : L, CompactProps<Without<P, keyof Props> & Props>, E, D, F, S>, Builder, Omit<Handle, keyof Builder>> : Handle : Handle;
|
|
973
|
+
/**
|
|
974
|
+
* The tombstones a `vendor` pin's handle is laid over with, as {@link LinkedHandle}'s `Props`: this
|
|
975
|
+
* system's style props and modifiers, and the style-property props the component itself or a forwarded
|
|
976
|
+
* layer declares (`Own`). Its values are its source's, so its call site takes none of them.
|
|
977
|
+
*/
|
|
978
|
+
type VendorWithheld<Own extends string = never> = { readonly [K in (keyof RegisteredStyleProps & string) | (keyof RegisteredModifiers & string) | Own]: null };
|
|
973
979
|
/**
|
|
974
980
|
* A rebuilt handle with the source handle's statics beside it, when it has any. A static whose
|
|
975
981
|
* builder is the handle's own is the rebuilt handle, with that static's own statics beside it.
|
|
@@ -1004,4 +1010,4 @@ interface DefineComponent {
|
|
|
1004
1010
|
declare function definePropsFirst<const P extends PropMap<LayerPath>>(props: P & NoInfer<{ [K in keyof P]: Exact<P[K], AuthoredProp<LayerPath>> }>): ComponentBuilder<LayerMap, CompactProps<P>>;
|
|
1005
1011
|
declare const defineComponent: DefineComponent;
|
|
1006
1012
|
//#endregion
|
|
1007
|
-
export { AsInput, AuthoredComponent, AuthoredDefaultsOf, AuthoredProp, ComponentBuilder, ComponentPropsOf, GlyphComponent, GlyphValue, LayerElement, LayerMap, LinkedHandle, ModifierProps, PhantomCallProps, PhantomReadProps, PropCondition, PropDecl, PropMap, RegisteredMembers, RenderArgs, SlotCodeForm, SlotDecl, StateMap, StyleProps, StyleRefProps, StyleRefs, StyleRuleInput, UnconditionalDefaults, defineComponent };
|
|
1013
|
+
export { AsInput, AuthoredComponent, AuthoredDefaultsOf, AuthoredProp, ComponentBuilder, ComponentPropsOf, GlyphComponent, GlyphValue, LayerElement, LayerMap, LinkedHandle, ModifierProps, PhantomCallProps, PhantomReadProps, PropCondition, PropDecl, PropMap, RegisteredMembers, RenderArgs, SlotCodeForm, SlotDecl, StateMap, StyleProps, StyleRefProps, StyleRefs, StyleRuleInput, UnconditionalDefaults, VendorWithheld, defineComponent };
|
|
@@ -51,6 +51,15 @@ const librariesOf = createSliceMemo({
|
|
|
51
51
|
compute: (_config) => /* @__PURE__ */ new Map()
|
|
52
52
|
});
|
|
53
53
|
function readIconLibrary(config, path) {
|
|
54
|
+
const at = path.lastIndexOf("@");
|
|
55
|
+
if (at > 0) {
|
|
56
|
+
const owner = config.sourceFor(path.slice(at + 1));
|
|
57
|
+
const library = owner ? iconLibrary(owner, path.slice(0, at)) : void 0;
|
|
58
|
+
return library ? {
|
|
59
|
+
...library,
|
|
60
|
+
path
|
|
61
|
+
} : void 0;
|
|
62
|
+
}
|
|
54
63
|
const group = Icon.groups(config).find((entry) => entry.path === path);
|
|
55
64
|
if (!group) return void 0;
|
|
56
65
|
const { items: _items, sizes, variants, ...meta } = group.meta;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { ConfigOp } from "../../framework/config-op.js";
|
|
2
|
+
import { Config } from "../../framework/Config.js";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/system/vendor-conditions.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The pin's modifier mappings that map nothing in the attached source: a path the source doesn't
|
|
7
|
+
* hold, or a modifier of another category than ours. Such a modifier keeps the vendor's own
|
|
8
|
+
* activation, which isn't what the entry asked for, so a build reports it.
|
|
9
|
+
*/
|
|
10
|
+
declare function unheldVendorModifierMappings({
|
|
11
|
+
config,
|
|
12
|
+
slug
|
|
13
|
+
}: {
|
|
14
|
+
readonly config: Config;
|
|
15
|
+
readonly slug: string;
|
|
16
|
+
}): string[];
|
|
17
|
+
/**
|
|
18
|
+
* The vendor's modifiers this config states as its own, vendor path to our path: the ones the pin
|
|
19
|
+
* maps, then the modes a selector switches that we hold at the same path. A modifier that asks
|
|
20
|
+
* about a surface (`composite`) is never bound, since the surface it asks about is the vendor's.
|
|
21
|
+
*/
|
|
22
|
+
declare function vendorModifierBindings({
|
|
23
|
+
consumer,
|
|
24
|
+
slug
|
|
25
|
+
}: {
|
|
26
|
+
readonly consumer: Config;
|
|
27
|
+
readonly slug: string;
|
|
28
|
+
}): ReadonlyMap<string, string>;
|
|
29
|
+
/** A vendor's mode that nothing in the consuming config turns on. */
|
|
30
|
+
interface UnmappedVendorMode {
|
|
31
|
+
readonly slug: string;
|
|
32
|
+
/** The vendor's modifier, by path. */
|
|
33
|
+
readonly modifier: string;
|
|
34
|
+
/** The selector that turns it on. */
|
|
35
|
+
readonly selector: string;
|
|
36
|
+
/** This config's one mode of the same name, which a mapping would most likely name. */
|
|
37
|
+
readonly candidate?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Each mode of a `vendor` pin's source that what the pin takes varies under, and that nothing in
|
|
41
|
+
* this config turns on: a selector switches it, no binding states it as one of ours
|
|
42
|
+
* ({@link vendorModifierBindings}), and none of our modifiers is switched by the same selector. It
|
|
43
|
+
* keeps the vendor's own switch, which only the app can set, so the lint reports it.
|
|
44
|
+
*
|
|
45
|
+
* A mode a query decides is left out, since the device answers it wherever the component renders.
|
|
46
|
+
*/
|
|
47
|
+
declare function unmappedVendorModes(config: Config): UnmappedVendorMode[];
|
|
48
|
+
/** One mode of a `vendor` pin's source, with how this config states it. */
|
|
49
|
+
interface VendorMode {
|
|
50
|
+
/** The vendor's modifier, by path. */
|
|
51
|
+
readonly modifier: string;
|
|
52
|
+
/**
|
|
53
|
+
* The mode of this config it holds under: the one the pin maps it to, or the one at its own path
|
|
54
|
+
* ({@link vendorModifierBindings}).
|
|
55
|
+
*/
|
|
56
|
+
readonly follows?: {
|
|
57
|
+
readonly path: string;
|
|
58
|
+
readonly by: 'mapping' | 'path';
|
|
59
|
+
};
|
|
60
|
+
/** The path the pin's `options` map it to, as written, whether or not the mapping binds it. */
|
|
61
|
+
readonly mappedTo?: string;
|
|
62
|
+
/** The selector that turns it on, when nothing in this config does ({@link unmappedVendorModes}). */
|
|
63
|
+
readonly unmapped?: {
|
|
64
|
+
readonly selector: string;
|
|
65
|
+
};
|
|
66
|
+
/** This config's one mode of the same name, for a mode that follows none of ours. */
|
|
67
|
+
readonly candidate?: string;
|
|
68
|
+
}
|
|
69
|
+
/** A `vendor` pin's modes, and the modes of this config one of them can be mapped to. */
|
|
70
|
+
interface VendorModes {
|
|
71
|
+
readonly modes: readonly VendorMode[];
|
|
72
|
+
readonly targets: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The modes of a `vendor` pin's attached source that a mapping can state: each one a mode group
|
|
76
|
+
* holds, activated by a selector or a query, and not one the vendor itself takes as shipped.
|
|
77
|
+
* `undefined` for a pin that isn't `vendor`, or whose source isn't attached, since the recorded
|
|
78
|
+
* closure holds only the modes this config's refs reach.
|
|
79
|
+
*/
|
|
80
|
+
declare function vendorModes({
|
|
81
|
+
config,
|
|
82
|
+
slug
|
|
83
|
+
}: {
|
|
84
|
+
readonly config: Config;
|
|
85
|
+
readonly slug: string;
|
|
86
|
+
}): VendorModes | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The edit that maps one of a `vendor` pin's modifiers to one of this config's, or, with `to` as
|
|
89
|
+
* `null`, removes the mapping. Whatever else the pin's entry for it says is kept. The pin refuses an
|
|
90
|
+
* empty entry, so a removal that leaves none drops the entry, and the accessor when it was the last.
|
|
91
|
+
*/
|
|
92
|
+
declare function vendorModeMapping({
|
|
93
|
+
config,
|
|
94
|
+
slug,
|
|
95
|
+
modifier,
|
|
96
|
+
to
|
|
97
|
+
}: {
|
|
98
|
+
readonly config: Config;
|
|
99
|
+
readonly slug: string;
|
|
100
|
+
readonly modifier: string;
|
|
101
|
+
readonly to: string | null;
|
|
102
|
+
}): ConfigOp;
|
|
103
|
+
/**
|
|
104
|
+
* A `vendor` pin's source with its bound modifiers activating as this config's do
|
|
105
|
+
* ({@link vendorModifierBindings}). Each keeps the vendor's path, so the vendor's tokens, rules and
|
|
106
|
+
* style props read against it unchanged. `undefined` for a pin that isn't `vendor`, or whose source
|
|
107
|
+
* isn't attached.
|
|
108
|
+
*/
|
|
109
|
+
declare function vendorSource({
|
|
110
|
+
consumer,
|
|
111
|
+
slug
|
|
112
|
+
}: {
|
|
113
|
+
readonly consumer: Config;
|
|
114
|
+
readonly slug: string;
|
|
115
|
+
}): Config | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* The path a modifier is stated under: ours, for a vendor's modifier bound to one of ours, and its
|
|
118
|
+
* own otherwise. What names a mode outside the stylesheet's own selector reads this, as the
|
|
119
|
+
* attribute an editor forces a mode with does.
|
|
120
|
+
*/
|
|
121
|
+
declare function statedModifierPath(config: Config, path: string): string;
|
|
122
|
+
//#endregion
|
|
123
|
+
export { UnmappedVendorMode, VendorMode, VendorModes, statedModifierPath, unheldVendorModifierMappings, unmappedVendorModes, vendorModeMapping, vendorModes, vendorModifierBindings, vendorSource };
|