@contractspec/bundle.marketing 3.8.8 → 3.8.9
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/.turbo/turbo-build.log +64 -32
- package/CHANGELOG.md +30 -0
- package/dist/browser/components/templates/TemplateCard.js +83 -0
- package/dist/browser/components/templates/TemplateCommandDialog.js +110 -0
- package/dist/browser/components/templates/TemplatePreviewContent.js +96 -0
- package/dist/browser/components/templates/TemplatesBrowseControls.js +115 -0
- package/dist/browser/components/templates/TemplatesCatalogSection.js +284 -0
- package/dist/browser/components/templates/TemplatesClientPage.js +840 -917
- package/dist/browser/components/templates/TemplatesHeroSection.js +87 -0
- package/dist/browser/components/templates/TemplatesNextStepsSection.js +126 -0
- package/dist/browser/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/browser/components/templates/index.js +873 -950
- package/dist/browser/components/templates/template-catalog.js +81 -0
- package/dist/browser/components/templates/template-new.js +23 -0
- package/dist/browser/components/templates/template-preview.js +43 -0
- package/dist/browser/components/templates/template-source.js +19 -0
- package/dist/browser/index.js +873 -950
- package/dist/components/templates/TemplateCard.d.ts +12 -0
- package/dist/components/templates/TemplateCard.js +78 -0
- package/dist/components/templates/TemplateCommandDialog.d.ts +6 -0
- package/dist/components/templates/TemplateCommandDialog.js +105 -0
- package/dist/components/templates/TemplatePreviewContent.d.ts +5 -0
- package/dist/components/templates/TemplatePreviewContent.js +91 -0
- package/dist/components/templates/TemplatesBrowseControls.d.ts +13 -0
- package/dist/components/templates/TemplatesBrowseControls.js +110 -0
- package/dist/components/templates/TemplatesCatalogSection.d.ts +14 -0
- package/dist/components/templates/TemplatesCatalogSection.js +279 -0
- package/dist/components/templates/TemplatesClientPage.js +840 -917
- package/dist/components/templates/TemplatesHeroSection.d.ts +5 -0
- package/dist/components/templates/TemplatesHeroSection.js +82 -0
- package/dist/components/templates/TemplatesNextStepsSection.d.ts +1 -0
- package/dist/components/templates/TemplatesNextStepsSection.js +121 -0
- package/dist/components/templates/TemplatesPreviewModal.d.ts +3 -4
- package/dist/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/components/templates/index.js +873 -950
- package/dist/components/templates/template-catalog.d.ts +27 -0
- package/dist/components/templates/template-catalog.js +76 -0
- package/dist/components/templates/template-catalog.test.d.ts +1 -0
- package/dist/components/templates/template-new.d.ts +2 -0
- package/dist/components/templates/template-new.js +18 -0
- package/dist/components/templates/template-preview.d.ts +18 -0
- package/dist/components/templates/template-preview.js +38 -0
- package/dist/components/templates/template-source.d.ts +3 -0
- package/dist/components/templates/template-source.js +14 -0
- package/dist/index.js +873 -950
- package/dist/node/components/templates/TemplateCard.js +78 -0
- package/dist/node/components/templates/TemplateCommandDialog.js +105 -0
- package/dist/node/components/templates/TemplatePreviewContent.js +91 -0
- package/dist/node/components/templates/TemplatesBrowseControls.js +110 -0
- package/dist/node/components/templates/TemplatesCatalogSection.js +279 -0
- package/dist/node/components/templates/TemplatesClientPage.js +840 -917
- package/dist/node/components/templates/TemplatesHeroSection.js +82 -0
- package/dist/node/components/templates/TemplatesNextStepsSection.js +121 -0
- package/dist/node/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/node/components/templates/index.js +873 -950
- package/dist/node/components/templates/template-catalog.js +76 -0
- package/dist/node/components/templates/template-new.js +18 -0
- package/dist/node/components/templates/template-preview.js +38 -0
- package/dist/node/components/templates/template-source.js +14 -0
- package/dist/node/index.js +873 -950
- package/package.json +181 -26
- package/src/components/templates/TemplateCard.tsx +74 -0
- package/src/components/templates/TemplateCommandDialog.tsx +92 -0
- package/src/components/templates/TemplatePreviewContent.tsx +182 -0
- package/src/components/templates/TemplatesBrowseControls.tsx +120 -0
- package/src/components/templates/TemplatesCatalogSection.tsx +166 -0
- package/src/components/templates/TemplatesClientPage.tsx +109 -741
- package/src/components/templates/TemplatesHeroSection.tsx +41 -0
- package/src/components/templates/TemplatesNextStepsSection.tsx +80 -0
- package/src/components/templates/TemplatesPreviewModal.tsx +19 -294
- package/src/components/templates/template-catalog.test.ts +66 -0
- package/src/components/templates/template-catalog.ts +132 -0
- package/src/components/templates/template-new.ts +12 -0
- package/src/components/templates/template-preview.ts +57 -0
- package/src/components/templates/template-source.ts +13 -0
- package/.turbo/turbo-prebuild.log +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/components/templates/template-new.ts
|
|
10
|
+
var NEW_TEMPLATE_IDS = [
|
|
11
|
+
"minimal",
|
|
12
|
+
"messaging-agent-actions",
|
|
13
|
+
"policy-safe-knowledge-assistant",
|
|
14
|
+
"visualization-showcase"
|
|
15
|
+
];
|
|
16
|
+
var NEW_TEMPLATE_ID_SET = new Set(NEW_TEMPLATE_IDS);
|
|
17
|
+
function isNewTemplateId(templateId) {
|
|
18
|
+
return NEW_TEMPLATE_ID_SET.has(templateId);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/components/templates/template-catalog.ts
|
|
22
|
+
import { listExamples, listTemplates } from "@contractspec/module.examples";
|
|
23
|
+
var NEW_TEMPLATE_INDEX = new Map(NEW_TEMPLATE_IDS.map((templateId, index) => [templateId, index]));
|
|
24
|
+
function buildLocalTemplateCatalog(examples = listExamples(), templates = listTemplates()) {
|
|
25
|
+
const templatesById = new Map(templates.map((template) => [template.id, template]));
|
|
26
|
+
return examples.filter((example) => example.meta.visibility === "public" && example.surfaces.templates).map((example) => {
|
|
27
|
+
const template = templatesById.get(example.meta.key);
|
|
28
|
+
const tags = Array.from(new Set(example.meta.tags.map((tag) => tag.trim()).filter(Boolean))).sort((left, right) => left.localeCompare(right));
|
|
29
|
+
return {
|
|
30
|
+
id: example.meta.key,
|
|
31
|
+
title: example.meta.title ?? template?.name ?? example.meta.key,
|
|
32
|
+
description: example.meta.summary ?? example.meta.description,
|
|
33
|
+
tags,
|
|
34
|
+
kind: example.meta.kind,
|
|
35
|
+
stability: example.meta.stability,
|
|
36
|
+
previewUrl: template?.preview?.demoUrl ?? `/sandbox?template=${encodeURIComponent(example.meta.key)}`,
|
|
37
|
+
featureList: [...template?.features ?? []],
|
|
38
|
+
sandboxModes: example.surfaces.sandbox.modes,
|
|
39
|
+
renderTargets: [...template?.renderTargets ?? []],
|
|
40
|
+
isNew: isNewTemplateId(example.meta.key),
|
|
41
|
+
packageName: example.entrypoints.packageName
|
|
42
|
+
};
|
|
43
|
+
}).sort(compareLocalTemplateCatalogItems);
|
|
44
|
+
}
|
|
45
|
+
function matchesTemplateFilters(template, search, selectedTag) {
|
|
46
|
+
const haystack = [
|
|
47
|
+
template.title,
|
|
48
|
+
template.description,
|
|
49
|
+
template.tags.join(" ")
|
|
50
|
+
].join(" ").toLowerCase();
|
|
51
|
+
const searchTokens = search.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
52
|
+
const matchesSearch = searchTokens.length === 0 || searchTokens.every((token) => haystack.includes(token));
|
|
53
|
+
const matchesTag = selectedTag === null || template.tags.includes(selectedTag);
|
|
54
|
+
return matchesSearch && matchesTag;
|
|
55
|
+
}
|
|
56
|
+
function formatExampleKindLabel(kind) {
|
|
57
|
+
return kind.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
58
|
+
}
|
|
59
|
+
function formatStabilityLabel(stability) {
|
|
60
|
+
return stability.split("_").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
61
|
+
}
|
|
62
|
+
function compareLocalTemplateCatalogItems(left, right) {
|
|
63
|
+
const leftNewIndex = NEW_TEMPLATE_INDEX.get(left.id);
|
|
64
|
+
const rightNewIndex = NEW_TEMPLATE_INDEX.get(right.id);
|
|
65
|
+
if (leftNewIndex !== undefined || rightNewIndex !== undefined) {
|
|
66
|
+
if (leftNewIndex === undefined) {
|
|
67
|
+
return 1;
|
|
68
|
+
}
|
|
69
|
+
if (rightNewIndex === undefined) {
|
|
70
|
+
return -1;
|
|
71
|
+
}
|
|
72
|
+
return leftNewIndex - rightNewIndex;
|
|
73
|
+
}
|
|
74
|
+
return left.title.localeCompare(right.title);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
matchesTemplateFilters,
|
|
78
|
+
formatStabilityLabel,
|
|
79
|
+
formatExampleKindLabel,
|
|
80
|
+
buildLocalTemplateCatalog
|
|
81
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/components/templates/template-new.ts
|
|
10
|
+
var NEW_TEMPLATE_IDS = [
|
|
11
|
+
"minimal",
|
|
12
|
+
"messaging-agent-actions",
|
|
13
|
+
"policy-safe-knowledge-assistant",
|
|
14
|
+
"visualization-showcase"
|
|
15
|
+
];
|
|
16
|
+
var NEW_TEMPLATE_ID_SET = new Set(NEW_TEMPLATE_IDS);
|
|
17
|
+
function isNewTemplateId(templateId) {
|
|
18
|
+
return NEW_TEMPLATE_ID_SET.has(templateId);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
isNewTemplateId,
|
|
22
|
+
NEW_TEMPLATE_IDS
|
|
23
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/components/templates/template-preview.ts
|
|
10
|
+
var INLINE_TEMPLATE_PREVIEW_IDS = [
|
|
11
|
+
"agent-console",
|
|
12
|
+
"ai-chat-assistant",
|
|
13
|
+
"analytics-dashboard",
|
|
14
|
+
"crm-pipeline",
|
|
15
|
+
"data-grid-showcase",
|
|
16
|
+
"integration-hub",
|
|
17
|
+
"marketplace",
|
|
18
|
+
"saas-boilerplate",
|
|
19
|
+
"visualization-showcase",
|
|
20
|
+
"workflow-system"
|
|
21
|
+
];
|
|
22
|
+
var INLINE_TEMPLATE_PREVIEW_SET = new Set(INLINE_TEMPLATE_PREVIEW_IDS);
|
|
23
|
+
function supportsInlineTemplatePreview(templateId) {
|
|
24
|
+
return INLINE_TEMPLATE_PREVIEW_SET.has(templateId);
|
|
25
|
+
}
|
|
26
|
+
function getLocalTemplatePreviewAction(template) {
|
|
27
|
+
if (supportsInlineTemplatePreview(template.id)) {
|
|
28
|
+
return { kind: "modal", templateId: template.id };
|
|
29
|
+
}
|
|
30
|
+
return { kind: "sandbox", href: template.previewUrl };
|
|
31
|
+
}
|
|
32
|
+
function getRegistryTemplatePreviewAction(template, localTemplate) {
|
|
33
|
+
if (!localTemplate) {
|
|
34
|
+
return { kind: "disabled" };
|
|
35
|
+
}
|
|
36
|
+
return getLocalTemplatePreviewAction(localTemplate);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
supportsInlineTemplatePreview,
|
|
40
|
+
getRegistryTemplatePreviewAction,
|
|
41
|
+
getLocalTemplatePreviewAction,
|
|
42
|
+
INLINE_TEMPLATE_PREVIEW_IDS
|
|
43
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// src/components/templates/template-source.ts
|
|
10
|
+
function isRegistryConfigured(registryUrl) {
|
|
11
|
+
return Boolean(registryUrl?.trim());
|
|
12
|
+
}
|
|
13
|
+
function getAvailableTemplateSources(registryUrl) {
|
|
14
|
+
return isRegistryConfigured(registryUrl) ? ["local", "registry"] : ["local"];
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
isRegistryConfigured,
|
|
18
|
+
getAvailableTemplateSources
|
|
19
|
+
};
|