@vectoriox/iox-builder 6.0.1 → 6.1.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.
|
@@ -16,7 +16,7 @@ import { SelectModule } from 'primeng/select';
|
|
|
16
16
|
import { TooltipModule } from 'primeng/tooltip';
|
|
17
17
|
import { DialogModule } from 'primeng/dialog';
|
|
18
18
|
import * as i1 from '@vectoriox/iox-ui';
|
|
19
|
-
import { VALIDATION_STATES as VALIDATION_STATES$1, VALIDATION_STATE_CLASS as VALIDATION_STATE_CLASS$1, DEFAULT_WIDTH_BY_TYPE, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, Breakpoint, BREAKPOINTS, countOverrides, setOverride, defaultElementStyleFor, applyElementStyle, stripSuppressedProps, DeclarationContext, buildPartSelector, planResponsiveRules, resolveStyleProps, buildTargetedStateSelector, statePseudoClass, compileTokenCssBlocks, fontsForTokens, GOOGLE_FONTS_FILE_ORIGIN, googleFontHref, compileDeclarations, wrapInBreakpointQuery, BreakpointQueryKind, breakpointDef, breakpointForWidth, FormRenderState, safeSetInput, ContextStore, ComponentInstanceRegistryService, isActionEnabled, isContextAction, contextActionEffect, resolveContextValue, declaredInputNames, emptyImagePlaceholder, syncNodeDesignClasses, composeVirtualTraits, withDefaultHoverTransition, stateNamesIn, partClassName, resolveInputs, setInputOverride, collectContextSlotKeys, withContextSlots, compilePageStyle, nodeUsesContext, resolveBoundValue, IS_PREVIEW, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule, PALETTE_PRESETS, PART_CLASS_NAMES } from '@vectoriox/iox-ui';
|
|
19
|
+
import { VALIDATION_STATES as VALIDATION_STATES$1, VALIDATION_STATE_CLASS as VALIDATION_STATE_CLASS$1, DEFAULT_WIDTH_BY_TYPE, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, Breakpoint, BREAKPOINTS, countOverrides, setOverride, defaultElementStyleFor, applyElementStyle, stripSuppressedProps, DeclarationContext, buildPartSelector, planResponsiveRules, resolveStyleProps, buildTargetedStateSelector, statePseudoClass, compileTokenCssBlocks, catalogFontId, fontsForTokens, GOOGLE_FONTS_FILE_ORIGIN, googleFontHref, compileDeclarations, wrapInBreakpointQuery, BreakpointQueryKind, breakpointDef, breakpointForWidth, FormRenderState, safeSetInput, ContextStore, ComponentInstanceRegistryService, isActionEnabled, isContextAction, contextActionEffect, resolveContextValue, declaredInputNames, emptyImagePlaceholder, syncNodeDesignClasses, composeVirtualTraits, withDefaultHoverTransition, stateNamesIn, partClassName, resolveInputs, setInputOverride, collectContextSlotKeys, withContextSlots, compilePageStyle, nodeUsesContext, resolveBoundValue, IS_PREVIEW, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule, PALETTE_PRESETS, PART_CLASS_NAMES } from '@vectoriox/iox-ui';
|
|
20
20
|
export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
|
|
21
21
|
import Lenis from 'lenis';
|
|
22
22
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
@@ -1982,6 +1982,7 @@ class StyleRegistryService {
|
|
|
1982
1982
|
this.nodeTypes = new Map();
|
|
1983
1983
|
this.tokenCss = { base: '', dark: '' };
|
|
1984
1984
|
this.tokenRows = [];
|
|
1985
|
+
this.uploadedFamilies = [];
|
|
1985
1986
|
this.tokenMode = 'auto';
|
|
1986
1987
|
this.styleEl = null;
|
|
1987
1988
|
this._flushPending = false;
|
|
@@ -2287,6 +2288,25 @@ class StyleRegistryService {
|
|
|
2287
2288
|
this.styleEl = null;
|
|
2288
2289
|
}
|
|
2289
2290
|
}
|
|
2291
|
+
/**
|
|
2292
|
+
* The families the org UPLOADED (the host reads them from storage). Such a family renders from the
|
|
2293
|
+
* org's own faces, so the canvas never links Google's — even when the catalog has one of that name:
|
|
2294
|
+
* an uploaded Inter variable file sat beside Google's static Inter cuts and lost to them (DS5.1). A
|
|
2295
|
+
* link added before the list arrived is removed, or it would keep shadowing the upload.
|
|
2296
|
+
*/
|
|
2297
|
+
setUploadedFamilies(families) {
|
|
2298
|
+
this.uploadedFamilies = [...(families ?? [])];
|
|
2299
|
+
const head = this.styleEl?.ownerDocument?.head ?? (typeof document !== 'undefined' ? document.head : null);
|
|
2300
|
+
for (const family of this.uploadedFamilies) {
|
|
2301
|
+
const id = catalogFontId(family);
|
|
2302
|
+
if (!id || !head)
|
|
2303
|
+
continue;
|
|
2304
|
+
head.querySelectorAll(`link[rel="stylesheet"][${BUILDER_FONT_LINK_ATTR}]`)
|
|
2305
|
+
.forEach(l => { if (l.getAttribute(BUILDER_FONT_LINK_ATTR) === id)
|
|
2306
|
+
l.remove(); });
|
|
2307
|
+
}
|
|
2308
|
+
this.flush();
|
|
2309
|
+
}
|
|
2290
2310
|
/**
|
|
2291
2311
|
* The Google families the org's font tokens name — the SAME catalog and URL the SSR engine links
|
|
2292
2312
|
* (design-core `fontsForTokens` / `googleFontHref`), one `<link>` per family. They only declare
|
|
@@ -2297,7 +2317,7 @@ class StyleRegistryService {
|
|
|
2297
2317
|
const head = this.styleEl?.ownerDocument?.head;
|
|
2298
2318
|
if (!head)
|
|
2299
2319
|
return;
|
|
2300
|
-
const ids = fontsForTokens(this.tokenRows, { usedCss: nodeCss });
|
|
2320
|
+
const ids = fontsForTokens(this.tokenRows, { usedCss: nodeCss, uploaded: this.uploadedFamilies });
|
|
2301
2321
|
if (!ids.length)
|
|
2302
2322
|
return;
|
|
2303
2323
|
const doc = head.ownerDocument;
|