@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.
Files changed (76) hide show
  1. package/.turbo/turbo-build.log +64 -32
  2. package/CHANGELOG.md +30 -0
  3. package/dist/browser/components/templates/TemplateCard.js +83 -0
  4. package/dist/browser/components/templates/TemplateCommandDialog.js +110 -0
  5. package/dist/browser/components/templates/TemplatePreviewContent.js +96 -0
  6. package/dist/browser/components/templates/TemplatesBrowseControls.js +115 -0
  7. package/dist/browser/components/templates/TemplatesCatalogSection.js +284 -0
  8. package/dist/browser/components/templates/TemplatesClientPage.js +840 -917
  9. package/dist/browser/components/templates/TemplatesHeroSection.js +87 -0
  10. package/dist/browser/components/templates/TemplatesNextStepsSection.js +126 -0
  11. package/dist/browser/components/templates/TemplatesPreviewModal.js +136 -126
  12. package/dist/browser/components/templates/index.js +873 -950
  13. package/dist/browser/components/templates/template-catalog.js +81 -0
  14. package/dist/browser/components/templates/template-new.js +23 -0
  15. package/dist/browser/components/templates/template-preview.js +43 -0
  16. package/dist/browser/components/templates/template-source.js +19 -0
  17. package/dist/browser/index.js +873 -950
  18. package/dist/components/templates/TemplateCard.d.ts +12 -0
  19. package/dist/components/templates/TemplateCard.js +78 -0
  20. package/dist/components/templates/TemplateCommandDialog.d.ts +6 -0
  21. package/dist/components/templates/TemplateCommandDialog.js +105 -0
  22. package/dist/components/templates/TemplatePreviewContent.d.ts +5 -0
  23. package/dist/components/templates/TemplatePreviewContent.js +91 -0
  24. package/dist/components/templates/TemplatesBrowseControls.d.ts +13 -0
  25. package/dist/components/templates/TemplatesBrowseControls.js +110 -0
  26. package/dist/components/templates/TemplatesCatalogSection.d.ts +14 -0
  27. package/dist/components/templates/TemplatesCatalogSection.js +279 -0
  28. package/dist/components/templates/TemplatesClientPage.js +840 -917
  29. package/dist/components/templates/TemplatesHeroSection.d.ts +5 -0
  30. package/dist/components/templates/TemplatesHeroSection.js +82 -0
  31. package/dist/components/templates/TemplatesNextStepsSection.d.ts +1 -0
  32. package/dist/components/templates/TemplatesNextStepsSection.js +121 -0
  33. package/dist/components/templates/TemplatesPreviewModal.d.ts +3 -4
  34. package/dist/components/templates/TemplatesPreviewModal.js +136 -126
  35. package/dist/components/templates/index.js +873 -950
  36. package/dist/components/templates/template-catalog.d.ts +27 -0
  37. package/dist/components/templates/template-catalog.js +76 -0
  38. package/dist/components/templates/template-catalog.test.d.ts +1 -0
  39. package/dist/components/templates/template-new.d.ts +2 -0
  40. package/dist/components/templates/template-new.js +18 -0
  41. package/dist/components/templates/template-preview.d.ts +18 -0
  42. package/dist/components/templates/template-preview.js +38 -0
  43. package/dist/components/templates/template-source.d.ts +3 -0
  44. package/dist/components/templates/template-source.js +14 -0
  45. package/dist/index.js +873 -950
  46. package/dist/node/components/templates/TemplateCard.js +78 -0
  47. package/dist/node/components/templates/TemplateCommandDialog.js +105 -0
  48. package/dist/node/components/templates/TemplatePreviewContent.js +91 -0
  49. package/dist/node/components/templates/TemplatesBrowseControls.js +110 -0
  50. package/dist/node/components/templates/TemplatesCatalogSection.js +279 -0
  51. package/dist/node/components/templates/TemplatesClientPage.js +840 -917
  52. package/dist/node/components/templates/TemplatesHeroSection.js +82 -0
  53. package/dist/node/components/templates/TemplatesNextStepsSection.js +121 -0
  54. package/dist/node/components/templates/TemplatesPreviewModal.js +136 -126
  55. package/dist/node/components/templates/index.js +873 -950
  56. package/dist/node/components/templates/template-catalog.js +76 -0
  57. package/dist/node/components/templates/template-new.js +18 -0
  58. package/dist/node/components/templates/template-preview.js +38 -0
  59. package/dist/node/components/templates/template-source.js +14 -0
  60. package/dist/node/index.js +873 -950
  61. package/package.json +181 -26
  62. package/src/components/templates/TemplateCard.tsx +74 -0
  63. package/src/components/templates/TemplateCommandDialog.tsx +92 -0
  64. package/src/components/templates/TemplatePreviewContent.tsx +182 -0
  65. package/src/components/templates/TemplatesBrowseControls.tsx +120 -0
  66. package/src/components/templates/TemplatesCatalogSection.tsx +166 -0
  67. package/src/components/templates/TemplatesClientPage.tsx +109 -741
  68. package/src/components/templates/TemplatesHeroSection.tsx +41 -0
  69. package/src/components/templates/TemplatesNextStepsSection.tsx +80 -0
  70. package/src/components/templates/TemplatesPreviewModal.tsx +19 -294
  71. package/src/components/templates/template-catalog.test.ts +66 -0
  72. package/src/components/templates/template-catalog.ts +132 -0
  73. package/src/components/templates/template-new.ts +12 -0
  74. package/src/components/templates/template-preview.ts +57 -0
  75. package/src/components/templates/template-source.ts +13 -0
  76. 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
+ };