@drawnagency/primitives 0.1.57 → 0.1.58
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/adapter-HH47ZPGM.js +1779 -0
- package/dist/auth/index.js +1 -0
- package/dist/{chunk-PRKUXM7E.js → chunk-AN62WPW7.js} +1 -156
- package/dist/chunk-ESE5UBQI.js +73 -0
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/chunk-RFZNNCAS.js +160 -0
- package/dist/chunk-V7JN2DDU.js +30 -0
- package/dist/chunk-ZU2MKPTG.js +29 -0
- package/dist/closest-edge-EBOXL3YW.js +72 -0
- package/dist/components/sections/register-schemas.js +4094 -0
- package/dist/index.js +17 -12
- package/dist/lib/dexie.js +2 -0
- package/dist/lib/env.js +1 -0
- package/dist/lib/index.js +11 -8
- package/dist/lib/migrate-sections-transform.js +1 -0
- package/dist/lib/registry.js +1 -0
- package/dist/media/index.js +1 -0
- package/dist/schemas/auth.js +1 -0
- package/dist/schemas/block.js +1 -0
- package/dist/schemas/index.js +7 -4
- package/dist/types/database.js +2 -0
- package/package.json +5 -1
- package/dist/chunk-PYWS3MOJ.js +0 -57
package/dist/index.js
CHANGED
|
@@ -29,13 +29,15 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
AudienceColorSchema,
|
|
31
31
|
AudienceNameSchema,
|
|
32
|
+
MediaGridOptionsSchema,
|
|
33
|
+
slugifyAudienceName
|
|
34
|
+
} from "./chunk-V7JN2DDU.js";
|
|
35
|
+
import {
|
|
32
36
|
DEFAULT_LINK,
|
|
33
37
|
LinkTargetSchema,
|
|
34
38
|
LinkValueSchema,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
slugifyAudienceName
|
|
38
|
-
} from "./chunk-PYWS3MOJ.js";
|
|
39
|
+
isSafeHref
|
|
40
|
+
} from "./chunk-ZU2MKPTG.js";
|
|
39
41
|
import {
|
|
40
42
|
AudienceSchema,
|
|
41
43
|
RoleSchema,
|
|
@@ -44,26 +46,28 @@ import {
|
|
|
44
46
|
} from "./chunk-LZKVV4K2.js";
|
|
45
47
|
import {
|
|
46
48
|
buildGoogleFontsUrl,
|
|
47
|
-
cn,
|
|
48
49
|
createEvent,
|
|
49
|
-
curatedIcons,
|
|
50
50
|
darkModeEvent,
|
|
51
51
|
deriveContrast,
|
|
52
52
|
editModeEvent,
|
|
53
|
-
ensureSanitizer,
|
|
54
53
|
formatTimestamp,
|
|
55
|
-
generateNavLinks,
|
|
56
|
-
getIcon,
|
|
57
54
|
gridColsClass,
|
|
58
55
|
loadSiteContent,
|
|
59
56
|
loadStaticSiteContent,
|
|
60
57
|
mergeSiteContent,
|
|
61
58
|
navChangeEvent,
|
|
62
|
-
safeRedirect
|
|
59
|
+
safeRedirect
|
|
60
|
+
} from "./chunk-AN62WPW7.js";
|
|
61
|
+
import "./chunk-TG43X7JO.js";
|
|
62
|
+
import {
|
|
63
|
+
cn,
|
|
64
|
+
curatedIcons,
|
|
65
|
+
ensureSanitizer,
|
|
66
|
+
generateNavLinks,
|
|
67
|
+
getIcon,
|
|
63
68
|
sanitizeHtml,
|
|
64
69
|
toSectionId
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import "./chunk-TG43X7JO.js";
|
|
70
|
+
} from "./chunk-RFZNNCAS.js";
|
|
67
71
|
import {
|
|
68
72
|
isSameOriginRequest,
|
|
69
73
|
requireSessionSecret,
|
|
@@ -108,6 +112,7 @@ import {
|
|
|
108
112
|
registerSchema,
|
|
109
113
|
registerSection
|
|
110
114
|
} from "./chunk-VKAGMEKE.js";
|
|
115
|
+
import "./chunk-JSBRDJBE.js";
|
|
111
116
|
|
|
112
117
|
// src/storage/types.ts
|
|
113
118
|
var StorageConflictError = class extends Error {
|
package/dist/lib/dexie.js
CHANGED
package/dist/lib/env.js
CHANGED
package/dist/lib/index.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildGoogleFontsUrl,
|
|
3
|
-
cn,
|
|
4
3
|
createEvent,
|
|
5
|
-
curatedIcons,
|
|
6
4
|
darkModeEvent,
|
|
7
5
|
deriveContrast,
|
|
8
6
|
editModeEvent,
|
|
9
|
-
ensureSanitizer,
|
|
10
7
|
formatTimestamp,
|
|
11
|
-
generateNavLinks,
|
|
12
|
-
getIcon,
|
|
13
8
|
gridColsClass,
|
|
14
9
|
loadSiteContent,
|
|
15
10
|
loadStaticSiteContent,
|
|
16
11
|
mergeSiteContent,
|
|
17
12
|
navChangeEvent,
|
|
18
|
-
safeRedirect
|
|
13
|
+
safeRedirect
|
|
14
|
+
} from "../chunk-AN62WPW7.js";
|
|
15
|
+
import "../chunk-TG43X7JO.js";
|
|
16
|
+
import {
|
|
17
|
+
cn,
|
|
18
|
+
curatedIcons,
|
|
19
|
+
ensureSanitizer,
|
|
20
|
+
generateNavLinks,
|
|
21
|
+
getIcon,
|
|
19
22
|
sanitizeHtml,
|
|
20
23
|
toSectionId
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-TG43X7JO.js";
|
|
24
|
+
} from "../chunk-RFZNNCAS.js";
|
|
23
25
|
import "../chunk-S2L3BPLS.js";
|
|
24
26
|
import "../chunk-ICLXLWQ5.js";
|
|
25
27
|
import "../chunk-DKOUFIP6.js";
|
|
@@ -38,6 +40,7 @@ import {
|
|
|
38
40
|
registerSchema,
|
|
39
41
|
registerSection
|
|
40
42
|
} from "../chunk-VKAGMEKE.js";
|
|
43
|
+
import "../chunk-JSBRDJBE.js";
|
|
41
44
|
export {
|
|
42
45
|
buildGoogleFontsUrl,
|
|
43
46
|
clearRegistry,
|
package/dist/lib/registry.js
CHANGED
package/dist/media/index.js
CHANGED
package/dist/schemas/auth.js
CHANGED
package/dist/schemas/block.js
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AudienceColorSchema,
|
|
3
3
|
AudienceNameSchema,
|
|
4
|
+
MediaGridOptionsSchema,
|
|
5
|
+
slugifyAudienceName
|
|
6
|
+
} from "../chunk-V7JN2DDU.js";
|
|
7
|
+
import {
|
|
4
8
|
DEFAULT_LINK,
|
|
5
9
|
LinkTargetSchema,
|
|
6
10
|
LinkValueSchema,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
slugifyAudienceName
|
|
10
|
-
} from "../chunk-PYWS3MOJ.js";
|
|
11
|
+
isSafeHref
|
|
12
|
+
} from "../chunk-ZU2MKPTG.js";
|
|
11
13
|
import {
|
|
12
14
|
AudienceSchema,
|
|
13
15
|
RoleSchema,
|
|
@@ -40,6 +42,7 @@ import {
|
|
|
40
42
|
} from "../chunk-DKOUFIP6.js";
|
|
41
43
|
import "../chunk-NSCT3AMV.js";
|
|
42
44
|
import "../chunk-VKAGMEKE.js";
|
|
45
|
+
import "../chunk-JSBRDJBE.js";
|
|
43
46
|
export {
|
|
44
47
|
AudienceColorSchema,
|
|
45
48
|
AudienceNameSchema,
|
package/dist/types/database.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drawnagency/primitives",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json",
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"types": "./dist/lib/migrate-sections-transform.d.ts",
|
|
45
45
|
"default": "./dist/lib/migrate-sections-transform.js"
|
|
46
46
|
},
|
|
47
|
+
"./components/sections/register-schemas": {
|
|
48
|
+
"types": "./dist/components/sections/register-schemas.d.ts",
|
|
49
|
+
"default": "./dist/components/sections/register-schemas.js"
|
|
50
|
+
},
|
|
47
51
|
"./auth": {
|
|
48
52
|
"types": "./dist/auth/index.d.ts",
|
|
49
53
|
"default": "./dist/auth/index.js"
|
package/dist/chunk-PYWS3MOJ.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HexColorSchema
|
|
3
|
-
} from "./chunk-ICLXLWQ5.js";
|
|
4
|
-
|
|
5
|
-
// src/schemas/audience.ts
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
var AudienceNameSchema = z.string().min(1).max(32).regex(
|
|
8
|
-
/^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$/,
|
|
9
|
-
"lowercase alphanumeric, dashes and underscores allowed"
|
|
10
|
-
);
|
|
11
|
-
var AudienceColorSchema = HexColorSchema.nullable();
|
|
12
|
-
function slugifyAudienceName(input) {
|
|
13
|
-
return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// src/schemas/media-grid-options.ts
|
|
17
|
-
import { z as z2 } from "zod";
|
|
18
|
-
var MediaGridOptionsSchema = z2.object({
|
|
19
|
-
square: z2.boolean().optional(),
|
|
20
|
-
border: z2.boolean().optional(),
|
|
21
|
-
crop: z2.boolean().optional(),
|
|
22
|
-
showCaptions: z2.boolean().optional()
|
|
23
|
-
}).default({});
|
|
24
|
-
|
|
25
|
-
// src/schemas/link.ts
|
|
26
|
-
import { z as z3 } from "zod";
|
|
27
|
-
var LinkTargetSchema = z3.enum(["_self", "_blank"]);
|
|
28
|
-
function isSafeHref(href) {
|
|
29
|
-
const normalized = href.replace(/[\t\r\n]/g, "").trimStart();
|
|
30
|
-
if (normalized === "") return true;
|
|
31
|
-
if (normalized.startsWith("//")) return false;
|
|
32
|
-
const scheme = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(normalized);
|
|
33
|
-
if (!scheme) return true;
|
|
34
|
-
const s = scheme[1].toLowerCase();
|
|
35
|
-
return s === "http" || s === "https" || s === "mailto";
|
|
36
|
-
}
|
|
37
|
-
var LinkValueSchema = z3.discriminatedUnion("kind", [
|
|
38
|
-
z3.object({ kind: z3.literal("external"), href: z3.string().refine(isSafeHref, "Unsafe href scheme"), target: LinkTargetSchema }),
|
|
39
|
-
z3.object({
|
|
40
|
-
kind: z3.literal("internal"),
|
|
41
|
-
pageId: z3.string(),
|
|
42
|
-
anchorSectionId: z3.string().nullable().optional(),
|
|
43
|
-
target: LinkTargetSchema
|
|
44
|
-
})
|
|
45
|
-
]);
|
|
46
|
-
var DEFAULT_LINK = { kind: "external", href: "", target: "_self" };
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
AudienceNameSchema,
|
|
50
|
-
AudienceColorSchema,
|
|
51
|
-
slugifyAudienceName,
|
|
52
|
-
MediaGridOptionsSchema,
|
|
53
|
-
LinkTargetSchema,
|
|
54
|
-
isSafeHref,
|
|
55
|
-
LinkValueSchema,
|
|
56
|
-
DEFAULT_LINK
|
|
57
|
-
};
|