@nuasite/cms 0.1.0
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/README.md +237 -0
- package/dist/src/build-processor.d.ts +20 -0
- package/dist/src/build-processor.d.ts.map +1 -0
- package/dist/src/collection-scanner.d.ts +6 -0
- package/dist/src/collection-scanner.d.ts.map +1 -0
- package/dist/src/component-registry.d.ts +63 -0
- package/dist/src/component-registry.d.ts.map +1 -0
- package/dist/src/config.d.ts +24 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/dev-middleware.d.ts +20 -0
- package/dist/src/dev-middleware.d.ts.map +1 -0
- package/dist/src/editor/ai.d.ts +60 -0
- package/dist/src/editor/ai.d.ts.map +1 -0
- package/dist/src/editor/api.d.ts +140 -0
- package/dist/src/editor/api.d.ts.map +1 -0
- package/dist/src/editor/color-utils.d.ts +106 -0
- package/dist/src/editor/color-utils.d.ts.map +1 -0
- package/dist/src/editor/components/ai-chat.d.ts +11 -0
- package/dist/src/editor/components/ai-chat.d.ts.map +1 -0
- package/dist/src/editor/components/ai-tooltip.d.ts +12 -0
- package/dist/src/editor/components/ai-tooltip.d.ts.map +1 -0
- package/dist/src/editor/components/attribute-editor.d.ts +5 -0
- package/dist/src/editor/components/attribute-editor.d.ts.map +1 -0
- package/dist/src/editor/components/block-editor.d.ts +12 -0
- package/dist/src/editor/components/block-editor.d.ts.map +1 -0
- package/dist/src/editor/components/collections-browser.d.ts +2 -0
- package/dist/src/editor/components/collections-browser.d.ts.map +1 -0
- package/dist/src/editor/components/color-toolbar.d.ts +12 -0
- package/dist/src/editor/components/color-toolbar.d.ts.map +1 -0
- package/dist/src/editor/components/confirm-dialog.d.ts +2 -0
- package/dist/src/editor/components/confirm-dialog.d.ts.map +1 -0
- package/dist/src/editor/components/create-page-modal.d.ts +2 -0
- package/dist/src/editor/components/create-page-modal.d.ts.map +1 -0
- package/dist/src/editor/components/editable-highlights.d.ts +9 -0
- package/dist/src/editor/components/editable-highlights.d.ts.map +1 -0
- package/dist/src/editor/components/error-boundary.d.ts +32 -0
- package/dist/src/editor/components/error-boundary.d.ts.map +1 -0
- package/dist/src/editor/components/fields.d.ts +75 -0
- package/dist/src/editor/components/fields.d.ts.map +1 -0
- package/dist/src/editor/components/frontmatter-fields.d.ts +29 -0
- package/dist/src/editor/components/frontmatter-fields.d.ts.map +1 -0
- package/dist/src/editor/components/highlight-overlay.d.ts +64 -0
- package/dist/src/editor/components/highlight-overlay.d.ts.map +1 -0
- package/dist/src/editor/components/image-overlay.d.ts +12 -0
- package/dist/src/editor/components/image-overlay.d.ts.map +1 -0
- package/dist/src/editor/components/markdown-editor-overlay.d.ts +6 -0
- package/dist/src/editor/components/markdown-editor-overlay.d.ts.map +1 -0
- package/dist/src/editor/components/markdown-inline-editor.d.ts +10 -0
- package/dist/src/editor/components/markdown-inline-editor.d.ts.map +1 -0
- package/dist/src/editor/components/media-library.d.ts +2 -0
- package/dist/src/editor/components/media-library.d.ts.map +1 -0
- package/dist/src/editor/components/outline.d.ts +21 -0
- package/dist/src/editor/components/outline.d.ts.map +1 -0
- package/dist/src/editor/components/redirect-countdown.d.ts +2 -0
- package/dist/src/editor/components/redirect-countdown.d.ts.map +1 -0
- package/dist/src/editor/components/seo-editor.d.ts +2 -0
- package/dist/src/editor/components/seo-editor.d.ts.map +1 -0
- package/dist/src/editor/components/text-style-toolbar.d.ts +8 -0
- package/dist/src/editor/components/text-style-toolbar.d.ts.map +1 -0
- package/dist/src/editor/components/toast/toast-container.d.ts +7 -0
- package/dist/src/editor/components/toast/toast-container.d.ts.map +1 -0
- package/dist/src/editor/components/toast/toast.d.ts +7 -0
- package/dist/src/editor/components/toast/toast.d.ts.map +1 -0
- package/dist/src/editor/components/toast/types.d.ts +7 -0
- package/dist/src/editor/components/toast/types.d.ts.map +1 -0
- package/dist/src/editor/components/toolbar.d.ts +21 -0
- package/dist/src/editor/components/toolbar.d.ts.map +1 -0
- package/dist/src/editor/config.d.ts +4 -0
- package/dist/src/editor/config.d.ts.map +1 -0
- package/dist/src/editor/constants.d.ts +101 -0
- package/dist/src/editor/constants.d.ts.map +1 -0
- package/dist/src/editor/context.d.ts +14 -0
- package/dist/src/editor/context.d.ts.map +1 -0
- package/dist/src/editor/dom.d.ts +77 -0
- package/dist/src/editor/dom.d.ts.map +1 -0
- package/dist/src/editor/editor.d.ts +64 -0
- package/dist/src/editor/editor.d.ts.map +1 -0
- package/dist/src/editor/history.d.ts +20 -0
- package/dist/src/editor/history.d.ts.map +1 -0
- package/dist/src/editor/hooks/index.d.ts +14 -0
- package/dist/src/editor/hooks/index.d.ts.map +1 -0
- package/dist/src/editor/hooks/useAIHandlers.d.ts +22 -0
- package/dist/src/editor/hooks/useAIHandlers.d.ts.map +1 -0
- package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts +18 -0
- package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts.map +1 -0
- package/dist/src/editor/hooks/useElementDetection.d.ts +26 -0
- package/dist/src/editor/hooks/useElementDetection.d.ts.map +1 -0
- package/dist/src/editor/hooks/useImageHoverDetection.d.ts +12 -0
- package/dist/src/editor/hooks/useImageHoverDetection.d.ts.map +1 -0
- package/dist/src/editor/hooks/useTextSelection.d.ts +23 -0
- package/dist/src/editor/hooks/useTextSelection.d.ts.map +1 -0
- package/dist/src/editor/hooks/useTooltipState.d.ts +19 -0
- package/dist/src/editor/hooks/useTooltipState.d.ts.map +1 -0
- package/dist/src/editor/hooks/utils.d.ts +32 -0
- package/dist/src/editor/hooks/utils.d.ts.map +1 -0
- package/dist/src/editor/index.d.ts +12 -0
- package/dist/src/editor/index.d.ts.map +1 -0
- package/dist/src/editor/lib/cn.d.ts +3 -0
- package/dist/src/editor/lib/cn.d.ts.map +1 -0
- package/dist/src/editor/manifest.d.ts +19 -0
- package/dist/src/editor/manifest.d.ts.map +1 -0
- package/dist/src/editor/markdown-api.d.ts +36 -0
- package/dist/src/editor/markdown-api.d.ts.map +1 -0
- package/dist/src/editor/signals.d.ts +242 -0
- package/dist/src/editor/signals.d.ts.map +1 -0
- package/dist/src/editor/storage.d.ts +27 -0
- package/dist/src/editor/storage.d.ts.map +1 -0
- package/dist/src/editor/text-styling.d.ts +350 -0
- package/dist/src/editor/text-styling.d.ts.map +1 -0
- package/dist/src/editor/themes.d.ts +38 -0
- package/dist/src/editor/themes.d.ts.map +1 -0
- package/dist/src/editor/types.d.ts +454 -0
- package/dist/src/editor/types.d.ts.map +1 -0
- package/dist/src/error-collector.d.ts +56 -0
- package/dist/src/error-collector.d.ts.map +1 -0
- package/dist/src/handlers/component-ops.d.ts +34 -0
- package/dist/src/handlers/component-ops.d.ts.map +1 -0
- package/dist/src/handlers/markdown-ops.d.ts +41 -0
- package/dist/src/handlers/markdown-ops.d.ts.map +1 -0
- package/dist/src/handlers/request-utils.d.ts +20 -0
- package/dist/src/handlers/request-utils.d.ts.map +1 -0
- package/dist/src/handlers/source-writer.d.ts +51 -0
- package/dist/src/handlers/source-writer.d.ts.map +1 -0
- package/dist/src/html-processor.d.ts +63 -0
- package/dist/src/html-processor.d.ts.map +1 -0
- package/dist/src/index.d.ts +41 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/manifest-writer.d.ts +111 -0
- package/dist/src/manifest-writer.d.ts.map +1 -0
- package/dist/src/media/contember.d.ts +15 -0
- package/dist/src/media/contember.d.ts.map +1 -0
- package/dist/src/media/local.d.ts +9 -0
- package/dist/src/media/local.d.ts.map +1 -0
- package/dist/src/media/s3.d.ts +12 -0
- package/dist/src/media/s3.d.ts.map +1 -0
- package/dist/src/media/types.d.ts +40 -0
- package/dist/src/media/types.d.ts.map +1 -0
- package/dist/src/preview-generator.d.ts +19 -0
- package/dist/src/preview-generator.d.ts.map +1 -0
- package/dist/src/seo-processor.d.ts +23 -0
- package/dist/src/seo-processor.d.ts.map +1 -0
- package/dist/src/source-finder/ast-extractors.d.ts +35 -0
- package/dist/src/source-finder/ast-extractors.d.ts.map +1 -0
- package/dist/src/source-finder/ast-parser.d.ts +16 -0
- package/dist/src/source-finder/ast-parser.d.ts.map +1 -0
- package/dist/src/source-finder/cache.d.ts +18 -0
- package/dist/src/source-finder/cache.d.ts.map +1 -0
- package/dist/src/source-finder/collection-finder.d.ts +29 -0
- package/dist/src/source-finder/collection-finder.d.ts.map +1 -0
- package/dist/src/source-finder/cross-file-tracker.d.ts +39 -0
- package/dist/src/source-finder/cross-file-tracker.d.ts.map +1 -0
- package/dist/src/source-finder/element-finder.d.ts +42 -0
- package/dist/src/source-finder/element-finder.d.ts.map +1 -0
- package/dist/src/source-finder/image-finder.d.ts +24 -0
- package/dist/src/source-finder/image-finder.d.ts.map +1 -0
- package/dist/src/source-finder/index.d.ts +9 -0
- package/dist/src/source-finder/index.d.ts.map +1 -0
- package/dist/src/source-finder/search-index.d.ts +27 -0
- package/dist/src/source-finder/search-index.d.ts.map +1 -0
- package/dist/src/source-finder/snippet-utils.d.ts +90 -0
- package/dist/src/source-finder/snippet-utils.d.ts.map +1 -0
- package/dist/src/source-finder/source-lookup.d.ts +16 -0
- package/dist/src/source-finder/source-lookup.d.ts.map +1 -0
- package/dist/src/source-finder/types.d.ts +167 -0
- package/dist/src/source-finder/types.d.ts.map +1 -0
- package/dist/src/source-finder/variable-extraction.d.ts +37 -0
- package/dist/src/source-finder/variable-extraction.d.ts.map +1 -0
- package/dist/src/tailwind-colors.d.ts +54 -0
- package/dist/src/tailwind-colors.d.ts.map +1 -0
- package/dist/src/tsconfig.tsbuildinfo +1 -0
- package/dist/src/types.d.ts +367 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils.d.ts +61 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/vite-plugin.d.ts +14 -0
- package/dist/src/vite-plugin.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +80 -0
- package/src/build-processor.ts +784 -0
- package/src/collection-scanner.ts +304 -0
- package/src/component-registry.ts +393 -0
- package/src/config.ts +74 -0
- package/src/dev-middleware.ts +525 -0
- package/src/dist/src/tsconfig.tsbuildinfo +1 -0
- package/src/editor/ai.ts +185 -0
- package/src/editor/api.ts +513 -0
- package/src/editor/color-utils.ts +556 -0
- package/src/editor/components/ai-chat.tsx +632 -0
- package/src/editor/components/ai-tooltip.tsx +179 -0
- package/src/editor/components/attribute-editor.tsx +596 -0
- package/src/editor/components/block-editor.tsx +546 -0
- package/src/editor/components/collections-browser.tsx +248 -0
- package/src/editor/components/color-toolbar.tsx +314 -0
- package/src/editor/components/confirm-dialog.tsx +69 -0
- package/src/editor/components/create-page-modal.tsx +163 -0
- package/src/editor/components/editable-highlights.tsx +260 -0
- package/src/editor/components/error-boundary.tsx +87 -0
- package/src/editor/components/fields.tsx +387 -0
- package/src/editor/components/frontmatter-fields.tsx +469 -0
- package/src/editor/components/highlight-overlay.ts +229 -0
- package/src/editor/components/image-overlay.tsx +230 -0
- package/src/editor/components/markdown-editor-overlay.tsx +505 -0
- package/src/editor/components/markdown-inline-editor.tsx +780 -0
- package/src/editor/components/media-library.tsx +297 -0
- package/src/editor/components/outline.tsx +402 -0
- package/src/editor/components/redirect-countdown.tsx +45 -0
- package/src/editor/components/seo-editor.tsx +498 -0
- package/src/editor/components/text-style-toolbar.tsx +362 -0
- package/src/editor/components/toast/toast-container.tsx +15 -0
- package/src/editor/components/toast/toast.tsx +49 -0
- package/src/editor/components/toast/types.ts +7 -0
- package/src/editor/components/toolbar.tsx +366 -0
- package/src/editor/config.ts +12 -0
- package/src/editor/constants.ts +106 -0
- package/src/editor/context.tsx +38 -0
- package/src/editor/dom.ts +357 -0
- package/src/editor/editor.ts +1510 -0
- package/src/editor/env.d.ts +4 -0
- package/src/editor/history.ts +355 -0
- package/src/editor/hooks/index.ts +19 -0
- package/src/editor/hooks/useAIHandlers.ts +345 -0
- package/src/editor/hooks/useBlockEditorHandlers.ts +206 -0
- package/src/editor/hooks/useElementDetection.ts +284 -0
- package/src/editor/hooks/useImageHoverDetection.ts +102 -0
- package/src/editor/hooks/useTextSelection.ts +187 -0
- package/src/editor/hooks/useTooltipState.ts +126 -0
- package/src/editor/hooks/utils.ts +101 -0
- package/src/editor/index.tsx +481 -0
- package/src/editor/lib/cn.ts +4 -0
- package/src/editor/manifest.ts +25 -0
- package/src/editor/markdown-api.ts +209 -0
- package/src/editor/signals.ts +1351 -0
- package/src/editor/storage.ts +266 -0
- package/src/editor/styles.css +465 -0
- package/src/editor/text-styling.ts +773 -0
- package/src/editor/themes.ts +210 -0
- package/src/editor/types.ts +591 -0
- package/src/error-collector.ts +106 -0
- package/src/handlers/component-ops.ts +463 -0
- package/src/handlers/markdown-ops.ts +202 -0
- package/src/handlers/request-utils.ts +151 -0
- package/src/handlers/source-writer.ts +649 -0
- package/src/html-processor.ts +1108 -0
- package/src/index.ts +284 -0
- package/src/manifest-writer.ts +371 -0
- package/src/media/contember.ts +84 -0
- package/src/media/local.ts +114 -0
- package/src/media/s3.ts +133 -0
- package/src/media/types.ts +33 -0
- package/src/preview-generator.ts +293 -0
- package/src/seo-processor.ts +567 -0
- package/src/source-finder/ast-extractors.ts +185 -0
- package/src/source-finder/ast-parser.ts +150 -0
- package/src/source-finder/cache.ts +76 -0
- package/src/source-finder/collection-finder.ts +335 -0
- package/src/source-finder/cross-file-tracker.ts +741 -0
- package/src/source-finder/element-finder.ts +387 -0
- package/src/source-finder/image-finder.ts +283 -0
- package/src/source-finder/index.ts +37 -0
- package/src/source-finder/search-index.ts +525 -0
- package/src/source-finder/snippet-utils.ts +668 -0
- package/src/source-finder/source-lookup.ts +200 -0
- package/src/source-finder/types.ts +210 -0
- package/src/source-finder/variable-extraction.ts +406 -0
- package/src/tailwind-colors.ts +874 -0
- package/src/tsconfig.json +25 -0
- package/src/types.ts +406 -0
- package/src/utils.ts +186 -0
- package/src/vite-plugin.ts +42 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text styling utilities for applying Tailwind classes to text selections.
|
|
3
|
+
* Supports inline styling of partial text content within CMS elements.
|
|
4
|
+
* Uses inline styles for immediate visual feedback.
|
|
5
|
+
* CSS values can be overridden by AvailableTextStyles from the manifest.
|
|
6
|
+
*/
|
|
7
|
+
import type { AvailableTextStyles } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Tailwind text style categories with their class mappings and CSS values.
|
|
10
|
+
* These are fallback defaults when manifest styles are not available.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TAILWIND_STYLES: {
|
|
13
|
+
readonly weight: {
|
|
14
|
+
readonly normal: {
|
|
15
|
+
readonly class: "font-normal";
|
|
16
|
+
readonly label: "Normal";
|
|
17
|
+
readonly css: {
|
|
18
|
+
readonly fontWeight: "400";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly medium: {
|
|
22
|
+
readonly class: "font-medium";
|
|
23
|
+
readonly label: "Medium";
|
|
24
|
+
readonly css: {
|
|
25
|
+
readonly fontWeight: "500";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly semibold: {
|
|
29
|
+
readonly class: "font-semibold";
|
|
30
|
+
readonly label: "Semibold";
|
|
31
|
+
readonly css: {
|
|
32
|
+
readonly fontWeight: "600";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly bold: {
|
|
36
|
+
readonly class: "font-bold";
|
|
37
|
+
readonly label: "Bold";
|
|
38
|
+
readonly css: {
|
|
39
|
+
readonly fontWeight: "700";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly decoration: {
|
|
44
|
+
readonly none: {
|
|
45
|
+
readonly class: "no-underline";
|
|
46
|
+
readonly label: "None";
|
|
47
|
+
readonly css: {
|
|
48
|
+
readonly textDecoration: "none";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly underline: {
|
|
52
|
+
readonly class: "underline";
|
|
53
|
+
readonly label: "Underline";
|
|
54
|
+
readonly css: {
|
|
55
|
+
readonly textDecoration: "underline";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly lineThrough: {
|
|
59
|
+
readonly class: "line-through";
|
|
60
|
+
readonly label: "Strikethrough";
|
|
61
|
+
readonly css: {
|
|
62
|
+
readonly textDecoration: "line-through";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly style: {
|
|
67
|
+
readonly normal: {
|
|
68
|
+
readonly class: "not-italic";
|
|
69
|
+
readonly label: "Normal";
|
|
70
|
+
readonly css: {
|
|
71
|
+
readonly fontStyle: "normal";
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly italic: {
|
|
75
|
+
readonly class: "italic";
|
|
76
|
+
readonly label: "Italic";
|
|
77
|
+
readonly css: {
|
|
78
|
+
readonly fontStyle: "italic";
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly color: {
|
|
83
|
+
readonly inherit: {
|
|
84
|
+
readonly class: "text-inherit";
|
|
85
|
+
readonly label: "Inherit";
|
|
86
|
+
readonly css: {
|
|
87
|
+
readonly color: "inherit";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly slate: {
|
|
91
|
+
readonly class: "text-slate-700";
|
|
92
|
+
readonly label: "Slate";
|
|
93
|
+
readonly css: {
|
|
94
|
+
readonly color: "#334155";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly gray: {
|
|
98
|
+
readonly class: "text-gray-700";
|
|
99
|
+
readonly label: "Gray";
|
|
100
|
+
readonly css: {
|
|
101
|
+
readonly color: "#374151";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly red: {
|
|
105
|
+
readonly class: "text-red-600";
|
|
106
|
+
readonly label: "Red";
|
|
107
|
+
readonly css: {
|
|
108
|
+
readonly color: "#dc2626";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly orange: {
|
|
112
|
+
readonly class: "text-orange-600";
|
|
113
|
+
readonly label: "Orange";
|
|
114
|
+
readonly css: {
|
|
115
|
+
readonly color: "#ea580c";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly amber: {
|
|
119
|
+
readonly class: "text-amber-600";
|
|
120
|
+
readonly label: "Amber";
|
|
121
|
+
readonly css: {
|
|
122
|
+
readonly color: "#d97706";
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
readonly green: {
|
|
126
|
+
readonly class: "text-green-600";
|
|
127
|
+
readonly label: "Green";
|
|
128
|
+
readonly css: {
|
|
129
|
+
readonly color: "#16a34a";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly blue: {
|
|
133
|
+
readonly class: "text-blue-600";
|
|
134
|
+
readonly label: "Blue";
|
|
135
|
+
readonly css: {
|
|
136
|
+
readonly color: "#2563eb";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
readonly purple: {
|
|
140
|
+
readonly class: "text-purple-600";
|
|
141
|
+
readonly label: "Purple";
|
|
142
|
+
readonly css: {
|
|
143
|
+
readonly color: "#9333ea";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
readonly highlight: {
|
|
148
|
+
readonly none: {
|
|
149
|
+
readonly class: "";
|
|
150
|
+
readonly label: "None";
|
|
151
|
+
readonly css: {
|
|
152
|
+
readonly backgroundColor: "transparent";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly yellow: {
|
|
156
|
+
readonly class: "bg-yellow-200";
|
|
157
|
+
readonly label: "Yellow";
|
|
158
|
+
readonly css: {
|
|
159
|
+
readonly backgroundColor: "#fef08a";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly green: {
|
|
163
|
+
readonly class: "bg-green-200";
|
|
164
|
+
readonly label: "Green";
|
|
165
|
+
readonly css: {
|
|
166
|
+
readonly backgroundColor: "#bbf7d0";
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly blue: {
|
|
170
|
+
readonly class: "bg-blue-200";
|
|
171
|
+
readonly label: "Blue";
|
|
172
|
+
readonly css: {
|
|
173
|
+
readonly backgroundColor: "#bfdbfe";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly pink: {
|
|
177
|
+
readonly class: "bg-pink-200";
|
|
178
|
+
readonly label: "Pink";
|
|
179
|
+
readonly css: {
|
|
180
|
+
readonly backgroundColor: "#fbcfe8";
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
readonly size: {
|
|
185
|
+
readonly xs: {
|
|
186
|
+
readonly class: "text-xs";
|
|
187
|
+
readonly label: "XS";
|
|
188
|
+
readonly css: {
|
|
189
|
+
readonly fontSize: "0.75rem";
|
|
190
|
+
readonly lineHeight: "1rem";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly sm: {
|
|
194
|
+
readonly class: "text-sm";
|
|
195
|
+
readonly label: "SM";
|
|
196
|
+
readonly css: {
|
|
197
|
+
readonly fontSize: "0.875rem";
|
|
198
|
+
readonly lineHeight: "1.25rem";
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly base: {
|
|
202
|
+
readonly class: "text-base";
|
|
203
|
+
readonly label: "Base";
|
|
204
|
+
readonly css: {
|
|
205
|
+
readonly fontSize: "1rem";
|
|
206
|
+
readonly lineHeight: "1.5rem";
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
readonly lg: {
|
|
210
|
+
readonly class: "text-lg";
|
|
211
|
+
readonly label: "LG";
|
|
212
|
+
readonly css: {
|
|
213
|
+
readonly fontSize: "1.125rem";
|
|
214
|
+
readonly lineHeight: "1.75rem";
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
readonly xl: {
|
|
218
|
+
readonly class: "text-xl";
|
|
219
|
+
readonly label: "XL";
|
|
220
|
+
readonly css: {
|
|
221
|
+
readonly fontSize: "1.25rem";
|
|
222
|
+
readonly lineHeight: "1.75rem";
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
readonly '2xl': {
|
|
226
|
+
readonly class: "text-2xl";
|
|
227
|
+
readonly label: "2XL";
|
|
228
|
+
readonly css: {
|
|
229
|
+
readonly fontSize: "1.5rem";
|
|
230
|
+
readonly lineHeight: "2rem";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
export type StyleCategory = keyof typeof TAILWIND_STYLES;
|
|
236
|
+
export type StyleValue<C extends StyleCategory> = keyof (typeof TAILWIND_STYLES)[C];
|
|
237
|
+
export interface TextStyle {
|
|
238
|
+
weight?: StyleValue<'weight'>;
|
|
239
|
+
decoration?: StyleValue<'decoration'>;
|
|
240
|
+
style?: StyleValue<'style'>;
|
|
241
|
+
color?: StyleValue<'color'>;
|
|
242
|
+
highlight?: StyleValue<'highlight'>;
|
|
243
|
+
size?: StyleValue<'size'>;
|
|
244
|
+
}
|
|
245
|
+
export interface TextSelection {
|
|
246
|
+
startOffset: number;
|
|
247
|
+
endOffset: number;
|
|
248
|
+
text: string;
|
|
249
|
+
range: Range;
|
|
250
|
+
anchorNode: Node;
|
|
251
|
+
focusNode: Node;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get the current text selection within a CMS element
|
|
255
|
+
*/
|
|
256
|
+
export declare function getTextSelection(cmsElement: HTMLElement): TextSelection | null;
|
|
257
|
+
/**
|
|
258
|
+
* Build the class string from a TextStyle object
|
|
259
|
+
*/
|
|
260
|
+
export declare function buildStyleClasses(style: TextStyle): string;
|
|
261
|
+
/**
|
|
262
|
+
* Build inline CSS styles from a TextStyle object.
|
|
263
|
+
* Uses manifest styles when available, falls back to hardcoded defaults.
|
|
264
|
+
*/
|
|
265
|
+
export declare function buildInlineStyles(style: TextStyle, availableTextStyles?: AvailableTextStyles): Record<string, string>;
|
|
266
|
+
/**
|
|
267
|
+
* Set the available text styles from manifest.
|
|
268
|
+
* Call this when manifest is loaded.
|
|
269
|
+
*/
|
|
270
|
+
export declare function setAvailableTextStyles(styles: AvailableTextStyles | undefined): void;
|
|
271
|
+
/**
|
|
272
|
+
* Parse Tailwind classes from a class string back to TextStyle.
|
|
273
|
+
* Uses O(n) lookup via pre-computed map instead of O(n*m) nested loops.
|
|
274
|
+
*/
|
|
275
|
+
export declare function parseStyleClasses(classString: string): TextStyle;
|
|
276
|
+
/**
|
|
277
|
+
* Separate styling classes from non-styling classes
|
|
278
|
+
*/
|
|
279
|
+
export declare function separateClasses(classString: string): {
|
|
280
|
+
styleClasses: string[];
|
|
281
|
+
otherClasses: string[];
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Check if an element is a styled span created by the CMS
|
|
285
|
+
*/
|
|
286
|
+
export declare function isStyledSpan(element: Element | null): element is HTMLElement;
|
|
287
|
+
/**
|
|
288
|
+
* Get the styled span element if the selection is entirely within one.
|
|
289
|
+
* Returns null if selection spans multiple elements or is not in a styled span.
|
|
290
|
+
*/
|
|
291
|
+
export declare function getStyledSpanFromSelection(cmsElement: HTMLElement): HTMLElement | null;
|
|
292
|
+
/**
|
|
293
|
+
* Remove styling from a styled span element, keeping only the text content.
|
|
294
|
+
* Used to "unstyle" previously styled text.
|
|
295
|
+
*/
|
|
296
|
+
export declare function removeStyleFromElement(styledSpan: HTMLElement): void;
|
|
297
|
+
/**
|
|
298
|
+
* Update styles on an existing styled span.
|
|
299
|
+
* Preserves non-styling classes and applies inline styles for immediate feedback.
|
|
300
|
+
*/
|
|
301
|
+
export declare function updateStyledSpan(span: HTMLElement, newStyle: Partial<TextStyle>): void;
|
|
302
|
+
/**
|
|
303
|
+
* Remove empty styled spans from the element
|
|
304
|
+
*/
|
|
305
|
+
export declare function cleanupEmptyStyledSpans(cmsElement: HTMLElement): void;
|
|
306
|
+
/**
|
|
307
|
+
* Merge adjacent styled spans that have the same classes
|
|
308
|
+
*/
|
|
309
|
+
export declare function mergeAdjacentStyledSpans(cmsElement: HTMLElement): void;
|
|
310
|
+
/**
|
|
311
|
+
* Wrap selected text in a span with Tailwind classes.
|
|
312
|
+
* If the selection is already inside a styled span, just update that span's classes.
|
|
313
|
+
* Returns the styled span element or null if failed.
|
|
314
|
+
*/
|
|
315
|
+
export declare function wrapSelectionWithStyle(cmsElement: HTMLElement, selection: TextSelection, style: TextStyle): HTMLSpanElement | null;
|
|
316
|
+
/**
|
|
317
|
+
* Apply a specific style category to the current selection.
|
|
318
|
+
* This is a convenience function for single-style application.
|
|
319
|
+
*/
|
|
320
|
+
export declare function applyStyleToSelection<C extends StyleCategory>(cmsElement: HTMLElement, category: C, value: StyleValue<C>): HTMLSpanElement | null;
|
|
321
|
+
/**
|
|
322
|
+
* Toggle a style value on the selection or styled element.
|
|
323
|
+
* If the style is already applied, it removes it; otherwise applies it.
|
|
324
|
+
*/
|
|
325
|
+
export declare function toggleStyle<C extends StyleCategory>(cmsElement: HTMLElement, category: C, value: StyleValue<C>): HTMLSpanElement | null;
|
|
326
|
+
/**
|
|
327
|
+
* Check if a specific style is currently applied to the selection
|
|
328
|
+
*/
|
|
329
|
+
export declare function hasStyle<C extends StyleCategory>(cmsElement: HTMLElement, category: C, value: StyleValue<C>): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* Get the current style of the selection
|
|
332
|
+
*/
|
|
333
|
+
export declare function getCurrentStyle(cmsElement: HTMLElement): TextStyle;
|
|
334
|
+
/**
|
|
335
|
+
* Remove all styling from the current selection
|
|
336
|
+
*/
|
|
337
|
+
export declare function clearAllStyles(cmsElement: HTMLElement): void;
|
|
338
|
+
/**
|
|
339
|
+
* Check if a style value is valid for a given category
|
|
340
|
+
*/
|
|
341
|
+
export declare function isValidStyleValue<C extends StyleCategory>(category: C, value: unknown): value is StyleValue<C>;
|
|
342
|
+
/**
|
|
343
|
+
* Get the default value for a style category
|
|
344
|
+
*/
|
|
345
|
+
export declare function getDefaultValue(category: StyleCategory): string;
|
|
346
|
+
/**
|
|
347
|
+
* Get all Tailwind classes used for text styling.
|
|
348
|
+
*/
|
|
349
|
+
export declare function getAllStyleClasses(): string[];
|
|
350
|
+
//# sourceMapp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|
|
5
|
+
export declare const THEME_PRESETS: Record<CmsThemePreset, CmsThemeConfig>;
|
|
6
|
+
/**
|
|
7
|
+
* Resolved theme with all values computed from preset + overrides
|
|
8
|
+
*/
|
|
9
|
+
export interface ResolvedTheme {
|
|
10
|
+
primary: string;
|
|
11
|
+
primaryHover: string;
|
|
12
|
+
primaryText: string;
|
|
13
|
+
secondary: string;
|
|
14
|
+
secondaryHover: string;
|
|
15
|
+
background: string;
|
|
16
|
+
card: string;
|
|
17
|
+
text: string;
|
|
18
|
+
textMuted: string;
|
|
19
|
+
border: string;
|
|
20
|
+
radiusSm: string;
|
|
21
|
+
radiusMd: string;
|
|
22
|
+
radiusLg: string;
|
|
23
|
+
radiusXl: string;
|
|
24
|
+
radiusPill: string;
|
|
25
|
+
shadowSm: string;
|
|
26
|
+
shadowMd: string;
|
|
27
|
+
shadowLg: string;
|
|
28
|
+
preset: CmsThemePreset;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve theme from config (preset + overrides)
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveTheme(config: CmsConfig): ResolvedTheme;
|
|
34
|
+
/**
|
|
35
|
+
* Generate CSS variable overrides from resolved theme
|
|
36
|
+
*/
|
|
37
|
+
export declare function generateCSSVariables(theme: ResolvedTheme): string;
|
|
38
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../src/editor/themes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,cAAc,CAyBhE,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAE7B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IAGd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAGlB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAGhB,MAAM,EAAE,cAAc,CAAA;CACtB;AAqFD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,aAAa,CA4B7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CA0BjE"}
|