@nuasite/cms-marker 0.0.80 → 0.0.82
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/types/html-processor.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/manifest-writer.d.ts.map +1 -1
- package/dist/types/seo-processor.d.ts +1 -1
- package/dist/types/seo-processor.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +221 -11
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/html-processor.ts +673 -4
- package/src/index.ts +11 -0
- package/src/manifest-writer.ts +15 -1
- package/src/seo-processor.ts +63 -178
- package/src/types.ts +232 -12
package/src/types.ts
CHANGED
|
@@ -139,6 +139,206 @@ export interface ColorClasses {
|
|
|
139
139
|
allColorClasses?: string[]
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/** Link attributes for anchor elements (for git diff tracking) */
|
|
143
|
+
export interface LinkAttributes {
|
|
144
|
+
/** The href attribute value */
|
|
145
|
+
href: string
|
|
146
|
+
/** Target attribute (e.g., '_blank', '_self') */
|
|
147
|
+
target?: string
|
|
148
|
+
/** Rel attribute (e.g., 'noopener noreferrer') */
|
|
149
|
+
rel?: string
|
|
150
|
+
/** Title attribute */
|
|
151
|
+
title?: string
|
|
152
|
+
/** Download attribute (triggers file download) */
|
|
153
|
+
download?: string | boolean
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Button attributes for button elements (for git diff tracking) */
|
|
157
|
+
export interface ButtonAttributes {
|
|
158
|
+
/** Button type (submit, reset, button) */
|
|
159
|
+
type?: string
|
|
160
|
+
/** Whether the button is disabled */
|
|
161
|
+
disabled?: boolean
|
|
162
|
+
/** Form ID the button belongs to */
|
|
163
|
+
form?: string
|
|
164
|
+
/** Form action URL override */
|
|
165
|
+
formAction?: string
|
|
166
|
+
/** Form method override */
|
|
167
|
+
formMethod?: string
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** Input attributes for form input elements (for git diff tracking) */
|
|
171
|
+
export interface InputAttributes {
|
|
172
|
+
/** Input type (text, email, password, checkbox, etc.) */
|
|
173
|
+
type?: string
|
|
174
|
+
/** Input name for form submission */
|
|
175
|
+
name?: string
|
|
176
|
+
/** Placeholder text */
|
|
177
|
+
placeholder?: string
|
|
178
|
+
/** Whether the input is required */
|
|
179
|
+
required?: boolean
|
|
180
|
+
/** Validation pattern (regex) */
|
|
181
|
+
pattern?: string
|
|
182
|
+
/** Mobile keyboard type (numeric, email, tel, etc.) */
|
|
183
|
+
inputMode?: string
|
|
184
|
+
/** Autocomplete hint (email, username, current-password, etc.) */
|
|
185
|
+
autoComplete?: string
|
|
186
|
+
/** Whether the input is disabled */
|
|
187
|
+
disabled?: boolean
|
|
188
|
+
/** Whether the input is readonly */
|
|
189
|
+
readOnly?: boolean
|
|
190
|
+
/** Minimum value (for number/date inputs) */
|
|
191
|
+
min?: string
|
|
192
|
+
/** Maximum value (for number/date inputs) */
|
|
193
|
+
max?: string
|
|
194
|
+
/** Step value (for number inputs) */
|
|
195
|
+
step?: string
|
|
196
|
+
/** Minimum length */
|
|
197
|
+
minLength?: number
|
|
198
|
+
/** Maximum length */
|
|
199
|
+
maxLength?: number
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Form attributes for form elements (for git diff tracking) */
|
|
203
|
+
export interface FormAttributes {
|
|
204
|
+
/** Form submission endpoint */
|
|
205
|
+
action?: string
|
|
206
|
+
/** HTTP method (GET, POST, etc.) */
|
|
207
|
+
method?: string
|
|
208
|
+
/** Encoding type (multipart/form-data, etc.) */
|
|
209
|
+
encType?: string
|
|
210
|
+
/** Whether to disable HTML5 validation */
|
|
211
|
+
noValidate?: boolean
|
|
212
|
+
/** Target for form submission (_blank, _self, etc.) */
|
|
213
|
+
target?: string
|
|
214
|
+
/** Form name */
|
|
215
|
+
name?: string
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** Media attributes for video/audio elements (for git diff tracking) */
|
|
219
|
+
export interface MediaAttributes {
|
|
220
|
+
/** Media source URL */
|
|
221
|
+
src?: string
|
|
222
|
+
/** Poster image URL (video only) */
|
|
223
|
+
poster?: string
|
|
224
|
+
/** Whether to show controls */
|
|
225
|
+
controls?: boolean
|
|
226
|
+
/** Whether to autoplay */
|
|
227
|
+
autoplay?: boolean
|
|
228
|
+
/** Whether to mute audio */
|
|
229
|
+
muted?: boolean
|
|
230
|
+
/** Whether to loop playback */
|
|
231
|
+
loop?: boolean
|
|
232
|
+
/** Whether to play inline on mobile */
|
|
233
|
+
playsInline?: boolean
|
|
234
|
+
/** Preload strategy (none, metadata, auto) */
|
|
235
|
+
preload?: string
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Iframe attributes for embedded content (for git diff tracking) */
|
|
239
|
+
export interface IframeAttributes {
|
|
240
|
+
/** Iframe source URL */
|
|
241
|
+
src?: string
|
|
242
|
+
/** Accessibility title */
|
|
243
|
+
title?: string
|
|
244
|
+
/** Permissions policy (camera, microphone, etc.) */
|
|
245
|
+
allow?: string
|
|
246
|
+
/** Sandbox restrictions */
|
|
247
|
+
sandbox?: string
|
|
248
|
+
/** Loading strategy (lazy, eager) */
|
|
249
|
+
loading?: string
|
|
250
|
+
/** Width */
|
|
251
|
+
width?: string
|
|
252
|
+
/** Height */
|
|
253
|
+
height?: string
|
|
254
|
+
/** Name attribute */
|
|
255
|
+
name?: string
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** Select attributes for dropdown elements (for git diff tracking) */
|
|
259
|
+
export interface SelectAttributes {
|
|
260
|
+
/** Select name for form submission */
|
|
261
|
+
name?: string
|
|
262
|
+
/** Whether multiple selection is allowed */
|
|
263
|
+
multiple?: boolean
|
|
264
|
+
/** Whether the select is required */
|
|
265
|
+
required?: boolean
|
|
266
|
+
/** Whether the select is disabled */
|
|
267
|
+
disabled?: boolean
|
|
268
|
+
/** Number of visible options */
|
|
269
|
+
size?: number
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Textarea attributes for multiline input (for git diff tracking) */
|
|
273
|
+
export interface TextareaAttributes {
|
|
274
|
+
/** Textarea name for form submission */
|
|
275
|
+
name?: string
|
|
276
|
+
/** Placeholder text */
|
|
277
|
+
placeholder?: string
|
|
278
|
+
/** Whether the textarea is required */
|
|
279
|
+
required?: boolean
|
|
280
|
+
/** Whether the textarea is disabled */
|
|
281
|
+
disabled?: boolean
|
|
282
|
+
/** Whether the textarea is readonly */
|
|
283
|
+
readOnly?: boolean
|
|
284
|
+
/** Number of visible rows */
|
|
285
|
+
rows?: number
|
|
286
|
+
/** Number of visible columns */
|
|
287
|
+
cols?: number
|
|
288
|
+
/** Minimum length */
|
|
289
|
+
minLength?: number
|
|
290
|
+
/** Maximum length */
|
|
291
|
+
maxLength?: number
|
|
292
|
+
/** Wrap behavior (soft, hard, off) */
|
|
293
|
+
wrap?: string
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** ARIA accessibility attributes (for git diff tracking) */
|
|
297
|
+
export interface AriaAttributes {
|
|
298
|
+
/** ARIA role (button, tab, navigation, dialog, etc.) */
|
|
299
|
+
role?: string
|
|
300
|
+
/** Screen reader label */
|
|
301
|
+
ariaLabel?: string
|
|
302
|
+
/** ID of element that labels this one */
|
|
303
|
+
ariaLabelledBy?: string
|
|
304
|
+
/** ID of element that describes this one */
|
|
305
|
+
ariaDescribedBy?: string
|
|
306
|
+
/** Whether hidden from assistive technology */
|
|
307
|
+
ariaHidden?: boolean
|
|
308
|
+
/** Expanded state for collapsibles */
|
|
309
|
+
ariaExpanded?: boolean
|
|
310
|
+
/** Pressed state for toggle buttons */
|
|
311
|
+
ariaPressed?: boolean | 'mixed'
|
|
312
|
+
/** Selected state for tabs/options */
|
|
313
|
+
ariaSelected?: boolean
|
|
314
|
+
/** Disabled state */
|
|
315
|
+
ariaDisabled?: boolean
|
|
316
|
+
/** Required state */
|
|
317
|
+
ariaRequired?: boolean
|
|
318
|
+
/** Invalid state */
|
|
319
|
+
ariaInvalid?: boolean | 'grammar' | 'spelling'
|
|
320
|
+
/** Live region announcement type */
|
|
321
|
+
ariaLive?: 'polite' | 'assertive' | 'off'
|
|
322
|
+
/** Atomic update for live regions */
|
|
323
|
+
ariaAtomic?: boolean
|
|
324
|
+
/** Busy state */
|
|
325
|
+
ariaBusy?: boolean
|
|
326
|
+
/** Current state (page, step, location, date, time, true, false) */
|
|
327
|
+
ariaCurrent?: string
|
|
328
|
+
/** Controls relationship */
|
|
329
|
+
ariaControls?: string
|
|
330
|
+
/** Owns relationship */
|
|
331
|
+
ariaOwns?: string
|
|
332
|
+
/** Haspopup type */
|
|
333
|
+
ariaHasPopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** Custom data-* attributes (for git diff tracking) */
|
|
337
|
+
export interface DataAttributes {
|
|
338
|
+
/** All data-* attributes as key-value pairs (without 'data-' prefix) */
|
|
339
|
+
[key: string]: string | undefined
|
|
340
|
+
}
|
|
341
|
+
|
|
142
342
|
/** Available colors palette from Tailwind config */
|
|
143
343
|
export interface AvailableColors {
|
|
144
344
|
/** All available colors with their shades */
|
|
@@ -206,6 +406,26 @@ export interface ManifestEntry {
|
|
|
206
406
|
constraints?: ContentConstraints
|
|
207
407
|
/** Color classes applied to this element (for buttons, etc.) */
|
|
208
408
|
colorClasses?: ColorClasses
|
|
409
|
+
/** Link attributes for anchor elements (href, target, rel, title) */
|
|
410
|
+
linkAttributes?: LinkAttributes
|
|
411
|
+
/** Button attributes (type, disabled, form, etc.) */
|
|
412
|
+
buttonAttributes?: ButtonAttributes
|
|
413
|
+
/** Input attributes (type, name, placeholder, required, etc.) */
|
|
414
|
+
inputAttributes?: InputAttributes
|
|
415
|
+
/** Form attributes (action, method, enctype, etc.) */
|
|
416
|
+
formAttributes?: FormAttributes
|
|
417
|
+
/** Media attributes for video/audio (src, controls, autoplay, etc.) */
|
|
418
|
+
mediaAttributes?: MediaAttributes
|
|
419
|
+
/** Iframe attributes (src, title, allow, sandbox, etc.) */
|
|
420
|
+
iframeAttributes?: IframeAttributes
|
|
421
|
+
/** Select attributes (name, multiple, required, etc.) */
|
|
422
|
+
selectAttributes?: SelectAttributes
|
|
423
|
+
/** Textarea attributes (name, placeholder, rows, cols, etc.) */
|
|
424
|
+
textareaAttributes?: TextareaAttributes
|
|
425
|
+
/** ARIA accessibility attributes (role, aria-label, etc.) */
|
|
426
|
+
ariaAttributes?: AriaAttributes
|
|
427
|
+
/** Custom data-* attributes */
|
|
428
|
+
dataAttributes?: DataAttributes
|
|
209
429
|
}
|
|
210
430
|
|
|
211
431
|
export interface ComponentInstance {
|
|
@@ -305,6 +525,14 @@ export interface ManifestMetadata {
|
|
|
305
525
|
sourceFileHashes?: Record<string, string>
|
|
306
526
|
}
|
|
307
527
|
|
|
528
|
+
/** Page entry for the global manifest */
|
|
529
|
+
export interface PageEntry {
|
|
530
|
+
/** Page URL pathname (e.g., '/', '/about') */
|
|
531
|
+
pathname: string
|
|
532
|
+
/** Page title from SEO data */
|
|
533
|
+
title?: string
|
|
534
|
+
}
|
|
535
|
+
|
|
308
536
|
export interface CmsManifest {
|
|
309
537
|
/** Manifest metadata for versioning and conflict detection */
|
|
310
538
|
metadata?: ManifestMetadata
|
|
@@ -319,12 +547,16 @@ export interface CmsManifest {
|
|
|
319
547
|
availableColors?: AvailableColors
|
|
320
548
|
/** Available text styles from the project's Tailwind config */
|
|
321
549
|
availableTextStyles?: AvailableTextStyles
|
|
550
|
+
/** All pages in the site with pathname and title */
|
|
551
|
+
pages?: PageEntry[]
|
|
322
552
|
}
|
|
323
553
|
|
|
324
554
|
// === SEO Types ===
|
|
325
555
|
|
|
326
556
|
/** Source tracking information for SEO elements */
|
|
327
557
|
export interface SeoSourceInfo {
|
|
558
|
+
/** CMS ID if element was marked for editing */
|
|
559
|
+
id?: string
|
|
328
560
|
/** Path to source file */
|
|
329
561
|
sourcePath: string
|
|
330
562
|
/** Line number in source file (1-indexed) */
|
|
@@ -380,8 +612,6 @@ export interface CanonicalUrl extends SeoSourceInfo {
|
|
|
380
612
|
export interface SeoTitle extends SeoSourceInfo {
|
|
381
613
|
/** Title text content */
|
|
382
614
|
content: string
|
|
383
|
-
/** CMS ID if title was marked for editing */
|
|
384
|
-
cmsId?: string
|
|
385
615
|
}
|
|
386
616
|
|
|
387
617
|
/** Meta keywords with parsed array */
|
|
@@ -392,14 +622,6 @@ export interface SeoKeywords extends SeoSourceInfo {
|
|
|
392
622
|
keywords: string[]
|
|
393
623
|
}
|
|
394
624
|
|
|
395
|
-
/** Robots meta directive */
|
|
396
|
-
export interface RobotsDirective extends SeoSourceInfo {
|
|
397
|
-
/** Raw content value */
|
|
398
|
-
content: string
|
|
399
|
-
/** Parsed individual directives (e.g., ['noindex', 'nofollow']) */
|
|
400
|
-
directives: string[]
|
|
401
|
-
}
|
|
402
|
-
|
|
403
625
|
/** Complete SEO data for a page */
|
|
404
626
|
export interface PageSeoData {
|
|
405
627
|
/** Page title */
|
|
@@ -410,8 +632,6 @@ export interface PageSeoData {
|
|
|
410
632
|
keywords?: SeoKeywords
|
|
411
633
|
/** Canonical URL */
|
|
412
634
|
canonical?: CanonicalUrl
|
|
413
|
-
/** Robots meta directive */
|
|
414
|
-
robots?: RobotsDirective
|
|
415
635
|
/** Open Graph metadata */
|
|
416
636
|
openGraph?: OpenGraphData
|
|
417
637
|
/** Twitter Card metadata */
|