@proveanything/smartlinks 2.2.1 → 3.0.0-alpha.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/README.md +741 -754
- package/dist/README.md +573 -573
- package/dist/adminCardsView.js +55 -55
- package/dist/api/adminCards.d.ts +8 -0
- package/dist/api/adminCards.js +9 -1
- package/dist/api/ai.d.ts +22 -11
- package/dist/api/ai.js +18 -14
- package/dist/api/analytics.d.ts +13 -0
- package/dist/api/analytics.js +13 -0
- package/dist/api/appConfiguration.d.ts +17 -14
- package/dist/api/appConfiguration.js +14 -12
- package/dist/api/appObjects.d.ts +80 -16
- package/dist/api/appObjects.js +74 -11
- package/dist/api/asset.d.ts +55 -19
- package/dist/api/asset.js +52 -32
- package/dist/api/attestation.d.ts +3 -2
- package/dist/api/attestation.js +1 -1
- package/dist/api/attestations.d.ts +22 -7
- package/dist/api/attestations.js +22 -7
- package/dist/api/authKit.d.ts +22 -5
- package/dist/api/authKit.js +21 -4
- package/dist/api/batch.d.ts +23 -16
- package/dist/api/batch.js +19 -13
- package/dist/api/bookings.d.ts +45 -9
- package/dist/api/bookings.js +39 -3
- package/dist/api/broadcasts.d.ts +26 -6
- package/dist/api/broadcasts.js +22 -2
- package/dist/api/claimSet.d.ts +48 -13
- package/dist/api/claimSet.js +43 -7
- package/dist/api/collection.d.ts +20 -6
- package/dist/api/collection.js +19 -8
- package/dist/api/comms.d.ts +43 -12
- package/dist/api/comms.js +43 -13
- package/dist/api/conditions.d.ts +12 -2
- package/dist/api/conditions.js +10 -1
- package/dist/api/config.d.ts +15 -2
- package/dist/api/config.js +12 -0
- package/dist/api/contact.d.ts +34 -13
- package/dist/api/contact.js +35 -10
- package/dist/api/containers.d.ts +41 -23
- package/dist/api/containers.js +37 -21
- package/dist/api/crate.d.ts +9 -8
- package/dist/api/crate.js +8 -8
- package/dist/api/dpp.d.ts +58 -10
- package/dist/api/dpp.js +57 -15
- package/dist/api/facets.d.ts +71 -0
- package/dist/api/facets.js +71 -0
- package/dist/api/files.d.ts +11 -5
- package/dist/api/files.js +9 -1
- package/dist/api/form.d.ts +9 -2
- package/dist/api/form.js +7 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/integrations.d.ts +82 -27
- package/dist/api/integrations.js +63 -7
- package/dist/api/interactions.d.ts +42 -6
- package/dist/api/interactions.js +41 -5
- package/dist/api/jobs.d.ts +9 -2
- package/dist/api/jobs.js +6 -0
- package/dist/api/journeys.d.ts +13 -2
- package/dist/api/journeys.js +10 -1
- package/dist/api/journeysAnalytics.d.ts +12 -3
- package/dist/api/journeysAnalytics.js +9 -1
- package/dist/api/knowledge.d.ts +43 -10
- package/dist/api/knowledge.js +37 -5
- package/dist/api/location.d.ts +10 -3
- package/dist/api/location.js +7 -1
- package/dist/api/lots.d.ts +40 -13
- package/dist/api/lots.js +38 -8
- package/dist/api/loyalty.d.ts +70 -12
- package/dist/api/loyalty.js +60 -3
- package/dist/api/nfc.d.ts +8 -2
- package/dist/api/nfc.js +6 -1
- package/dist/api/order.d.ts +51 -160
- package/dist/api/order.js +46 -208
- package/dist/api/partner.d.ts +41 -8
- package/dist/api/partner.js +36 -4
- package/dist/api/products.d.ts +41 -8
- package/dist/api/products.js +33 -4
- package/dist/api/proof.d.ts +50 -13
- package/dist/api/proof.js +43 -7
- package/dist/api/realtime.d.ts +1 -11
- package/dist/api/realtime.js +1 -22
- package/dist/api/secrets.d.ts +25 -5
- package/dist/api/secrets.js +21 -2
- package/dist/api/segments.d.ts +26 -6
- package/dist/api/segments.js +22 -2
- package/dist/api/serviceAccounts.d.ts +8 -1
- package/dist/api/serviceAccounts.js +8 -1
- package/dist/api/shop.d.ts +41 -13
- package/dist/api/shop.js +35 -4
- package/dist/api/subscriptions.d.ts +47 -12
- package/dist/api/subscriptions.js +40 -4
- package/dist/api/tags.d.ts +40 -19
- package/dist/api/tags.js +38 -18
- package/dist/api/template.d.ts +31 -3
- package/dist/api/template.js +27 -0
- package/dist/api/translations.d.ts +17 -2
- package/dist/api/translations.js +14 -0
- package/dist/api/userGroups.d.ts +35 -9
- package/dist/api/userGroups.js +30 -5
- package/dist/api/variant.d.ts +11 -3
- package/dist/api/variant.js +9 -2
- package/dist/api/wallet.d.ts +23 -10
- package/dist/api/wallet.js +20 -2
- package/dist/apiVersion.d.ts +1 -1
- package/dist/apiVersion.js +1 -1
- package/dist/baseline.css +194 -194
- package/dist/docs/API_SUMMARY.md +1389 -2298
- package/dist/docs/PRODUCT_FACETS_SDK.md +10 -15
- package/dist/docs/admin-cards.md +189 -189
- package/dist/docs/admin-lists-and-pickers.md +1 -1
- package/dist/docs/agent-tools.md +156 -156
- package/dist/docs/ai-tools-and-skills.md +180 -180
- package/dist/docs/ai.md +1721 -1721
- package/dist/docs/analytics.md +3 -2
- package/dist/docs/api-versions.md +85 -76
- package/dist/docs/app-data-storage.md +277 -277
- package/dist/docs/app-docs.md +73 -73
- package/dist/docs/app-manifest.md +852 -852
- package/dist/docs/app-objects.md +38 -50
- package/dist/docs/app-records-pattern.md +388 -388
- package/dist/docs/appConfig.md +550 -550
- package/dist/docs/assets.md +17 -3
- package/dist/docs/assistant-apps.md +172 -172
- package/dist/docs/assistant-context.md +119 -119
- package/dist/docs/attestations.md +5 -4
- package/dist/docs/auth-kit.md +1 -1
- package/dist/docs/bookings.md +442 -442
- package/dist/docs/comms.md +689 -686
- package/dist/docs/connectors.md +340 -340
- package/dist/docs/contact-search.md +4 -3
- package/dist/docs/container-tracking.md +7 -7
- package/dist/docs/css-baseline.md +133 -133
- package/dist/docs/customer-guide.md +70 -70
- package/dist/docs/deploying-apps.md +340 -340
- package/dist/docs/dpp.md +115 -115
- package/dist/docs/entitlements.md +90 -90
- package/dist/docs/executor.md +1 -1
- package/dist/docs/files.md +69 -69
- package/dist/docs/forms.md +1 -1
- package/dist/docs/headless-providers.md +3 -3
- package/dist/docs/host-dependency-contract.md +252 -210
- package/dist/docs/i18n.md +292 -46
- package/dist/docs/integrations.md +322 -322
- package/dist/docs/interactions.md +544 -545
- package/dist/docs/item-context.md +181 -181
- package/dist/docs/knowledge.md +105 -102
- package/dist/docs/lists.md +114 -0
- package/dist/docs/lots.md +112 -111
- package/dist/docs/loyalty.md +348 -352
- package/dist/docs/members.md +183 -183
- package/dist/docs/memberships.md +150 -149
- package/dist/docs/mobile-admin-container.md +693 -693
- package/dist/docs/operations.md +281 -281
- package/dist/docs/overview.md +485 -485
- package/dist/docs/proof-claiming-methods.md +6 -6
- package/dist/docs/proof-comms-triggers.md +142 -142
- package/dist/docs/proof-ownership-transfer.md +155 -155
- package/dist/docs/proof-product-data-scoping.md +462 -462
- package/dist/docs/proof-share-grants.md +305 -305
- package/dist/docs/realtime.md +139 -138
- package/dist/docs/records-admin-pattern.md +304 -304
- package/dist/docs/server-functions.md +2 -2
- package/dist/docs/service-accounts.md +64 -64
- package/dist/docs/shop.md +4 -2
- package/dist/docs/site-seo.md +2 -1
- package/dist/docs/standard-query.md +187 -187
- package/dist/docs/tag-codes.md +97 -97
- package/dist/docs/tag-ranges.md +106 -106
- package/dist/docs/theme-tokens.md +252 -252
- package/dist/docs/translations.md +6 -1
- package/dist/docs/upgrading-to-3.md +430 -0
- package/dist/docs/user-groups.md +4 -4
- package/dist/docs/utils.md +1 -1
- package/dist/docs/wallet-passes.md +107 -107
- package/dist/docs/websites.md +123 -123
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +2 -2
- package/dist/http.d.ts +15 -2
- package/dist/http.js +60 -2
- package/dist/i18n.d.ts +2 -14
- package/dist/i18n.js +6 -23
- package/dist/index.d.ts +7 -8
- package/dist/index.js +2 -0
- package/dist/list.d.ts +24 -0
- package/dist/list.js +80 -0
- package/dist/mobile-admin/types.d.ts +0 -16
- package/dist/openapi.yaml +290 -2723
- package/dist/shared-dependencies.d.ts +3 -3
- package/dist/shared-dependencies.js +13 -5
- package/dist/site.d.ts +1 -7
- package/dist/site.js +1 -14
- package/dist/theme-boot.js +82 -82
- package/dist/theme.css +75 -75
- package/dist/types/adminCards.d.ts +6 -3
- package/dist/types/ai.d.ts +0 -6
- package/dist/types/analytics.d.ts +5 -8
- package/dist/types/appManifest.d.ts +4 -5
- package/dist/types/appObjects.d.ts +14 -18
- package/dist/types/appObjects.js +0 -1
- package/dist/types/appOptions.d.ts +18 -0
- package/dist/types/asset.d.ts +3 -22
- package/dist/types/attestations.d.ts +7 -10
- package/dist/types/batch.d.ts +6 -14
- package/dist/types/bookings.d.ts +22 -4
- package/dist/types/broadcasts.d.ts +5 -13
- package/dist/types/broadcasts.js +0 -1
- package/dist/types/claimSet.d.ts +0 -5
- package/dist/types/comms.d.ts +11 -9
- package/dist/types/contact.d.ts +5 -29
- package/dist/types/contact.js +0 -13
- package/dist/types/containers.d.ts +15 -26
- package/dist/types/crate.d.ts +4 -12
- package/dist/types/dpp.d.ts +3 -3
- package/dist/types/dpp.js +0 -1
- package/dist/types/error.d.ts +8 -5
- package/dist/types/error.js +12 -5
- package/dist/types/facets.d.ts +15 -15
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/integrations.d.ts +3 -28
- package/dist/types/interaction.d.ts +3 -9
- package/dist/types/jobs.d.ts +3 -8
- package/dist/types/jobs.js +0 -1
- package/dist/types/journeys.d.ts +3 -8
- package/dist/types/journeys.js +0 -1
- package/dist/types/journeysAnalytics.d.ts +0 -1
- package/dist/types/list.d.ts +24 -0
- package/dist/types/list.js +2 -0
- package/dist/types/location.d.ts +0 -4
- package/dist/types/lots.d.ts +0 -9
- package/dist/types/loyalty.d.ts +0 -9
- package/dist/types/order.d.ts +7 -134
- package/dist/types/product.d.ts +11 -24
- package/dist/types/proof.d.ts +16 -0
- package/dist/types/realtime.d.ts +0 -29
- package/dist/types/segments.d.ts +5 -13
- package/dist/types/segments.js +0 -1
- package/dist/types/serviceAccounts.d.ts +3 -2
- package/dist/types/serviceAccounts.js +0 -1
- package/dist/types/shop.d.ts +5 -12
- package/dist/types/shop.js +0 -4
- package/dist/types/subscriptions.d.ts +18 -0
- package/dist/types/subscriptions.js +0 -8
- package/dist/types/tags.d.ts +6 -16
- package/dist/types/tags.js +0 -7
- package/dist/types/translations.d.ts +3 -9
- package/dist/types/variant.d.ts +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/API_SUMMARY.md +1389 -2298
- package/docs/PRODUCT_FACETS_SDK.md +10 -15
- package/docs/admin-cards.md +189 -189
- package/docs/admin-lists-and-pickers.md +1 -1
- package/docs/agent-tools.md +156 -156
- package/docs/ai-tools-and-skills.md +180 -180
- package/docs/ai.md +1721 -1721
- package/docs/analytics.md +3 -2
- package/docs/api-versions.md +85 -76
- package/docs/app-data-storage.md +277 -277
- package/docs/app-docs.md +73 -73
- package/docs/app-manifest.md +852 -852
- package/docs/app-objects.md +38 -50
- package/docs/app-records-pattern.md +388 -388
- package/docs/appConfig.md +550 -550
- package/docs/assets.md +17 -3
- package/docs/assistant-apps.md +172 -172
- package/docs/assistant-context.md +119 -119
- package/docs/attestations.md +5 -4
- package/docs/auth-kit.md +1 -1
- package/docs/bookings.md +442 -442
- package/docs/comms.md +689 -686
- package/docs/connectors.md +340 -340
- package/docs/contact-search.md +4 -3
- package/docs/container-tracking.md +7 -7
- package/docs/css-baseline.md +133 -133
- package/docs/customer-guide.md +70 -70
- package/docs/deploying-apps.md +340 -340
- package/docs/dpp.md +115 -115
- package/docs/entitlements.md +90 -90
- package/docs/executor.md +1 -1
- package/docs/files.md +69 -69
- package/docs/forms.md +1 -1
- package/docs/headless-providers.md +3 -3
- package/docs/host-dependency-contract.md +252 -210
- package/docs/i18n.md +292 -46
- package/docs/integrations.md +322 -322
- package/docs/interactions.md +544 -545
- package/docs/item-context.md +181 -181
- package/docs/knowledge.md +105 -102
- package/docs/lists.md +114 -0
- package/docs/lots.md +112 -111
- package/docs/loyalty.md +348 -352
- package/docs/members.md +183 -183
- package/docs/memberships.md +150 -149
- package/docs/mobile-admin-container.md +693 -693
- package/docs/operations.md +281 -281
- package/docs/overview.md +485 -485
- package/docs/proof-claiming-methods.md +6 -6
- package/docs/proof-comms-triggers.md +142 -142
- package/docs/proof-ownership-transfer.md +155 -155
- package/docs/proof-product-data-scoping.md +462 -462
- package/docs/proof-share-grants.md +305 -305
- package/docs/realtime.md +139 -138
- package/docs/server-functions.md +2 -2
- package/docs/service-accounts.md +64 -64
- package/docs/shop.md +4 -2
- package/docs/site-seo.md +2 -1
- package/docs/standard-query.md +187 -187
- package/docs/tag-codes.md +97 -97
- package/docs/tag-ranges.md +106 -106
- package/docs/theme-lookbook.v1.json +120 -120
- package/docs/theme-tokens.md +252 -252
- package/docs/translations.md +6 -1
- package/docs/upgrading-to-3.md +430 -0
- package/docs/user-groups.md +4 -4
- package/docs/utils.md +1 -1
- package/docs/wallet-passes.md +107 -107
- package/docs/websites.md +123 -123
- package/openapi.yaml +290 -2723
- package/package.json +91 -87
- package/scripts/headless-check.mjs +87 -87
- package/scripts/lib/bare-imports.mjs +57 -57
- package/scripts/lib/keyed-app-data.mjs +21 -21
- package/scripts/lib/upgrade.mjs +512 -0
- package/scripts/publish.mjs +272 -272
- package/scripts/register-release.mjs +91 -91
- package/scripts/upgrade.mjs +56 -0
- package/upgrade/3.json +2213 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Current contract revision. Bumped when the entry list or host versions change. */
|
|
2
|
-
export declare const SHARED_DEPENDENCY_CONTRACT_VERSION: "
|
|
2
|
+
export declare const SHARED_DEPENDENCY_CONTRACT_VERSION: "v8";
|
|
3
3
|
export interface SharedDependency {
|
|
4
4
|
/** Bare import specifier the app writes, e.g. `react-dom/client`. */
|
|
5
5
|
specifier: string;
|
|
@@ -13,8 +13,8 @@ export interface SharedDependency {
|
|
|
13
13
|
/**
|
|
14
14
|
* Canonical import-map path for a specifier: drop the leading `@` scope marker and
|
|
15
15
|
* turn every `/` into `-`.
|
|
16
|
-
* 'react-dom/client' -> '/sl-shared/
|
|
17
|
-
* '@radix-ui/react-slot' -> '/sl-shared/
|
|
16
|
+
* 'react-dom/client' -> '/sl-shared/v8/react-dom-client.js'
|
|
17
|
+
* '@radix-ui/react-slot' -> '/sl-shared/v8/radix-ui-react-slot.js'
|
|
18
18
|
* Hosts MUST serve shims at these paths so the map the SDK advertises resolves.
|
|
19
19
|
*/
|
|
20
20
|
export declare function importMapPathFor(specifier: string, version?: string): string;
|
|
@@ -11,19 +11,27 @@
|
|
|
11
11
|
//
|
|
12
12
|
// See docs/host-dependency-contract.md.
|
|
13
13
|
/** Current contract revision. Bumped when the entry list or host versions change. */
|
|
14
|
-
export const SHARED_DEPENDENCY_CONTRACT_VERSION = '
|
|
14
|
+
export const SHARED_DEPENDENCY_CONTRACT_VERSION = 'v8';
|
|
15
15
|
/**
|
|
16
16
|
* Canonical import-map path for a specifier: drop the leading `@` scope marker and
|
|
17
17
|
* turn every `/` into `-`.
|
|
18
|
-
* 'react-dom/client' -> '/sl-shared/
|
|
19
|
-
* '@radix-ui/react-slot' -> '/sl-shared/
|
|
18
|
+
* 'react-dom/client' -> '/sl-shared/v8/react-dom-client.js'
|
|
19
|
+
* '@radix-ui/react-slot' -> '/sl-shared/v8/radix-ui-react-slot.js'
|
|
20
20
|
* Hosts MUST serve shims at these paths so the map the SDK advertises resolves.
|
|
21
21
|
*/
|
|
22
22
|
export function importMapPathFor(specifier, version = SHARED_DEPENDENCY_CONTRACT_VERSION) {
|
|
23
23
|
const slug = specifier.replace(/^@/, '').replace(/\//g, '-');
|
|
24
24
|
return `/sl-shared/${version}/${slug}.js`;
|
|
25
25
|
}
|
|
26
|
-
//
|
|
26
|
+
// v8 is the v7 set with SDK 3 in place of SDK 2. SDK 3 changes what the SDK's functions return (every
|
|
27
|
+
// list is { items, nextCursor, count? }) and drops the deprecated calls, so a host cannot swap it in under
|
|
28
|
+
// apps built for SDK 2. Instead a host serves BOTH: a v7 app keeps resolving SDK 2 (window.SL) and a v8
|
|
29
|
+
// app resolves SDK 3 (window.SL3). Every other entry is the same library at the same version in both,
|
|
30
|
+
// and the host serves ONE copy of each (two Reacts would crash). That includes the sign-in UI: its
|
|
31
|
+
// provider and hooks share a React context, so there is one copy for every app on the page, whichever
|
|
32
|
+
// SDK the app was built on.
|
|
33
|
+
//
|
|
34
|
+
// The 29-entry v7 contract was: the v6 set plus `dompurify` (HTML sanitizer — pairs with
|
|
27
35
|
// the shared `marked` so output apps sanitize instead of each bundling their own),
|
|
28
36
|
// `clsx` + `tailwind-merge` (the standard `cn()` pair the portal/hub already ship, now
|
|
29
37
|
// exposed to apps). All small, version-stable, ubiquitous — apps stop bundling copies.
|
|
@@ -35,7 +43,7 @@ const CONTRACT = [
|
|
|
35
43
|
{ specifier: 'react-dom/client', globalName: 'ReactDOMClient', minVersion: '19.0.0' },
|
|
36
44
|
{ specifier: 'react/jsx-runtime', globalName: 'jsxRuntime', minVersion: '19.0.0' },
|
|
37
45
|
{ specifier: 'react/jsx-dev-runtime', globalName: 'jsxDevRuntime', minVersion: '19.0.0' },
|
|
38
|
-
{ specifier: '@proveanything/smartlinks', globalName: '
|
|
46
|
+
{ specifier: '@proveanything/smartlinks', globalName: 'SL3', minVersion: '3.0.0' },
|
|
39
47
|
{ specifier: '@proveanything/smartlinks-auth-ui', globalName: 'SmartlinksAuthUI', minVersion: '2.0.0' },
|
|
40
48
|
{ specifier: 'react-router-dom', globalName: 'ReactRouterDOM', minVersion: '7.18.4' },
|
|
41
49
|
{ specifier: '@tanstack/react-query', globalName: 'ReactQuery', minVersion: '5.0.0' },
|
package/dist/site.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
declare global {
|
|
2
|
-
var __SL_READY__: boolean | undefined;
|
|
3
2
|
var __SMARTLINKS_SITE__: SiteContext | undefined;
|
|
4
3
|
}
|
|
5
4
|
/** The site a page is being served as. */
|
|
@@ -30,14 +29,9 @@ type HeaderSource = {
|
|
|
30
29
|
* @example
|
|
31
30
|
* // TanStack Start server function / loader
|
|
32
31
|
* const site = SL.site.fromRequest(getRequest())
|
|
33
|
-
* const products = await SL.
|
|
32
|
+
* const { items: products } = await SL.products.list(site!.collectionId)
|
|
34
33
|
*/
|
|
35
34
|
export declare function fromRequest(request: HeaderSource): SiteContext | null;
|
|
36
35
|
/** In the browser: the site the page is served as (the router puts it in the page). Null elsewhere. */
|
|
37
36
|
export declare function current(): SiteContext | null;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Sites are server-rendered: crawlers get the finished page from the server, so nothing
|
|
40
|
-
* waits for this signal any more. Kept as a harmless no-op signal for older pages.
|
|
41
|
-
*/
|
|
42
|
-
export declare function ready(): void;
|
|
43
37
|
export {};
|
package/dist/site.js
CHANGED
|
@@ -37,7 +37,7 @@ function parse(raw) {
|
|
|
37
37
|
* @example
|
|
38
38
|
* // TanStack Start server function / loader
|
|
39
39
|
* const site = SL.site.fromRequest(getRequest())
|
|
40
|
-
* const products = await SL.
|
|
40
|
+
* const { items: products } = await SL.products.list(site!.collectionId)
|
|
41
41
|
*/
|
|
42
42
|
export function fromRequest(request) {
|
|
43
43
|
return parse(headerOf(request, 'x-sl-site'));
|
|
@@ -46,16 +46,3 @@ export function fromRequest(request) {
|
|
|
46
46
|
export function current() {
|
|
47
47
|
return parse(globalThis.__SMARTLINKS_SITE__);
|
|
48
48
|
}
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Sites are server-rendered: crawlers get the finished page from the server, so nothing
|
|
51
|
-
* waits for this signal any more. Kept as a harmless no-op signal for older pages.
|
|
52
|
-
*/
|
|
53
|
-
export function ready() {
|
|
54
|
-
if (typeof globalThis === 'undefined')
|
|
55
|
-
return;
|
|
56
|
-
globalThis.__SL_READY__ = true;
|
|
57
|
-
const w = typeof window !== 'undefined' ? window : null;
|
|
58
|
-
if (w && typeof w.dispatchEvent === 'function' && typeof w.CustomEvent === 'function') {
|
|
59
|
-
w.dispatchEvent(new w.CustomEvent('smartlinks:ready'));
|
|
60
|
-
}
|
|
61
|
-
}
|
package/dist/theme-boot.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
/* @proveanything/smartlinks/theme-boot.js — iframe theme + viewer-prefs bootstrap (theme tokens v1)
|
|
2
|
-
*
|
|
3
|
-
* ONLY for iframe / standalone app entries (admin.html, index.html). Container & widget apps do NOT
|
|
4
|
-
* need this — they inherit the host's :root tokens through the DOM. See docs/theme-tokens.md.
|
|
5
|
-
*
|
|
6
|
-
* What it does, and nothing more:
|
|
7
|
-
* 1. BOOT (synchronous, before first paint): reads the initial theme + viewer prefs from the URL
|
|
8
|
-
* (`#slt=<base64url JSON>` plus convenience params ?theme=&contrast=&lang=&fontScale=) and applies
|
|
9
|
-
* them to :root. Put this in <head>, inline, so it runs before the app's stylesheet — no flash.
|
|
10
|
-
* 2. LIVE: applies generic root-state updates the host posts (`smartlinks:root-state`) — viewer /
|
|
11
|
-
* accessibility prefs (dark, contrast, font-scale, lang) and, if the host chooses, editor
|
|
12
|
-
* brand-preview. The app AUTHORS CSS against these root hooks; it never writes a message handler.
|
|
13
|
-
*
|
|
14
|
-
* Root hooks the app styles against:
|
|
15
|
-
* - theme: the `.dark` class (Tailwind/shadcn convention) AND `[data-theme="dark|light"]`
|
|
16
|
-
* - contrast: `[data-contrast="high"]` (also honour @media (prefers-contrast: more) natively)
|
|
17
|
-
* - font size: `--sl-font-scale` (e.g. 1.25) — scale your rem/base type off it
|
|
18
|
-
* - language: `lang` attribute, and `dir` (rtl for Arabic, Hebrew, ...; use start/end CSS so it mirrors)
|
|
19
|
-
* - brand: the --sl-* theme tokens (see theme.css)
|
|
20
|
-
*
|
|
21
|
-
* Brand THEME changes are expected via iframe reload (rare, operator-driven). Viewer / a11y prefs are
|
|
22
|
-
* applied LIVE here (a reload on an accessibility toggle is itself an accessibility failure).
|
|
23
|
-
*/
|
|
24
|
-
(function () {
|
|
25
|
-
if (typeof document === 'undefined') return;
|
|
26
|
-
var root = document.documentElement;
|
|
27
|
-
|
|
28
|
-
function setVar(k, val) {
|
|
29
|
-
root.style.setProperty(k.charAt(0) === '-' ? k : '--sl-' + k, String(val));
|
|
30
|
-
}
|
|
31
|
-
function applyTheme(mode) { // 'dark' | 'light'
|
|
32
|
-
if (!mode) return;
|
|
33
|
-
root.classList.toggle('dark', mode === 'dark');
|
|
34
|
-
root.setAttribute('data-theme', mode);
|
|
35
|
-
}
|
|
36
|
-
function applyState(s) {
|
|
37
|
-
if (!s || typeof s !== 'object') return;
|
|
38
|
-
var v = s.values || s.vars;
|
|
39
|
-
if (v) for (var k in v) if (Object.prototype.hasOwnProperty.call(v, k)) setVar(k, v[k]);
|
|
40
|
-
if (s.theme) applyTheme(s.theme);
|
|
41
|
-
if (s.contrast != null) {
|
|
42
|
-
if (s.contrast === 'normal' || s.contrast === false) root.removeAttribute('data-contrast');
|
|
43
|
-
else root.setAttribute('data-contrast', String(s.contrast));
|
|
44
|
-
}
|
|
45
|
-
if (s.fontScale != null) setVar('font-scale', s.fontScale);
|
|
46
|
-
if (s.lang) {
|
|
47
|
-
root.setAttribute('lang', String(s.lang));
|
|
48
|
-
// Right-to-left languages mirror the page (Arabic, Hebrew, Persian, Urdu, ...); see i18n.textDirection.
|
|
49
|
-
root.setAttribute('dir', /^(ar|he|iw|fa|ur|ps|yi|dv|ckb|sd|ug)(-|$)/i.test(String(s.lang)) ? 'rtl' : 'ltr');
|
|
50
|
-
}
|
|
51
|
-
var a = s.attrs;
|
|
52
|
-
if (a) for (var name in a) if (Object.prototype.hasOwnProperty.call(a, name)) {
|
|
53
|
-
if (a[name] == null || a[name] === false) root.removeAttribute(name);
|
|
54
|
-
else root.setAttribute(name, a[name] === true ? '' : String(a[name]));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// 1) BOOT from the URL — synchronous, before paint.
|
|
59
|
-
try {
|
|
60
|
-
var hash = location.hash || '';
|
|
61
|
-
var m = hash.match(/[#&]slt=([^&]+)/);
|
|
62
|
-
if (m) {
|
|
63
|
-
var b64 = m[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
64
|
-
applyState(JSON.parse(decodeURIComponent(escape(atob(b64)))));
|
|
65
|
-
}
|
|
66
|
-
var q = new URLSearchParams(location.search);
|
|
67
|
-
var boot = {};
|
|
68
|
-
if (q.get('theme')) boot.theme = q.get('theme');
|
|
69
|
-
if (q.get('contrast')) boot.contrast = q.get('contrast');
|
|
70
|
-
if (q.get('lang')) boot.lang = q.get('lang');
|
|
71
|
-
if (q.get('fontScale')) boot.fontScale = q.get('fontScale');
|
|
72
|
-
applyState(boot);
|
|
73
|
-
} catch (e) { /* never block the app on a malformed theme payload */ }
|
|
74
|
-
|
|
75
|
-
// 2) LIVE updates — generic; the app never writes this.
|
|
76
|
-
try {
|
|
77
|
-
window.addEventListener('message', function (e) {
|
|
78
|
-
var d = e && e.data;
|
|
79
|
-
if (d && d.type === 'smartlinks:root-state') applyState(d);
|
|
80
|
-
});
|
|
81
|
-
} catch (e) {}
|
|
82
|
-
})();
|
|
1
|
+
/* @proveanything/smartlinks/theme-boot.js — iframe theme + viewer-prefs bootstrap (theme tokens v1)
|
|
2
|
+
*
|
|
3
|
+
* ONLY for iframe / standalone app entries (admin.html, index.html). Container & widget apps do NOT
|
|
4
|
+
* need this — they inherit the host's :root tokens through the DOM. See docs/theme-tokens.md.
|
|
5
|
+
*
|
|
6
|
+
* What it does, and nothing more:
|
|
7
|
+
* 1. BOOT (synchronous, before first paint): reads the initial theme + viewer prefs from the URL
|
|
8
|
+
* (`#slt=<base64url JSON>` plus convenience params ?theme=&contrast=&lang=&fontScale=) and applies
|
|
9
|
+
* them to :root. Put this in <head>, inline, so it runs before the app's stylesheet — no flash.
|
|
10
|
+
* 2. LIVE: applies generic root-state updates the host posts (`smartlinks:root-state`) — viewer /
|
|
11
|
+
* accessibility prefs (dark, contrast, font-scale, lang) and, if the host chooses, editor
|
|
12
|
+
* brand-preview. The app AUTHORS CSS against these root hooks; it never writes a message handler.
|
|
13
|
+
*
|
|
14
|
+
* Root hooks the app styles against:
|
|
15
|
+
* - theme: the `.dark` class (Tailwind/shadcn convention) AND `[data-theme="dark|light"]`
|
|
16
|
+
* - contrast: `[data-contrast="high"]` (also honour @media (prefers-contrast: more) natively)
|
|
17
|
+
* - font size: `--sl-font-scale` (e.g. 1.25) — scale your rem/base type off it
|
|
18
|
+
* - language: `lang` attribute, and `dir` (rtl for Arabic, Hebrew, ...; use start/end CSS so it mirrors)
|
|
19
|
+
* - brand: the --sl-* theme tokens (see theme.css)
|
|
20
|
+
*
|
|
21
|
+
* Brand THEME changes are expected via iframe reload (rare, operator-driven). Viewer / a11y prefs are
|
|
22
|
+
* applied LIVE here (a reload on an accessibility toggle is itself an accessibility failure).
|
|
23
|
+
*/
|
|
24
|
+
(function () {
|
|
25
|
+
if (typeof document === 'undefined') return;
|
|
26
|
+
var root = document.documentElement;
|
|
27
|
+
|
|
28
|
+
function setVar(k, val) {
|
|
29
|
+
root.style.setProperty(k.charAt(0) === '-' ? k : '--sl-' + k, String(val));
|
|
30
|
+
}
|
|
31
|
+
function applyTheme(mode) { // 'dark' | 'light'
|
|
32
|
+
if (!mode) return;
|
|
33
|
+
root.classList.toggle('dark', mode === 'dark');
|
|
34
|
+
root.setAttribute('data-theme', mode);
|
|
35
|
+
}
|
|
36
|
+
function applyState(s) {
|
|
37
|
+
if (!s || typeof s !== 'object') return;
|
|
38
|
+
var v = s.values || s.vars;
|
|
39
|
+
if (v) for (var k in v) if (Object.prototype.hasOwnProperty.call(v, k)) setVar(k, v[k]);
|
|
40
|
+
if (s.theme) applyTheme(s.theme);
|
|
41
|
+
if (s.contrast != null) {
|
|
42
|
+
if (s.contrast === 'normal' || s.contrast === false) root.removeAttribute('data-contrast');
|
|
43
|
+
else root.setAttribute('data-contrast', String(s.contrast));
|
|
44
|
+
}
|
|
45
|
+
if (s.fontScale != null) setVar('font-scale', s.fontScale);
|
|
46
|
+
if (s.lang) {
|
|
47
|
+
root.setAttribute('lang', String(s.lang));
|
|
48
|
+
// Right-to-left languages mirror the page (Arabic, Hebrew, Persian, Urdu, ...); see i18n.textDirection.
|
|
49
|
+
root.setAttribute('dir', /^(ar|he|iw|fa|ur|ps|yi|dv|ckb|sd|ug)(-|$)/i.test(String(s.lang)) ? 'rtl' : 'ltr');
|
|
50
|
+
}
|
|
51
|
+
var a = s.attrs;
|
|
52
|
+
if (a) for (var name in a) if (Object.prototype.hasOwnProperty.call(a, name)) {
|
|
53
|
+
if (a[name] == null || a[name] === false) root.removeAttribute(name);
|
|
54
|
+
else root.setAttribute(name, a[name] === true ? '' : String(a[name]));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 1) BOOT from the URL — synchronous, before paint.
|
|
59
|
+
try {
|
|
60
|
+
var hash = location.hash || '';
|
|
61
|
+
var m = hash.match(/[#&]slt=([^&]+)/);
|
|
62
|
+
if (m) {
|
|
63
|
+
var b64 = m[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
64
|
+
applyState(JSON.parse(decodeURIComponent(escape(atob(b64)))));
|
|
65
|
+
}
|
|
66
|
+
var q = new URLSearchParams(location.search);
|
|
67
|
+
var boot = {};
|
|
68
|
+
if (q.get('theme')) boot.theme = q.get('theme');
|
|
69
|
+
if (q.get('contrast')) boot.contrast = q.get('contrast');
|
|
70
|
+
if (q.get('lang')) boot.lang = q.get('lang');
|
|
71
|
+
if (q.get('fontScale')) boot.fontScale = q.get('fontScale');
|
|
72
|
+
applyState(boot);
|
|
73
|
+
} catch (e) { /* never block the app on a malformed theme payload */ }
|
|
74
|
+
|
|
75
|
+
// 2) LIVE updates — generic; the app never writes this.
|
|
76
|
+
try {
|
|
77
|
+
window.addEventListener('message', function (e) {
|
|
78
|
+
var d = e && e.data;
|
|
79
|
+
if (d && d.type === 'smartlinks:root-state') applyState(d);
|
|
80
|
+
});
|
|
81
|
+
} catch (e) {}
|
|
82
|
+
})();
|
package/dist/theme.css
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
/* @proveanything/smartlinks/theme.css — SmartLinks host theming preset (theme tokens v1)
|
|
2
|
-
*
|
|
3
|
-
* Maps Tailwind 4's design tokens onto the SmartLinks semantic theme tokens (--sl-color-*,
|
|
4
|
-
* --sl-radius-*, --sl-font-*) that the host sets on each app's mount root. After importing this,
|
|
5
|
-
* an app's `bg-primary` / `text-foreground` / `border-border` / `rounded-md` / `font-heading`
|
|
6
|
-
* resolve to whatever brand the host is running — no per-app mapping, no hardcoded palette.
|
|
7
|
-
*
|
|
8
|
-
* app styles.css:
|
|
9
|
-
* @import "tailwindcss";
|
|
10
|
-
* @import "@proveanything/smartlinks/theme.css";
|
|
11
|
-
*
|
|
12
|
-
* Requires Tailwind 4 (@theme). Every value has a neutral fallback, so the app renders correctly
|
|
13
|
-
* even against a host that sets none of the --sl-* tokens. See docs/theme-tokens.md.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
@theme {
|
|
17
|
-
/* ── Colour (semantic roles) ─────────────────────────────────────────── */
|
|
18
|
-
--color-background: var(--sl-color-bg, #ffffff);
|
|
19
|
-
--color-surface: var(--sl-color-surface, #f7f7f8);
|
|
20
|
-
--color-surface-raised:var(--sl-color-surface-raised, var(--sl-color-surface, #ffffff));
|
|
21
|
-
--color-foreground: var(--sl-color-fg, #18181b);
|
|
22
|
-
--color-muted: var(--sl-color-muted, #71717a);
|
|
23
|
-
--color-border: var(--sl-color-border, #e4e4e7);
|
|
24
|
-
--color-primary: var(--sl-color-accent, #4f46e5);
|
|
25
|
-
--color-on-primary: var(--sl-color-on-accent, #ffffff);
|
|
26
|
-
--color-primary-soft: var(--sl-color-accent-soft, color-mix(in oklab, var(--sl-color-accent, #4f46e5) 12%, transparent));
|
|
27
|
-
--color-success: var(--sl-color-success, #16a34a);
|
|
28
|
-
--color-danger: var(--sl-color-danger, #dc2626);
|
|
29
|
-
|
|
30
|
-
/* ── Shape ───────────────────────────────────────────────────────────── */
|
|
31
|
-
--radius-sm: var(--sl-radius-sm, 4px);
|
|
32
|
-
--radius-md: var(--sl-radius-md, 8px);
|
|
33
|
-
--radius-lg: var(--sl-radius-lg, 16px);
|
|
34
|
-
|
|
35
|
-
/* ── Type ────────────────────────────────────────────────────────────── */
|
|
36
|
-
--font-heading: var(--sl-font-heading, var(--sl-font-body, ui-sans-serif, system-ui, sans-serif));
|
|
37
|
-
--font-body: var(--sl-font-body, ui-sans-serif, system-ui, sans-serif);
|
|
38
|
-
|
|
39
|
-
/* ── Elevation (extended; no shadow unless the host sets one) ─────────── */
|
|
40
|
-
--shadow-sm: var(--sl-shadow-sm, 0 0 #0000);
|
|
41
|
-
--shadow-md: var(--sl-shadow-md, 0 0 #0000);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* Dark mode without values. A host in dark mode should send a dark value-set (the --sl-* tokens); one
|
|
45
|
-
* that only sets the hook (.dark / data-theme="dark") left every colour on its light fallback — white
|
|
46
|
-
* cards and near-black text on a dark page. Under the hook the fallbacks are dark too; whatever the host
|
|
47
|
-
* does send still wins. (Re-declared on the hook's element, so it works wherever the host puts it.) */
|
|
48
|
-
.dark,
|
|
49
|
-
[data-theme="dark"] {
|
|
50
|
-
--color-background: var(--sl-color-bg, #09090b);
|
|
51
|
-
--color-surface: var(--sl-color-surface, #18181b);
|
|
52
|
-
--color-surface-raised:var(--sl-color-surface-raised, var(--sl-color-surface, #27272a));
|
|
53
|
-
--color-foreground: var(--sl-color-fg, #fafafa);
|
|
54
|
-
--color-muted: var(--sl-color-muted, #a1a1aa);
|
|
55
|
-
--color-border: var(--sl-color-border, #3f3f46);
|
|
56
|
-
--color-primary: var(--sl-color-accent, #6366f1);
|
|
57
|
-
--color-on-primary: var(--sl-color-on-accent, #ffffff);
|
|
58
|
-
--color-primary-soft: var(--sl-color-accent-soft, color-mix(in oklab, var(--sl-color-accent, #6366f1) 20%, transparent));
|
|
59
|
-
--color-success: var(--sl-color-success, #22c55e);
|
|
60
|
-
--color-danger: var(--sl-color-danger, #f87171);
|
|
61
|
-
color-scheme: dark;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* shadcn bridge (optional): if the app uses shadcn's --primary/--background/etc. HSL variables,
|
|
65
|
-
* uncomment to drive them from the SmartLinks tokens too. Left commented so it never overrides an
|
|
66
|
-
* app that has deliberately customised its shadcn palette — opt in per app (see migration step 17).
|
|
67
|
-
*
|
|
68
|
-
* :where([data-sl-app]) {
|
|
69
|
-
* --primary: var(--sl-color-accent);
|
|
70
|
-
* --background: var(--sl-color-bg);
|
|
71
|
-
* --foreground: var(--sl-color-fg);
|
|
72
|
-
* --border: var(--sl-color-border);
|
|
73
|
-
* --radius: var(--sl-radius-md);
|
|
74
|
-
* }
|
|
75
|
-
*/
|
|
1
|
+
/* @proveanything/smartlinks/theme.css — SmartLinks host theming preset (theme tokens v1)
|
|
2
|
+
*
|
|
3
|
+
* Maps Tailwind 4's design tokens onto the SmartLinks semantic theme tokens (--sl-color-*,
|
|
4
|
+
* --sl-radius-*, --sl-font-*) that the host sets on each app's mount root. After importing this,
|
|
5
|
+
* an app's `bg-primary` / `text-foreground` / `border-border` / `rounded-md` / `font-heading`
|
|
6
|
+
* resolve to whatever brand the host is running — no per-app mapping, no hardcoded palette.
|
|
7
|
+
*
|
|
8
|
+
* app styles.css:
|
|
9
|
+
* @import "tailwindcss";
|
|
10
|
+
* @import "@proveanything/smartlinks/theme.css";
|
|
11
|
+
*
|
|
12
|
+
* Requires Tailwind 4 (@theme). Every value has a neutral fallback, so the app renders correctly
|
|
13
|
+
* even against a host that sets none of the --sl-* tokens. See docs/theme-tokens.md.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
@theme {
|
|
17
|
+
/* ── Colour (semantic roles) ─────────────────────────────────────────── */
|
|
18
|
+
--color-background: var(--sl-color-bg, #ffffff);
|
|
19
|
+
--color-surface: var(--sl-color-surface, #f7f7f8);
|
|
20
|
+
--color-surface-raised:var(--sl-color-surface-raised, var(--sl-color-surface, #ffffff));
|
|
21
|
+
--color-foreground: var(--sl-color-fg, #18181b);
|
|
22
|
+
--color-muted: var(--sl-color-muted, #71717a);
|
|
23
|
+
--color-border: var(--sl-color-border, #e4e4e7);
|
|
24
|
+
--color-primary: var(--sl-color-accent, #4f46e5);
|
|
25
|
+
--color-on-primary: var(--sl-color-on-accent, #ffffff);
|
|
26
|
+
--color-primary-soft: var(--sl-color-accent-soft, color-mix(in oklab, var(--sl-color-accent, #4f46e5) 12%, transparent));
|
|
27
|
+
--color-success: var(--sl-color-success, #16a34a);
|
|
28
|
+
--color-danger: var(--sl-color-danger, #dc2626);
|
|
29
|
+
|
|
30
|
+
/* ── Shape ───────────────────────────────────────────────────────────── */
|
|
31
|
+
--radius-sm: var(--sl-radius-sm, 4px);
|
|
32
|
+
--radius-md: var(--sl-radius-md, 8px);
|
|
33
|
+
--radius-lg: var(--sl-radius-lg, 16px);
|
|
34
|
+
|
|
35
|
+
/* ── Type ────────────────────────────────────────────────────────────── */
|
|
36
|
+
--font-heading: var(--sl-font-heading, var(--sl-font-body, ui-sans-serif, system-ui, sans-serif));
|
|
37
|
+
--font-body: var(--sl-font-body, ui-sans-serif, system-ui, sans-serif);
|
|
38
|
+
|
|
39
|
+
/* ── Elevation (extended; no shadow unless the host sets one) ─────────── */
|
|
40
|
+
--shadow-sm: var(--sl-shadow-sm, 0 0 #0000);
|
|
41
|
+
--shadow-md: var(--sl-shadow-md, 0 0 #0000);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Dark mode without values. A host in dark mode should send a dark value-set (the --sl-* tokens); one
|
|
45
|
+
* that only sets the hook (.dark / data-theme="dark") left every colour on its light fallback — white
|
|
46
|
+
* cards and near-black text on a dark page. Under the hook the fallbacks are dark too; whatever the host
|
|
47
|
+
* does send still wins. (Re-declared on the hook's element, so it works wherever the host puts it.) */
|
|
48
|
+
.dark,
|
|
49
|
+
[data-theme="dark"] {
|
|
50
|
+
--color-background: var(--sl-color-bg, #09090b);
|
|
51
|
+
--color-surface: var(--sl-color-surface, #18181b);
|
|
52
|
+
--color-surface-raised:var(--sl-color-surface-raised, var(--sl-color-surface, #27272a));
|
|
53
|
+
--color-foreground: var(--sl-color-fg, #fafafa);
|
|
54
|
+
--color-muted: var(--sl-color-muted, #a1a1aa);
|
|
55
|
+
--color-border: var(--sl-color-border, #3f3f46);
|
|
56
|
+
--color-primary: var(--sl-color-accent, #6366f1);
|
|
57
|
+
--color-on-primary: var(--sl-color-on-accent, #ffffff);
|
|
58
|
+
--color-primary-soft: var(--sl-color-accent-soft, color-mix(in oklab, var(--sl-color-accent, #6366f1) 20%, transparent));
|
|
59
|
+
--color-success: var(--sl-color-success, #22c55e);
|
|
60
|
+
--color-danger: var(--sl-color-danger, #f87171);
|
|
61
|
+
color-scheme: dark;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* shadcn bridge (optional): if the app uses shadcn's --primary/--background/etc. HSL variables,
|
|
65
|
+
* uncomment to drive them from the SmartLinks tokens too. Left commented so it never overrides an
|
|
66
|
+
* app that has deliberately customised its shadcn palette — opt in per app (see migration step 17).
|
|
67
|
+
*
|
|
68
|
+
* :where([data-sl-app]) {
|
|
69
|
+
* --primary: var(--sl-color-accent);
|
|
70
|
+
* --background: var(--sl-color-bg);
|
|
71
|
+
* --foreground: var(--sl-color-fg);
|
|
72
|
+
* --border: var(--sl-color-border);
|
|
73
|
+
* --radius: var(--sl-radius-md);
|
|
74
|
+
* }
|
|
75
|
+
*/
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* recomputed when something it declares in `refresh.on` changed (or `refresh.maxAge` passed), in the
|
|
12
12
|
* background, within a time and size budget — so a dashboard never waits on 20 functions.
|
|
13
13
|
*/
|
|
14
|
+
import type { ListResult } from './list.js';
|
|
14
15
|
/** Grid widths on a 12-column dashboard: small 3, medium 6, wide 8, full 12. One column on phones. */
|
|
15
16
|
export type AdminCardSize = 'small' | 'medium' | 'wide' | 'full';
|
|
16
17
|
/**
|
|
@@ -172,9 +173,11 @@ export interface StudioHomeLayout {
|
|
|
172
173
|
hidden?: boolean;
|
|
173
174
|
}>;
|
|
174
175
|
}
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
/**
|
|
177
|
+
* `adminCards.list` → the whole dashboard in one call: the cards to show are in `items`, in display
|
|
178
|
+
* order. It is not paged, so `nextCursor` is always `null`.
|
|
179
|
+
*/
|
|
180
|
+
export interface AdminCardsResponse extends ListResult<AdminCard> {
|
|
178
181
|
/** Cards the layout hides (for the "add a card" picker). */
|
|
179
182
|
hidden: AdminCard[];
|
|
180
183
|
layout: StudioHomeLayout | null;
|
package/dist/types/ai.d.ts
CHANGED
|
@@ -731,9 +731,6 @@ export interface AgentToolDefinition {
|
|
|
731
731
|
capabilities: string[];
|
|
732
732
|
parameters: any;
|
|
733
733
|
}
|
|
734
|
-
export interface AgentToolsResponse {
|
|
735
|
-
tools: AgentToolDefinition[];
|
|
736
|
-
}
|
|
737
734
|
export interface AgentToolsQuery {
|
|
738
735
|
allowCapabilities?: string;
|
|
739
736
|
only?: string;
|
|
@@ -746,9 +743,6 @@ export interface SkillDescriptor {
|
|
|
746
743
|
outputSchema: any;
|
|
747
744
|
capabilities: string[];
|
|
748
745
|
}
|
|
749
|
-
export interface SkillsListResponse {
|
|
750
|
-
skills: SkillDescriptor[];
|
|
751
|
-
}
|
|
752
746
|
export interface CatalogResponse {
|
|
753
747
|
tools: AgentToolDefinition[];
|
|
754
748
|
skills: SkillDescriptor[];
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Separate from the `interactions` namespace. These types cover generic web
|
|
5
5
|
* analytics, click tracking, and tag scan analytics for collection dashboards.
|
|
6
6
|
*/
|
|
7
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
7
8
|
export type AnalyticsSource = 'events' | 'tag';
|
|
8
9
|
/**
|
|
9
10
|
* Includes `scan_redirect` - logged automatically by the server (not the
|
|
@@ -273,19 +274,15 @@ export interface AnalyticsBreakdownResponse {
|
|
|
273
274
|
metric: AnalyticsMetric;
|
|
274
275
|
rows: AnalyticsBreakdownRow[];
|
|
275
276
|
}
|
|
276
|
-
|
|
277
|
+
/** Paging is `limit` (default 100) and `cursor`: pass the previous page's `nextCursor`. */
|
|
278
|
+
export interface AnalyticsEventsRequest extends AnalyticsFilterRequest, ListOptions {
|
|
277
279
|
source: AnalyticsSource;
|
|
278
|
-
limit?: number;
|
|
279
|
-
offset?: number;
|
|
280
280
|
sort?: AnalyticsSortOrder;
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
/** `{ items, nextCursor, source, sort }`: the event rows are in `items`. This list does not report a total. */
|
|
283
|
+
export interface AnalyticsEventsResponse extends ListResult<Record<string, any>> {
|
|
283
284
|
source: AnalyticsSource;
|
|
284
|
-
limit: number;
|
|
285
|
-
offset: number;
|
|
286
285
|
sort: 'ASC' | 'DESC';
|
|
287
|
-
count: number;
|
|
288
|
-
rows: Array<Record<string, any>>;
|
|
289
286
|
}
|
|
290
287
|
export interface LegacyAnalyticsRequest {
|
|
291
288
|
collection?: string;
|
|
@@ -1223,7 +1223,7 @@ export interface AppManifest {
|
|
|
1223
1223
|
*/
|
|
1224
1224
|
moduleFormat?: 'umd' | 'esm' | 'dual';
|
|
1225
1225
|
/**
|
|
1226
|
-
* Shared-dependency contract version this bundle was built against, e.g. `"v7"`
|
|
1226
|
+
* Shared-dependency contract version this bundle was built against, e.g. `"v8"` (SDK 3) or `"v7"` (SDK 2)
|
|
1227
1227
|
* (see `SHARED_DEPENDENCY_CONTRACT_VERSION`). The host uses it to select a
|
|
1228
1228
|
* compatible import map for the ESM load path.
|
|
1229
1229
|
*/
|
|
@@ -1765,11 +1765,10 @@ export interface CollectionAppWidget {
|
|
|
1765
1765
|
admin: string | null;
|
|
1766
1766
|
}
|
|
1767
1767
|
/**
|
|
1768
|
-
* Response from GET /api/v1/public/collection/:collectionId/widgets
|
|
1768
|
+
* Response from GET /api/v1/public/collection/:collectionId/app/widgets: the apps are in `items`.
|
|
1769
|
+
* It is not paged, so `nextCursor` is always `null`.
|
|
1769
1770
|
*/
|
|
1770
|
-
export
|
|
1771
|
-
apps: CollectionAppWidget[];
|
|
1772
|
-
}
|
|
1771
|
+
export type CollectionWidgetsResponse = import('./list.js').ListResult<CollectionAppWidget>;
|
|
1773
1772
|
/**
|
|
1774
1773
|
* Options for fetching collection widgets
|
|
1775
1774
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListResult, ListOptions } from './list.js';
|
|
1
2
|
/**
|
|
2
3
|
* Visibility levels for app objects
|
|
3
4
|
*/
|
|
@@ -7,9 +8,10 @@ export type Visibility = 'public' | 'owner' | 'admin';
|
|
|
7
8
|
*/
|
|
8
9
|
export type CallerRole = 'admin' | 'owner' | 'public';
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* The older list shape (`data` + `pagination`). `app.cases.list`, `app.threads.list` and
|
|
12
|
+
* `app.records.list` no longer return it: from SDK 3 they return {@link ListResult}
|
|
13
|
+
* (`{ items, nextCursor, count }`). Kept for server functions (`ctx.sl` bookings), which still answer this way.
|
|
11
14
|
*
|
|
12
|
-
* All list endpoints return this shape:
|
|
13
15
|
* ```json
|
|
14
16
|
* {
|
|
15
17
|
* "data": [ ...items ],
|
|
@@ -101,11 +103,10 @@ export interface AggregateResponse {
|
|
|
101
103
|
avg_replies?: number;
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
|
-
* Common query parameters for list endpoints
|
|
106
|
+
* Common query parameters for list endpoints. Paging is `limit` and `cursor` (from {@link ListOptions}):
|
|
107
|
+
* pass the previous page's `nextCursor` as `cursor` to get the next page.
|
|
105
108
|
*/
|
|
106
|
-
export interface ListQueryParams {
|
|
107
|
-
limit?: number;
|
|
108
|
-
offset?: number;
|
|
109
|
+
export interface ListQueryParams extends ListOptions {
|
|
109
110
|
sort?: string;
|
|
110
111
|
includeDeleted?: boolean;
|
|
111
112
|
status?: string;
|
|
@@ -450,13 +451,10 @@ export interface MatchEntry extends AppRecord {
|
|
|
450
451
|
matchedClauseCount?: number;
|
|
451
452
|
}
|
|
452
453
|
/**
|
|
453
|
-
* Response from the match endpoint
|
|
454
|
+
* Response from the match endpoint: `items` are the matched records, most specific first; `count` is
|
|
455
|
+
* how many matched. It is not paged, so `nextCursor` is always `null`.
|
|
454
456
|
*/
|
|
455
|
-
export interface MatchResult {
|
|
456
|
-
/** Matched records ordered by specificity descending (most specific first) */
|
|
457
|
-
data: MatchEntry[];
|
|
458
|
-
/** Total count of matched records */
|
|
459
|
-
total: number;
|
|
457
|
+
export interface MatchResult extends ListResult<MatchEntry> {
|
|
460
458
|
/** Strategy used for this result */
|
|
461
459
|
strategy: 'all' | 'best';
|
|
462
460
|
}
|
|
@@ -704,13 +702,11 @@ export interface ResolveAllParams {
|
|
|
704
702
|
includeExpired?: boolean;
|
|
705
703
|
}
|
|
706
704
|
/**
|
|
707
|
-
* Response from the resolve-all endpoint
|
|
705
|
+
* Response from the resolve-all endpoint: `items` are every applicable record sorted by precedence
|
|
706
|
+
* (most specific first), each at most once; `count` is how many were returned. It is not paged, so
|
|
707
|
+
* `nextCursor` is always `null` (see `truncated`).
|
|
708
708
|
*/
|
|
709
|
-
export interface ResolveAllResult {
|
|
710
|
-
/** Every applicable record sorted by precedence (most-specific first). Each appears at most once. */
|
|
711
|
-
records: ResolveAllEntry[];
|
|
712
|
-
/** Total count of returned records. */
|
|
713
|
-
total: number;
|
|
709
|
+
export interface ResolveAllResult extends ListResult<ResolveAllEntry> {
|
|
714
710
|
/** The context echoed back from the request (for verification). */
|
|
715
711
|
context: ResolveAllContext;
|
|
716
712
|
/** true if the result was capped at the safety limit. */
|
package/dist/types/appObjects.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListResult } from './list.js';
|
|
1
2
|
/** One entry a picker shows. */
|
|
2
3
|
export interface AppOption {
|
|
3
4
|
/** A record's id, or a value list value's code: what a record stores. */
|
|
@@ -24,6 +25,23 @@ export type AppOptionsResponse =
|
|
|
24
25
|
unchanged: true;
|
|
25
26
|
version: string;
|
|
26
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* What `app.options.get` returns: the standard list shape plus the picker's `version` and `mode`.
|
|
30
|
+
* `count` is how many entries there are in all, where the server reports it. Pickers are not paged, so
|
|
31
|
+
* `nextCursor` is always `null`.
|
|
32
|
+
*/
|
|
33
|
+
export type AppOptionsList =
|
|
34
|
+
/** `all`: every entry. `search`: the type is too large to send whole; these match `q`. */
|
|
35
|
+
(ListResult<AppOption> & {
|
|
36
|
+
version: string;
|
|
37
|
+
mode: 'all' | 'search';
|
|
38
|
+
unchanged?: undefined;
|
|
39
|
+
})
|
|
40
|
+
/** You already hold this version. */
|
|
41
|
+
| {
|
|
42
|
+
unchanged: true;
|
|
43
|
+
version: string;
|
|
44
|
+
};
|
|
27
45
|
/** A value to save in a value list, in the order to show them. */
|
|
28
46
|
export interface AppOptionValueInput {
|
|
29
47
|
code: string;
|