@drawnagency/primitives 0.1.114 → 0.1.115
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-OAGJBCSH.js → chunk-4WQ36ZP7.js} +19 -3
- package/dist/{chunk-PTY2RG2K.js → chunk-67P34WNW.js} +75 -130
- package/dist/chunk-APIJPTFG.js +64 -0
- package/dist/chunk-CDBURDPX.js +90 -0
- package/dist/chunk-DFKTF3CH.js +0 -0
- package/dist/chunk-DJABADOO.js +131 -0
- package/dist/{chunk-IP2SEBAJ.js → chunk-DJOGPSRU.js} +31 -72
- package/dist/{chunk-N3G7DOU3.js → chunk-FHTKSELX.js} +6 -6
- package/dist/chunk-GNF6KFQ7.js +18 -0
- package/dist/{chunk-QHMKIODQ.js → chunk-HHNPSKPT.js} +2 -89
- package/dist/{chunk-PZPGJZRG.js → chunk-JXATNKLV.js} +5 -5
- package/dist/{chunk-PLANHXS7.js → chunk-NX7TFHA4.js} +9 -9
- package/dist/{chunk-PNSCDBU7.js → chunk-O37AV27P.js} +6 -49
- package/dist/{chunk-5KSAS4VY.js → chunk-RIITGTV3.js} +1 -1
- package/dist/chunk-S7QRHUWO.js +8 -0
- package/dist/{chunk-7SAAJVDE.js → chunk-T26HAKW3.js} +37 -35
- package/dist/chunk-VY3IFGE3.js +70 -0
- package/dist/{chunk-VUYCRBJK.js → chunk-WYOFQHKI.js} +6 -4
- package/dist/{chunk-Y5QECJX7.js → chunk-YV3YSZEB.js} +5 -5
- package/dist/collab/rebase.d.ts.map +1 -1
- package/dist/collab/rebase.js +15 -15
- package/dist/components/editor/index.js +13 -13
- package/dist/components/primitives/index.js +16 -11
- package/dist/components/sections/brand-guide.js +13 -8
- package/dist/components/sections/register-schemas.js +20 -15
- package/dist/components/sections/register.js +20 -15
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/deck-builder/index.js +9 -9
- package/dist/hooks/useEditorPublish.d.ts +4 -1
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
- package/dist/index.js +85 -56
- package/dist/lib/dexie.d.ts +7 -1
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +3 -2
- package/dist/lib/image-variant-plan.d.ts +42 -0
- package/dist/lib/image-variant-plan.d.ts.map +1 -0
- package/dist/lib/image-variant-plan.js +53 -0
- package/dist/lib/index-ops.d.ts.map +1 -1
- package/dist/lib/index-ops.js +20 -16
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +43 -22
- package/dist/lib/loader.d.ts +16 -17
- package/dist/lib/loader.d.ts.map +1 -1
- package/dist/lib/media-ops.d.ts +73 -0
- package/dist/lib/media-ops.d.ts.map +1 -0
- package/dist/lib/media-ops.js +60 -0
- package/dist/lib/nav-tree.d.ts +6 -0
- package/dist/lib/nav-tree.d.ts.map +1 -1
- package/dist/lib/pages.d.ts +2 -1
- package/dist/lib/pages.d.ts.map +1 -1
- package/dist/lib/sidecar-diagnostics.d.ts +20 -0
- package/dist/lib/sidecar-diagnostics.d.ts.map +1 -0
- package/dist/lib/sidecars.d.ts +118 -0
- package/dist/lib/sidecars.d.ts.map +1 -0
- package/dist/lib/sidecars.js +23 -0
- package/dist/lib/slug.d.ts +2 -0
- package/dist/lib/slug.d.ts.map +1 -0
- package/dist/lib/storage-tier.d.ts +17 -0
- package/dist/lib/storage-tier.d.ts.map +1 -0
- package/dist/lib/storage-tier.js +29 -0
- package/dist/lib/tags.d.ts +6 -0
- package/dist/lib/tags.d.ts.map +1 -1
- package/dist/media/index.js +15 -15
- package/dist/media/queue.d.ts +2 -0
- package/dist/media/queue.d.ts.map +1 -1
- package/dist/media/worker.d.ts +1 -35
- package/dist/media/worker.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -12
- package/dist/schemas/media.d.ts +4 -0
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/storage/index.js +2 -1
- package/dist/storage/memory.d.ts +21 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +129 -0
- package/dist/storage/types.d.ts +9 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +21 -1
- package/src/collab/rebase.ts +12 -16
- package/src/components/shell/EditorShell.tsx +7 -4
- package/src/hooks/useEditorPublish.ts +9 -4
- package/src/hooks/useMediaPipeline.ts +29 -23
- package/src/lib/dexie.ts +9 -1
- package/src/lib/image-variant-plan.ts +92 -0
- package/src/lib/index-ops.ts +9 -18
- package/src/lib/index.ts +15 -0
- package/src/lib/loader.ts +18 -77
- package/src/lib/media-ops.ts +112 -0
- package/src/lib/nav-tree.ts +33 -4
- package/src/lib/pages.ts +2 -3
- package/src/lib/sidecar-diagnostics.ts +29 -0
- package/src/lib/sidecars.ts +221 -0
- package/src/lib/slug.ts +6 -0
- package/src/lib/storage-tier.ts +38 -0
- package/src/lib/tags.ts +20 -3
- package/src/media/queue.ts +3 -0
- package/src/media/utils.ts +1 -1
- package/src/media/worker.ts +17 -8
- package/src/schemas/media.ts +7 -2
- package/src/storage/memory.ts +178 -0
- package/src/storage/types.ts +15 -2
- /package/dist/{chunk-45FA7Z55.js → chunk-UUUSJDIG.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -14,29 +14,7 @@ import {
|
|
|
14
14
|
verifyAudienceToken,
|
|
15
15
|
verifySessionToken
|
|
16
16
|
} from "./chunk-KQA772WQ.js";
|
|
17
|
-
import
|
|
18
|
-
BAKED_MEDIA_KEYS,
|
|
19
|
-
EXT_TO_MIME,
|
|
20
|
-
MIME_TO_EXT,
|
|
21
|
-
ProcessingQueue,
|
|
22
|
-
composePreviewImage,
|
|
23
|
-
displayFilename,
|
|
24
|
-
displayFilenameExt,
|
|
25
|
-
displayName,
|
|
26
|
-
formatFileSize,
|
|
27
|
-
generateVideoPoster,
|
|
28
|
-
getMediaProvider,
|
|
29
|
-
hashFileBuffer,
|
|
30
|
-
imageThumbnailUrl,
|
|
31
|
-
mediaThumbnailUrl,
|
|
32
|
-
mimeToExt,
|
|
33
|
-
rebindImageRef,
|
|
34
|
-
resolveLogo,
|
|
35
|
-
resolveManifestReferences,
|
|
36
|
-
resolveMedia,
|
|
37
|
-
sanitizeMediaName,
|
|
38
|
-
setMediaProvider
|
|
39
|
-
} from "./chunk-QHMKIODQ.js";
|
|
17
|
+
import "./chunk-DFKTF3CH.js";
|
|
40
18
|
import {
|
|
41
19
|
ASSET_CACHE_CONTROL,
|
|
42
20
|
DOCUMENT_CACHE_CONTROL,
|
|
@@ -46,7 +24,7 @@ import {
|
|
|
46
24
|
NothingToPublishError,
|
|
47
25
|
StorageConflictError,
|
|
48
26
|
withIdempotencyTrailer
|
|
49
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UUUSJDIG.js";
|
|
50
28
|
import {
|
|
51
29
|
CollabPeerSchema,
|
|
52
30
|
HEARTBEAT_INTERVAL_MS,
|
|
@@ -60,6 +38,31 @@ import {
|
|
|
60
38
|
getCollabProvider,
|
|
61
39
|
setCollabProvider
|
|
62
40
|
} from "./chunk-2G2S36SY.js";
|
|
41
|
+
import {
|
|
42
|
+
BAKED_MEDIA_KEYS,
|
|
43
|
+
ProcessingQueue,
|
|
44
|
+
composePreviewImage,
|
|
45
|
+
generateVideoPoster,
|
|
46
|
+
getMediaProvider,
|
|
47
|
+
rebindImageRef,
|
|
48
|
+
resolveLogo,
|
|
49
|
+
resolveManifestReferences,
|
|
50
|
+
resolveMedia,
|
|
51
|
+
setMediaProvider
|
|
52
|
+
} from "./chunk-HHNPSKPT.js";
|
|
53
|
+
import {
|
|
54
|
+
EXT_TO_MIME,
|
|
55
|
+
MIME_TO_EXT,
|
|
56
|
+
displayFilename,
|
|
57
|
+
displayFilenameExt,
|
|
58
|
+
displayName,
|
|
59
|
+
formatFileSize,
|
|
60
|
+
hashFileBuffer,
|
|
61
|
+
imageThumbnailUrl,
|
|
62
|
+
mediaThumbnailUrl,
|
|
63
|
+
mimeToExt,
|
|
64
|
+
sanitizeMediaName
|
|
65
|
+
} from "./chunk-CDBURDPX.js";
|
|
63
66
|
import {
|
|
64
67
|
DEFAULT_CHATBOT_NAME,
|
|
65
68
|
accentVarValue,
|
|
@@ -77,46 +80,59 @@ import {
|
|
|
77
80
|
safeRedirect,
|
|
78
81
|
suggestAccessibleOn,
|
|
79
82
|
wcagLevel
|
|
80
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-O37AV27P.js";
|
|
84
|
+
import {
|
|
85
|
+
formatTimestamp
|
|
86
|
+
} from "./chunk-MM7KZS5C.js";
|
|
87
|
+
import {
|
|
88
|
+
generateNavLinks,
|
|
89
|
+
resolveReference,
|
|
90
|
+
toSectionId
|
|
91
|
+
} from "./chunk-WYOFQHKI.js";
|
|
92
|
+
import {
|
|
93
|
+
ensureSanitizer,
|
|
94
|
+
sanitizeHtml
|
|
95
|
+
} from "./chunk-QQ3S3P5P.js";
|
|
81
96
|
import {
|
|
82
97
|
curatedIcons,
|
|
83
98
|
getIcon
|
|
84
99
|
} from "./chunk-WDSVHKAH.js";
|
|
100
|
+
import "./chunk-L45X7DKX.js";
|
|
85
101
|
import {
|
|
86
102
|
createEvent,
|
|
87
103
|
darkModeEvent,
|
|
88
104
|
editModeEvent
|
|
89
105
|
} from "./chunk-XDEPXTBY.js";
|
|
90
|
-
import {
|
|
91
|
-
generateNavLinks,
|
|
92
|
-
resolveReference,
|
|
93
|
-
toSectionId
|
|
94
|
-
} from "./chunk-VUYCRBJK.js";
|
|
95
|
-
import "./chunk-L45X7DKX.js";
|
|
96
106
|
import "./chunk-FRVO75DK.js";
|
|
97
|
-
import {
|
|
98
|
-
formatTimestamp
|
|
99
|
-
} from "./chunk-MM7KZS5C.js";
|
|
100
|
-
import {
|
|
101
|
-
ensureSanitizer,
|
|
102
|
-
sanitizeHtml
|
|
103
|
-
} from "./chunk-QQ3S3P5P.js";
|
|
104
107
|
import {
|
|
105
108
|
cn
|
|
106
109
|
} from "./chunk-7EOSDFS3.js";
|
|
107
110
|
import {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
audiencePasses
|
|
112
|
+
} from "./chunk-VY3IFGE3.js";
|
|
113
|
+
import {
|
|
114
|
+
NAV,
|
|
115
|
+
SIDECARS,
|
|
116
|
+
TAGS,
|
|
117
|
+
liftSidecars,
|
|
118
|
+
planSidecarWrite,
|
|
119
|
+
readSidecar,
|
|
120
|
+
readSidecarText
|
|
121
|
+
} from "./chunk-DJABADOO.js";
|
|
112
122
|
import {
|
|
113
|
-
audiencePasses,
|
|
114
123
|
groupDisplayLabel,
|
|
115
124
|
groupOfPage,
|
|
116
125
|
navEntries,
|
|
117
126
|
pagesInNavOrder,
|
|
118
127
|
reconcileNav
|
|
119
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-DJOGPSRU.js";
|
|
129
|
+
import {
|
|
130
|
+
reconcileTags,
|
|
131
|
+
siteTags,
|
|
132
|
+
tagDisplayLabel
|
|
133
|
+
} from "./chunk-4WQ36ZP7.js";
|
|
134
|
+
import "./chunk-GNF6KFQ7.js";
|
|
135
|
+
import "./chunk-S7QRHUWO.js";
|
|
120
136
|
import {
|
|
121
137
|
REFERENCE_TYPE
|
|
122
138
|
} from "./chunk-5GFACGSN.js";
|
|
@@ -136,21 +152,11 @@ import {
|
|
|
136
152
|
getSectionSchema,
|
|
137
153
|
getSectionSchemaForType
|
|
138
154
|
} from "./chunk-DMCGN5AS.js";
|
|
139
|
-
import {
|
|
140
|
-
NavEntrySchema,
|
|
141
|
-
NavFileSchema,
|
|
142
|
-
TagEntrySchema,
|
|
143
|
-
TagsFileSchema
|
|
144
|
-
} from "./chunk-4Y2JQQZL.js";
|
|
145
155
|
import {
|
|
146
156
|
ChatbotConfigSchema,
|
|
147
157
|
ChatbotTaskSchema,
|
|
148
158
|
DeckBuilderConfigSchema,
|
|
149
|
-
ImageManifestSchema,
|
|
150
159
|
IndexSchema,
|
|
151
|
-
MediaConfigSchema,
|
|
152
|
-
MediaFolderSchema,
|
|
153
|
-
MediaItemSchema,
|
|
154
160
|
PageSchema,
|
|
155
161
|
PageStatusSchema,
|
|
156
162
|
RESERVED_SLUGS,
|
|
@@ -158,10 +164,24 @@ import {
|
|
|
158
164
|
SectionMetaSchema,
|
|
159
165
|
SiteConfigSchema,
|
|
160
166
|
StatusSchema,
|
|
161
|
-
VariantSchema,
|
|
162
167
|
normalizeSiteIndex
|
|
163
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-67P34WNW.js";
|
|
164
169
|
import "./chunk-4TZJZU2T.js";
|
|
170
|
+
import {
|
|
171
|
+
NavEntrySchema,
|
|
172
|
+
NavFileSchema,
|
|
173
|
+
TagEntrySchema,
|
|
174
|
+
TagsFileSchema
|
|
175
|
+
} from "./chunk-4Y2JQQZL.js";
|
|
176
|
+
import {
|
|
177
|
+
ImageManifestSchema,
|
|
178
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
179
|
+
MEDIA_GIT_MAX_BYTES,
|
|
180
|
+
MediaConfigSchema,
|
|
181
|
+
MediaFolderSchema,
|
|
182
|
+
MediaItemSchema,
|
|
183
|
+
VariantSchema
|
|
184
|
+
} from "./chunk-APIJPTFG.js";
|
|
165
185
|
import {
|
|
166
186
|
clearRegistry,
|
|
167
187
|
createRegistry,
|
|
@@ -255,12 +275,15 @@ export {
|
|
|
255
275
|
LastOwnerError,
|
|
256
276
|
LinkTargetSchema,
|
|
257
277
|
LinkValueSchema,
|
|
278
|
+
MEDIA_BUCKET_MAX_BYTES,
|
|
279
|
+
MEDIA_GIT_MAX_BYTES,
|
|
258
280
|
MIME_TO_EXT,
|
|
259
281
|
MediaConfigSchema,
|
|
260
282
|
MediaFolderSchema,
|
|
261
283
|
MediaGridOptionsSchema,
|
|
262
284
|
MediaItemSchema,
|
|
263
285
|
MediaReferenceSchema,
|
|
286
|
+
NAV,
|
|
264
287
|
NavEntrySchema,
|
|
265
288
|
NavFileSchema,
|
|
266
289
|
NormalizedUsernameSchema,
|
|
@@ -273,6 +296,7 @@ export {
|
|
|
273
296
|
RoleSchema,
|
|
274
297
|
SESSION_COOKIE,
|
|
275
298
|
SESSION_MAX_AGE_SECONDS,
|
|
299
|
+
SIDECARS,
|
|
276
300
|
SLUG_RE,
|
|
277
301
|
SavedMessageSchema,
|
|
278
302
|
SectionMetaSchema,
|
|
@@ -284,6 +308,7 @@ export {
|
|
|
284
308
|
SiteUserSchema,
|
|
285
309
|
StatusSchema,
|
|
286
310
|
StorageConflictError,
|
|
311
|
+
TAGS,
|
|
287
312
|
TagEntrySchema,
|
|
288
313
|
TagsFileSchema,
|
|
289
314
|
TakeoverMessageSchema,
|
|
@@ -338,6 +363,7 @@ export {
|
|
|
338
363
|
imageThumbnailUrl,
|
|
339
364
|
isSafeHref,
|
|
340
365
|
isSameOriginRequest,
|
|
366
|
+
liftSidecars,
|
|
341
367
|
loadStaticSiteContent,
|
|
342
368
|
mediaThumbnailUrl,
|
|
343
369
|
mergeSiteContent,
|
|
@@ -347,7 +373,10 @@ export {
|
|
|
347
373
|
normalizeUsername,
|
|
348
374
|
onPrimaryVarValue,
|
|
349
375
|
pagesInNavOrder,
|
|
376
|
+
planSidecarWrite,
|
|
350
377
|
primaryVarValue,
|
|
378
|
+
readSidecar,
|
|
379
|
+
readSidecarText,
|
|
351
380
|
rebindImageRef,
|
|
352
381
|
reconcileNav,
|
|
353
382
|
reconcileTags,
|
package/dist/lib/dexie.d.ts
CHANGED
|
@@ -69,11 +69,17 @@ export declare function persistAll(sections: {
|
|
|
69
69
|
* cache hit then served pre-upload media ("No Image" on images the published site
|
|
70
70
|
* rendered fine) and an empty document manifest ("File missing" on committed
|
|
71
71
|
* documents). Passing them positionally makes forgetting a compile error.
|
|
72
|
+
*
|
|
73
|
+
* `tagsDegraded` is required for the same reason. A degraded tags read caches
|
|
74
|
+
* as "not loaded" (the index without `tags`), so a later cache-hit load stays
|
|
75
|
+
* read-only for tags instead of trusting the partial list. Only the cold load
|
|
76
|
+
* used to strip it, so a conflict recovery, remote sync or save re-primed the
|
|
77
|
+
* row with the partial list and the next cache hit re-enabled tag editing.
|
|
72
78
|
*/
|
|
73
79
|
export declare function cacheContent(sha: string, sections: LoadedSection[], index: SiteIndex, siteConfig: Record<string, unknown>, manifests: {
|
|
74
80
|
media: MediaManifest;
|
|
75
81
|
documents: DocumentManifest;
|
|
76
|
-
}, diff?: {
|
|
82
|
+
}, tagsDegraded: boolean, diff?: {
|
|
77
83
|
savedBranchSha?: string | null;
|
|
78
84
|
changedSectionIds?: string[];
|
|
79
85
|
mainIndex?: SiteIndex | null;
|
package/dist/lib/dexie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dexie.d.ts","sourceRoot":"","sources":["../../src/lib/dexie.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAe,UAAU,EAAQ,MAAM,wBAAwB,CAAC;AAGvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAyFpF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB;AAsKD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQpD;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAcxF;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IACnD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kB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAG5E;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAG7E;AAED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E"}
|
package/dist/lib/dexie.js
CHANGED
|
@@ -303,13 +303,14 @@ async function persistAll(sections, siteIndex, deletedSectionIds, siteConfig) {
|
|
|
303
303
|
}
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
|
-
async function cacheContent(sha, sections, index, siteConfig, manifests, diff) {
|
|
306
|
+
async function cacheContent(sha, sections, index, siteConfig, manifests, tagsDegraded, diff) {
|
|
307
307
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
308
|
+
const { tags: _partialTags, ...untaggedIndex } = index;
|
|
308
309
|
await getDb().contentCache.put({
|
|
309
310
|
key: "current",
|
|
310
311
|
sha,
|
|
311
312
|
sections,
|
|
312
|
-
index,
|
|
313
|
+
index: tagsDegraded ? untaggedIndex : index,
|
|
313
314
|
siteConfig,
|
|
314
315
|
updatedAt: now,
|
|
315
316
|
savedBranchSha: diff?.savedBranchSha ?? null,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MediaConfig, MediaItem, Variant } from "../schemas/media";
|
|
2
|
+
export interface MediaIdentity {
|
|
3
|
+
id: string;
|
|
4
|
+
hash: string;
|
|
5
|
+
originalName: string;
|
|
6
|
+
/** Storage dir under assets/images/. Never changes once committed. */
|
|
7
|
+
folder: string;
|
|
8
|
+
}
|
|
9
|
+
/** `hash` is the 16-hex content hash both sides compute (hashFileBuffer / hashBuffer). */
|
|
10
|
+
export declare function mediaIdentity(hash: string, fileName: string): MediaIdentity;
|
|
11
|
+
/** Repo path of one stored file in a media folder: a variant width, or `poster`. */
|
|
12
|
+
export declare function imageVariantPath(folder: string, key: number | string): string;
|
|
13
|
+
export interface ImageVariantPlan extends MediaIdentity {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
/** WebP quality, 1-100. */
|
|
17
|
+
quality: number;
|
|
18
|
+
/** Ascending by width. */
|
|
19
|
+
variants: {
|
|
20
|
+
width: number;
|
|
21
|
+
path: string;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
export declare function planImageVariants(input: {
|
|
25
|
+
hash: string;
|
|
26
|
+
fileName: string;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
media: Pick<MediaConfig, "sizes" | "quality">;
|
|
30
|
+
}): ImageVariantPlan;
|
|
31
|
+
export type ImageManifestEntry = Omit<MediaItem, "kind" | "storage" | "url" | "duration" | "folderId" | "hidden"> & {
|
|
32
|
+
kind: "image";
|
|
33
|
+
storage: "github";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `rendered` is what the adapter measured for each planned width (heights come
|
|
37
|
+
* from the encoder, not the plan). `size` is the adapter's byte count for the
|
|
38
|
+
* item: the editor records its largest variant, the sharp path the original's
|
|
39
|
+
* length — they differ today and this module does not decide that.
|
|
40
|
+
*/
|
|
41
|
+
export declare function imageManifestEntry(plan: ImageVariantPlan, rendered: Variant[], size: number): ImageManifestEntry;
|
|
42
|
+
//# sourceMappingURL=image-variant-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-variant-plan.d.ts","sourceRoot":"","sources":["../../src/lib/image-variant-plan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAUxE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IAC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DPX.js";
|
|
4
|
+
import "../chunk-S7QRHUWO.js";
|
|
5
|
+
import "../chunk-JSBRDJBE.js";
|
|
6
|
+
|
|
7
|
+
// src/lib/image-variant-plan.ts
|
|
8
|
+
function mediaIdentity(hash, fileName) {
|
|
9
|
+
const originalName = sanitizeMediaName(fileName);
|
|
10
|
+
return { id: hash, hash, originalName, folder: `${originalName}-${hash}` };
|
|
11
|
+
}
|
|
12
|
+
function imageVariantPath(folder, key) {
|
|
13
|
+
return `assets/images/${folder}/${key}.webp`;
|
|
14
|
+
}
|
|
15
|
+
function planImageVariants(input) {
|
|
16
|
+
const identity = mediaIdentity(input.hash, input.fileName);
|
|
17
|
+
const widths = input.media.sizes.filter((s) => s <= input.width).sort((a, b) => a - b);
|
|
18
|
+
if (widths.length === 0) widths.push(input.width);
|
|
19
|
+
return {
|
|
20
|
+
...identity,
|
|
21
|
+
width: input.width,
|
|
22
|
+
height: input.height,
|
|
23
|
+
quality: input.media.quality,
|
|
24
|
+
variants: widths.map((width) => ({ width, path: imageVariantPath(identity.folder, width) }))
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function imageManifestEntry(plan, rendered, size) {
|
|
28
|
+
const variants = plan.variants.map(({ width }) => {
|
|
29
|
+
const out = rendered.find((r) => r.width === width);
|
|
30
|
+
if (!out) throw new Error(`[image-variant-plan] no rendered variant for planned width ${width}`);
|
|
31
|
+
return { width, height: out.height, size: out.size };
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
id: plan.id,
|
|
35
|
+
hash: plan.hash,
|
|
36
|
+
kind: "image",
|
|
37
|
+
originalName: plan.originalName,
|
|
38
|
+
width: plan.width,
|
|
39
|
+
height: plan.height,
|
|
40
|
+
mimeType: "image/webp",
|
|
41
|
+
size,
|
|
42
|
+
folder: plan.folder,
|
|
43
|
+
variants,
|
|
44
|
+
alt: "",
|
|
45
|
+
storage: "github"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
imageManifestEntry,
|
|
50
|
+
imageVariantPath,
|
|
51
|
+
mediaIdentity,
|
|
52
|
+
planImageVariants
|
|
53
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-ops.d.ts","sourceRoot":"","sources":["../../src/lib/index-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAe,gBAAgB,EAA2B,KAAK,SAAS,EAAoB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index-ops.d.ts","sourceRoot":"","sources":["../../src/lib/index-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAe,gBAAgB,EAA2B,KAAK,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAalI;;;;;;;;;GASG;AAOH,QAAA,MAAM,cAAc;;;;EAAwC,CAAC;AAa7D,QAAA,MAAM,mBAAmB;;;;;;;;iBAIvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2ExB,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,OAAO,GACf;IAAE,EAAE,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,GACxF;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,GAC/E;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MA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@@ -1,24 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
|
-
addGroup,
|
|
3
2
|
addPage,
|
|
4
|
-
deleteGroup,
|
|
5
3
|
deletePage,
|
|
4
|
+
uniquePageSlug
|
|
5
|
+
} from "../chunk-VY3IFGE3.js";
|
|
6
|
+
import {
|
|
7
|
+
liftSidecars
|
|
8
|
+
} from "../chunk-DJABADOO.js";
|
|
9
|
+
import {
|
|
10
|
+
addGroup,
|
|
11
|
+
deleteGroup,
|
|
6
12
|
groupOfPage,
|
|
7
13
|
moveNavEntry,
|
|
8
14
|
navEntries,
|
|
9
15
|
reconcileNav,
|
|
10
16
|
renameGroup,
|
|
11
|
-
setGroupStartCollapsed
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
setGroupStartCollapsed
|
|
18
|
+
} from "../chunk-DJOGPSRU.js";
|
|
19
|
+
import "../chunk-4WQ36ZP7.js";
|
|
20
|
+
import "../chunk-GNF6KFQ7.js";
|
|
21
|
+
import {
|
|
22
|
+
slugifyPageSlug
|
|
23
|
+
} from "../chunk-S7QRHUWO.js";
|
|
15
24
|
import {
|
|
16
25
|
IndexSchema,
|
|
17
26
|
PageStatusSchema,
|
|
18
27
|
RESERVED_SLUGS,
|
|
19
28
|
SLUG_RE
|
|
20
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-67P34WNW.js";
|
|
21
30
|
import "../chunk-4TZJZU2T.js";
|
|
31
|
+
import "../chunk-4Y2JQQZL.js";
|
|
32
|
+
import "../chunk-APIJPTFG.js";
|
|
22
33
|
import "../chunk-AASEGXNT.js";
|
|
23
34
|
import "../chunk-JSBRDJBE.js";
|
|
24
35
|
|
|
@@ -152,19 +163,12 @@ function applyIndexOps(rawIndex, ops, newSectionTypes) {
|
|
|
152
163
|
error: "the site's current index could not be parsed, so indexOps cannot be applied \u2014 read it with get_site_index and post a repaired full `index` instead. " + base.error.issues.map((i) => i.message).join("; ")
|
|
153
164
|
};
|
|
154
165
|
}
|
|
155
|
-
const
|
|
166
|
+
const lifted = liftSidecars(rawIndex);
|
|
156
167
|
let index = {
|
|
157
168
|
...base.data,
|
|
158
169
|
pages: base.data.pages.map((p) => ({ ...p, order: [...p.order] })),
|
|
159
170
|
sections: Object.fromEntries(Object.entries(base.data.sections).map(([k, v]) => [k, { ...v }])),
|
|
160
|
-
|
|
161
|
-
// op that spliced in place would mutate the caller's index — the one thing
|
|
162
|
-
// this function's own comment promises it never does.
|
|
163
|
-
...Array.isArray(rawNav) ? {
|
|
164
|
-
nav: rawNav.map(
|
|
165
|
-
(entry) => entry && typeof entry === "object" && "pageIds" in entry ? { ...entry, pageIds: [...entry.pageIds] } : { ...entry }
|
|
166
|
-
)
|
|
167
|
-
} : {}
|
|
171
|
+
...lifted.nav ? { nav: lifted.nav.entries } : {}
|
|
168
172
|
};
|
|
169
173
|
const removed = /* @__PURE__ */ new Set();
|
|
170
174
|
const warnings = [];
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { resolveChatbotName, resolveThinkingPhrases, DEFAULT_CHATBOT_NAME } from
|
|
|
5
5
|
export { generateNavLinks, toSectionId, type NavItem } from "./nav";
|
|
6
6
|
export { navEntries, pagesInNavOrder, groupOfPage, groupDisplayLabel, reconcileNav } from "./nav-tree";
|
|
7
7
|
export { siteTags, tagDisplayLabel, reconcileTags } from "./tags";
|
|
8
|
+
export { NAV, TAGS, SIDECARS, readSidecar, readSidecarText, liftSidecars, planSidecarWrite, type SidecarDefinition, type SidecarFileState, type SidecarWritePlan, type SidecarRead, type SidecarDiagnostic, } from "./sidecars";
|
|
8
9
|
export { resolveReference, type ReferenceContent } from "./references";
|
|
9
10
|
export { REFERENCE_TYPE } from "./reference-type";
|
|
10
11
|
export { deriveContrast, contrastColor, relativeLuminance, contrastRatio, wcagLevel, suggestAccessibleOn, type WcagLevel, } from "./contrast";
|
|
@@ -16,5 +17,5 @@ export { formatTimestamp } from "./timestamp";
|
|
|
16
17
|
export { safeRedirect } from "./safe-redirect";
|
|
17
18
|
export { createEvent, editModeEvent, darkModeEvent, type TypedEvent } from "./events";
|
|
18
19
|
export { createRegistry, defineSection, registerSection, registerSchema, getSection, getSchema, getAllSections, getAllSchemas, clearRegistry, type SectionRegistry, type SectionDefinition, type SectionProps, type WrapperProps, type SettingsFieldDef, type SettingsSchema, type CustomSettingsFormProps, } from "./registry";
|
|
19
|
-
export { mergeSiteContent, loadStaticSiteContent, type LoadedSection, type SiteContent, } from "./loader";
|
|
20
|
+
export { mergeSiteContent, loadStaticSiteContent, type LoadedSection, type SiteContent, type SidecarReads, } from "./loader";
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
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,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvG,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,KAAK,SAA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K,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -15,46 +15,59 @@ import {
|
|
|
15
15
|
safeRedirect,
|
|
16
16
|
suggestAccessibleOn,
|
|
17
17
|
wcagLevel
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-O37AV27P.js";
|
|
19
|
+
import {
|
|
20
|
+
formatTimestamp
|
|
21
|
+
} from "../chunk-MM7KZS5C.js";
|
|
22
|
+
import {
|
|
23
|
+
generateNavLinks,
|
|
24
|
+
resolveReference,
|
|
25
|
+
toSectionId
|
|
26
|
+
} from "../chunk-WYOFQHKI.js";
|
|
27
|
+
import {
|
|
28
|
+
ensureSanitizer,
|
|
29
|
+
sanitizeHtml
|
|
30
|
+
} from "../chunk-QQ3S3P5P.js";
|
|
19
31
|
import {
|
|
20
32
|
curatedIcons,
|
|
21
33
|
getIcon
|
|
22
34
|
} from "../chunk-WDSVHKAH.js";
|
|
35
|
+
import "../chunk-L45X7DKX.js";
|
|
23
36
|
import {
|
|
24
37
|
createEvent,
|
|
25
38
|
darkModeEvent,
|
|
26
39
|
editModeEvent
|
|
27
40
|
} from "../chunk-XDEPXTBY.js";
|
|
28
|
-
import {
|
|
29
|
-
generateNavLinks,
|
|
30
|
-
resolveReference,
|
|
31
|
-
toSectionId
|
|
32
|
-
} from "../chunk-VUYCRBJK.js";
|
|
33
|
-
import "../chunk-L45X7DKX.js";
|
|
34
41
|
import "../chunk-FRVO75DK.js";
|
|
35
|
-
import {
|
|
36
|
-
formatTimestamp
|
|
37
|
-
} from "../chunk-MM7KZS5C.js";
|
|
38
|
-
import {
|
|
39
|
-
ensureSanitizer,
|
|
40
|
-
sanitizeHtml
|
|
41
|
-
} from "../chunk-QQ3S3P5P.js";
|
|
42
42
|
import {
|
|
43
43
|
cn
|
|
44
44
|
} from "../chunk-7EOSDFS3.js";
|
|
45
45
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
audiencePasses
|
|
47
|
+
} from "../chunk-VY3IFGE3.js";
|
|
48
|
+
import {
|
|
49
|
+
NAV,
|
|
50
|
+
SIDECARS,
|
|
51
|
+
TAGS,
|
|
52
|
+
liftSidecars,
|
|
53
|
+
planSidecarWrite,
|
|
54
|
+
readSidecar,
|
|
55
|
+
readSidecarText
|
|
56
|
+
} from "../chunk-DJABADOO.js";
|
|
50
57
|
import {
|
|
51
|
-
audiencePasses,
|
|
52
58
|
groupDisplayLabel,
|
|
53
59
|
groupOfPage,
|
|
54
60
|
navEntries,
|
|
55
61
|
pagesInNavOrder,
|
|
56
62
|
reconcileNav
|
|
57
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-DJOGPSRU.js";
|
|
64
|
+
import {
|
|
65
|
+
reconcileTags,
|
|
66
|
+
siteTags,
|
|
67
|
+
tagDisplayLabel
|
|
68
|
+
} from "../chunk-4WQ36ZP7.js";
|
|
69
|
+
import "../chunk-GNF6KFQ7.js";
|
|
70
|
+
import "../chunk-S7QRHUWO.js";
|
|
58
71
|
import {
|
|
59
72
|
REFERENCE_TYPE
|
|
60
73
|
} from "../chunk-5GFACGSN.js";
|
|
@@ -63,9 +76,10 @@ import {
|
|
|
63
76
|
env
|
|
64
77
|
} from "../chunk-BQ5TZZUE.js";
|
|
65
78
|
import "../chunk-DMCGN5AS.js";
|
|
66
|
-
import "../chunk-
|
|
67
|
-
import "../chunk-PTY2RG2K.js";
|
|
79
|
+
import "../chunk-67P34WNW.js";
|
|
68
80
|
import "../chunk-4TZJZU2T.js";
|
|
81
|
+
import "../chunk-4Y2JQQZL.js";
|
|
82
|
+
import "../chunk-APIJPTFG.js";
|
|
69
83
|
import {
|
|
70
84
|
clearRegistry,
|
|
71
85
|
createRegistry,
|
|
@@ -82,7 +96,10 @@ import "../chunk-NSCT3AMV.js";
|
|
|
82
96
|
import "../chunk-JSBRDJBE.js";
|
|
83
97
|
export {
|
|
84
98
|
DEFAULT_CHATBOT_NAME,
|
|
99
|
+
NAV,
|
|
85
100
|
REFERENCE_TYPE,
|
|
101
|
+
SIDECARS,
|
|
102
|
+
TAGS,
|
|
86
103
|
accentVarValue,
|
|
87
104
|
audiencePasses,
|
|
88
105
|
buildGoogleFontsUrl,
|
|
@@ -108,12 +125,16 @@ export {
|
|
|
108
125
|
getSection,
|
|
109
126
|
groupDisplayLabel,
|
|
110
127
|
groupOfPage,
|
|
128
|
+
liftSidecars,
|
|
111
129
|
loadStaticSiteContent,
|
|
112
130
|
mergeSiteContent,
|
|
113
131
|
navEntries,
|
|
114
132
|
onPrimaryVarValue,
|
|
115
133
|
pagesInNavOrder,
|
|
134
|
+
planSidecarWrite,
|
|
116
135
|
primaryVarValue,
|
|
136
|
+
readSidecar,
|
|
137
|
+
readSidecarText,
|
|
117
138
|
reconcileNav,
|
|
118
139
|
reconcileTags,
|
|
119
140
|
registerSchema,
|