@drawnagency/primitives 0.1.60 → 0.1.62
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-2BHPWO7M.js +558 -0
- package/dist/chunk-4E66N6UV.js +10 -0
- package/dist/{chunk-RFZNNCAS.js → chunk-53DKVAB6.js} +1 -61
- package/dist/chunk-5THS4K5D.js +123 -0
- package/dist/chunk-677NTHAZ.js +27 -0
- package/dist/{chunk-TG43X7JO.js → chunk-75P6HWPN.js} +29 -5
- package/dist/chunk-7EOSDFS3.js +10 -0
- package/dist/{chunk-ODCJQOVO.js → chunk-7IMQVDDJ.js} +1 -1
- package/dist/chunk-FJBDGYHE.js +782 -0
- package/dist/chunk-I5737FJY.js +62 -0
- package/dist/chunk-JRT4KWHU.js +1201 -0
- package/dist/chunk-QWDOJUUO.js +648 -0
- package/dist/{chunk-BT7STGDW.js → chunk-TEYTLQVH.js} +0 -15
- package/dist/chunk-WDSVHKAH.js +54 -0
- package/dist/{chunk-Q5EEYBMJ.js → chunk-ZYXLNJ5M.js} +6 -30
- package/dist/components/brandguide/ColorSwatchSettings.d.ts +1 -1
- package/dist/components/brandguide/ColorSwatchSettings.d.ts.map +1 -1
- package/dist/components/brandguide/Colors.d.ts +1 -1
- package/dist/components/brandguide/Colors.d.ts.map +1 -1
- package/dist/components/editor/index.js +642 -0
- package/dist/components/primitives/IconPicker.d.ts +1 -7
- package/dist/components/primitives/IconPicker.d.ts.map +1 -1
- package/dist/components/primitives/index.d.ts +10 -0
- package/dist/components/primitives/index.d.ts.map +1 -0
- package/dist/components/primitives/index.js +169 -0
- package/dist/components/sections/Colors/index.d.ts.map +1 -1
- package/dist/components/sections/Colors/schema.d.ts +19 -0
- package/dist/components/sections/Colors/schema.d.ts.map +1 -0
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts +20 -0
- package/dist/components/sections/DoDontMedia/DoDontMediaBlock.d.ts.map +1 -0
- package/dist/components/sections/DoDontMedia/index.d.ts +45 -0
- package/dist/components/sections/DoDontMedia/index.d.ts.map +1 -0
- package/dist/components/sections/IconList/DoDontToggle.d.ts +14 -0
- package/dist/components/sections/IconList/DoDontToggle.d.ts.map +1 -0
- package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
- package/dist/components/sections/IconList/index.d.ts.map +1 -1
- package/dist/components/sections/Media/MediaBlock.d.ts +1 -3
- package/dist/components/sections/Media/MediaBlock.d.ts.map +1 -1
- package/dist/components/sections/Media/index.d.ts +0 -1
- package/dist/components/sections/Media/index.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +54 -18
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.d.ts +84 -0
- package/dist/components/sections/brand-guide.d.ts.map +1 -0
- package/dist/components/sections/brand-guide.js +21 -0
- package/dist/components/sections/core-sections.d.ts +93 -0
- package/dist/components/sections/core-sections.d.ts.map +1 -0
- package/dist/components/sections/register-schemas.js +240 -3353
- package/dist/index.js +48 -46
- package/dist/lib/index.js +17 -11
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/migrate-sections-transform.d.ts.map +1 -1
- package/dist/lib/migrate-sections-transform.js +1 -1
- package/dist/lib/registry.d.ts +6 -1
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/schemas/index.js +9 -13
- package/dist/schemas/link.js +13 -0
- package/dist/schemas/shared.d.ts +0 -17
- package/dist/schemas/shared.d.ts.map +1 -1
- package/package.json +13 -1
- package/src/components/brandguide/ColorSwatchSettings.tsx +1 -1
- package/src/components/brandguide/Colors.tsx +1 -1
- package/src/components/primitives/IconPicker.tsx +27 -119
- package/src/components/primitives/index.ts +11 -0
- package/src/components/sections/Colors/index.tsx +2 -1
- package/src/components/sections/Colors/schema.ts +24 -0
- package/src/components/sections/DoDontMedia/DoDontMediaBlock.tsx +35 -0
- package/src/components/sections/DoDontMedia/index.tsx +84 -0
- package/src/components/sections/IconList/DoDontToggle.tsx +76 -0
- package/src/components/sections/IconList/IconList.tsx +24 -14
- package/src/components/sections/IconList/index.tsx +1 -0
- package/src/components/sections/Media/MediaBlock.tsx +1 -11
- package/src/components/sections/Media/index.tsx +0 -15
- package/src/components/sections/all-sections.ts +7 -35
- package/src/components/sections/brand-guide.ts +13 -0
- package/src/components/sections/core-sections.ts +26 -0
- package/src/lib/loader.ts +10 -4
- package/src/lib/migrate-sections-transform.ts +33 -5
- package/src/lib/registry.ts +6 -1
- package/src/schemas/shared.ts +0 -18
- /package/dist/{chunk-ZU2MKPTG.js → chunk-3DCG4DNU.js} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/lib/icons.ts
|
|
2
|
+
import {
|
|
3
|
+
Check,
|
|
4
|
+
X,
|
|
5
|
+
ArrowRight,
|
|
6
|
+
Star,
|
|
7
|
+
Info,
|
|
8
|
+
AlertTriangle,
|
|
9
|
+
Heart,
|
|
10
|
+
Lightbulb,
|
|
11
|
+
Flag,
|
|
12
|
+
Shield,
|
|
13
|
+
Zap,
|
|
14
|
+
Eye,
|
|
15
|
+
Lock,
|
|
16
|
+
Globe,
|
|
17
|
+
Users,
|
|
18
|
+
Target,
|
|
19
|
+
Bookmark,
|
|
20
|
+
Clock,
|
|
21
|
+
ThumbsUp,
|
|
22
|
+
ThumbsDown
|
|
23
|
+
} from "lucide-react";
|
|
24
|
+
var curatedIcons = [
|
|
25
|
+
{ id: "check", label: "Check", icon: Check },
|
|
26
|
+
{ id: "x", label: "X", icon: X },
|
|
27
|
+
{ id: "arrow-right", label: "Arrow Right", icon: ArrowRight },
|
|
28
|
+
{ id: "star", label: "Star", icon: Star },
|
|
29
|
+
{ id: "info", label: "Info", icon: Info },
|
|
30
|
+
{ id: "alert-triangle", label: "Warning", icon: AlertTriangle },
|
|
31
|
+
{ id: "heart", label: "Heart", icon: Heart },
|
|
32
|
+
{ id: "lightbulb", label: "Lightbulb", icon: Lightbulb },
|
|
33
|
+
{ id: "flag", label: "Flag", icon: Flag },
|
|
34
|
+
{ id: "shield", label: "Shield", icon: Shield },
|
|
35
|
+
{ id: "zap", label: "Zap", icon: Zap },
|
|
36
|
+
{ id: "eye", label: "Eye", icon: Eye },
|
|
37
|
+
{ id: "lock", label: "Lock", icon: Lock },
|
|
38
|
+
{ id: "globe", label: "Globe", icon: Globe },
|
|
39
|
+
{ id: "users", label: "Users", icon: Users },
|
|
40
|
+
{ id: "target", label: "Target", icon: Target },
|
|
41
|
+
{ id: "bookmark", label: "Bookmark", icon: Bookmark },
|
|
42
|
+
{ id: "clock", label: "Clock", icon: Clock },
|
|
43
|
+
{ id: "thumbs-up", label: "Thumbs Up", icon: ThumbsUp },
|
|
44
|
+
{ id: "thumbs-down", label: "Thumbs Down", icon: ThumbsDown }
|
|
45
|
+
];
|
|
46
|
+
var iconMap = new Map(curatedIcons.map((e) => [e.id, e]));
|
|
47
|
+
function getIcon(id) {
|
|
48
|
+
return iconMap.get(id);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
curatedIcons,
|
|
53
|
+
getIcon
|
|
54
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
upgradeLegacySection
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-75P6HWPN.js";
|
|
4
4
|
import {
|
|
5
5
|
safeNextPath
|
|
6
6
|
} from "./chunk-S2L3BPLS.js";
|
|
7
7
|
import {
|
|
8
8
|
getSectionSchema
|
|
9
9
|
} from "./chunk-TZQPOR5A.js";
|
|
10
|
+
import {
|
|
11
|
+
IndexSchema
|
|
12
|
+
} from "./chunk-TEYTLQVH.js";
|
|
10
13
|
import {
|
|
11
14
|
getAllSchemas
|
|
12
15
|
} from "./chunk-VKAGMEKE.js";
|
|
13
|
-
import {
|
|
14
|
-
IndexSchema
|
|
15
|
-
} from "./chunk-BT7STGDW.js";
|
|
16
16
|
import {
|
|
17
17
|
MAX_BLOCK_DEPTH,
|
|
18
18
|
blockDepth
|
|
@@ -81,27 +81,6 @@ function safeRedirect(url, fallback) {
|
|
|
81
81
|
return safeNextPath(url) ?? fallback;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// src/lib/events.ts
|
|
85
|
-
function createEvent(name) {
|
|
86
|
-
return {
|
|
87
|
-
dispatch(detail) {
|
|
88
|
-
window.dispatchEvent(new CustomEvent(name, { detail }));
|
|
89
|
-
},
|
|
90
|
-
listen(callback) {
|
|
91
|
-
const handler = (e) => callback(e.detail);
|
|
92
|
-
window.addEventListener(name, handler);
|
|
93
|
-
return () => window.removeEventListener(name, handler);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
var editModeEvent = createEvent("editmodechange");
|
|
98
|
-
var navChangeEvent = createEvent("sitenavchange");
|
|
99
|
-
var darkModeEvent = createEvent("sitedarkmode");
|
|
100
|
-
var siteNameChangeEvent = createEvent("sitenamechange");
|
|
101
|
-
var historySelectEvent = createEvent("history-select");
|
|
102
|
-
var siteNavChangeEvent = createEvent("sitenavchange-v2");
|
|
103
|
-
var pageSelectEvent = createEvent("pageselect");
|
|
104
|
-
|
|
105
84
|
// src/lib/loader.ts
|
|
106
85
|
function mergeSiteContent(index, sectionFiles) {
|
|
107
86
|
const sections = [];
|
|
@@ -116,7 +95,8 @@ function mergeSiteContent(index, sectionFiles) {
|
|
|
116
95
|
}
|
|
117
96
|
const raw = upgradeLegacySection(rawFile);
|
|
118
97
|
const baseMeta = index.sections[id];
|
|
119
|
-
const
|
|
98
|
+
const upgradedType = raw && typeof raw === "object" ? raw.type : void 0;
|
|
99
|
+
const meta = raw !== rawFile && typeof upgradedType === "string" ? { ...baseMeta, type: upgradedType } : baseMeta;
|
|
120
100
|
if (canValidate && schema) {
|
|
121
101
|
const result = schema.safeParse(raw);
|
|
122
102
|
if (!result.success) {
|
|
@@ -164,10 +144,6 @@ export {
|
|
|
164
144
|
buildGoogleFontsUrl,
|
|
165
145
|
formatTimestamp,
|
|
166
146
|
safeRedirect,
|
|
167
|
-
createEvent,
|
|
168
|
-
editModeEvent,
|
|
169
|
-
navChangeEvent,
|
|
170
|
-
darkModeEvent,
|
|
171
147
|
mergeSiteContent,
|
|
172
148
|
loadStaticSiteContent,
|
|
173
149
|
loadSiteContent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatchSettings.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/ColorSwatchSettings.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"ColorSwatchSettings.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/ColorSwatchSettings.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,2BAA2B,CAAC;AAEvE,UAAU,KAAK;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC;AAMD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAkCrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/Colors.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../src/components/brandguide/Colors.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,UAAU,KAAK;IACb,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACzD;AAgCD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,MAAM,EAAE,OAAW,EAAE,KAAK,EAAE,UAAU,EAAE,SAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,KAAK,2CAgBtH"}
|