@aglyn/aglyn 1.14.0 → 1.15.1
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/package.json +11 -11
- package/src/lib/app-utils/buy-now-pay-later.d.ts +45 -0
- package/src/lib/app-utils/buy-now-pay-later.js +68 -0
- package/src/lib/app-utils/buy-now-pay-later.js.map +1 -0
- package/src/lib/app-utils/contexts.d.ts +1 -0
- package/src/lib/app-utils/contexts.js +1 -0
- package/src/lib/app-utils/contexts.js.map +1 -1
- package/src/lib/app-utils/docs-help-sections.generated.js +6 -3
- package/src/lib/app-utils/docs-help-sections.generated.js.map +1 -1
- package/src/lib/app-utils/docs-help.generated.d.ts +6 -6
- package/src/lib/app-utils/docs-help.generated.js +14 -1
- package/src/lib/app-utils/docs-help.generated.js.map +1 -1
- package/src/lib/app-utils/docs-index.generated.js +20 -20
- package/src/lib/app-utils/docs-index.generated.js.map +1 -1
- package/src/lib/app-utils/entity-picker-context.d.ts +6 -0
- package/src/lib/app-utils/entity-picker-context.js.map +1 -1
- package/src/lib/app-utils/host-status.js +1 -1
- package/src/lib/app-utils/host-status.js.map +1 -1
- package/src/lib/app-utils/org-role-grants.js +1 -1
- package/src/lib/app-utils/org-role-grants.js.map +1 -1
- package/src/lib/app-utils/page-header-record-context.d.ts +15 -0
- package/src/lib/app-utils/page-header-record-context.js +13 -4
- package/src/lib/app-utils/page-header-record-context.js.map +1 -1
- package/src/lib/app-utils/plan-entitlements.d.ts +125 -46
- package/src/lib/app-utils/plan-entitlements.js +118 -49
- package/src/lib/app-utils/plan-entitlements.js.map +1 -1
- package/src/lib/app-utils/plugin-bundle-checks.d.ts +14 -2
- package/src/lib/app-utils/plugin-bundle-checks.js +82 -7
- package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -1
- package/src/lib/app-utils/plugin-connection-editor.d.ts +48 -0
- package/src/lib/app-utils/plugin-connection-editor.js +46 -0
- package/src/lib/app-utils/plugin-connection-editor.js.map +1 -0
- package/src/lib/app-utils/plugin-connection-record.d.ts +42 -0
- package/src/lib/app-utils/plugin-connection-record.js +48 -0
- package/src/lib/app-utils/plugin-connection-record.js.map +1 -0
- package/src/lib/app-utils/plugin-connection-records-context.d.ts +23 -0
- package/src/lib/app-utils/plugin-connection-records-context.js +29 -0
- package/src/lib/app-utils/plugin-connection-records-context.js.map +1 -0
- package/src/lib/app-utils/plugin-connection-records.d.ts +42 -0
- package/src/lib/app-utils/plugin-connection-records.js +56 -0
- package/src/lib/app-utils/plugin-connection-records.js.map +1 -0
- package/src/lib/app-utils/plugin-connections.d.ts +320 -0
- package/src/lib/app-utils/plugin-connections.js +895 -0
- package/src/lib/app-utils/plugin-connections.js.map +1 -0
- package/src/lib/app-utils/plugin-elements.d.ts +104 -0
- package/src/lib/app-utils/plugin-elements.js +128 -0
- package/src/lib/app-utils/plugin-elements.js.map +1 -0
- package/src/lib/app-utils/plugin-manifest.d.ts +20 -75
- package/src/lib/app-utils/plugin-manifest.js +65 -100
- package/src/lib/app-utils/plugin-manifest.js.map +1 -1
- package/src/lib/app-utils/realm-elements-context.d.ts +16 -0
- package/src/lib/app-utils/realm-elements-context.js +16 -0
- package/src/lib/app-utils/realm-elements-context.js.map +1 -1
- package/src/lib/app-utils/realm-host-surface.generated.js +1 -0
- package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
- package/src/lib/app-utils/release-flags.d.ts +1 -1
- package/src/lib/app-utils/release-flags.js +35 -0
- package/src/lib/app-utils/release-flags.js.map +1 -1
- package/src/lib/app-utils/server.d.ts +1 -0
- package/src/lib/app-utils/server.js +2 -0
- package/src/lib/app-utils/server.js.map +1 -1
- package/src/lib/app-utils/site-context.d.ts +9 -0
- package/src/lib/app-utils/site-context.js.map +1 -1
- package/src/lib/app-utils/site-starter.d.ts +6 -0
- package/src/lib/app-utils/site-starter.js +15 -0
- package/src/lib/app-utils/site-starter.js.map +1 -1
- package/src/lib/plugin-manager/feature-plugins.d.ts +25 -0
- package/src/lib/plugin-manager/feature-plugins.js +10 -0
- package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
- package/src/lib/plugin-manager/first-party-plugins.generated.js +12 -0
- package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
- package/src/lib/plugin-manager/index.d.ts +1 -0
- package/src/lib/plugin-manager/index.js +1 -0
- package/src/lib/plugin-manager/index.js.map +1 -1
- package/src/lib/plugin-manager/plugin-artifact-inventory.d.ts +5 -0
- package/src/lib/plugin-manager/plugin-artifact-inventory.js.map +1 -1
- package/src/lib/plugin-manager/plugin-record-lists.d.ts +18 -0
- package/src/lib/plugin-manager/plugin-record-lists.js +13 -0
- package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -1
- package/src/lib/plugin-manager/plugin-site-csp.d.ts +36 -0
- package/src/lib/plugin-manager/plugin-site-csp.js +50 -1
- package/src/lib/plugin-manager/plugin-site-csp.js.map +1 -1
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js +61 -59
- package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
- package/src/lib/plugin-manager/site-page-enricher-services.d.ts +35 -0
- package/src/lib/plugin-manager/site-page-enricher-services.js +35 -0
- package/src/lib/plugin-manager/site-page-enricher-services.js.map +1 -0
- package/src/lib/plugin-manager/site-page-hooks.js +16 -3
- package/src/lib/plugin-manager/site-page-hooks.js.map +1 -1
- package/src/lib/plugin-manager/video-embed-provider.d.ts +28 -0
- package/src/lib/plugin-manager/video-embed-provider.js +21 -0
- package/src/lib/plugin-manager/video-embed-provider.js.map +1 -1
- package/src/lib/plugin-manager/video-embed-providers.generated.js +3 -1
- package/src/lib/plugin-manager/video-embed-providers.generated.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/site-starter.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HostTheme } from '@aglyn/shared-data-types'\nimport { SCREEN_ROOT_PATH } from './screen-slug'\n\n/**\n * Site starters (AGL-4049): a whole site a person picks before it exists,\n * every one of them a listing anyone may publish and price, the platform's own\n * included.\n *\n * This module is the vocabulary every reader of a starter shares: the artifact\n * type it is listed under, the facets a search filters on (stamped on the\n * listing as plain fields, so a query can match them), the payload a resolved\n * starter hands the site it creates, and the one check that payload must pass.\n * Who stores starters and how they are bought is the starter source's business\n * (`plugin-manager/plugin-site-starters.ts`); nothing here reads or writes.\n *\n * Pure data and readers, safe for any surface to import.\n */\n\n/** The artifact type a site starter is listed and installed under (AGL-4049). */\nexport const SITE_STARTER_ARTIFACT_TYPE = 'siteStarter' as const\n\n/**\n * How a starter fills the site it creates: `base` copies its pages as they\n * are; `ai` hands them to the AI site start with the answers it asks for, so\n * the pages are rewritten for the business.\n */\nexport type SiteStarterMode = 'base' | 'ai'\n\n/**\n * The platform's built-in themes a site's look is layered on (AGL-3497,\n * AGL-4049), by the short name of the themes plugin's preset id\n * (`theme-presets.<name>`), and `starter`: the theme a new site is born with.\n * A starter on a built-in theme names one of these; the AI site start picks\n * among the same list.\n */\nexport const SITE_THEME_BASES = [\n 'starter',\n 'material-ui',\n 'bootstrap',\n 'minimal',\n 'material3',\n 'ant-design',\n 'fluent',\n 'carbon',\n 'cupertino',\n] as const\nexport type SiteThemeBase = (typeof SITE_THEME_BASES)[number]\n\n/** Whether a value names one of the {@link SITE_THEME_BASES}. */\nexport function isSiteThemeBase(value: unknown): value is SiteThemeBase {\n return typeof value === 'string' && (SITE_THEME_BASES as readonly string[]).includes(value)\n}\n\n/**\n * A starter's theme (AGL-4049), one of two shapes: a built-in theme with the\n * starter's brand colors and font pairing over it, which is how a person's own\n * pick and edits are stored, or a full theme of its author's own.\n */\nexport type SiteStarterTheme =\n | {\n kind: 'builtin'\n /** One of the {@link SITE_THEME_BASES}. */\n base: string\n /** Palette overrides by scheme, as the theme editor stores them. */\n brand: { light: Record<string, string>; dark?: Record<string, string> }\n /** A font pairing id (`site-font-pairings.ts`), or `null` for the base theme's own fonts. */\n fonts: string | null\n }\n | { kind: 'full'; theme: HostTheme }\n\n/**\n * What a starter search filters on (AGL-4049). `kind` is the kind of site it\n * is, an id the core does not interpret (the AI plugin keeps the kinds),\n * `base` a {@link SITE_THEME_BASES} name and `fonts` a font pairing id\n * (`site-font-pairings.ts`), each `null` where the starter names none;\n * `pages` is how many pages it creates.\n */\nexport interface SiteStarterFacets {\n kind: string | null\n base: string | null\n fonts: string | null\n pages: number\n mode: SiteStarterMode\n}\n\n/** A person's pick: the listing, and the version when one is pinned. */\nexport interface SiteStarterChoice {\n listingId: string\n version?: string\n}\n\n/** What a resolved starter hands the site it creates (AGL-4049). */\nexport interface SiteStarterPayload {\n mode: SiteStarterMode\n facets: SiteStarterFacets\n theme: SiteStarterTheme\n /**\n * The starter's pages, each carrying its routing `slug` as a starter\n * template's screens do: `'/'` is the home page, and a page without one is\n * unpublished.\n */\n screens: unknown[]\n /** The shared layout every page sits in: the header and footer. */\n layout: unknown | null\n /** The questions an `ai` starter asks before the site job runs; required for `ai`. */\n answers?: Record<string, unknown>\n}\n\n/** The most pages one starter may create. */\nexport const SITE_STARTER_MAX_SCREENS = 25\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n !!value && typeof value === 'object' && !Array.isArray(value)\n\nconst facetString = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() ? value.trim() : null\n\n/**\n * A listing's starter facets, read defensively from the fields\n * {@link siteStarterFacetFields} stamps: a missing or malformed field reads as\n * none, a page count as a whole number from zero, and a mode as `base` unless\n * it says `ai`.\n */\nexport function siteStarterFacetsOf(doc: Record<string, unknown>): SiteStarterFacets {\n const pages = doc['starterPages']\n return {\n kind: facetString(doc['starterKind']),\n base: facetString(doc['starterBase']),\n fonts: facetString(doc['starterFonts']),\n pages: typeof pages === 'number' && Number.isFinite(pages) && pages > 0 ? Math.floor(pages) : 0,\n mode: doc['starterMode'] === 'ai' ? 'ai' : 'base',\n }\n}\n\n/** The listing fields a starter's publish stamps, the inverse of {@link siteStarterFacetsOf}. */\nexport function siteStarterFacetFields(facets: SiteStarterFacets): Record<string, unknown> {\n return {\n starterKind: facets.kind,\n starterBase: facets.base,\n starterFonts: facets.fonts,\n starterPages: facets.pages,\n starterMode: facets.mode,\n }\n}\n\nconst FACET_KEYS: readonly (keyof SiteStarterFacets)[] = ['kind', 'base', 'fonts', 'pages', 'mode']\n\n/** Whether a starter's facets meet a filter: every facet the filter names, equal; an absent one, any. */\nexport function matchSiteStarterFacets(\n facets: SiteStarterFacets,\n filter: Partial<SiteStarterFacets>,\n): boolean {\n return FACET_KEYS.every((key) => filter[key] === undefined || facets[key] === filter[key])\n}\n\n/** Whether a page is the published home page: routed at the site root and not marked unpublished. */\nconst isPublishedHome = (screen: unknown): boolean =>\n isRecord(screen) && screen['slug'] === SCREEN_ROOT_PATH && screen['published'] !== false\n\n/**\n * The ids a caller knows, by facet. `siteStarterRefusal` checks a kind, base\n * or font pairing id only against the set its caller passes: the core keeps\n * no list of kinds, and which bases and pairings are offered is the caller's\n * to say (`new Set(SITE_THEME_BASES)`, the ids of `SITE_FONT_PAIRINGS`).\n */\nexport interface SiteStarterKnownIds {\n kinds?: ReadonlySet<string>\n bases?: ReadonlySet<string>\n fonts?: ReadonlySet<string>\n}\n\n/**\n * Why a starter's payload cannot start a site, in the words its author is\n * told, or `null` when it can (AGL-4049). Checked when a starter is published\n * and again when one is resolved, since a site is created from it with no\n * step between to catch what is missing.\n */\nexport function siteStarterRefusal(payload: SiteStarterPayload, known: SiteStarterKnownIds = {}): string | null {\n const screens = Array.isArray(payload.screens) ? payload.screens : []\n if (!screens.some(isPublishedHome)) return 'A starter needs a published Home page at /'\n if (!isRecord(payload.layout)) return 'A starter needs a shared layout'\n if (screens.length > SITE_STARTER_MAX_SCREENS) {\n return `A starter can have at most ${SITE_STARTER_MAX_SCREENS} pages`\n }\n const unknown = (id: string | null, ids: ReadonlySet<string> | undefined) =>\n id !== null && ids !== undefined && !ids.has(id)\n const { facets, theme } = payload\n if (unknown(facets.kind, known.kinds)) return `Unknown site kind \"${facets.kind}\"`\n if (unknown(facets.base, known.bases)) return `Unknown base theme \"${facets.base}\"`\n if (unknown(facets.fonts, known.fonts)) return `Unknown font pairing \"${facets.fonts}\"`\n if (theme?.kind === 'builtin') {\n if (unknown(theme.base, known.bases)) return `Unknown base theme \"${theme.base}\"`\n if (unknown(theme.fonts, known.fonts)) return `Unknown font pairing \"${theme.fonts}\"`\n }\n if (payload.mode === 'ai' && !isRecord(payload.answers)) {\n return 'An AI starter needs the questions it asks'\n }\n return null\n}\n"],"names":["SCREEN_ROOT_PATH","SITE_STARTER_ARTIFACT_TYPE","SITE_THEME_BASES","isSiteThemeBase","value","includes","SITE_STARTER_MAX_SCREENS","isRecord","Array","isArray","facetString","trim","siteStarterFacetsOf","doc","pages","kind","base","fonts","Number","isFinite","Math","floor","mode","siteStarterFacetFields","facets","starterKind","starterBase","starterFonts","starterPages","starterMode","FACET_KEYS","matchSiteStarterFacets","filter","every","key","undefined","isPublishedHome","screen","siteStarterRefusal","payload","known","screens","some","layout","length","unknown","id","ids","has","theme","kinds","bases","answers"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,gBAAgB,QAAQ,mBAAe;AAEhD;;;;;;;;;;;;;CAaC,GAED,+EAA+E,GAC/E,OAAO,MAAMC,6BAA6B,cAAsB;AAShE;;;;;;CAMC,GACD,OAAO,MAAMC,mBAAmB;IAC9B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAGV,+DAA+D,GAC/D,OAAO,SAASC,gBAAgBC,KAA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MAAMhC,KAAK,CAAC,CAAC,CAAC;IACvF;IACA,IAAIsB,QAAQjB,IAAI,KAAK,QAAQ,CAACf,SAASgC,QAAQa,OAAO,GAAG;QACvD,OAAO;IACT;IACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/aglyn/src/lib/app-utils/site-starter.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HostTheme } from '@aglyn/shared-data-types'\nimport { SCREEN_ROOT_PATH } from './screen-slug'\n\n/**\n * Site starters (AGL-4049): a whole site a person picks before it exists,\n * every one of them a listing anyone may publish and price, the platform's own\n * included.\n *\n * This module is the vocabulary every reader of a starter shares: the artifact\n * type it is listed under, the facets a search filters on (stamped on the\n * listing as plain fields, so a query can match them), the payload a resolved\n * starter hands the site it creates, and the one check that payload must pass.\n * Who stores starters and how they are bought is the starter source's business\n * (`plugin-manager/plugin-site-starters.ts`); nothing here reads or writes.\n *\n * Pure data and readers, safe for any surface to import.\n */\n\n/** The artifact type a site starter is listed and installed under (AGL-4049). */\nexport const SITE_STARTER_ARTIFACT_TYPE = 'siteStarter' as const\n\n/**\n * How a starter fills the site it creates: `base` copies its pages as they\n * are; `ai` hands them to the AI site start with the answers it asks for, so\n * the pages are rewritten for the business.\n */\nexport type SiteStarterMode = 'base' | 'ai'\n\n/**\n * The platform's built-in themes a site's look is layered on (AGL-3497,\n * AGL-4049), by the short name of the themes plugin's preset id\n * (`theme-presets.<name>`), and `starter`: the theme a new site is born with.\n * A starter on a built-in theme names one of these; the AI site start picks\n * among the same list.\n */\nexport const SITE_THEME_BASES = [\n 'starter',\n 'material-ui',\n 'bootstrap',\n 'minimal',\n 'material3',\n 'ant-design',\n 'fluent',\n 'carbon',\n 'cupertino',\n] as const\nexport type SiteThemeBase = (typeof SITE_THEME_BASES)[number]\n\n/**\n * Each base as a person reads it (AGL-4049): the name the themes plugin's\n * preset carries (its `presets.spec.ts` holds the two equal), and `Starter`\n * for the theme a new site is born with.\n */\nexport const SITE_THEME_BASE_NAMES: Readonly<Record<SiteThemeBase, string>> = {\n starter: 'Starter',\n 'material-ui': 'Material UI',\n bootstrap: 'Bootstrap',\n minimal: 'Minimal',\n material3: 'Material 3',\n 'ant-design': 'Ant Design',\n fluent: 'Fluent',\n carbon: 'Carbon',\n cupertino: 'Cupertino',\n}\n\n/** Whether a value names one of the {@link SITE_THEME_BASES}. */\nexport function isSiteThemeBase(value: unknown): value is SiteThemeBase {\n return typeof value === 'string' && (SITE_THEME_BASES as readonly string[]).includes(value)\n}\n\n/**\n * A starter's theme (AGL-4049), one of two shapes: a built-in theme with the\n * starter's brand colors and font pairing over it, which is how a person's own\n * pick and edits are stored, or a full theme of its author's own.\n */\nexport type SiteStarterTheme =\n | {\n kind: 'builtin'\n /** One of the {@link SITE_THEME_BASES}. */\n base: string\n /** Palette overrides by scheme, as the theme editor stores them. */\n brand: { light: Record<string, string>; dark?: Record<string, string> }\n /** A font pairing id (`site-font-pairings.ts`), or `null` for the base theme's own fonts. */\n fonts: string | null\n }\n | { kind: 'full'; theme: HostTheme }\n\n/**\n * What a starter search filters on (AGL-4049). `kind` is the kind of site it\n * is, an id the core does not interpret (the AI plugin keeps the kinds),\n * `base` a {@link SITE_THEME_BASES} name and `fonts` a font pairing id\n * (`site-font-pairings.ts`), each `null` where the starter names none;\n * `pages` is how many pages it creates.\n */\nexport interface SiteStarterFacets {\n kind: string | null\n base: string | null\n fonts: string | null\n pages: number\n mode: SiteStarterMode\n}\n\n/** A person's pick: the listing, and the version when one is pinned. */\nexport interface SiteStarterChoice {\n listingId: string\n version?: string\n}\n\n/** What a resolved starter hands the site it creates (AGL-4049). */\nexport interface SiteStarterPayload {\n mode: SiteStarterMode\n facets: SiteStarterFacets\n theme: SiteStarterTheme\n /**\n * The starter's pages, each carrying its routing `slug` as a starter\n * template's screens do: `'/'` is the home page, and a page without one is\n * unpublished.\n */\n screens: unknown[]\n /** The shared layout every page sits in: the header and footer. */\n layout: unknown | null\n /** The questions an `ai` starter asks before the site job runs; required for `ai`. */\n answers?: Record<string, unknown>\n}\n\n/** The most pages one starter may create. */\nexport const SITE_STARTER_MAX_SCREENS = 25\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n !!value && typeof value === 'object' && !Array.isArray(value)\n\nconst facetString = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() ? value.trim() : null\n\n/**\n * A listing's starter facets, read defensively from the fields\n * {@link siteStarterFacetFields} stamps: a missing or malformed field reads as\n * none, a page count as a whole number from zero, and a mode as `base` unless\n * it says `ai`.\n */\nexport function siteStarterFacetsOf(doc: Record<string, unknown>): SiteStarterFacets {\n const pages = doc['starterPages']\n return {\n kind: facetString(doc['starterKind']),\n base: facetString(doc['starterBase']),\n fonts: facetString(doc['starterFonts']),\n pages: typeof pages === 'number' && Number.isFinite(pages) && pages > 0 ? Math.floor(pages) : 0,\n mode: doc['starterMode'] === 'ai' ? 'ai' : 'base',\n }\n}\n\n/** The listing fields a starter's publish stamps, the inverse of {@link siteStarterFacetsOf}. */\nexport function siteStarterFacetFields(facets: SiteStarterFacets): Record<string, unknown> {\n return {\n starterKind: facets.kind,\n starterBase: facets.base,\n starterFonts: facets.fonts,\n starterPages: facets.pages,\n starterMode: facets.mode,\n }\n}\n\nconst FACET_KEYS: readonly (keyof SiteStarterFacets)[] = ['kind', 'base', 'fonts', 'pages', 'mode']\n\n/** Whether a starter's facets meet a filter: every facet the filter names, equal; an absent one, any. */\nexport function matchSiteStarterFacets(\n facets: SiteStarterFacets,\n filter: Partial<SiteStarterFacets>,\n): boolean {\n return FACET_KEYS.every((key) => filter[key] === undefined || facets[key] === filter[key])\n}\n\n/** Whether a page is the published home page: routed at the site root and not marked unpublished. */\nconst isPublishedHome = (screen: unknown): boolean =>\n isRecord(screen) && screen['slug'] === SCREEN_ROOT_PATH && screen['published'] !== false\n\n/**\n * The ids a caller knows, by facet. `siteStarterRefusal` checks a kind, base\n * or font pairing id only against the set its caller passes: the core keeps\n * no list of kinds, and which bases and pairings are offered is the caller's\n * to say (`new Set(SITE_THEME_BASES)`, the ids of `SITE_FONT_PAIRINGS`).\n */\nexport interface SiteStarterKnownIds {\n kinds?: ReadonlySet<string>\n bases?: ReadonlySet<string>\n fonts?: ReadonlySet<string>\n}\n\n/**\n * Why a starter's payload cannot start a site, in the words its author is\n * told, or `null` when it can (AGL-4049). Checked when a starter is published\n * and again when one is resolved, since a site is created from it with no\n * step between to catch what is missing.\n */\nexport function siteStarterRefusal(payload: SiteStarterPayload, known: SiteStarterKnownIds = {}): string | null {\n const screens = Array.isArray(payload.screens) ? payload.screens : []\n if (!screens.some(isPublishedHome)) return 'A starter needs a published Home page at /'\n if (!isRecord(payload.layout)) return 'A starter needs a shared layout'\n if (screens.length > SITE_STARTER_MAX_SCREENS) {\n return `A starter can have at most ${SITE_STARTER_MAX_SCREENS} pages`\n }\n const unknown = (id: string | null, ids: ReadonlySet<string> | undefined) =>\n id !== null && ids !== undefined && !ids.has(id)\n const { facets, theme } = payload\n if (unknown(facets.kind, known.kinds)) return `Unknown site kind \"${facets.kind}\"`\n if (unknown(facets.base, known.bases)) return `Unknown base theme \"${facets.base}\"`\n if (unknown(facets.fonts, known.fonts)) return `Unknown font pairing \"${facets.fonts}\"`\n if (theme?.kind === 'builtin') {\n if (unknown(theme.base, known.bases)) return `Unknown base theme \"${theme.base}\"`\n if (unknown(theme.fonts, known.fonts)) return `Unknown font pairing \"${theme.fonts}\"`\n }\n if (payload.mode === 'ai' && !isRecord(payload.answers)) {\n return 'An AI starter needs the questions it asks'\n }\n return null\n}\n"],"names":["SCREEN_ROOT_PATH","SITE_STARTER_ARTIFACT_TYPE","SITE_THEME_BASES","SITE_THEME_BASE_NAMES","starter","bootstrap","minimal","material3","fluent","carbon","cupertino","isSiteThemeBase","value","includes","SITE_STARTER_MAX_SCREENS","isRecord","Array","isArray","facetString","trim","siteStarterFacetsOf","doc","pages","kind","base","fonts","Number","isFinite","Math","floor","mode","siteStarterFacetFields","facets","starterKind","starterBase","starterFonts","starterPages","starterMode","FACET_KEYS","matchSiteStarterFacets","filter","every","key","undefined","isPublishedHome","screen","siteStarterRefusal","payload","known","screens","some","layout","length","unknown","id","ids","has","theme","kinds","bases","answers"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,gBAAgB,QAAQ,mBAAe;AAEhD;;;;;;;;;;;;;CAaC,GAED,+EAA+E,GAC/E,OAAO,MAAMC,6BAA6B,cAAsB;AAShE;;;;;;CAMC,GACD,OAAO,MAAMC,mBAAmB;IAC9B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAGV;;;;CAIC,GACD,OAAO,MAAMC,wBAAiE;IAC5EC,SAAS;IACT,eAAe;IACfC,WAAW;IACXC,SAAS;IACTC,WAAW;IACX,cAAc;IACdC,QAAQ;IACRC,QAAQ;IACRC,WAAW;AACb,EAAC;AAED,+DAA+D,GAC/D,OAAO,SAASC,gBAAgBC,KAAc;IAC5C,OAAO,OAAOA,UAAU,YAAY,AAACV,iBAAuCW,QAAQ,CAACD;AACvF;AAyDA,2CAA2C,GAC3C,OAAO,MAAME,2BAA2B,GAAE;AAE1C,MAAMC,WAAW,CAACH,QAChB,CAAC,CAACA,SAAS,OAAOA,UAAU,YAAY,CAACI,MAAMC,OAAO,CAACL;AAEzD,MAAMM,cAAc,CAACN,QACnB,OAAOA,UAAU,YAAYA,MAAMO,IAAI,KAAKP,MAAMO,IAAI,KAAK;AAE7D;;;;;CAKC,GACD,OAAO,SAASC,oBAAoBC,GAA4B;IAC9D,MAAMC,QAAQD,GA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AAO,CAAC,2BAA2B,EAAEA,yBAAyB,MAAM,CAAC;IACvE;IACA,MAAMuC,UAAU,CAACC,IAAmBC,MAClCD,OAAO,QAAQC,QAAQZ,aAAa,CAACY,IAAIC,GAAG,CAACF;IAC/C,MAAM,EAAEtB,MAAM,EAAEyB,KAAK,EAAE,GAAGV;IAC1B,IAAIM,QAAQrB,OAAOT,IAAI,EAAEyB,MAAMU,KAAK,GAAG,OAAO,CAAC,mBAAmB,EAAE1B,OAAOT,IAAI,CAAC,CAAC,CAAC;IAClF,IAAI8B,QAAQrB,OAAOR,IAAI,EAAEwB,MAAMW,KAAK,GAAG,OAAO,CAAC,oBAAoB,EAAE3B,OAAOR,IAAI,CAAC,CAAC,CAAC;IACnF,IAAI6B,QAAQrB,OAAOP,KAAK,EAAEuB,MAAMvB,KAAK,GAAG,OAAO,CAAC,sBAAsB,EAAEO,OAAOP,KAAK,CAAC,CAAC,CAAC;IACvF,IAAIgC,CAAAA,yBAAAA,MAAOlC,IAAI,MAAK,WAAW;QAC7B,IAAI8B,QAAQI,MAAMjC,IAAI,EAAEwB,MAAMW,KAAK,GAAG,OAAO,CAAC,oBAAoB,EAAEF,MAAMjC,IAAI,CAAC,CAAC,CAAC;QACjF,IAAI6B,QAAQI,MAAMhC,KAAK,EAAEuB,MAAMvB,KAAK,GAAG,OAAO,CAAC,sBAAsB,EAAEgC,MAAMhC,KAAK,CAAC,CAAC,CAAC;IACvF;IACA,IAAIsB,QAAQjB,IAAI,KAAK,QAAQ,CAACf,SAASgC,QAAQa,OAAO,GAAG;QACvD,OAAO;IACT;IACA,OAAO;AACT"}
|
|
@@ -699,6 +699,17 @@ export declare const CONSOLE_WIDGET_SLOTS: {
|
|
|
699
699
|
* the installing plugin's own surface, which the widget may link to.
|
|
700
700
|
*/
|
|
701
701
|
readonly pluginInstallStatus: "pluginInstallStatus";
|
|
702
|
+
/**
|
|
703
|
+
* A site's page for one plugin some plugin INSTALLED, below its settings
|
|
704
|
+
* (AGL-4196): the services that plugin's manifest declares it connects to,
|
|
705
|
+
* and where this site stands with each. Props:
|
|
706
|
+
* {@link ConsoleSitePluginConnectionsZoneProps}.
|
|
707
|
+
*
|
|
708
|
+
* The installing plugin runs the connections — the sign-in at the other
|
|
709
|
+
* service, what the owner picks there, the scheduled sync — so it draws
|
|
710
|
+
* them. A widget draws nothing for a plugin that declares none.
|
|
711
|
+
*/
|
|
712
|
+
readonly sitePluginConnections: "sitePluginConnections";
|
|
702
713
|
/**
|
|
703
714
|
* The template gallery — "Start from a template" on a site's Screens,
|
|
704
715
|
* Layouts and Components pages — below the site's own templates and the
|
|
@@ -1460,6 +1471,20 @@ export interface ConsolePluginInstallStatusZoneProps {
|
|
|
1460
1471
|
*/
|
|
1461
1472
|
pin: Readonly<Record<string, unknown>>;
|
|
1462
1473
|
}
|
|
1474
|
+
/** What the `sitePluginConnections` zone hands each widget (AGL-4196). */
|
|
1475
|
+
export interface ConsoleSitePluginConnectionsZoneProps {
|
|
1476
|
+
/** The site whose page this is. */
|
|
1477
|
+
hostId: string;
|
|
1478
|
+
/** Path slug for building `/[orgSlug]/…` links. */
|
|
1479
|
+
orgSlug: string;
|
|
1480
|
+
/** The installation's id: the segment of the page, which is the pin's key. */
|
|
1481
|
+
pluginRef: string;
|
|
1482
|
+
/**
|
|
1483
|
+
* The pin the site runs — its own, else the workspace's — whose manifest
|
|
1484
|
+
* says what it connects to.
|
|
1485
|
+
*/
|
|
1486
|
+
pin: Readonly<Record<string, unknown>>;
|
|
1487
|
+
}
|
|
1463
1488
|
/** A release flag's verdict as the console applies it: the staff bypass included. */
|
|
1464
1489
|
export interface ConsoleReleaseVerdict {
|
|
1465
1490
|
/** Released, or the reader is staff. */
|
|
@@ -199,6 +199,16 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
199
199
|
* the installing plugin's own surface, which the widget may link to.
|
|
200
200
|
*/ pluginInstallStatus: 'pluginInstallStatus',
|
|
201
201
|
/**
|
|
202
|
+
* A site's page for one plugin some plugin INSTALLED, below its settings
|
|
203
|
+
* (AGL-4196): the services that plugin's manifest declares it connects to,
|
|
204
|
+
* and where this site stands with each. Props:
|
|
205
|
+
* {@link ConsoleSitePluginConnectionsZoneProps}.
|
|
206
|
+
*
|
|
207
|
+
* The installing plugin runs the connections — the sign-in at the other
|
|
208
|
+
* service, what the owner picks there, the scheduled sync — so it draws
|
|
209
|
+
* them. A widget draws nothing for a plugin that declares none.
|
|
210
|
+
*/ sitePluginConnections: 'sitePluginConnections',
|
|
211
|
+
/**
|
|
202
212
|
* The template gallery — "Start from a template" on a site's Screens,
|
|
203
213
|
* Layouts and Components pages — below the site's own templates and the
|
|
204
214
|
* starters (AGL-3080): a shelf of templates a plugin offers to INSTALL.
|