@vectoriox/iox-ui 5.1.0 → 5.3.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/actions-core/index.d.ts +86 -0
- package/actions-core/package.json +3 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +57 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -0
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +3 -14
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +91 -14
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +4 -17
- package/index.d.ts +62 -2
- package/package.json +5 -1
- package/src/actions-core/action.model.ts +79 -0
- package/src/actions-core/availability.ts +46 -0
- package/src/actions-core/public-api.ts +12 -0
- package/src/forms-core/rule-catalog.ts +6 -25
|
@@ -7,6 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
9
9
|
import Lenis from 'lenis';
|
|
10
|
+
import '@vectoriox/iox-ui/actions-core';
|
|
10
11
|
|
|
11
12
|
class ViewPositionDirective {
|
|
12
13
|
constructor(_elr) {
|
|
@@ -3475,19 +3476,6 @@ const PATTERN_PRESET_OPTIONS = Object.freeze([
|
|
|
3475
3476
|
{ value: PatternPreset.Letters, labelKey: 'forms.rules.preset.letters' },
|
|
3476
3477
|
{ value: PatternPreset.Slug, labelKey: 'forms.rules.preset.slug' },
|
|
3477
3478
|
]);
|
|
3478
|
-
const ACTION_DESCRIPTORS = Object.freeze([
|
|
3479
|
-
{ type: 'store', labelKey: 'forms.actions.store', locked: true },
|
|
3480
|
-
{ type: 'email', labelKey: 'forms.actions.email' },
|
|
3481
|
-
{ type: 'redirect', labelKey: 'forms.actions.redirect' },
|
|
3482
|
-
{ type: 'createItem', labelKey: 'forms.actions.createItem', planned: true },
|
|
3483
|
-
{ type: 'webhook', labelKey: 'forms.actions.webhook', planned: true },
|
|
3484
|
-
{ type: 'autoReply', labelKey: 'forms.actions.autoReply', planned: true },
|
|
3485
|
-
]);
|
|
3486
|
-
/** Destinations that can still be added — each at most once, and never a planned one. */
|
|
3487
|
-
function addableActions(existing = []) {
|
|
3488
|
-
const used = new Set(existing.map(action => action.type));
|
|
3489
|
-
return ACTION_DESCRIPTORS.filter(action => !action.locked && !action.planned && !used.has(action.type));
|
|
3490
|
-
}
|
|
3491
3479
|
|
|
3492
3480
|
/**
|
|
3493
3481
|
* The submit transport CONTRACT — what a host must provide to make a form actually send.
|
|
@@ -5007,6 +4995,95 @@ function compileTokenCss(tokens) {
|
|
|
5007
4995
|
};
|
|
5008
4996
|
}
|
|
5009
4997
|
|
|
4998
|
+
/** trait → `var(--iox-<token>, <packValue>)` for one node type. Unknown type → {}. */
|
|
4999
|
+
function resolveFlavorDefaults(type, pack) {
|
|
5000
|
+
const map = pack?.defaults?.[type];
|
|
5001
|
+
if (!map)
|
|
5002
|
+
return {};
|
|
5003
|
+
const byName = new Map((pack.tokens ?? []).map(t => [t.name, t.value]));
|
|
5004
|
+
const out = {};
|
|
5005
|
+
for (const [trait, tokenName] of Object.entries(map)) {
|
|
5006
|
+
const fallback = byName.get(tokenName);
|
|
5007
|
+
if (fallback === undefined)
|
|
5008
|
+
continue; // validator fails the build; runtime stays safe
|
|
5009
|
+
out[trait] = `var(--iox-${tokenName}, ${fallback})`;
|
|
5010
|
+
}
|
|
5011
|
+
return out;
|
|
5012
|
+
}
|
|
5013
|
+
/**
|
|
5014
|
+
* The ENGINE's half of the cascade: kebab `prop: var(…)` declarations for every pack default
|
|
5015
|
+
* the node's persisted styleProps does NOT set. Appended beside renderDefaultDeclarations —
|
|
5016
|
+
* same guard-on-undefined discipline, so a node saved post-F1 (var already serialised via the
|
|
5017
|
+
* builder's trait defaults) is untouched, and a legacy node picks the pack default up at
|
|
5018
|
+
* render time. Node styleProps always wins.
|
|
5019
|
+
*/
|
|
5020
|
+
function flavorDefaultDeclarations(type, styleProps, pack) {
|
|
5021
|
+
const sp = styleProps ?? {};
|
|
5022
|
+
const out = [];
|
|
5023
|
+
for (const [trait, value] of Object.entries(resolveFlavorDefaults(type, pack))) {
|
|
5024
|
+
if (sp[trait] === undefined)
|
|
5025
|
+
out.push(`${styleKeyToKebab(trait)}: ${value}`);
|
|
5026
|
+
}
|
|
5027
|
+
return out;
|
|
5028
|
+
}
|
|
5029
|
+
/**
|
|
5030
|
+
* The CI gate (flavors plan §10 C4): a pack may only name types and traits that exist in the
|
|
5031
|
+
* live component registry, and tokens it defines itself. Returns human-readable errors; a
|
|
5032
|
+
* consumer spec feeds it the REAL registry and asserts [].
|
|
5033
|
+
*/
|
|
5034
|
+
function validateFlavorPack(pack, knownTraitsByType) {
|
|
5035
|
+
const errors = [];
|
|
5036
|
+
const tokenNames = new Set((pack.tokens ?? []).map(t => t.name));
|
|
5037
|
+
for (const t of pack.tokens ?? []) {
|
|
5038
|
+
if (!t.name)
|
|
5039
|
+
errors.push(`${pack.id}: token with empty name`);
|
|
5040
|
+
if (!t.value)
|
|
5041
|
+
errors.push(`${pack.id}: token "${t.name}" has no value`);
|
|
5042
|
+
}
|
|
5043
|
+
for (const [type, traits] of Object.entries(pack.defaults ?? {})) {
|
|
5044
|
+
const known = knownTraitsByType[type];
|
|
5045
|
+
if (!known) {
|
|
5046
|
+
errors.push(`${pack.id}: unknown component type "${type}"`);
|
|
5047
|
+
continue;
|
|
5048
|
+
}
|
|
5049
|
+
const knownSet = known instanceof Set ? known : new Set(known);
|
|
5050
|
+
for (const [trait, tokenName] of Object.entries(traits)) {
|
|
5051
|
+
if (!knownSet.has(trait))
|
|
5052
|
+
errors.push(`${pack.id}: "${type}" has no style trait "${trait}"`);
|
|
5053
|
+
if (!tokenNames.has(tokenName))
|
|
5054
|
+
errors.push(`${pack.id}: "${type}.${trait}" references undefined token "${tokenName}"`);
|
|
5055
|
+
if (/[:(]|^#|\d/.test(tokenName))
|
|
5056
|
+
errors.push(`${pack.id}: "${type}.${trait}" must name a token, not a value ("${tokenName}")`);
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
return errors;
|
|
5060
|
+
}
|
|
5061
|
+
/**
|
|
5062
|
+
* Swiss — the default pack (flavors plan §8: "the flavor that can never embarrass anyone").
|
|
5063
|
+
* Deliberately SMALL at F1: radius + control padding on the clickables, surface radius on Card.
|
|
5064
|
+
* Colour, type and motion arrive with the brand step (F2) — a colour default here would repaint
|
|
5065
|
+
* legacy pages before anyone chose anything.
|
|
5066
|
+
*/
|
|
5067
|
+
const SWISS_FLAVOR = {
|
|
5068
|
+
id: 'swiss',
|
|
5069
|
+
version: 1,
|
|
5070
|
+
label: 'Swiss',
|
|
5071
|
+
blurb: 'Grid discipline, hairline rules, near-zero motion.',
|
|
5072
|
+
tokens: [
|
|
5073
|
+
{ name: 'radius-control', value: '4px', type: 'size', group: 'radius' },
|
|
5074
|
+
{ name: 'radius-surface', value: '4px', type: 'size', group: 'radius' },
|
|
5075
|
+
{ name: 'space-control', value: '10px 18px', type: 'spacing', group: 'space' },
|
|
5076
|
+
{ name: 'space-stack', value: '12px', type: 'spacing', group: 'space' },
|
|
5077
|
+
],
|
|
5078
|
+
defaults: {
|
|
5079
|
+
Button: { borderRadius: 'radius-control', padding: 'space-control' },
|
|
5080
|
+
ButtonBlock: { borderRadius: 'radius-control', padding: 'space-control' },
|
|
5081
|
+
Card: { borderRadius: 'radius-surface' },
|
|
5082
|
+
},
|
|
5083
|
+
};
|
|
5084
|
+
/** What both renderers use until F2 lets an org choose. */
|
|
5085
|
+
const DEFAULT_FLAVOR = SWISS_FLAVOR;
|
|
5086
|
+
|
|
5010
5087
|
/**
|
|
5011
5088
|
* page-style — the ONE compiler that turns a page's style settings into CSS.
|
|
5012
5089
|
*
|
|
@@ -6844,5 +6921,5 @@ function effectiveTransitionId(anim) {
|
|
|
6844
6921
|
* Generated bundle index. Do not edit.
|
|
6845
6922
|
*/
|
|
6846
6923
|
|
|
6847
|
-
export { AOSService, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CONTEXT_ACTION_TYPES, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ContainerComponent, ContextStore, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DeclarationContext, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PART_CLASS_NAMES, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_RESPONSIVE_TRAITS, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VALIDATION_STATES, VALIDATION_STATE_CLASS, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, activeActions, applyBindingPipes, applyFeel, breakpointDef, breakpointForWidth, breakpointQueryFor, buildDataSourceFilter, buildPartSelector, buildRelatedFilter, buildSwiperBreakpoints, buildTargetedStateSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, compilePageStyle, compileTokenCss, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, countOverrides, dataSourcePlanToRequest, declaredInputNames, defaultMessageResolver, deriveSeoFromContent, describeSeoFields, effectiveTransitionId, excludeSelf, feelFor, getByPath, getSeoValue, initialSlotValues, isActionEnabled, isContextAction, isInputOverriddenAt, isOverriddenAt, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, mediaQueryFor, mergeSwiperBreakpoints, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, normalizeGalleryImage, normalizeIconClass, parentBreakpoint, parseUrlList, partClassName, planDataSource, planResponsiveRules, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resetSeoField, resolveBoundValue, resolveContextValue, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSeo, resolveSiblings, resolveSingleItemId, resolveStateStyles, resolveStyleProps, resolveValueChain, rewriteViewportUnits, safeSetInput, setInputOverride, setOverride, setSeoAuto, setSeoBinding, setSeoOverride, setSeoValue, stateNamesIn, stripSuppressedProps, styleKeyToKebab, tokensToDarkVarMap, tokensToVarMap, variableAliases, variableItemsFrom, withContextSlots, wrapInBreakpointQuery, wrapInMediaQuery };
|
|
6924
|
+
export { AOSService, BREAKPOINTS, Breakpoint, BreakpointQueryKind, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CONTEXT_ACTION_TYPES, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ContainerComponent, ContextStore, DEFAULT_FLAVOR, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_PHOSPHOR_WEIGHT, DEFAULT_WIDTH_BY_TYPE, DeclarationContext, FormRenderState, FormRuntimeService, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IOX_FORM_MESSAGES, IOX_FORM_NAVIGATOR, IOX_FORM_TRANSPORT, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxFieldComponent, IoxFormComponent, IoxFormErrorComponent, IoxFormSuccessComponent, IoxPageComponent, IoxPageModule, IoxSubmitButtonComponent, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PART_CLASS_NAMES, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SWIPER_RESPONSIVE_TRAITS, SWISS_FLAVOR, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VALIDATION_STATES, VALIDATION_STATE_CLASS, VIRTUAL_TRAIT_GROUPS, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, activeActions, applyBindingPipes, applyFeel, breakpointDef, breakpointForWidth, breakpointQueryFor, buildDataSourceFilter, buildPartSelector, buildRelatedFilter, buildSwiperBreakpoints, buildTargetedStateSelector, buildTransitionTimeline, cascadeChain, clearInputOverride, clearOverride, collectContextSlotKeys, collectReferencedAliases, compileDeclarations, compilePageStyle, compileTokenCss, composeVirtualTraits, computeRelative, contextActionEffect, contextSlotKeys, countOverrides, dataSourcePlanToRequest, declaredInputNames, defaultMessageResolver, deriveSeoFromContent, describeSeoFields, effectiveTransitionId, excludeSelf, feelFor, flavorDefaultDeclarations, getByPath, getSeoValue, initialSlotValues, isActionEnabled, isContextAction, isInputOverriddenAt, isOverriddenAt, isReservedAlias, isValidSlotKey, legacyEnterToTransition, matchRouteParams, mediaQueryFor, mergeSwiperBreakpoints, nearestCommonAncestorId, nodeCssId, nodeUsesContext, normalizeCollectionResult, normalizeGalleryImage, normalizeIconClass, parentBreakpoint, parseUrlList, partClassName, planDataSource, planResponsiveRules, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resetSeoField, resolveBoundValue, resolveContextValue, resolveDerivedInto, resolveFlavorDefaults, resolveGalleryEffect, resolveGalleryUrls, resolveInputChain, resolveInputs, resolvePageTransition, resolvePath, resolveRelativeInto, resolveRepeaterItems, resolveSeo, resolveSiblings, resolveSingleItemId, resolveStateStyles, resolveStyleProps, resolveValueChain, rewriteViewportUnits, safeSetInput, setInputOverride, setOverride, setSeoAuto, setSeoBinding, setSeoOverride, setSeoValue, stateNamesIn, stripSuppressedProps, styleKeyToKebab, tokensToDarkVarMap, tokensToVarMap, validateFlavorPack, variableAliases, variableItemsFrom, withContextSlots, wrapInBreakpointQuery, wrapInMediaQuery };
|
|
6848
6925
|
//# sourceMappingURL=vectoriox-iox-ui.mjs.map
|