@drawnagency/primitives 0.1.66 → 0.1.68
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/dist/chunk-4YEOTFVU.js +14 -0
- package/dist/{chunk-VU3XR362.js → chunk-6UDYJQL6.js} +1 -1
- package/dist/{chunk-7IMQVDDJ.js → chunk-EWKCEPMW.js} +1 -1
- package/dist/{chunk-XNGG5AGI.js → chunk-KWBM27UR.js} +1 -1
- package/dist/{chunk-TEYTLQVH.js → chunk-QKOIEWZ4.js} +33 -1
- package/dist/chunk-TYYCKVAW.js +968 -0
- package/dist/{chunk-VEIDANEU.js → chunk-VVK6ZRCN.js} +128 -41
- package/dist/{chunk-ZYXLNJ5M.js → chunk-WNPMBFD6.js} +4 -4
- package/dist/{chunk-DQTKWKSK.js → chunk-WXVKX6PY.js} +12 -3
- package/dist/components/chat/ChatPanel.d.ts +31 -0
- package/dist/components/chat/ChatPanel.d.ts.map +1 -0
- package/dist/components/chat/ChatWidget.d.ts +11 -0
- package/dist/components/chat/ChatWidget.d.ts.map +1 -0
- package/dist/components/primitives/defineHeadingSection.d.ts +2 -0
- package/dist/components/primitives/defineHeadingSection.d.ts.map +1 -1
- package/dist/components/primitives/index.js +5 -5
- package/dist/components/sections/Button/index.d.ts.map +1 -1
- package/dist/components/sections/Colors/index.d.ts.map +1 -1
- package/dist/components/sections/Colors/schema.d.ts.map +1 -1
- package/dist/components/sections/Container/index.d.ts.map +1 -1
- package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconList.d.ts +2 -1
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts +2 -1
- package/dist/components/sections/IconList/IconListSettings.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +1 -0
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/LinkHeading/index.d.ts.map +1 -1
- package/dist/components/sections/Media/index.d.ts.map +1 -1
- package/dist/components/sections/Prose/index.d.ts.map +1 -1
- package/dist/components/sections/Spacer/index.d.ts.map +1 -1
- package/dist/components/sections/SubHeading/index.d.ts.map +1 -1
- package/dist/components/sections/SubSubHeading/index.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +1 -0
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +1 -0
- package/dist/components/sections/brand-guide.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +5 -5
- package/dist/components/sections/register-schemas.js +13 -943
- package/dist/components/sections/register.js +36 -0
- package/dist/components/shell/ChatbotConfigModal.d.ts +13 -0
- package/dist/components/shell/ChatbotConfigModal.d.ts.map +1 -0
- package/dist/components/shell/EditorShell.d.ts +2 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/index.js +31 -24
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +7 -4
- package/dist/lib/insert-menu.d.ts +19 -0
- package/dist/lib/insert-menu.d.ts.map +1 -0
- package/dist/lib/platform-broker.d.ts +7 -0
- package/dist/lib/platform-broker.d.ts.map +1 -1
- package/dist/lib/platform-broker.js +27 -1
- package/dist/lib/registry.d.ts +23 -0
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/media/index.js +3 -3
- package/dist/schemas/index.js +6 -2
- package/dist/schemas/site-config.d.ts +30 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/dist/types/database.d.ts +296 -34
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/components/chat/ChatPanel.tsx +152 -0
- package/src/components/chat/ChatWidget.tsx +38 -0
- package/src/components/primitives/defineHeadingSection.tsx +18 -2
- package/src/components/sections/Button/index.tsx +10 -3
- package/src/components/sections/Colors/index.tsx +15 -7
- package/src/components/sections/Colors/schema.ts +5 -2
- package/src/components/sections/Container/index.tsx +19 -3
- package/src/components/sections/DoDontMedia/index.tsx +18 -7
- package/src/components/sections/IconList/IconList.tsx +43 -19
- package/src/components/sections/IconList/IconListSettings.tsx +58 -11
- package/src/components/sections/IconList/index.tsx +51 -7
- package/src/components/sections/LinkHeading/index.tsx +2 -0
- package/src/components/sections/Media/index.tsx +15 -6
- package/src/components/sections/Prose/index.tsx +9 -1
- package/src/components/sections/Spacer/index.tsx +2 -0
- package/src/components/sections/SubHeading/index.tsx +2 -0
- package/src/components/sections/SubSubHeading/index.tsx +2 -0
- package/src/components/shell/ChatbotConfigModal.tsx +152 -0
- package/src/components/shell/EditorShell.tsx +41 -20
- package/src/lib/index.ts +1 -0
- package/src/lib/insert-menu.ts +42 -0
- package/src/lib/platform-broker.ts +36 -0
- package/src/lib/registry.ts +24 -0
- package/src/schemas/site-config.ts +36 -0
- package/src/types/database.ts +284 -36
- package/dist/chunk-ZGFAYZWB.js +0 -8
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
allSectionDefs
|
|
3
|
+
} from "../../chunk-TYYCKVAW.js";
|
|
4
|
+
import "../../chunk-VVK6ZRCN.js";
|
|
5
|
+
import "../../chunk-2BHPWO7M.js";
|
|
6
|
+
import "../../chunk-5THS4K5D.js";
|
|
7
|
+
import "../../chunk-WXVKX6PY.js";
|
|
8
|
+
import "../../chunk-KWBM27UR.js";
|
|
9
|
+
import "../../chunk-4E66N6UV.js";
|
|
10
|
+
import "../../chunk-I5737FJY.js";
|
|
11
|
+
import "../../chunk-6UDYJQL6.js";
|
|
12
|
+
import "../../chunk-3DCG4DNU.js";
|
|
13
|
+
import "../../chunk-WDSVHKAH.js";
|
|
14
|
+
import "../../chunk-53DKVAB6.js";
|
|
15
|
+
import "../../chunk-4YEOTFVU.js";
|
|
16
|
+
import "../../chunk-7EOSDFS3.js";
|
|
17
|
+
import "../../chunk-TZQPOR5A.js";
|
|
18
|
+
import "../../chunk-QKOIEWZ4.js";
|
|
19
|
+
import {
|
|
20
|
+
registerSection
|
|
21
|
+
} from "../../chunk-VKAGMEKE.js";
|
|
22
|
+
import "../../chunk-NSCT3AMV.js";
|
|
23
|
+
import "../../chunk-JSBRDJBE.js";
|
|
24
|
+
|
|
25
|
+
// src/components/sections/register.ts
|
|
26
|
+
var _ensured = false;
|
|
27
|
+
function ensureSectionsRegistered() {
|
|
28
|
+
if (!_ensured) {
|
|
29
|
+
allSectionDefs.forEach(registerSection);
|
|
30
|
+
_ensured = true;
|
|
31
|
+
}
|
|
32
|
+
return allSectionDefs.length;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
ensureSectionsRegistered
|
|
36
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SiteConfig } from "../../schemas/site-config";
|
|
2
|
+
import type { Audience } from "../../auth/types";
|
|
3
|
+
interface Props {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
siteConfig: SiteConfig;
|
|
7
|
+
onSiteConfigChange: (config: SiteConfig) => void;
|
|
8
|
+
audiences: Audience[];
|
|
9
|
+
platformEnabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatbotConfigModal({ isOpen, onClose, siteConfig, onSiteConfigChange, audiences, platformEnabled }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ChatbotConfigModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatbotConfigModal.d.ts","sourceRoot":"","sources":["../../../src/components/shell/ChatbotConfigModal.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,KAAK;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAsBD,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,KAAK,2CAkHxH"}
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
email: string;
|
|
18
18
|
role: "owner" | "editor";
|
|
19
19
|
} | null;
|
|
20
|
+
chatbotPlatformEnabled?: boolean;
|
|
20
21
|
}
|
|
21
|
-
export default function EditorShell({ headSha, draftHeadSha, siteId, audiences: initialAudiences, capabilities, currentUser, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default function EditorShell({ headSha, draftHeadSha, siteId, audiences: initialAudiences, capabilities, currentUser, chatbotPlatformEnabled, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
//# sourceMappingURL=EditorShell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyEjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAQxD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAIhE,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,EACX,sBAA8B,GAC/B,EAAE,KAAK,2CAm7BP"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUDIENCE_COOKIE,
|
|
3
|
+
AUDIENCE_MAX_AGE_SECONDS,
|
|
4
|
+
LastOwnerError,
|
|
5
|
+
SESSION_COOKIE,
|
|
6
|
+
SESSION_MAX_AGE_SECONDS,
|
|
7
|
+
SessionExpiredError,
|
|
8
|
+
deriveUiCapabilities,
|
|
9
|
+
setSessionCookie,
|
|
10
|
+
signAudienceToken,
|
|
11
|
+
signSessionToken,
|
|
12
|
+
verifyAudienceToken,
|
|
13
|
+
verifySessionToken
|
|
14
|
+
} from "./chunk-EM5DFHDZ.js";
|
|
1
15
|
import {
|
|
2
16
|
EXT_TO_MIME,
|
|
3
17
|
MIME_TO_EXT,
|
|
@@ -13,27 +27,13 @@ import {
|
|
|
13
27
|
resolveMedia,
|
|
14
28
|
sanitizeMediaName,
|
|
15
29
|
setMediaProvider
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
AUDIENCE_COOKIE,
|
|
19
|
-
AUDIENCE_MAX_AGE_SECONDS,
|
|
20
|
-
LastOwnerError,
|
|
21
|
-
SESSION_COOKIE,
|
|
22
|
-
SESSION_MAX_AGE_SECONDS,
|
|
23
|
-
SessionExpiredError,
|
|
24
|
-
deriveUiCapabilities,
|
|
25
|
-
setSessionCookie,
|
|
26
|
-
signAudienceToken,
|
|
27
|
-
signSessionToken,
|
|
28
|
-
verifyAudienceToken,
|
|
29
|
-
verifySessionToken
|
|
30
|
-
} from "./chunk-EM5DFHDZ.js";
|
|
30
|
+
} from "./chunk-6UDYJQL6.js";
|
|
31
31
|
import {
|
|
32
32
|
AudienceColorSchema,
|
|
33
33
|
AudienceNameSchema,
|
|
34
34
|
MediaGridOptionsSchema,
|
|
35
35
|
slugifyAudienceName
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-EWKCEPMW.js";
|
|
37
37
|
import {
|
|
38
38
|
AudienceSchema,
|
|
39
39
|
RoleSchema,
|
|
@@ -55,7 +55,12 @@ import {
|
|
|
55
55
|
loadStaticSiteContent,
|
|
56
56
|
mergeSiteContent,
|
|
57
57
|
safeRedirect
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-WNPMBFD6.js";
|
|
59
|
+
import {
|
|
60
|
+
isSameOriginRequest,
|
|
61
|
+
requireSessionSecret,
|
|
62
|
+
safeNextPath
|
|
63
|
+
} from "./chunk-S2L3BPLS.js";
|
|
59
64
|
import "./chunk-75P6HWPN.js";
|
|
60
65
|
import {
|
|
61
66
|
curatedIcons,
|
|
@@ -73,20 +78,19 @@ import {
|
|
|
73
78
|
sanitizeHtml,
|
|
74
79
|
toSectionId
|
|
75
80
|
} from "./chunk-53DKVAB6.js";
|
|
76
|
-
import
|
|
81
|
+
import {
|
|
82
|
+
audiencePasses
|
|
83
|
+
} from "./chunk-4YEOTFVU.js";
|
|
77
84
|
import {
|
|
78
85
|
cn
|
|
79
86
|
} from "./chunk-7EOSDFS3.js";
|
|
80
|
-
import {
|
|
81
|
-
isSameOriginRequest,
|
|
82
|
-
requireSessionSecret,
|
|
83
|
-
safeNextPath
|
|
84
|
-
} from "./chunk-S2L3BPLS.js";
|
|
85
87
|
import {
|
|
86
88
|
getSectionContentSchema,
|
|
87
89
|
getSectionSchema
|
|
88
90
|
} from "./chunk-TZQPOR5A.js";
|
|
89
91
|
import {
|
|
92
|
+
ChatbotConfigSchema,
|
|
93
|
+
ChatbotTaskSchema,
|
|
90
94
|
FontNameSchema,
|
|
91
95
|
HexColorSchema,
|
|
92
96
|
ImageManifestSchema,
|
|
@@ -103,7 +107,7 @@ import {
|
|
|
103
107
|
TextLineSchema,
|
|
104
108
|
VariantSchema,
|
|
105
109
|
normalizeSiteIndex
|
|
106
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-QKOIEWZ4.js";
|
|
107
111
|
import {
|
|
108
112
|
clearRegistry,
|
|
109
113
|
createRegistry,
|
|
@@ -136,6 +140,8 @@ export {
|
|
|
136
140
|
AudienceColorSchema,
|
|
137
141
|
AudienceNameSchema,
|
|
138
142
|
AudienceSchema,
|
|
143
|
+
ChatbotConfigSchema,
|
|
144
|
+
ChatbotTaskSchema,
|
|
139
145
|
DEFAULT_LINK,
|
|
140
146
|
EXT_TO_MIME,
|
|
141
147
|
FontNameSchema,
|
|
@@ -166,6 +172,7 @@ export {
|
|
|
166
172
|
StorageConflictError,
|
|
167
173
|
TextLineSchema,
|
|
168
174
|
VariantSchema,
|
|
175
|
+
audiencePasses,
|
|
169
176
|
buildGoogleFontsUrl,
|
|
170
177
|
clearRegistry,
|
|
171
178
|
cn,
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { env } from "./env";
|
|
2
2
|
export { cn } from "./cn";
|
|
3
|
+
export { audiencePasses } from "./pages";
|
|
3
4
|
export { generateNavLinks, toSectionId, type NavItem } from "./nav";
|
|
4
5
|
export { deriveContrast } from "./contrast";
|
|
5
6
|
export { sanitizeHtml, ensureSanitizer } from "./sanitize";
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,UAAU,EACV,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
loadStaticSiteContent,
|
|
8
8
|
mergeSiteContent,
|
|
9
9
|
safeRedirect
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WNPMBFD6.js";
|
|
11
|
+
import "../chunk-S2L3BPLS.js";
|
|
11
12
|
import "../chunk-75P6HWPN.js";
|
|
12
13
|
import {
|
|
13
14
|
curatedIcons,
|
|
@@ -25,13 +26,14 @@ import {
|
|
|
25
26
|
sanitizeHtml,
|
|
26
27
|
toSectionId
|
|
27
28
|
} from "../chunk-53DKVAB6.js";
|
|
28
|
-
import
|
|
29
|
+
import {
|
|
30
|
+
audiencePasses
|
|
31
|
+
} from "../chunk-4YEOTFVU.js";
|
|
29
32
|
import {
|
|
30
33
|
cn
|
|
31
34
|
} from "../chunk-7EOSDFS3.js";
|
|
32
|
-
import "../chunk-S2L3BPLS.js";
|
|
33
35
|
import "../chunk-TZQPOR5A.js";
|
|
34
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-QKOIEWZ4.js";
|
|
35
37
|
import {
|
|
36
38
|
clearRegistry,
|
|
37
39
|
createRegistry,
|
|
@@ -49,6 +51,7 @@ import {
|
|
|
49
51
|
} from "../chunk-WKZ7OENC.js";
|
|
50
52
|
import "../chunk-JSBRDJBE.js";
|
|
51
53
|
export {
|
|
54
|
+
audiencePasses,
|
|
52
55
|
buildGoogleFontsUrl,
|
|
53
56
|
clearRegistry,
|
|
54
57
|
cn,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { SectionDefinition } from "./registry";
|
|
3
|
+
import type { SectionContent } from "../schemas/sections";
|
|
4
|
+
/** Namespacing prefix for preset selections in the Add-section menu. */
|
|
5
|
+
export declare const PRESET_PREFIX = "__preset:";
|
|
6
|
+
/** One Add-section menu entry: a section `type`, or `__preset:<presetId>`. */
|
|
7
|
+
export interface InsertMenuOption {
|
|
8
|
+
type: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** Every non-spacer section type, followed by presets contributed by registered
|
|
13
|
+
* sections. Presets appear only when their owning section is registered, so a
|
|
14
|
+
* core-only build (no brand-guide sections) shows no brand-guide presets. */
|
|
15
|
+
export declare function buildInsertMenuOptions(sections: SectionDefinition[]): InsertMenuOption[];
|
|
16
|
+
/** Resolve an Add-menu selection to ready-to-insert content. `newId` mints ids for
|
|
17
|
+
* any nested children a preset creates. Returns null for an unknown type/preset. */
|
|
18
|
+
export declare function resolveInsertedContent(selection: string, sections: SectionDefinition[], newId: () => string): SectionContent | null;
|
|
19
|
+
//# sourceMappingURL=insert-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-menu.d.ts","sourceRoot":"","sources":["../../src/lib/insert-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,wEAAwE;AACxE,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;8EAE8E;AAC9E,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,gBAAgB,EAAE,CAQxF;AAED;qFACqF;AACrF,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,KAAK,EAAE,MAAM,MAAM,GAClB,cAAc,GAAG,IAAI,CAQvB"}
|
|
@@ -11,4 +11,11 @@ export declare function platformBroker<T = unknown>(path: string, opts?: {
|
|
|
11
11
|
body?: unknown;
|
|
12
12
|
query?: Record<string, string>;
|
|
13
13
|
}): Promise<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Streaming variant of platformBroker for SSE endpoints (the LLM broker).
|
|
16
|
+
* Same auth headers; retries only pre-stream connection failures — once bytes
|
|
17
|
+
* are flowing there is no safe retry. Non-2xx throws with the status ONLY
|
|
18
|
+
* (never the body: stream endpoints may proxy provider errors).
|
|
19
|
+
*/
|
|
20
|
+
export declare function platformBrokerStream(path: string, body: unknown): Promise<ReadableStream<Uint8Array>>;
|
|
14
21
|
//# sourceMappingURL=platform-broker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-broker.d.ts","sourceRoot":"","sources":["../../src/lib/platform-broker.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAO,GAC7E,OAAO,CAAC,CAAC,CAAC,CAgDZ"}
|
|
1
|
+
{"version":3,"file":"platform-broker.d.ts","sourceRoot":"","sources":["../../src/lib/platform-broker.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAO,GAC7E,OAAO,CAAC,CAAC,CAAC,CAgDZ;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAyBrC"}
|
|
@@ -54,7 +54,33 @@ async function platformBroker(path, opts = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
throw lastError instanceof Error ? lastError : new Error("Platform broker unreachable");
|
|
56
56
|
}
|
|
57
|
+
async function platformBrokerStream(path, body) {
|
|
58
|
+
const apiUrl = env("PLATFORM_API_URL");
|
|
59
|
+
const apiKey = env("PLATFORM_API_KEY");
|
|
60
|
+
const siteId = env("PORTAL_SITE_ID");
|
|
61
|
+
const url = `${apiUrl}${path}`;
|
|
62
|
+
let lastError;
|
|
63
|
+
for (let attempt = 0; attempt < ATTEMPTS; attempt++) {
|
|
64
|
+
let res;
|
|
65
|
+
try {
|
|
66
|
+
res = await fetch(url, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers: { "x-api-key": apiKey, "x-site-id": siteId, "Content-Type": "application/json" },
|
|
69
|
+
body: JSON.stringify(body)
|
|
70
|
+
});
|
|
71
|
+
} catch (err) {
|
|
72
|
+
lastError = err;
|
|
73
|
+
if (attempt === ATTEMPTS - 1) throw err;
|
|
74
|
+
await sleep(RETRY_BASE_MS * 2 ** attempt);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (!res.ok || !res.body) throw new Error(`Platform broker error (${res.status})`);
|
|
78
|
+
return res.body;
|
|
79
|
+
}
|
|
80
|
+
throw lastError instanceof Error ? lastError : new Error("Platform broker unreachable");
|
|
81
|
+
}
|
|
57
82
|
export {
|
|
58
83
|
isPlatformMode,
|
|
59
|
-
platformBroker
|
|
84
|
+
platformBroker,
|
|
85
|
+
platformBrokerStream
|
|
60
86
|
};
|
package/dist/lib/registry.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ZodType, z } from "zod";
|
|
|
2
2
|
import type { ComponentType, ReactNode } from "react";
|
|
3
3
|
import type { Audience } from "../schemas/auth";
|
|
4
4
|
import type { LinkValue } from "../schemas/link";
|
|
5
|
+
import type { SectionContent } from "../schemas/sections";
|
|
5
6
|
export type SettingsFieldDef = {
|
|
6
7
|
type: "text";
|
|
7
8
|
label: string;
|
|
@@ -92,6 +93,18 @@ export interface WrapperProps {
|
|
|
92
93
|
isLocalOnly?: boolean;
|
|
93
94
|
children: React.ReactNode;
|
|
94
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* A ready-to-insert composite (e.g. a container of preconfigured child sections),
|
|
98
|
+
* surfaced in the Add-section menu. Contributed by the section definition that owns
|
|
99
|
+
* the composition, so it rides the section registry and disappears in a core-only
|
|
100
|
+
* build that never registers that section. `newId` mints unique ids for nested children.
|
|
101
|
+
*/
|
|
102
|
+
export interface SectionPreset {
|
|
103
|
+
id: string;
|
|
104
|
+
label: string;
|
|
105
|
+
icon?: ReactNode;
|
|
106
|
+
build(newId: () => string): SectionContent;
|
|
107
|
+
}
|
|
95
108
|
export interface SectionDefinition<T = unknown> {
|
|
96
109
|
type: string;
|
|
97
110
|
/** Grouping label. `"brand-guide"` marks opinionated sections separable from the
|
|
@@ -124,6 +137,14 @@ export interface SectionDefinition<T = unknown> {
|
|
|
124
137
|
label: string;
|
|
125
138
|
fields: string[];
|
|
126
139
|
}[];
|
|
140
|
+
/** Composite blueprints for the Add-section menu (see SectionPreset). */
|
|
141
|
+
presets?: SectionPreset[];
|
|
142
|
+
/**
|
|
143
|
+
* Human/agent-facing prose describing when to use this section type and how to
|
|
144
|
+
* author it well. Surfaced by the get_section_schema tool as the JSON Schema
|
|
145
|
+
* top-level `description`. Presentation/metadata only — not validated.
|
|
146
|
+
*/
|
|
147
|
+
authoringNote?: string;
|
|
127
148
|
}
|
|
128
149
|
type DefineSectionInput<S extends ZodType> = {
|
|
129
150
|
type: string;
|
|
@@ -149,6 +170,8 @@ type DefineSectionInput<S extends ZodType> = {
|
|
|
149
170
|
label: string;
|
|
150
171
|
fields: string[];
|
|
151
172
|
}[];
|
|
173
|
+
presets?: SectionPreset[];
|
|
174
|
+
authoringNote?: string;
|
|
152
175
|
};
|
|
153
176
|
export declare function defineSection<S extends ZodType>(def: DefineSectionInput<S>): SectionDefinition<z.infer<S>>;
|
|
154
177
|
export interface SectionRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,gBAAgB,GACxB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,UAAU,C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B,GAAG,SAAS,CAEtE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE3D;AAED,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD;AAED,wBAAgB,aAAa,IAAI,OAAO,EAAE,CAEzC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
package/dist/media/index.js
CHANGED
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
resolveMedia,
|
|
14
14
|
sanitizeMediaName,
|
|
15
15
|
setMediaProvider
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-6UDYJQL6.js";
|
|
17
|
+
import "../chunk-4YEOTFVU.js";
|
|
18
18
|
import {
|
|
19
19
|
ImageManifestSchema,
|
|
20
20
|
MediaConfigSchema,
|
|
21
21
|
MediaItemSchema,
|
|
22
22
|
VariantSchema
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-QKOIEWZ4.js";
|
|
24
24
|
import "../chunk-JSBRDJBE.js";
|
|
25
25
|
export {
|
|
26
26
|
EXT_TO_MIME,
|
package/dist/schemas/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AudienceNameSchema,
|
|
4
4
|
MediaGridOptionsSchema,
|
|
5
5
|
slugifyAudienceName
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-EWKCEPMW.js";
|
|
7
7
|
import {
|
|
8
8
|
AudienceSchema,
|
|
9
9
|
RoleSchema,
|
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
getSectionSchema
|
|
22
22
|
} from "../chunk-TZQPOR5A.js";
|
|
23
23
|
import {
|
|
24
|
+
ChatbotConfigSchema,
|
|
25
|
+
ChatbotTaskSchema,
|
|
24
26
|
FontNameSchema,
|
|
25
27
|
HexColorSchema,
|
|
26
28
|
ImageManifestSchema,
|
|
@@ -37,7 +39,7 @@ import {
|
|
|
37
39
|
TextLineSchema,
|
|
38
40
|
VariantSchema,
|
|
39
41
|
normalizeSiteIndex
|
|
40
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-QKOIEWZ4.js";
|
|
41
43
|
import "../chunk-VKAGMEKE.js";
|
|
42
44
|
import "../chunk-NSCT3AMV.js";
|
|
43
45
|
import "../chunk-JSBRDJBE.js";
|
|
@@ -45,6 +47,8 @@ export {
|
|
|
45
47
|
AudienceColorSchema,
|
|
46
48
|
AudienceNameSchema,
|
|
47
49
|
AudienceSchema,
|
|
50
|
+
ChatbotConfigSchema,
|
|
51
|
+
ChatbotTaskSchema,
|
|
48
52
|
DEFAULT_LINK,
|
|
49
53
|
FontNameSchema,
|
|
50
54
|
HexColorSchema,
|
|
@@ -150,6 +150,25 @@ export declare const IndexSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
|
150
150
|
export type SiteIndex = z.infer<typeof CanonicalIndexSchema>;
|
|
151
151
|
/** Parse + normalize any raw index (legacy or canonical) to the canonical shape. */
|
|
152
152
|
export declare function normalizeSiteIndex(raw: unknown): SiteIndex;
|
|
153
|
+
export declare const ChatbotTaskSchema: z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
label: z.ZodString;
|
|
156
|
+
prompt: z.ZodString;
|
|
157
|
+
access: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type ChatbotTask = z.infer<typeof ChatbotTaskSchema>;
|
|
160
|
+
export declare const ChatbotConfigSchema: z.ZodObject<{
|
|
161
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
162
|
+
systemPrompt: z.ZodDefault<z.ZodString>;
|
|
163
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
164
|
+
tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
label: z.ZodString;
|
|
167
|
+
prompt: z.ZodString;
|
|
168
|
+
access: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
169
|
+
}, z.core.$strip>>>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
export type ChatbotConfig = z.infer<typeof ChatbotConfigSchema>;
|
|
153
172
|
export declare const SiteConfigSchema: z.ZodObject<{
|
|
154
173
|
siteName: z.ZodDefault<z.ZodString>;
|
|
155
174
|
primaryColor: z.ZodDefault<z.ZodString>;
|
|
@@ -171,6 +190,17 @@ export declare const SiteConfigSchema: z.ZodObject<{
|
|
|
171
190
|
maxFileSize: z.ZodDefault<z.ZodNumber>;
|
|
172
191
|
quality: z.ZodDefault<z.ZodNumber>;
|
|
173
192
|
}, z.core.$strip>>;
|
|
193
|
+
chatbot: z.ZodDefault<z.ZodObject<{
|
|
194
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
195
|
+
systemPrompt: z.ZodDefault<z.ZodString>;
|
|
196
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
197
|
+
tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
label: z.ZodString;
|
|
200
|
+
prompt: z.ZodString;
|
|
201
|
+
access: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
}, z.core.$strip>>>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
174
204
|
}, z.core.$strip>;
|
|
175
205
|
export type SiteConfig = z.infer<typeof SiteConfigSchema>;
|
|
176
206
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,iBAAiB;;;;;;;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAO5D,eAAO,MAAM,cAAc,0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