@drawnagency/primitives 0.1.59 → 0.1.60
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/auth/capabilities.d.ts +16 -0
- package/dist/auth/capabilities.d.ts.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -1
- package/dist/auth/types.d.ts +26 -22
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/{chunk-ICLXLWQ5.js → chunk-BT7STGDW.js} +31 -23
- package/dist/{chunk-L2JJFOXD.js → chunk-CBWK3KPV.js} +5 -1
- package/dist/{chunk-V7JN2DDU.js → chunk-ODCJQOVO.js} +1 -1
- package/dist/{chunk-NTGSA3TI.js → chunk-Q5EEYBMJ.js} +7 -5
- package/dist/chunk-TZQPOR5A.js +24 -0
- package/dist/{chunk-XTK4BR27.js → chunk-UNWNT52N.js} +13 -0
- package/dist/chunk-ZGFAYZWB.js +8 -0
- package/dist/components/editor/DropEdgeIndicator.d.ts +8 -0
- package/dist/components/editor/DropEdgeIndicator.d.ts.map +1 -0
- package/dist/components/editor/PagesModal.d.ts.map +1 -1
- package/dist/components/editor/SectionOrderingModal.d.ts.map +1 -1
- package/dist/components/primitives/defineHeadingSection.d.ts +28 -0
- package/dist/components/primitives/defineHeadingSection.d.ts.map +1 -0
- package/dist/components/sections/Colors/index.d.ts.map +1 -1
- package/dist/components/sections/Container/index.d.ts.map +1 -1
- package/dist/components/sections/IconList/IconList.d.ts +1 -6
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts +11 -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/SubHeading/index.d.ts +0 -1
- package/dist/components/sections/SubHeading/index.d.ts.map +1 -1
- package/dist/components/sections/SubSubHeading/index.d.ts +0 -1
- package/dist/components/sections/SubSubHeading/index.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +0 -2
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +409 -420
- package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/hooks/useSortableRow.d.ts +25 -0
- package/dist/hooks/useSortableRow.d.ts.map +1 -0
- package/dist/index.js +27 -24
- package/dist/lib/image-refs.d.ts +21 -0
- package/dist/lib/image-refs.d.ts.map +1 -0
- package/dist/lib/index.js +8 -7
- package/dist/lib/platform-broker.d.ts +14 -0
- package/dist/lib/platform-broker.d.ts.map +1 -0
- package/dist/lib/platform-broker.js +60 -0
- package/dist/lib/reorder.d.ts +12 -0
- package/dist/lib/reorder.d.ts.map +1 -0
- package/dist/lib/text.d.ts +2 -0
- package/dist/lib/text.d.ts.map +1 -1
- package/dist/media/index.js +3 -2
- package/dist/media/utils.d.ts.map +1 -1
- package/dist/schemas/index.js +11 -11
- package/dist/types/database.d.ts +46 -0
- package/dist/types/database.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/auth/capabilities.ts +26 -0
- package/src/auth/index.ts +3 -0
- package/src/auth/types.ts +36 -26
- package/src/components/editor/DropEdgeIndicator.tsx +13 -0
- package/src/components/editor/PagesModal.tsx +12 -80
- package/src/components/editor/SectionOrderingModal.tsx +8 -78
- package/src/components/primitives/defineHeadingSection.tsx +56 -0
- package/src/components/sections/Colors/index.tsx +2 -4
- package/src/components/sections/Container/index.tsx +2 -4
- package/src/components/sections/IconList/IconList.tsx +1 -7
- package/src/components/sections/IconList/index.tsx +11 -5
- package/src/components/sections/LinkHeading/index.tsx +5 -20
- package/src/components/sections/SubHeading/index.tsx +6 -23
- package/src/components/sections/SubSubHeading/index.tsx +6 -23
- package/src/components/shell/BugReportFAB.tsx +13 -9
- package/src/hooks/useEditorPublish.ts +71 -49
- package/src/hooks/useMediaPipeline.ts +11 -34
- package/src/hooks/useSortableRow.ts +99 -0
- package/src/lib/image-refs.ts +53 -0
- package/src/lib/platform-broker.ts +72 -0
- package/src/lib/reorder.ts +20 -0
- package/src/lib/text.ts +5 -0
- package/src/media/utils.ts +6 -1
- package/src/types/database.ts +41 -0
- package/dist/chunk-DKOUFIP6.js +0 -35
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AuthProvider } from "./types";
|
|
2
|
+
export interface UiCapabilities {
|
|
3
|
+
oauth: boolean;
|
|
4
|
+
emailPassword: boolean;
|
|
5
|
+
passwordOnly: boolean;
|
|
6
|
+
userManagement: boolean;
|
|
7
|
+
audienceManagement: boolean;
|
|
8
|
+
passwordToggle: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The single mapping from an AuthProvider's structure to the booleans the editor
|
|
12
|
+
* UI gates on. Derived from sub-object / method presence so the UI and the API
|
|
13
|
+
* routes can never disagree about what a provider supports.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deriveUiCapabilities(auth: AuthProvider): UiCapabilities;
|
|
16
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/auth/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CASvE"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { Role, Session, SiteUser, Audience, SignInMethod, SignInResult, TokenExchangeType, TokenExchangeResult, AuthProvider, CookieLike, AuthContext, } from "./types";
|
|
2
|
+
export type { UiCapabilities } from "./capabilities";
|
|
3
|
+
export { deriveUiCapabilities } from "./capabilities";
|
|
2
4
|
export { requireSessionSecret, isSameOriginRequest, safeNextPath } from "./security";
|
|
3
5
|
export { signSessionToken, verifySessionToken, signAudienceToken, verifyAudienceToken, setSessionCookie, SESSION_COOKIE, AUDIENCE_COOKIE, SESSION_MAX_AGE_SECONDS, AUDIENCE_MAX_AGE_SECONDS } from "./cookies";
|
|
4
6
|
export { LastOwnerError } from "./errors";
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC/M,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC/M,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/auth/index.js
CHANGED
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
LastOwnerError,
|
|
5
5
|
SESSION_COOKIE,
|
|
6
6
|
SESSION_MAX_AGE_SECONDS,
|
|
7
|
+
deriveUiCapabilities,
|
|
7
8
|
setSessionCookie,
|
|
8
9
|
signAudienceToken,
|
|
9
10
|
signSessionToken,
|
|
10
11
|
verifyAudienceToken,
|
|
11
12
|
verifySessionToken
|
|
12
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-UNWNT52N.js";
|
|
13
14
|
import {
|
|
14
15
|
isSameOriginRequest,
|
|
15
16
|
requireSessionSecret,
|
|
@@ -23,6 +24,7 @@ export {
|
|
|
23
24
|
LastOwnerError,
|
|
24
25
|
SESSION_COOKIE,
|
|
25
26
|
SESSION_MAX_AGE_SECONDS,
|
|
27
|
+
deriveUiCapabilities,
|
|
26
28
|
isSameOriginRequest,
|
|
27
29
|
requireSessionSecret,
|
|
28
30
|
safeNextPath,
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -32,31 +32,35 @@ export type TokenExchangeResult = {
|
|
|
32
32
|
error: string;
|
|
33
33
|
};
|
|
34
34
|
export interface AuthProvider {
|
|
35
|
-
capabilities: {
|
|
36
|
-
oauth: boolean;
|
|
37
|
-
emailPassword: boolean;
|
|
38
|
-
passwordOnly: boolean;
|
|
39
|
-
userManagement: boolean;
|
|
40
|
-
audienceManagement: boolean;
|
|
41
|
-
passwordToggle: boolean;
|
|
42
|
-
};
|
|
43
|
-
oauthProviders?: ("google" | "github")[];
|
|
44
35
|
resolveSession(ctx: AuthContext): Promise<Session | null>;
|
|
45
36
|
signIn(method: SignInMethod, ctx: AuthContext): Promise<SignInResult>;
|
|
46
37
|
signOut(ctx: AuthContext): Promise<void>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
signInMethods: {
|
|
39
|
+
oauth?: ("google" | "github")[];
|
|
40
|
+
emailPassword?: boolean;
|
|
41
|
+
passwordOnly?: boolean;
|
|
42
|
+
};
|
|
43
|
+
audiences: {
|
|
44
|
+
list(): Promise<Audience[]>;
|
|
45
|
+
verify(name: string, password: string): Promise<boolean>;
|
|
46
|
+
get?(name: string): Promise<Audience | null>;
|
|
47
|
+
manage?: {
|
|
48
|
+
create(displayName: string, color: string | null, password: string): Promise<void>;
|
|
49
|
+
setPassword(name: string, password: string): Promise<void>;
|
|
50
|
+
setColor(name: string, color: string | null): Promise<void>;
|
|
51
|
+
setDisplayName(name: string, displayName: string): Promise<void>;
|
|
52
|
+
delete(name: string): Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
passwordEnabled: {
|
|
56
|
+
get(): Promise<boolean>;
|
|
57
|
+
set?(enabled: boolean): Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
userManagement?: {
|
|
60
|
+
list(): Promise<SiteUser[]>;
|
|
61
|
+
invite(email: string, role: Role): Promise<void>;
|
|
62
|
+
revoke(userId: string): Promise<void>;
|
|
63
|
+
};
|
|
60
64
|
handleCallback?(request: Request, ctx: AuthContext): Promise<Response>;
|
|
61
65
|
handleTokenExchange?(tokens: {
|
|
62
66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 -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MediaConfigSchema
|
|
3
|
-
} from "./chunk-DKOUFIP6.js";
|
|
4
|
-
import {
|
|
5
|
-
LayoutEnvelopeSchema
|
|
6
|
-
} from "./chunk-NSCT3AMV.js";
|
|
7
|
-
import {
|
|
8
|
-
getAllSchemas
|
|
9
|
-
} from "./chunk-VKAGMEKE.js";
|
|
10
|
-
|
|
11
1
|
// src/schemas/shared.ts
|
|
12
2
|
import { z } from "zod";
|
|
13
3
|
var TextHeadingLine = z.object({
|
|
@@ -84,18 +74,34 @@ var ColorItemSchema = z.object({
|
|
|
84
74
|
spaces: z.array(ColorSpaceSchema).min(1)
|
|
85
75
|
});
|
|
86
76
|
|
|
87
|
-
// src/schemas/
|
|
77
|
+
// src/schemas/media.ts
|
|
88
78
|
import { z as z2 } from "zod";
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
79
|
+
var VariantSchema = z2.object({
|
|
80
|
+
width: z2.number().int().positive(),
|
|
81
|
+
height: z2.number().int().positive(),
|
|
82
|
+
size: z2.number().int().nonnegative()
|
|
83
|
+
});
|
|
84
|
+
var MediaItemSchema = z2.object({
|
|
85
|
+
id: z2.string(),
|
|
86
|
+
hash: z2.string(),
|
|
87
|
+
kind: z2.enum(["image", "animated", "video"]),
|
|
88
|
+
originalName: z2.string(),
|
|
89
|
+
width: z2.number().int().positive(),
|
|
90
|
+
height: z2.number().int().positive(),
|
|
91
|
+
mimeType: z2.string(),
|
|
92
|
+
size: z2.number().int().nonnegative(),
|
|
93
|
+
folder: z2.string(),
|
|
94
|
+
variants: z2.array(VariantSchema),
|
|
95
|
+
alt: z2.string().default("")
|
|
96
|
+
});
|
|
97
|
+
var ImageManifestSchema = z2.object({
|
|
98
|
+
images: z2.record(z2.string(), MediaItemSchema)
|
|
99
|
+
});
|
|
100
|
+
var MediaConfigSchema = z2.object({
|
|
101
|
+
sizes: z2.array(z2.number()).default([640, 1080, 1920]),
|
|
102
|
+
maxFileSize: z2.number().default(5242880),
|
|
103
|
+
quality: z2.number().min(1).max(100).default(85)
|
|
104
|
+
});
|
|
99
105
|
|
|
100
106
|
// src/schemas/site-config.ts
|
|
101
107
|
import { z as z3 } from "zod";
|
|
@@ -226,8 +232,10 @@ export {
|
|
|
226
232
|
FontNameSchema,
|
|
227
233
|
ColorSpaceSchema,
|
|
228
234
|
ColorItemSchema,
|
|
229
|
-
|
|
230
|
-
|
|
235
|
+
VariantSchema,
|
|
236
|
+
MediaItemSchema,
|
|
237
|
+
ImageManifestSchema,
|
|
238
|
+
MediaConfigSchema,
|
|
231
239
|
SectionMetaSchema,
|
|
232
240
|
RESERVED_SLUGS,
|
|
233
241
|
PageStatusSchema,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
slugifyPageSlug
|
|
3
|
+
} from "./chunk-ZGFAYZWB.js";
|
|
4
|
+
|
|
1
5
|
// src/media/utils.ts
|
|
2
6
|
async function hashFileBuffer(buffer) {
|
|
3
7
|
if (typeof crypto !== "undefined" && crypto.subtle) {
|
|
@@ -19,7 +23,7 @@ async function hashFileBuffer(buffer) {
|
|
|
19
23
|
return result;
|
|
20
24
|
}
|
|
21
25
|
function sanitizeMediaName(name) {
|
|
22
|
-
return name.replace(/\.[^.]+$/, "")
|
|
26
|
+
return slugifyPageSlug(name.replace(/\.[^.]+$/, ""));
|
|
23
27
|
}
|
|
24
28
|
var MIME_TO_EXT = {
|
|
25
29
|
"image/gif": "gif",
|
|
@@ -5,16 +5,18 @@ import {
|
|
|
5
5
|
safeNextPath
|
|
6
6
|
} from "./chunk-S2L3BPLS.js";
|
|
7
7
|
import {
|
|
8
|
-
IndexSchema,
|
|
9
8
|
getSectionSchema
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TZQPOR5A.js";
|
|
10
|
+
import {
|
|
11
|
+
getAllSchemas
|
|
12
|
+
} from "./chunk-VKAGMEKE.js";
|
|
13
|
+
import {
|
|
14
|
+
IndexSchema
|
|
15
|
+
} from "./chunk-BT7STGDW.js";
|
|
11
16
|
import {
|
|
12
17
|
MAX_BLOCK_DEPTH,
|
|
13
18
|
blockDepth
|
|
14
19
|
} from "./chunk-NSCT3AMV.js";
|
|
15
|
-
import {
|
|
16
|
-
getAllSchemas
|
|
17
|
-
} from "./chunk-VKAGMEKE.js";
|
|
18
20
|
|
|
19
21
|
// src/lib/contrast.ts
|
|
20
22
|
function deriveContrast(hex) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAllSchemas
|
|
3
|
+
} from "./chunk-VKAGMEKE.js";
|
|
4
|
+
import {
|
|
5
|
+
LayoutEnvelopeSchema
|
|
6
|
+
} from "./chunk-NSCT3AMV.js";
|
|
7
|
+
|
|
8
|
+
// src/schemas/sections.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
function getSectionContentSchema() {
|
|
11
|
+
const schemas = getAllSchemas();
|
|
12
|
+
if (schemas.length < 2) {
|
|
13
|
+
throw new Error("At least 2 section schemas must be registered before validation");
|
|
14
|
+
}
|
|
15
|
+
return z.union(schemas);
|
|
16
|
+
}
|
|
17
|
+
function getSectionSchema() {
|
|
18
|
+
return z.object({ id: z.string(), layout: LayoutEnvelopeSchema.optional() }).and(getSectionContentSchema());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
getSectionContentSchema,
|
|
23
|
+
getSectionSchema
|
|
24
|
+
};
|
|
@@ -2,6 +2,18 @@ import {
|
|
|
2
2
|
requireSessionSecret
|
|
3
3
|
} from "./chunk-S2L3BPLS.js";
|
|
4
4
|
|
|
5
|
+
// src/auth/capabilities.ts
|
|
6
|
+
function deriveUiCapabilities(auth) {
|
|
7
|
+
return {
|
|
8
|
+
oauth: (auth.signInMethods.oauth?.length ?? 0) > 0,
|
|
9
|
+
emailPassword: auth.signInMethods.emailPassword ?? false,
|
|
10
|
+
passwordOnly: auth.signInMethods.passwordOnly ?? false,
|
|
11
|
+
userManagement: !!auth.userManagement,
|
|
12
|
+
audienceManagement: !!auth.audiences.manage,
|
|
13
|
+
passwordToggle: !!auth.passwordEnabled.set
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
// src/auth/cookies.ts
|
|
6
18
|
import * as jose from "jose";
|
|
7
19
|
var SESSION_COOKIE = "bp-session";
|
|
@@ -64,6 +76,7 @@ var LastOwnerError = class extends Error {
|
|
|
64
76
|
};
|
|
65
77
|
|
|
66
78
|
export {
|
|
79
|
+
deriveUiCapabilities,
|
|
67
80
|
SESSION_COOKIE,
|
|
68
81
|
AUDIENCE_COOKIE,
|
|
69
82
|
SESSION_MAX_AGE_SECONDS,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The horizontal insertion line shown at the top or bottom edge of a row during
|
|
3
|
+
* a closest-edge drag-to-reorder, paired with `useSortableRow`'s `closestEdge`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function DropEdgeIndicator({ edge }: {
|
|
6
|
+
edge: "top" | "bottom" | null;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
//# sourceMappingURL=DropEdgeIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropEdgeIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/editor/DropEdgeIndicator.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAA;CAAE,kDAQ5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagesModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/PagesModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"PagesModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/PagesModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAajD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,+EAA+E;IAC/E,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IAClG,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1D,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA2EhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionOrderingModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionOrderingModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SectionOrderingModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionOrderingModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD,UAAU,yBAAyB;IACjC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAgHD,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,aAAa,EACb,SAAS,GACV,EAAE,yBAAyB,2CAc3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface HeadingSectionConfig<T extends string> {
|
|
3
|
+
type: T;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
/** Heading level reported to nav generation (one above the rendered tag by design). */
|
|
7
|
+
navRole: "h1" | "h2" | "h3";
|
|
8
|
+
/** The actual HTML tag rendered. */
|
|
9
|
+
tag: "h2" | "h3" | "h4";
|
|
10
|
+
placeholder: string;
|
|
11
|
+
defaultHeading: string;
|
|
12
|
+
/** When true, adds the `excludeFromNav` content field plus its settings toggle. */
|
|
13
|
+
navExclusion?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Factory for the heading section family (link / sub / sub-sub). They differ only
|
|
17
|
+
* in their type tag, label, icon, nav level, rendered tag, placeholder, default
|
|
18
|
+
* text, and whether they expose the nav-exclusion toggle — all three render the
|
|
19
|
+
* shared HeadingSection primitive through the identical edit/view plumbing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineHeadingSection<T extends string>(config: HeadingSectionConfig<T>): import("../..").SectionDefinition<{
|
|
22
|
+
type: T;
|
|
23
|
+
content: {
|
|
24
|
+
heading: string;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=defineHeadingSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineHeadingSection.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/defineHeadingSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,UAAU,oBAAoB,CAAC,CAAC,SAAS,MAAM;IAC7C,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,uFAAuF;IACvF,OAAO,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,oCAAoC;IACpC,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;;;;;GA8BrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Colors/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Colors/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,wBAkCG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Container/index.tsx"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/Container/index.tsx"],"names":[],"mappings":";;;;;;;;;AAkCA,wBAcG"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { SectionContent } from "../../../schemas/sections";
|
|
2
|
-
|
|
3
|
-
label: string;
|
|
4
|
-
text: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
dodont?: "do" | "dont";
|
|
7
|
-
}
|
|
2
|
+
import type { IconListItem } from "./index";
|
|
8
3
|
interface Props {
|
|
9
4
|
items: IconListItem[];
|
|
10
5
|
icon?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconList.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/IconList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"IconList.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/IconList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,UAAU,KAAK;IACb,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,IAAW,EACX,SAAgB,EAChB,SAAiB,EACjB,cAA+C,EAC/C,aAA0C,EAC1C,aAA8B,EAC9B,QAAQ,EACR,aAAa,GACd,EAAE,KAAK,2CAyCP"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const IconListItemSchema: z.ZodObject<{
|
|
3
|
+
label: z.ZodString;
|
|
4
|
+
text: z.ZodString;
|
|
5
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
6
|
+
dodont: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
do: "do";
|
|
8
|
+
dont: "dont";
|
|
9
|
+
}>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type IconListItem = z.infer<typeof IconListItemSchema>;
|
|
1
12
|
declare const _default: import("../../..").SectionDefinition<{
|
|
2
13
|
type: "icon_list";
|
|
3
14
|
content: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/IconList/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB;;;;;;;;iBAK7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;;;;;;;;;;;;;;;;;AAc9D,wBAoBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/LinkHeading/index.tsx"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/LinkHeading/index.tsx"],"names":[],"mappings":";;;;;;AAGA,wBAQG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SubHeading/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SubHeading/index.tsx"],"names":[],"mappings":";;;;;;AAGA,wBASG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SubSubHeading/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/SubSubHeading/index.tsx"],"names":[],"mappings":";;;;;;AAGA,wBASG"}
|
|
@@ -20,13 +20,11 @@ export declare const allSectionDefs: (import("../..").SectionDefinition<{
|
|
|
20
20
|
type: "sub_heading";
|
|
21
21
|
content: {
|
|
22
22
|
heading: string;
|
|
23
|
-
excludeFromNav?: boolean | undefined;
|
|
24
23
|
};
|
|
25
24
|
}> | import("../..").SectionDefinition<{
|
|
26
25
|
type: "sub_sub_heading";
|
|
27
26
|
content: {
|
|
28
27
|
heading: string;
|
|
29
|
-
excludeFromNav?: boolean | undefined;
|
|
30
28
|
};
|
|
31
29
|
}> | import("../..").SectionDefinition<{
|
|
32
30
|
type: "prose";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AAKH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"all-sections.d.ts","sourceRoot":"","sources":["../../../src/components/sections/all-sections.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;GAYG;AAKH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAW1B,CAAC"}
|