@yahoo/uds-create-config 4.42.1 → 4.42.3
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.js +1 -1
- package/dist/configs/system.js +2 -2
- package/dist/entities/native/NativeModifier.js +1 -1
- package/dist/entities/system/Component.js +3 -3
- package/dist/entities/system/Composite.js +1 -1
- package/dist/entities/system/File.js +1 -1
- package/dist/entities/system/Font.js +1 -1
- package/dist/entities/system/Icon.js +1 -1
- package/dist/entities/system/Modifier.js +1 -1
- package/dist/entities/system/Package.js +1 -1
- package/dist/entities/system/Settings.js +1 -1
- package/dist/entities/system/StyleProperty.js +2 -2
- package/dist/entities/system/Token.js +1 -1
- package/dist/entities/system/defineComponent.js +1 -1
- package/dist/entities/system/forward-route-invariants.js +1 -1
- package/dist/entities/system/glyph-identity.js +1 -1
- package/dist/entities/system/icon-domain-invariants.js +2 -2
- package/dist/entities/system/root-layer-invariants.js +1 -1
- package/dist/entities/system/style-bag.js +2 -2
- package/dist/framework/Config.js +1 -1
- package/dist/framework/projections.js +2 -2
- package/dist/framework/source-integrity.d.ts +7 -9
- package/dist/framework/source-integrity.js +51 -27
- package/dist/index.js +10 -10
- package/dist/migrations/2.0.0/v1-artifact.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AI_LANES } from "../ai-lanes.js";
|
|
2
|
-
import { defineEntity } from "../framework/defineEntity.js";
|
|
3
2
|
import { Package } from "../entities/system/Package.js";
|
|
3
|
+
import { defineEntity } from "../framework/defineEntity.js";
|
|
4
4
|
import { Component } from "../entities/system/Component.js";
|
|
5
5
|
import { Icon } from "../entities/system/Icon.js";
|
|
6
6
|
import { captureNodeOps } from "../capture/node-ops.js";
|
package/dist/configs/system.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Font } from "../entities/system/Font.js";
|
|
2
|
+
import { Settings } from "../entities/system/Settings.js";
|
|
3
|
+
import { StyleProperty } from "../entities/system/StyleProperty.js";
|
|
2
4
|
import { Package } from "../entities/system/Package.js";
|
|
3
5
|
import { Composite } from "../entities/system/Composite.js";
|
|
4
6
|
import { Modifier } from "../entities/system/Modifier.js";
|
|
5
|
-
import { Settings } from "../entities/system/Settings.js";
|
|
6
|
-
import { StyleProperty } from "../entities/system/StyleProperty.js";
|
|
7
7
|
import { File } from "../entities/system/File.js";
|
|
8
8
|
import { Token } from "../entities/system/Token.js";
|
|
9
9
|
import { Component } from "../entities/system/Component.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
1
|
import { modifierAxis, modifierGroupFields, modifierInvariants } from "../system/Modifier.js";
|
|
2
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/entities/native/NativeModifier.ts
|
|
5
5
|
/**
|
|
@@ -4,16 +4,16 @@ import { isPlainObject } from "../../framework/utils/field-path.js";
|
|
|
4
4
|
import { pathInput } from "../../framework/schemas.js";
|
|
5
5
|
import { derivedColor, gradient } from "./color.js";
|
|
6
6
|
import { shadowValue } from "./shadow.js";
|
|
7
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
8
7
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
9
8
|
import { childrenPolicy, forwardedPropName } from "./element.js";
|
|
10
9
|
import { listedIn } from "../../framework/utils/enumerated.js";
|
|
10
|
+
import { storedPreview } from "../../framework/preview-store.js";
|
|
11
|
+
import { glyphPropsOf, propOwner, propValueDomain, refListOf, resolveComponentProps, stylePropValueLeaves, validateComponentProps } from "../../framework/projections.js";
|
|
11
12
|
import { valueSchemaOf } from "../../framework/value-domain.js";
|
|
12
13
|
import { Package } from "./Package.js";
|
|
13
14
|
import { bindPreviewGlyphs, glyphLeafOf } from "./glyph-identity.js";
|
|
14
15
|
import { Style, addBagKeyIssues, anatomyPropValue, bagNameEdges, bagRewriteName, bindBagTokens, collectBag, isPlainRecord, openBag, styleValue } from "./style-bag.js";
|
|
15
|
-
import {
|
|
16
|
-
import { glyphPropsOf, propOwner, propValueDomain, refListOf, resolveComponentProps, stylePropValueLeaves, validateComponentProps } from "../../framework/projections.js";
|
|
16
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
17
17
|
import { carriesContent, intoName, isValueSlot, renderBoundProp, routedPropIn, routesContent } from "../../framework/prop-surface.js";
|
|
18
18
|
import { slotAnatomyPropOf, slotTargetsOf, withoutTruthyTerm } from "../../framework/render-spec.js";
|
|
19
19
|
import { listSlots, namedSlots, slotHostedBy, slotOf } from "../../spec/slot.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
1
|
import { Style, bagNameEdges, bagRewriteName, collectBag } from "./style-bag.js";
|
|
2
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/entities/system/Composite.ts
|
|
5
5
|
/** A composite's one bag. Same shape as a component's, so the same hooks read it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
1
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
3
2
|
import { Package } from "./Package.js";
|
|
3
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/entities/system/File.ts
|
|
6
6
|
/** The extensions a module resolver will try, and the ones {@link isBinaryAsset} therefore counts as
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
1
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
2
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
const FontFile = defineSubEntity({
|
|
5
5
|
name: "file",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isRef, pathOf } from "../../framework/utils/refs.js";
|
|
2
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
2
|
import { spellValues } from "../../framework/value-domain.js";
|
|
4
3
|
import { Package } from "./Package.js";
|
|
5
4
|
import { iconMemberMetadata, iconMetadataDeclaration, iconMetadataFormat } from "./icon-metadata.js";
|
|
6
5
|
import { glyphMembersOf, glyphOfLibrary, libraryGlyphFacts, recordGlyphIdentities } from "./glyph-identity.js";
|
|
6
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
7
7
|
import { iconDomainInvariants } from "./icon-domain-invariants.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/entities/system/Icon.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRef, refTo } from "../../framework/utils/refs.js";
|
|
2
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
2
|
import { Composite } from "./Composite.js";
|
|
3
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/entities/system/Modifier.ts
|
|
6
6
|
/** The category a typed group gives its members. Untyped groups are folders; their members are
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
2
1
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
2
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/entities/system/Package.ts
|
|
5
5
|
const PackageExport = defineSubEntity({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { splitRef } from "../../framework/utils/refs.js";
|
|
2
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
2
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
4
3
|
import { buildFields } from "../../configs/build-options.js";
|
|
5
4
|
import { parseRootFontSize } from "../../css/root-font-size.js";
|
|
6
5
|
import { createSliceMemo } from "../../framework/memo.js";
|
|
7
6
|
import { resolveInputDir } from "../../framework/registry-dir.js";
|
|
8
7
|
import { safelistSchema } from "./safelist.js";
|
|
8
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/entities/system/Settings.ts
|
|
11
11
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isRef, kindOf, pathOf, ref, refSchema, sourceOf, splitRef } from "../../framework/utils/refs.js";
|
|
2
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
3
2
|
import { cssValueIssue, isCssProperty } from "../../css/values.js";
|
|
4
|
-
import { camelCase } from "./style-bag.js";
|
|
5
3
|
import { createSliceMemo } from "../../framework/memo.js";
|
|
6
4
|
import { isIdentifier } from "../../framework/utils/identifier.js";
|
|
5
|
+
import { camelCase } from "./style-bag.js";
|
|
6
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/entities/system/StyleProperty.ts
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isRef, pathOf, ref, sourceOf } from "../../framework/utils/refs.js";
|
|
2
2
|
import { composedValueSchemas } from "./composed-values.js";
|
|
3
|
-
import { defineEntity } from "../../framework/defineEntity.js";
|
|
4
3
|
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
5
4
|
import { Font } from "./Font.js";
|
|
6
5
|
import { Modifier } from "./Modifier.js";
|
|
6
|
+
import { defineEntity } from "../../framework/defineEntity.js";
|
|
7
7
|
import { authoringPhantom } from "../../framework/utils/authoring-phantom.js";
|
|
8
8
|
import { TOKEN_READERS, spellTokenRead } from "./token-values.js";
|
|
9
9
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { canonicalCondition, isRef, kindOf, memberRef, pathOf } from "../../framework/utils/refs.js";
|
|
2
|
-
import { glyphIdentityOf, glyphPackageRefOf, isComponentType } from "./glyph-identity.js";
|
|
3
2
|
import "../../framework/preview-store.js";
|
|
3
|
+
import { glyphIdentityOf, glyphPackageRefOf, isComponentType } from "./glyph-identity.js";
|
|
4
4
|
import { Component, canonicalWhen, layerRef } from "./Component.js";
|
|
5
5
|
//#region src/entities/system/defineComponent.ts
|
|
6
6
|
function build(body) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRef, pathOf } from "../../framework/utils/refs.js";
|
|
2
|
-
import { isPlainRecord } from "./style-bag.js";
|
|
3
2
|
import { createSliceMemo } from "../../framework/memo.js";
|
|
3
|
+
import { isPlainRecord } from "./style-bag.js";
|
|
4
4
|
import { forwardRoutes, intoName, routedPropIn, routesContent } from "../../framework/prop-surface.js";
|
|
5
5
|
//#region src/entities/system/forward-route-invariants.ts
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isRef, kindOf, memberOf, pathOf } from "../../framework/utils/refs.js";
|
|
2
|
+
import { memberLeaves } from "../../framework/projections.js";
|
|
2
3
|
import { spellValues } from "../../framework/value-domain.js";
|
|
3
4
|
import { glyphExportRule } from "./icon-metadata.js";
|
|
4
|
-
import { memberLeaves } from "../../framework/projections.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/entities/system/glyph-identity.ts
|
|
7
7
|
const PACKAGE = "package";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isRef, kindOf, memberOf, pathOf } from "../../framework/utils/refs.js";
|
|
2
|
-
import { spellValues } from "../../framework/value-domain.js";
|
|
3
|
-
import { collectBag, isPlainRecord } from "./style-bag.js";
|
|
4
2
|
import { createSliceMemo } from "../../framework/memo.js";
|
|
5
3
|
import { glyphComponentOf, glyphLibrariesOf, memberLeaves, propValueDomain, refListOf, resolveComponentProps } from "../../framework/projections.js";
|
|
4
|
+
import { spellValues } from "../../framework/value-domain.js";
|
|
5
|
+
import { collectBag, isPlainRecord } from "./style-bag.js";
|
|
6
6
|
//#region src/entities/system/icon-domain-invariants.ts
|
|
7
7
|
/**
|
|
8
8
|
* The rules that hold between icon libraries and the components that draw them: a leaf two bound
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isPlainRecord } from "./style-bag.js";
|
|
2
1
|
import { createSliceMemo } from "../../framework/memo.js";
|
|
2
|
+
import { isPlainRecord } from "./style-bag.js";
|
|
3
3
|
//#region src/entities/system/root-layer-invariants.ts
|
|
4
4
|
/**
|
|
5
5
|
* A component's layers include one named `root`. The name is what the anatomy's edge list starts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isExtendedRef, isRef, ref, refSchema, splitRef } from "../../framework/utils/refs.js";
|
|
2
2
|
import { composedValueSchemas } from "./composed-values.js";
|
|
3
|
-
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
4
3
|
import { isCssProperty, kebabCase } from "../../css/values.js";
|
|
4
|
+
import { defineSubEntity } from "../../framework/defineSubEntity.js";
|
|
5
|
+
import { glyphPropsOfBody, refListOf, stylePropTokenPath } from "../../framework/projections.js";
|
|
5
6
|
import { valueSchemaOf } from "../../framework/value-domain.js";
|
|
6
7
|
import { glyphLeafOf, glyphPackageRef } from "./glyph-identity.js";
|
|
7
|
-
import { glyphPropsOfBody, refListOf, stylePropTokenPath } from "../../framework/projections.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/entities/system/style-bag.ts
|
|
10
10
|
/** The explicit type annotation breaks the `z.lazy` self-reference cycle and keeps the
|
package/dist/framework/Config.js
CHANGED
|
@@ -5,10 +5,10 @@ import { describePatch } from "./plan.js";
|
|
|
5
5
|
import { applyPathDelta, isPlainObject, namedFields, pathSegments, sectionDelta, touchedFields } from "./utils/field-path.js";
|
|
6
6
|
import { METADATA_KEYS, declaredField } from "./utils/field-schema.js";
|
|
7
7
|
import { dataSchema, resolveInputSchema } from "./schemas.js";
|
|
8
|
+
import { authoredBag } from "./projections.js";
|
|
8
9
|
import { borrowedSlug, classifyOverlay } from "./source-integrity.js";
|
|
9
10
|
import { kindBorrowable, titleCase } from "./registry.js";
|
|
10
11
|
import { isGroupBody } from "./utils/group.js";
|
|
11
|
-
import { authoredBag } from "./projections.js";
|
|
12
12
|
import { isAuthoringPhantom, phantomsIn } from "./utils/authoring-phantom.js";
|
|
13
13
|
import { addressOf, editOp, inputOf, opVerb } from "./config-op.js";
|
|
14
14
|
import { configSchemas } from "./config-ops.js";
|
|
@@ -2,12 +2,12 @@ import { isRef, kindOf, memberOf, pathOf, ref, refLeaf, sourceOf, splitRef } fro
|
|
|
2
2
|
import { isComposedValue, renderComposedValue } from "../entities/system/composed-values.js";
|
|
3
3
|
import { forwardedPropName, forwardsOf, rootLayerOf } from "../entities/system/element.js";
|
|
4
4
|
import { fontFamilyStack } from "../entities/system/Font.js";
|
|
5
|
-
import { listedIn } from "./utils/enumerated.js";
|
|
6
|
-
import { modifierCategory } from "../entities/system/Modifier.js";
|
|
7
5
|
import { createSliceMemo } from "./memo.js";
|
|
8
6
|
import { classPrefixOf, varPrefixOf } from "../entities/system/Settings.js";
|
|
9
7
|
import { StyleProperty, leavesOfStylePropValue } from "../entities/system/StyleProperty.js";
|
|
8
|
+
import { listedIn } from "./utils/enumerated.js";
|
|
10
9
|
import { isConditionalPreview, storedPreview, unconditionalPreviewProps } from "./preview-store.js";
|
|
10
|
+
import { modifierCategory } from "../entities/system/Modifier.js";
|
|
11
11
|
//#region src/framework/projections.ts
|
|
12
12
|
/**
|
|
13
13
|
* Expanded value domains, cached per config instance.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocalOverlay } from "./sources.js";
|
|
2
2
|
import { Config } from "./Config.js";
|
|
3
|
+
import { ModifierCategory } from "../entities/system/Modifier.js";
|
|
3
4
|
|
|
4
5
|
//#region src/framework/source-integrity.d.ts
|
|
5
6
|
/** One ref that names something its source does not have. */
|
|
@@ -219,22 +220,19 @@ interface DanglingDirective {
|
|
|
219
220
|
* catch one level down.
|
|
220
221
|
*/
|
|
221
222
|
declare function danglingDirectives(config: Config): DanglingDirective[];
|
|
222
|
-
/** A borrowed token whose
|
|
223
|
+
/** A borrowed token whose condition is missing or has a different category here. */
|
|
223
224
|
interface UnstatableCondition {
|
|
224
225
|
slug: string;
|
|
225
226
|
/** The source's token path. */
|
|
226
227
|
token: string;
|
|
227
228
|
/** The modifier its override names. */
|
|
228
229
|
modifier: string;
|
|
230
|
+
categories?: {
|
|
231
|
+
source: ModifierCategory | 'plain';
|
|
232
|
+
consumer: ModifierCategory | 'plain';
|
|
233
|
+
};
|
|
229
234
|
}
|
|
230
|
-
/**
|
|
231
|
-
* Every borrowed token that varies under a modifier this config does not declare.
|
|
232
|
-
*
|
|
233
|
-
* A borrowed token's conditional values apply under your modifier of that name — so if you don't have the
|
|
234
|
-
* name, the condition is unstatable and the token silently behaves like a lesser version of itself: one
|
|
235
|
-
* colour where the source had two. Refusing is the same rule inlining already enforces; this is the other
|
|
236
|
-
* path to the same place, for a token a consumer references directly rather than one that got inlined.
|
|
237
|
-
*/
|
|
235
|
+
/** Borrowed conditions need a consumer modifier with the same name and category. */
|
|
238
236
|
declare function unstatableConditions(config: Config): UnstatableCondition[];
|
|
239
237
|
/** A token of ours whose conditional value names another system's modifier. */
|
|
240
238
|
interface UnstatableOverride {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { collectRefs, isExtendedRef, isRef, kindOf, memberOf, pathOf, sourceOf, splitRef } from "./utils/refs.js";
|
|
2
2
|
import { isPlainObject, setAtPath } from "./utils/field-path.js";
|
|
3
3
|
import { isComposedValue } from "../entities/system/composed-values.js";
|
|
4
|
+
import { modifierCategory } from "../entities/system/Modifier.js";
|
|
4
5
|
//#region src/framework/source-integrity.ts
|
|
5
6
|
/**
|
|
6
7
|
* Whether a config's links hold — the two ways a borrow can be broken by the other side.
|
|
@@ -233,13 +234,14 @@ function valueAt(body, field) {
|
|
|
233
234
|
return segmentsOf(field).reduce((at, key) => isWalkable(at) ? at[key] : void 0, body);
|
|
234
235
|
}
|
|
235
236
|
/**
|
|
236
|
-
* Whether a
|
|
237
|
-
*
|
|
238
|
-
* over a rule the source has is the source's own, and a rule list, which has
|
|
239
|
-
* restate it to reach the rule at all.
|
|
237
|
+
* Whether a leaf sits under a style rule's `when` (`styles.<rule>.when…`). That's the rule's name,
|
|
238
|
+
* not its content: a rule is stored under the key its condition spells, with `when` kept in its body,
|
|
239
|
+
* so a condition restated over a rule the source has is the source's own, and a rule list, which has
|
|
240
|
+
* no key to write, has to restate it to reach the rule at all. Judged as a leaf, every extension of
|
|
241
|
+
* an existing conditional rule read as a restatement; it has no verb of its own.
|
|
240
242
|
*/
|
|
241
|
-
function isRuleCondition(
|
|
242
|
-
return
|
|
243
|
+
function isRuleCondition(address) {
|
|
244
|
+
return address.length >= 3 && address[0] === "styles" && address[2] === "when";
|
|
243
245
|
}
|
|
244
246
|
/**
|
|
245
247
|
* The verb one local leaf is against the source's value at the same address: `extend` where the
|
|
@@ -296,7 +298,7 @@ function misdeclaredOverlays(config) {
|
|
|
296
298
|
if (!overlay) continue;
|
|
297
299
|
const theirs = source.resolve(kind, path)?.toJSON();
|
|
298
300
|
for (const field of leafAddresses(overlay.extend)) {
|
|
299
|
-
if (
|
|
301
|
+
if (isRuleCondition(field)) continue;
|
|
300
302
|
if (valueAt(theirs, field) !== void 0) found.push({
|
|
301
303
|
slug,
|
|
302
304
|
kind,
|
|
@@ -305,13 +307,16 @@ function misdeclaredOverlays(config) {
|
|
|
305
307
|
field
|
|
306
308
|
});
|
|
307
309
|
}
|
|
308
|
-
for (const field of leafAddresses(overlay.override))
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
310
|
+
for (const field of leafAddresses(overlay.override)) {
|
|
311
|
+
if (isRuleCondition(field)) continue;
|
|
312
|
+
if (valueAt(theirs, field) === void 0) found.push({
|
|
313
|
+
slug,
|
|
314
|
+
kind,
|
|
315
|
+
path,
|
|
316
|
+
declared: "override",
|
|
317
|
+
field
|
|
318
|
+
});
|
|
319
|
+
}
|
|
315
320
|
}
|
|
316
321
|
}
|
|
317
322
|
return found;
|
|
@@ -330,6 +335,7 @@ function classifyOverlay(local, theirs) {
|
|
|
330
335
|
let extend = {};
|
|
331
336
|
for (const [address, value] of leafEntries(local)) {
|
|
332
337
|
if (address.length === 0) continue;
|
|
338
|
+
if (isRuleCondition(address)) continue;
|
|
333
339
|
const verb = leafVerb({
|
|
334
340
|
ours: value,
|
|
335
341
|
theirs: valueAt(theirs, address)
|
|
@@ -337,6 +343,18 @@ function classifyOverlay(local, theirs) {
|
|
|
337
343
|
if (verb === "override") override = setAtPath(override, address, value);
|
|
338
344
|
else if (verb === "extend") extend = setAtPath(extend, address, value);
|
|
339
345
|
}
|
|
346
|
+
const rules = local.styles;
|
|
347
|
+
if (isWalkable(rules)) for (const [key, rule] of Object.entries(rules)) {
|
|
348
|
+
const when = isWalkable(rule) ? rule.when : void 0;
|
|
349
|
+
if (when === void 0) continue;
|
|
350
|
+
const at = [
|
|
351
|
+
"styles",
|
|
352
|
+
key,
|
|
353
|
+
"when"
|
|
354
|
+
];
|
|
355
|
+
if (valueAt(override, ["styles", key]) !== void 0) override = setAtPath(override, at, when);
|
|
356
|
+
if (valueAt(extend, ["styles", key]) !== void 0) extend = setAtPath(extend, at, when);
|
|
357
|
+
}
|
|
340
358
|
return {
|
|
341
359
|
...Object.keys(override).length > 0 ? { override } : {},
|
|
342
360
|
...Object.keys(extend).length > 0 ? { extend } : {}
|
|
@@ -406,18 +424,11 @@ function danglingDirectives(config) {
|
|
|
406
424
|
}
|
|
407
425
|
return found;
|
|
408
426
|
}
|
|
409
|
-
/**
|
|
410
|
-
* Every borrowed token that varies under a modifier this config does not declare.
|
|
411
|
-
*
|
|
412
|
-
* A borrowed token's conditional values apply under your modifier of that name — so if you don't have the
|
|
413
|
-
* name, the condition is unstatable and the token silently behaves like a lesser version of itself: one
|
|
414
|
-
* colour where the source had two. Refusing is the same rule inlining already enforces; this is the other
|
|
415
|
-
* path to the same place, for a token a consumer references directly rather than one that got inlined.
|
|
416
|
-
*/
|
|
427
|
+
/** Borrowed conditions need a consumer modifier with the same name and category. */
|
|
417
428
|
function unstatableConditions(config) {
|
|
418
429
|
const found = [];
|
|
419
430
|
for (const slug of config.sourceSlugs()) {
|
|
420
|
-
const source = config.
|
|
431
|
+
const source = config.sourceFor(slug);
|
|
421
432
|
if (!source) continue;
|
|
422
433
|
for (const target of config.sourceClosure(slug, "token")) {
|
|
423
434
|
const token = pathOf(target);
|
|
@@ -427,12 +438,25 @@ function unstatableConditions(config) {
|
|
|
427
438
|
const refs = Array.isArray(entry.on) ? entry.on : [entry.on];
|
|
428
439
|
for (const ref of refs) {
|
|
429
440
|
if (!isRef(ref)) continue;
|
|
430
|
-
const modifier =
|
|
431
|
-
if (config.resolve("modifier", modifier))
|
|
432
|
-
|
|
441
|
+
const modifier = pathOf(ref);
|
|
442
|
+
if (!config.resolve("modifier", modifier)) {
|
|
443
|
+
found.push({
|
|
444
|
+
slug,
|
|
445
|
+
token,
|
|
446
|
+
modifier
|
|
447
|
+
});
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
const sourceCategory = modifierCategory(source, splitRef(ref).qualifiedPath) ?? "plain";
|
|
451
|
+
const consumerCategory = modifierCategory(config, modifier) ?? "plain";
|
|
452
|
+
if (sourceCategory !== consumerCategory) found.push({
|
|
433
453
|
slug,
|
|
434
454
|
token,
|
|
435
|
-
modifier
|
|
455
|
+
modifier,
|
|
456
|
+
categories: {
|
|
457
|
+
source: sourceCategory,
|
|
458
|
+
consumer: consumerCategory
|
|
459
|
+
}
|
|
436
460
|
});
|
|
437
461
|
}
|
|
438
462
|
}
|
package/dist/index.js
CHANGED
|
@@ -9,19 +9,10 @@ import { DERIVED_COLOR_SPACE, alpha, darken, isDerivedColor, isGradient, lighten
|
|
|
9
9
|
import { isShadow, renderShadow, shadow } from "./entities/system/shadow.js";
|
|
10
10
|
import { isTransition, renderTransition, transition } from "./entities/system/transition.js";
|
|
11
11
|
import { composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, isComposedValue, renderComposedValue } from "./entities/system/composed-values.js";
|
|
12
|
-
import {
|
|
13
|
-
import { opsForKind } from "./framework/registry.js";
|
|
14
|
-
import { GROUP, brandGroup, isGroupBody } from "./framework/utils/group.js";
|
|
15
|
-
import { defineEntity } from "./framework/defineEntity.js";
|
|
12
|
+
import { CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, cssProperty, cssValueIssue, isCssProperty } from "./css/values.js";
|
|
16
13
|
import { defineSubEntity } from "./framework/defineSubEntity.js";
|
|
17
14
|
import { VOID_ELEMENTS, childrenPolicy, forwardsOf, ownerOf, partsOf, renderedElement, renderedTarget, rootLayerOf } from "./entities/system/element.js";
|
|
18
15
|
import { Font, FontFile, cssString, fontFamilyStack } from "./entities/system/Font.js";
|
|
19
|
-
import { CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, cssProperty, cssValueIssue, isCssProperty } from "./css/values.js";
|
|
20
|
-
import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
|
|
21
|
-
import { Package } from "./entities/system/Package.js";
|
|
22
|
-
import { ICON_METADATA_FORMATS, glyphExportRule, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, tablerExportName, tablerStyledExportName } from "./entities/system/icon-metadata.js";
|
|
23
|
-
import { Composite } from "./entities/system/Composite.js";
|
|
24
|
-
import { MODIFIER_CATEGORIES, Modifier, WEB_ACTIVATIONS, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf } from "./entities/system/Modifier.js";
|
|
25
16
|
import { BUILD_DEFAULTS } from "./configs/build-options.js";
|
|
26
17
|
import { resolveValueType, sniffValueType } from "./css/value-type.js";
|
|
27
18
|
import { parseRootFontSize } from "./css/root-font-size.js";
|
|
@@ -33,6 +24,15 @@ import { isIdentifier, isReservedWord } from "./framework/utils/identifier.js";
|
|
|
33
24
|
import { STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StyleProperty, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName } from "./entities/system/StyleProperty.js";
|
|
34
25
|
import { UNCONDITIONAL_PREVIEW_KEY, storedPreview, unconditionalPreviewProps } from "./framework/preview-store.js";
|
|
35
26
|
import { authoredBag, authoredValue, className, cssPropValue, cssVar, cssVarRef, declaredPropDefaults, declaredPropRouting, glyphComponentOf, glyphLibrariesOf, glyphPropsOf, heldLinked, iconToolAxisOptions, iconToolFor, iconToolOf, iconToolsOf, keyedPreviewConditions, linkedVarNaming, memberFromLeaf, memberLeaves, negatedCssValue, opacityPercentage, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, propOwner, propValueDomain, propValueFromAxis, refListOf, renderStyleValue, resolveComponentProps, resolveFieldValue, resolveTokenValue, resolveTokenValueUnder, routedBag, sourceVarPrefix, styleAliasesOf, styleDeclarations, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, validateComponentProps } from "./framework/projections.js";
|
|
27
|
+
import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
|
|
28
|
+
import { Package } from "./entities/system/Package.js";
|
|
29
|
+
import { ICON_METADATA_FORMATS, glyphExportRule, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, tablerExportName, tablerStyledExportName } from "./entities/system/icon-metadata.js";
|
|
30
|
+
import { Composite } from "./entities/system/Composite.js";
|
|
31
|
+
import { MODIFIER_CATEGORIES, Modifier, WEB_ACTIVATIONS, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf } from "./entities/system/Modifier.js";
|
|
32
|
+
import { classifyOverlay, danglingDirectives, danglingSourcedRefs, leafAddresses, leafVerb, misdeclaredOverlays, overlayVerb, redundantQualifiers, unadoptedDirectives, unreadableBorrows, unstatableConditions, unstatableOverrides, valueAt } from "./framework/source-integrity.js";
|
|
33
|
+
import { opsForKind } from "./framework/registry.js";
|
|
34
|
+
import { GROUP, brandGroup, isGroupBody } from "./framework/utils/group.js";
|
|
35
|
+
import { defineEntity } from "./framework/defineEntity.js";
|
|
36
36
|
import { codeSlotsOf, forwardClaims, forwardRoutes, forwardedLayers, intoName, isValueSlot, layerPropRoutes, propApplies, propRegistryRef, renderBindingsOf, routedProp, routedPropIn, routesContent, slotCodeForms, standsInForCode, surfaceProp, surfaceProps } from "./framework/prop-surface.js";
|
|
37
37
|
import { graftPreviewElements, isPreviewElement } from "./spec/preview-elements.js";
|
|
38
38
|
import { layerStyles, ruleApplies } from "./framework/layer-styles.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isRef, pathOf, splitRef } from "../../framework/utils/refs.js";
|
|
2
2
|
import { alpha, darken, lighten, mix } from "../../entities/system/color.js";
|
|
3
|
-
import { Font } from "../../entities/system/Font.js";
|
|
4
3
|
import { isCssProperty, kebabCase } from "../../css/values.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Modifier } from "../../entities/system/Modifier.js";
|
|
4
|
+
import { Font } from "../../entities/system/Font.js";
|
|
7
5
|
import { StyleProperty } from "../../entities/system/StyleProperty.js";
|
|
8
6
|
import { cssVar } from "../../framework/projections.js";
|
|
7
|
+
import { Composite } from "../../entities/system/Composite.js";
|
|
8
|
+
import { Modifier } from "../../entities/system/Modifier.js";
|
|
9
9
|
import { Token, overrideKey } from "../../entities/system/Token.js";
|
|
10
10
|
import { Component, canonicalWhen } from "../../entities/system/Component.js";
|
|
11
11
|
import { Icon } from "../../entities/system/Icon.js";
|