@vectoriox/iox-ui 5.48.0 → 5.50.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.
@@ -9832,6 +9832,129 @@ 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
+ CreatedKind["SampleImage"] = "sample-image";
9880
+ CreatedKind["Item"] = "item";
9881
+ CreatedKind["DataSource"] = "data-source";
9882
+ CreatedKind["Page"] = "page";
9883
+ CreatedKind["Global"] = "global";
9884
+ CreatedKind["Look"] = "look";
9885
+ })(CreatedKind || (CreatedKind = {}));
9886
+ /** Why Undo left something in place. */
9887
+ var KeptReason;
9888
+ (function (KeptReason) {
9889
+ KeptReason["Edited"] = "edited";
9890
+ KeptReason["Published"] = "published";
9891
+ KeptReason["InUse"] = "in-use";
9892
+ })(KeptReason || (KeptReason = {}));
9893
+ var BuildNoticeCode;
9894
+ (function (BuildNoticeCode) {
9895
+ /** Storage is not configured: sample items get the empty image box, and the run says so. */
9896
+ BuildNoticeCode["NoStorage"] = "no-storage";
9897
+ })(BuildNoticeCode || (BuildNoticeCode = {}));
9898
+ var PreflightRefusalCode;
9899
+ (function (PreflightRefusalCode) {
9900
+ /** The Site Plan itself is invalid (`validateSitePlan`); `issue` is the validator's code. */
9901
+ PreflightRefusalCode["InvalidPlan"] = "invalid-plan";
9902
+ /** A route the plan wants is already a page of this organization. */
9903
+ PreflightRefusalCode["RouteTaken"] = "route-taken";
9904
+ /** A content type of that name exists in this instance (content types are instance-wide). */
9905
+ PreflightRefusalCode["ContentTypeTaken"] = "content-type-taken";
9906
+ /** The name may not be a content type (a platform collection, or not a valid name). */
9907
+ PreflightRefusalCode["ContentTypeName"] = "content-type-name";
9908
+ /** Content types act on the whole instance: only the instance owner may create them (SEC1). */
9909
+ PreflightRefusalCode["ContentTypesNeedInstanceOwner"] = "content-types-need-instance-owner";
9910
+ /** The org library holds the alias with a different definition. */
9911
+ PreflightRefusalCode["DataSourceConflict"] = "data-source-conflict";
9912
+ /** The studio has pages AND a header/footer: replace or keep them is the caller's choice (D7). */
9913
+ PreflightRefusalCode["GlobalsNeedDecision"] = "globals-need-decision";
9914
+ /** A global the plan adds has the id of one the studio keeps. */
9915
+ PreflightRefusalCode["GlobalTaken"] = "global-taken";
9916
+ })(PreflightRefusalCode || (PreflightRefusalCode = {}));
9917
+ /**
9918
+ * The stable key each written document carries beside `siteBuildId`: a step that runs twice looks it up first and
9919
+ * skips what exists (so a restart or a Retry continues without duplicates), and a reader finds what the run made
9920
+ * by it — the wizard opens the HOME page by `page(<its key>)`. One builder per kind.
9921
+ */
9922
+ const buildKeys = {
9923
+ contentType: (name) => `schema:${name}`,
9924
+ item: (contentType, n) => `item:${contentType}:${n}`,
9925
+ sampleImage: (n) => `sample-image:${n}`,
9926
+ dataSource: (alias) => `data-source:${alias}`,
9927
+ page: (key) => `page:${key}`,
9928
+ global: (nodeId) => `global:${nodeId}`,
9929
+ look: () => 'look',
9930
+ };
9931
+ /** The id of the page a run made for the plan's home page, or null (not made yet, or no home page). */
9932
+ function builtHomePageId(run) {
9933
+ const home = run?.plan?.pages?.find(p => p.isHome) ?? run?.plan?.pages?.[0];
9934
+ if (!home)
9935
+ return null;
9936
+ const key = buildKeys.page(home.key);
9937
+ return run.created?.find(c => c.kind === CreatedKind.Page && c.buildKey === key)?.id ?? null;
9938
+ }
9939
+ /** The step a run stopped at, or null. */
9940
+ function failedBuildStep(run) {
9941
+ return run?.steps?.find(s => s.state === StepState.Failed) ?? null;
9942
+ }
9943
+ /** A run still holding the org's slot (building or undoing) — a page that left it comes back to its progress. */
9944
+ function isActiveBuild(run) {
9945
+ return !!run && ACTIVE_BUILD_STATUSES.includes(run.status);
9946
+ }
9947
+ function buildStepFacts(plan) {
9948
+ return {
9949
+ contentTypes: plan.contentTypes.map(t => t.label),
9950
+ items: plan.contentTypes.reduce((n, t) => n + (t.seed?.count ?? 0), 0),
9951
+ pages: plan.pages.length,
9952
+ routes: plan.pages.map(p => p.route),
9953
+ navLinks: plan.pages.filter(p => p.inNav).length,
9954
+ flavorId: plan.design.flavorId,
9955
+ };
9956
+ }
9957
+
9835
9958
  /**
9836
9959
  * @vectoriox/iox-ui/generation-core — the shared, FRAMEWORK-FREE site-plan core (design-system plan
9837
9960
  * §6b, W1): the Site Plan shape + its validator, the pattern library and the Studio template (both
@@ -9848,5 +9971,5 @@ function describePlanData(plan) {
9848
9971
  * Generated bundle index. Do not edit.
9849
9972
  */
9850
9973
 
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 };
9974
+ export { ACTIVE_BUILD_STATUSES, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BUILD_STEPS, BaselineRole, BindScope, BuildNoticeCode, BuildStep, CardBindTarget, ComposeError, ComposeIssueCode, 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
9975
  //# sourceMappingURL=vectoriox-iox-ui-generation-core.mjs.map