@vectoriox/iox-ui 5.49.0 → 5.51.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/fesm2022/vectoriox-iox-ui-generation-core.mjs +148 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +12 -2
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +212 -2
- package/harness-core/index.d.ts +18 -3
- package/package.json +1 -1
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/site-build-run.ts +263 -0
- package/src/harness-core/public-api.ts +1 -0
- package/src/harness-core/structure.ts +23 -0
|
@@ -9832,6 +9832,153 @@ function describePlanData(plan) {
|
|
|
9832
9832
|
return plan.pages.map(page => ({ pageKey: page.key, lines: pageLines(page, plan, label) }));
|
|
9833
9833
|
}
|
|
9834
9834
|
|
|
9835
|
+
/**
|
|
9836
|
+
* A site build's WIRE vocabulary (AI plan §3b, W2): what iox-cms's `site-builds` API answers and what every
|
|
9837
|
+
* client of it reads — the run's statuses and steps, what it created, why Undo kept something, the preflight's
|
|
9838
|
+
* refusals, and the one spelling of each document's `buildKey`. ONE definition: iox-cms stores and answers it,
|
|
9839
|
+
* the website wizard (W3) polls it. Pure types, enums and helpers; no transport.
|
|
9840
|
+
*/
|
|
9841
|
+
var SiteBuildKind;
|
|
9842
|
+
(function (SiteBuildKind) {
|
|
9843
|
+
SiteBuildKind["Build"] = "build";
|
|
9844
|
+
})(SiteBuildKind || (SiteBuildKind = {}));
|
|
9845
|
+
var SiteBuildStatus;
|
|
9846
|
+
(function (SiteBuildStatus) {
|
|
9847
|
+
SiteBuildStatus["Running"] = "running";
|
|
9848
|
+
SiteBuildStatus["Done"] = "done";
|
|
9849
|
+
SiteBuildStatus["Failed"] = "failed";
|
|
9850
|
+
SiteBuildStatus["Undoing"] = "undoing";
|
|
9851
|
+
SiteBuildStatus["Undone"] = "undone";
|
|
9852
|
+
})(SiteBuildStatus || (SiteBuildStatus = {}));
|
|
9853
|
+
/** The statuses a runner advances — and the ones that hold the org's single-run slot. */
|
|
9854
|
+
const ACTIVE_BUILD_STATUSES = [SiteBuildStatus.Running, SiteBuildStatus.Undoing];
|
|
9855
|
+
/** The steps of a build, in the order they run. */
|
|
9856
|
+
var BuildStep;
|
|
9857
|
+
(function (BuildStep) {
|
|
9858
|
+
BuildStep["Preflight"] = "preflight";
|
|
9859
|
+
BuildStep["ContentTypes"] = "content-types";
|
|
9860
|
+
BuildStep["SampleImages"] = "sample-images";
|
|
9861
|
+
BuildStep["Items"] = "items";
|
|
9862
|
+
BuildStep["DataSources"] = "data-sources";
|
|
9863
|
+
BuildStep["Pages"] = "pages";
|
|
9864
|
+
BuildStep["Globals"] = "globals";
|
|
9865
|
+
BuildStep["Look"] = "look";
|
|
9866
|
+
})(BuildStep || (BuildStep = {}));
|
|
9867
|
+
const BUILD_STEPS = Object.values(BuildStep);
|
|
9868
|
+
var StepState;
|
|
9869
|
+
(function (StepState) {
|
|
9870
|
+
StepState["Wait"] = "wait";
|
|
9871
|
+
StepState["Run"] = "run";
|
|
9872
|
+
StepState["Done"] = "done";
|
|
9873
|
+
StepState["Failed"] = "failed";
|
|
9874
|
+
})(StepState || (StepState = {}));
|
|
9875
|
+
/** What a build creates, as Undo walks it. */
|
|
9876
|
+
var CreatedKind;
|
|
9877
|
+
(function (CreatedKind) {
|
|
9878
|
+
CreatedKind["ContentType"] = "content-type";
|
|
9879
|
+
/** Fields the build added to a content type it found (types are shared by every organization of a studio). */
|
|
9880
|
+
CreatedKind["ContentTypeFields"] = "content-type-fields";
|
|
9881
|
+
CreatedKind["SampleImage"] = "sample-image";
|
|
9882
|
+
CreatedKind["Item"] = "item";
|
|
9883
|
+
CreatedKind["DataSource"] = "data-source";
|
|
9884
|
+
CreatedKind["Page"] = "page";
|
|
9885
|
+
CreatedKind["Global"] = "global";
|
|
9886
|
+
CreatedKind["Look"] = "look";
|
|
9887
|
+
})(CreatedKind || (CreatedKind = {}));
|
|
9888
|
+
/** Why Undo left something in place. */
|
|
9889
|
+
var KeptReason;
|
|
9890
|
+
(function (KeptReason) {
|
|
9891
|
+
KeptReason["Edited"] = "edited";
|
|
9892
|
+
KeptReason["Published"] = "published";
|
|
9893
|
+
KeptReason["InUse"] = "in-use";
|
|
9894
|
+
/** Added to a content type every organization shares: removing a field is the studio owner's change. */
|
|
9895
|
+
KeptReason["Shared"] = "shared";
|
|
9896
|
+
})(KeptReason || (KeptReason = {}));
|
|
9897
|
+
var BuildNoticeCode;
|
|
9898
|
+
(function (BuildNoticeCode) {
|
|
9899
|
+
/** Storage is not configured: sample items get the empty image box, and the run says so. */
|
|
9900
|
+
BuildNoticeCode["NoStorage"] = "no-storage";
|
|
9901
|
+
/** A content type the build reuses is not public in this studio: the site will not show its items. */
|
|
9902
|
+
BuildNoticeCode["ContentTypeNotPublic"] = "content-type-not-public";
|
|
9903
|
+
})(BuildNoticeCode || (BuildNoticeCode = {}));
|
|
9904
|
+
var PreflightRefusalCode;
|
|
9905
|
+
(function (PreflightRefusalCode) {
|
|
9906
|
+
/** The Site Plan itself is invalid (`validateSitePlan`); `issue` is the validator's code. */
|
|
9907
|
+
PreflightRefusalCode["InvalidPlan"] = "invalid-plan";
|
|
9908
|
+
/** A route the plan wants is already a page of this organization. */
|
|
9909
|
+
PreflightRefusalCode["RouteTaken"] = "route-taken";
|
|
9910
|
+
/** The studio's content type of that name stores a field the plan needs differently (type or control) —
|
|
9911
|
+
* types are shared by every organization, so the build reuses one it finds and adds what it lacks. */
|
|
9912
|
+
PreflightRefusalCode["ContentTypeConflict"] = "content-type-conflict";
|
|
9913
|
+
/** The name may not be a content type (a platform collection, or not a valid name). */
|
|
9914
|
+
PreflightRefusalCode["ContentTypeName"] = "content-type-name";
|
|
9915
|
+
/** The plan creates a content type or adds fields to one, and the caller may not (an org owner/admin — schema_all). */
|
|
9916
|
+
PreflightRefusalCode["ContentTypesNeedPermission"] = "content-types-need-permission";
|
|
9917
|
+
/** The org library holds the alias with a different definition. */
|
|
9918
|
+
PreflightRefusalCode["DataSourceConflict"] = "data-source-conflict";
|
|
9919
|
+
/** The studio has pages AND a header/footer: replace or keep them is the caller's choice (D7). */
|
|
9920
|
+
PreflightRefusalCode["GlobalsNeedDecision"] = "globals-need-decision";
|
|
9921
|
+
/** A global the plan adds has the id of one the studio keeps. */
|
|
9922
|
+
PreflightRefusalCode["GlobalTaken"] = "global-taken";
|
|
9923
|
+
})(PreflightRefusalCode || (PreflightRefusalCode = {}));
|
|
9924
|
+
/**
|
|
9925
|
+
* The stable key each written document carries beside `siteBuildId`: a step that runs twice looks it up first and
|
|
9926
|
+
* skips what exists (so a restart or a Retry continues without duplicates), and a reader finds what the run made
|
|
9927
|
+
* by it — the wizard opens the HOME page by `page(<its key>)`. One builder per kind.
|
|
9928
|
+
*/
|
|
9929
|
+
const buildKeys = {
|
|
9930
|
+
contentType: (name) => `schema:${name}`,
|
|
9931
|
+
contentTypeFields: (name) => `schema-fields:${name}`,
|
|
9932
|
+
item: (contentType, n) => `item:${contentType}:${n}`,
|
|
9933
|
+
sampleImage: (n) => `sample-image:${n}`,
|
|
9934
|
+
dataSource: (alias) => `data-source:${alias}`,
|
|
9935
|
+
page: (key) => `page:${key}`,
|
|
9936
|
+
global: (nodeId) => `global:${nodeId}`,
|
|
9937
|
+
look: () => 'look',
|
|
9938
|
+
};
|
|
9939
|
+
/** The id of the page a run made for the plan's home page, or null (not made yet, or no home page). */
|
|
9940
|
+
function builtHomePageId(run) {
|
|
9941
|
+
const home = run?.plan?.pages?.find(p => p.isHome) ?? run?.plan?.pages?.[0];
|
|
9942
|
+
if (!home)
|
|
9943
|
+
return null;
|
|
9944
|
+
const key = buildKeys.page(home.key);
|
|
9945
|
+
return run.created?.find(c => c.kind === CreatedKind.Page && c.buildKey === key)?.id ?? null;
|
|
9946
|
+
}
|
|
9947
|
+
/** The step a run stopped at, or null. */
|
|
9948
|
+
function failedBuildStep(run) {
|
|
9949
|
+
return run?.steps?.find(s => s.state === StepState.Failed) ?? null;
|
|
9950
|
+
}
|
|
9951
|
+
/** A run still holding the org's slot (building or undoing) — a page that left it comes back to its progress. */
|
|
9952
|
+
function isActiveBuild(run) {
|
|
9953
|
+
return !!run && ACTIVE_BUILD_STATUSES.includes(run.status);
|
|
9954
|
+
}
|
|
9955
|
+
/** What a build does with each content type its plan names (the preflight's `summary.contentTypes[].action`): content
|
|
9956
|
+
* types are shared by every organization of a studio, so one the studio already has is reused, or extended with the
|
|
9957
|
+
* fields it lacks — never created twice. */
|
|
9958
|
+
var ContentTypeAction;
|
|
9959
|
+
(function (ContentTypeAction) {
|
|
9960
|
+
ContentTypeAction["Create"] = "create";
|
|
9961
|
+
ContentTypeAction["Reuse"] = "reuse";
|
|
9962
|
+
ContentTypeAction["Extend"] = "extend";
|
|
9963
|
+
})(ContentTypeAction || (ContentTypeAction = {}));
|
|
9964
|
+
function buildStepFacts(plan, actions = {}) {
|
|
9965
|
+
const contentTypeActions = {};
|
|
9966
|
+
for (const t of plan.contentTypes) {
|
|
9967
|
+
const action = actions[t.name];
|
|
9968
|
+
if (action)
|
|
9969
|
+
(contentTypeActions[action] ??= []).push(t.label);
|
|
9970
|
+
}
|
|
9971
|
+
return {
|
|
9972
|
+
contentTypes: plan.contentTypes.map(t => t.label),
|
|
9973
|
+
contentTypeActions,
|
|
9974
|
+
items: plan.contentTypes.reduce((n, t) => n + (t.seed?.count ?? 0), 0),
|
|
9975
|
+
pages: plan.pages.length,
|
|
9976
|
+
routes: plan.pages.map(p => p.route),
|
|
9977
|
+
navLinks: plan.pages.filter(p => p.inNav).length,
|
|
9978
|
+
flavorId: plan.design.flavorId,
|
|
9979
|
+
};
|
|
9980
|
+
}
|
|
9981
|
+
|
|
9835
9982
|
/**
|
|
9836
9983
|
* @vectoriox/iox-ui/generation-core — the shared, FRAMEWORK-FREE site-plan core (design-system plan
|
|
9837
9984
|
* §6b, W1): the Site Plan shape + its validator, the pattern library and the Studio template (both
|
|
@@ -9848,5 +9995,5 @@ function describePlanData(plan) {
|
|
|
9848
9995
|
* Generated bundle index. Do not edit.
|
|
9849
9996
|
*/
|
|
9850
9997
|
|
|
9851
|
-
export { BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BaselineRole, BindScope, CardBindTarget, ComposeError, ComposeIssueCode, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, FACT_KEYS, GlobalSlot, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NavPagesSource, NavRole, NavShape, NavShapeError, PRICING_PATTERN, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PlaceholderKind, PlanDataSourceMode, PlanDataSourceType, RelativeOp, SAMPLE_IMAGE_REF, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_FACTS, SPEC_SITE_LIBRARY, SPEC_SITE_PATTERNS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_TEMPLATES, STUDIO_TEMPLATE, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, addBarItem, altSourceScopes, assertStyleSlots, assertValidSitePlan, barIconForRoute, blocksPublish, composeNavHeader, composeSection, composeSite, createSerializedNode, describePlanData, entranceAction, entranceInteraction, findNavRoot, isNonEmptyString, isPlainObject, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, parseSampleImageRef, pathAt, patternById, patternNeedsBinding, patternNodes, patternOptionalParts, patternScopes, patternSlots, patternTakesBinding, phoneMenuPages, planFromTemplate, planNavShape, releasedLayoutDefaults, removeBarItem, requiredShapeKeys, routeParams, sampleImageRef, sectionEntrances, setStyleProps, shapeKeys, siteNavPages, staggerDelay, validateSitePlan, walkSerialized };
|
|
9998
|
+
export { ACTIVE_BUILD_STATUSES, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BUILD_STEPS, BaselineRole, BindScope, BuildNoticeCode, BuildStep, CardBindTarget, ComposeError, ComposeIssueCode, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, FACT_KEYS, GlobalSlot, KeptReason, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NavPagesSource, NavRole, NavShape, NavShapeError, PRICING_PATTERN, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PlaceholderKind, PlanDataSourceMode, PlanDataSourceType, PreflightRefusalCode, RelativeOp, SAMPLE_IMAGE_REF, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_FACTS, SPEC_SITE_LIBRARY, SPEC_SITE_PATTERNS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_TEMPLATES, STUDIO_TEMPLATE, SiteBuildKind, SiteBuildStatus, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StepState, addBarItem, altSourceScopes, assertStyleSlots, assertValidSitePlan, barIconForRoute, blocksPublish, buildKeys, buildStepFacts, builtHomePageId, composeNavHeader, composeSection, composeSite, createSerializedNode, describePlanData, entranceAction, entranceInteraction, failedBuildStep, findNavRoot, isActiveBuild, isNonEmptyString, isPlainObject, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, parseSampleImageRef, pathAt, patternById, patternNeedsBinding, patternNodes, patternOptionalParts, patternScopes, patternSlots, patternTakesBinding, phoneMenuPages, planFromTemplate, planNavShape, releasedLayoutDefaults, removeBarItem, requiredShapeKeys, routeParams, sampleImageRef, sectionEntrances, setStyleProps, shapeKeys, siteNavPages, staggerDelay, validateSitePlan, walkSerialized };
|
|
9852
9999
|
//# sourceMappingURL=vectoriox-iox-ui-generation-core.mjs.map
|