@blokkli/editor 2.0.0-alpha.48 → 2.0.0-alpha.49
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/chunks/tailwindConfig.mjs +222 -0
- package/dist/global/types/definitions.d.ts +1 -1
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +143 -11
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +6 -29
- package/dist/modules/charts/index.d.mts +1 -1
- package/dist/modules/charts/index.mjs +3 -3
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +1 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +50 -53
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +1 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +1 -1
- package/dist/modules/index.d.mts +7 -0
- package/dist/{shared/editor.CGf7C_0M.mjs → modules/index.mjs} +1 -1
- package/dist/modules/table-of-contents/index.d.mts +1 -1
- package/dist/modules/table-of-contents/index.mjs +1 -1
- package/dist/modules/tailwind/index.d.mts +5 -0
- package/dist/modules/tailwind/index.mjs +2 -0
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +4 -4
- package/dist/runtime/editor/features/add-list/index.vue +1 -1
- package/dist/runtime/editor/features/anchors/Overlay/index.vue +25 -7
- package/dist/runtime/editor/features/complex-options/index.vue +98 -0
- package/dist/runtime/editor/features/dragging-overlay/index.vue +29 -13
- package/dist/runtime/editor/translations/de.json +15 -15
- package/dist/runtime/editor/translations/fr.json +14 -14
- package/dist/runtime/editor/translations/gsw_CH.json +14 -14
- package/dist/runtime/editor/translations/it.json +14 -14
- package/dist/shared/{editor.BVregnEC.d.mts → editor.DsGJIlGn.d.mts} +19 -2
- package/dist/types.d.mts +1 -1
- package/package.json +36 -1
- package/dist/modules/charts/runtime/features/charts/index.vue +0 -72
- /package/dist/{modules/charts/runtime/features/charts → runtime/editor/features/complex-options}/index.d.vue.ts +0 -0
- /package/dist/{modules/charts/runtime/features/charts → runtime/editor/features/complex-options}/index.vue.d.ts +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import plugin from 'tailwindcss/plugin';
|
|
2
|
+
|
|
3
|
+
const z = (index, key) => {
|
|
4
|
+
return `calc(var(--bk-z-index-base) + ${index}) /* "${key}" */`;
|
|
5
|
+
};
|
|
6
|
+
const zIndexKeys = [
|
|
7
|
+
"main-layout",
|
|
8
|
+
"canvas-overlay",
|
|
9
|
+
"animation-canvas",
|
|
10
|
+
"selection",
|
|
11
|
+
"analyze-tooltip",
|
|
12
|
+
"interaction-overlay",
|
|
13
|
+
"comments-overlay",
|
|
14
|
+
"comments-overlay-active",
|
|
15
|
+
"artboard-scrollbar",
|
|
16
|
+
"artboard-overview",
|
|
17
|
+
"translations-banner-mobile",
|
|
18
|
+
"editable-field",
|
|
19
|
+
"translations-banner-desktop",
|
|
20
|
+
"actions",
|
|
21
|
+
"sidebar",
|
|
22
|
+
"sidebar-tabs",
|
|
23
|
+
"toolbar",
|
|
24
|
+
"selection-add",
|
|
25
|
+
"add-buttons-label",
|
|
26
|
+
"add-list",
|
|
27
|
+
"add-list-info",
|
|
28
|
+
"tour-popup",
|
|
29
|
+
"preview",
|
|
30
|
+
"toolbar-dropdown",
|
|
31
|
+
"drop-targets",
|
|
32
|
+
"dragging-overlay",
|
|
33
|
+
"touch-action-bar",
|
|
34
|
+
"tour-overlay",
|
|
35
|
+
"tour-item",
|
|
36
|
+
"context-menu",
|
|
37
|
+
"search",
|
|
38
|
+
"resizable",
|
|
39
|
+
"transform-overlay",
|
|
40
|
+
"overlay",
|
|
41
|
+
"sidebar-detached",
|
|
42
|
+
"form-overlay",
|
|
43
|
+
"form-overlay-header",
|
|
44
|
+
"dialog",
|
|
45
|
+
"messages",
|
|
46
|
+
"menu",
|
|
47
|
+
"command-palette",
|
|
48
|
+
"library-edit-dialog",
|
|
49
|
+
"nested-editor-overlay-bg",
|
|
50
|
+
"nested-editor-overlay-iframe",
|
|
51
|
+
"init-overlay"
|
|
52
|
+
];
|
|
53
|
+
const zIndexCssVars = ["sidebar-detached"];
|
|
54
|
+
const zIndex = zIndexKeys.reduce((acc, key, index) => {
|
|
55
|
+
acc[key] = z(index * 1e4, key);
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
const tailwindConfig = {
|
|
59
|
+
content: [],
|
|
60
|
+
corePlugins: {
|
|
61
|
+
preflight: false,
|
|
62
|
+
container: false
|
|
63
|
+
},
|
|
64
|
+
theme: {
|
|
65
|
+
fontFamily: {
|
|
66
|
+
sans: ["PB Inter, sans-serif"],
|
|
67
|
+
mono: ["monospace"]
|
|
68
|
+
},
|
|
69
|
+
colors: {
|
|
70
|
+
accent: {
|
|
71
|
+
50: "rgb(var(--bk-theme-accent-50) / <alpha-value>)",
|
|
72
|
+
100: "rgb(var(--bk-theme-accent-100) / <alpha-value>)",
|
|
73
|
+
200: "rgb(var(--bk-theme-accent-200) / <alpha-value>)",
|
|
74
|
+
300: "rgb(var(--bk-theme-accent-300) / <alpha-value>)",
|
|
75
|
+
400: "rgb(var(--bk-theme-accent-400) / <alpha-value>)",
|
|
76
|
+
500: "rgb(var(--bk-theme-accent-500) / <alpha-value>)",
|
|
77
|
+
600: "rgb(var(--bk-theme-accent-600) / <alpha-value>)",
|
|
78
|
+
700: "rgb(var(--bk-theme-accent-700) / <alpha-value>)",
|
|
79
|
+
800: "rgb(var(--bk-theme-accent-800) / <alpha-value>)",
|
|
80
|
+
900: "rgb(var(--bk-theme-accent-900) / <alpha-value>)",
|
|
81
|
+
950: "rgb(var(--bk-theme-accent-950) / <alpha-value>)"
|
|
82
|
+
},
|
|
83
|
+
mono: {
|
|
84
|
+
50: "rgb(var(--bk-theme-mono-50) / <alpha-value>)",
|
|
85
|
+
100: "rgb(var(--bk-theme-mono-100) / <alpha-value>)",
|
|
86
|
+
200: "rgb(var(--bk-theme-mono-200) / <alpha-value>)",
|
|
87
|
+
300: "rgb(var(--bk-theme-mono-300) / <alpha-value>)",
|
|
88
|
+
400: "rgb(var(--bk-theme-mono-400) / <alpha-value>)",
|
|
89
|
+
500: "rgb(var(--bk-theme-mono-500) / <alpha-value>)",
|
|
90
|
+
600: "rgb(var(--bk-theme-mono-600) / <alpha-value>)",
|
|
91
|
+
700: "rgb(var(--bk-theme-mono-700) / <alpha-value>)",
|
|
92
|
+
800: "rgb(var(--bk-theme-mono-800) / <alpha-value>)",
|
|
93
|
+
900: "rgb(var(--bk-theme-mono-900) / <alpha-value>)",
|
|
94
|
+
950: "rgb(var(--bk-theme-mono-950) / <alpha-value>)"
|
|
95
|
+
},
|
|
96
|
+
teal: {
|
|
97
|
+
light: "rgb(var(--bk-theme-teal-light) / <alpha-value>)",
|
|
98
|
+
normal: "rgb(var(--bk-theme-teal-normal) / <alpha-value>)",
|
|
99
|
+
dark: "rgb(var(--bk-theme-teal-dark) / <alpha-value>)"
|
|
100
|
+
},
|
|
101
|
+
yellow: {
|
|
102
|
+
light: "rgb(var(--bk-theme-yellow-light) / <alpha-value>)",
|
|
103
|
+
normal: "rgb(var(--bk-theme-yellow-normal) / <alpha-value>)",
|
|
104
|
+
dark: "rgb(var(--bk-theme-yellow-dark) / <alpha-value>)"
|
|
105
|
+
},
|
|
106
|
+
red: {
|
|
107
|
+
light: "rgb(var(--bk-theme-red-light) / <alpha-value>)",
|
|
108
|
+
normal: "rgb(var(--bk-theme-red-normal) / <alpha-value>)",
|
|
109
|
+
dark: "rgb(var(--bk-theme-red-dark) / <alpha-value>)"
|
|
110
|
+
},
|
|
111
|
+
lime: {
|
|
112
|
+
light: "rgb(var(--bk-theme-lime-light) / <alpha-value>)",
|
|
113
|
+
normal: "rgb(var(--bk-theme-lime-normal) / <alpha-value>)",
|
|
114
|
+
dark: "rgb(var(--bk-theme-lime-dark) / <alpha-value>)"
|
|
115
|
+
},
|
|
116
|
+
orange: {
|
|
117
|
+
light: "rgb(var(--bk-theme-orange-light) / <alpha-value>)",
|
|
118
|
+
normal: "rgb(var(--bk-theme-orange-normal) / <alpha-value>)",
|
|
119
|
+
dark: "rgb(var(--bk-theme-orange-dark) / <alpha-value>)"
|
|
120
|
+
},
|
|
121
|
+
scheme: {
|
|
122
|
+
light: "rgb(var(--bk-scheme-light, var(--bk-theme-accent-100)) / <alpha-value>)",
|
|
123
|
+
normal: "rgb(var(--bk-scheme-normal, var(--bk-theme-accent-600)) / <alpha-value>)",
|
|
124
|
+
dark: "rgb(var(--bk-scheme-dark, var(--bk-theme-accent-800)) / <alpha-value>)",
|
|
125
|
+
text: "rgb(var(--bk-scheme-text, var(--bk-scheme-dark)) / <alpha-value>)"
|
|
126
|
+
},
|
|
127
|
+
white: "white",
|
|
128
|
+
black: "black",
|
|
129
|
+
transparent: "transparent",
|
|
130
|
+
current: "currentColor"
|
|
131
|
+
},
|
|
132
|
+
extend: {
|
|
133
|
+
screens: {
|
|
134
|
+
"3xl": "1920px"
|
|
135
|
+
},
|
|
136
|
+
transitionTimingFunction: {
|
|
137
|
+
swing: "cubic-bezier(0.56, 0.04, 0.25, 1)"
|
|
138
|
+
},
|
|
139
|
+
zIndex: {
|
|
140
|
+
...zIndex
|
|
141
|
+
},
|
|
142
|
+
boxShadow: {
|
|
143
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
144
|
+
DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
145
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
146
|
+
"md-even": "0 0px 10px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
147
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
148
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
149
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
150
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
151
|
+
none: "none",
|
|
152
|
+
"lg-inverted": "0 -10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
153
|
+
"xl-inverted": "0 -20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
154
|
+
"xl-left": "-20px 0px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
155
|
+
"xl-even": "0 0px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
spacing: {
|
|
159
|
+
770: "770px",
|
|
160
|
+
340: "340px",
|
|
161
|
+
300: "300px",
|
|
162
|
+
200: "200px",
|
|
163
|
+
120: "120px",
|
|
164
|
+
100: "100px",
|
|
165
|
+
90: "90px",
|
|
166
|
+
80: "80px",
|
|
167
|
+
70: "70px",
|
|
168
|
+
60: "60px",
|
|
169
|
+
50: "50px",
|
|
170
|
+
40: "40px",
|
|
171
|
+
30: "30px",
|
|
172
|
+
25: "25px",
|
|
173
|
+
24: "24px",
|
|
174
|
+
20: "20px",
|
|
175
|
+
18: "18px",
|
|
176
|
+
15: "15px",
|
|
177
|
+
10: "10px",
|
|
178
|
+
8: "8px",
|
|
179
|
+
5: "5px",
|
|
180
|
+
3: "3px",
|
|
181
|
+
2: "2px",
|
|
182
|
+
1: "1px",
|
|
183
|
+
0: "0px",
|
|
184
|
+
"offset-t": "var(--bk-root-offset-top)",
|
|
185
|
+
"offset-r": "var(--bk-root-offset-right)",
|
|
186
|
+
"offset-b": "var(--bk-root-offset-bottom)",
|
|
187
|
+
scrollbar: "var(--bk-artboard-scrollbar-size)",
|
|
188
|
+
"sidebar-right": "var(--bk-sidebar-width-right)",
|
|
189
|
+
"toolbar-left": "var(--bk-toolbar-left-width)"
|
|
190
|
+
},
|
|
191
|
+
borderWidth: {
|
|
192
|
+
DEFAULT: "1px",
|
|
193
|
+
0: "0",
|
|
194
|
+
2: "2px",
|
|
195
|
+
3: "3px",
|
|
196
|
+
4: "4px"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
plugins: [
|
|
200
|
+
plugin(function({ addVariant, addBase }) {
|
|
201
|
+
addVariant(
|
|
202
|
+
"mobile-only",
|
|
203
|
+
"@media screen and (max-width: theme('screens.sm'))"
|
|
204
|
+
);
|
|
205
|
+
const cssVars = zIndexCssVars.reduce(
|
|
206
|
+
(acc, key) => {
|
|
207
|
+
const index = zIndexKeys.indexOf(key);
|
|
208
|
+
if (index !== -1) {
|
|
209
|
+
acc[`--bk-z-index-${key}`] = `calc(var(--bk-z-index-base) + ${index * 1e4})`;
|
|
210
|
+
}
|
|
211
|
+
return acc;
|
|
212
|
+
},
|
|
213
|
+
{}
|
|
214
|
+
);
|
|
215
|
+
addBase({
|
|
216
|
+
":root": cssVars
|
|
217
|
+
});
|
|
218
|
+
})
|
|
219
|
+
]
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export { tailwindConfig as default };
|
|
@@ -2,7 +2,7 @@ import type { BlockOptionDefinitionBase } from './blockOptions';
|
|
|
2
2
|
export type BlockDefinitionOptionsInputBase = {
|
|
3
3
|
[key: string]: BlockOptionDefinitionBase;
|
|
4
4
|
};
|
|
5
|
-
export type BlokkliDefinitionAddBehaviour = 'no-form' | 'form' | `editable:${string}`;
|
|
5
|
+
export type BlokkliDefinitionAddBehaviour = 'no-form' | 'form' | `editable:${string}` | `complex-option:${string}`;
|
|
6
6
|
export type BlockDefinitionRenderForParentBase<BundleWithNested extends string = string> = {
|
|
7
7
|
parentBundle: BundleWithNested;
|
|
8
8
|
};
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NuxtModule } from 'nuxt/schema';
|
|
2
|
-
import { M as ModuleOptions } from './shared/editor.
|
|
3
|
-
export { a as ModuleHooks } from './shared/editor.
|
|
2
|
+
import { M as ModuleOptions } from './shared/editor.DsGJIlGn.mjs';
|
|
3
|
+
export { a as ModuleHooks } from './shared/editor.DsGJIlGn.mjs';
|
|
4
4
|
import 'consola';
|
|
5
5
|
import '../dist/global/types/definitions.js';
|
|
6
6
|
import '../dist/global/types/theme.js';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { resolveAlias, resolveFiles, createResolver, addComponent, addImports, addTemplate, useLogger, defineNuxtModule, addPlugin, addBuildPlugin } from '@nuxt/kit';
|
|
1
|
+
import { resolveAlias, resolveFiles, createResolver, addComponent, addImports, addTemplate, useLogger, defineNuxtModule, addPlugin, addBuildPlugin, updateTemplates } from '@nuxt/kit';
|
|
2
|
+
import path__default, { basename, dirname as dirname$1, resolve as resolve$1, join } from 'node:path';
|
|
2
3
|
import { createUnplugin } from 'unplugin';
|
|
3
4
|
import MagicString from 'magic-string';
|
|
4
5
|
import { walk } from 'estree-walker-ts';
|
|
5
6
|
import { pathToFileURL } from 'node:url';
|
|
6
7
|
import { parseURL, parseQuery } from 'ufo';
|
|
7
8
|
import { C as Collector, a as CollectedFile, b as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.9vf8ZnOp.mjs';
|
|
8
|
-
import path__default, { basename, dirname as dirname$1 } from 'node:path';
|
|
9
9
|
import { dirname, resolve, relative } from 'pathe';
|
|
10
10
|
import micromatch from 'micromatch';
|
|
11
11
|
import { hash } from 'ohash';
|
|
@@ -18,7 +18,7 @@ import 'typescript';
|
|
|
18
18
|
import 'oxc-walker';
|
|
19
19
|
|
|
20
20
|
const name = "@blokkli/editor";
|
|
21
|
-
const version = "2.0.0-alpha.
|
|
21
|
+
const version = "2.0.0-alpha.49";
|
|
22
22
|
|
|
23
23
|
function validateOption(optionKey, option, icons) {
|
|
24
24
|
const errors = [];
|
|
@@ -1142,6 +1142,25 @@ class ModuleHelper {
|
|
|
1142
1142
|
path + "/*"
|
|
1143
1143
|
];
|
|
1144
1144
|
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Add a directory to the app TypeScript tsconfig includes.
|
|
1147
|
+
*/
|
|
1148
|
+
addAppTsInclude(absolutePath) {
|
|
1149
|
+
const rel = relative(this.nuxt.options.buildDir, absolutePath);
|
|
1150
|
+
this.nuxt.options.typescript.tsConfig ||= {};
|
|
1151
|
+
this.nuxt.options.typescript.tsConfig.include ||= [];
|
|
1152
|
+
this.nuxt.options.typescript.tsConfig.include.push(rel);
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Add a directory to the server/Nitro TypeScript tsconfig includes.
|
|
1156
|
+
*/
|
|
1157
|
+
addServerTsInclude(absolutePath) {
|
|
1158
|
+
const rel = relative(this.nuxt.options.buildDir, absolutePath);
|
|
1159
|
+
this.nuxt.options.nitro.typescript ||= {};
|
|
1160
|
+
this.nuxt.options.nitro.typescript.tsConfig ||= {};
|
|
1161
|
+
this.nuxt.options.nitro.typescript.tsConfig.include ||= [];
|
|
1162
|
+
this.nuxt.options.nitro.typescript.tsConfig.include.push(rel);
|
|
1163
|
+
}
|
|
1145
1164
|
/**
|
|
1146
1165
|
* Add a path to Nitro's externals.inline for server-side usage.
|
|
1147
1166
|
* @see https://github.com/nuxt/nuxt/issues/28995
|
|
@@ -1191,7 +1210,21 @@ class ModuleContext {
|
|
|
1191
1210
|
adapterExtensions = [];
|
|
1192
1211
|
featureFragments = /* @__PURE__ */ new Set();
|
|
1193
1212
|
complexOptionTypes = /* @__PURE__ */ new Map();
|
|
1213
|
+
cssFiles = [];
|
|
1214
|
+
additionalIcons = [];
|
|
1194
1215
|
collectors = [];
|
|
1216
|
+
addCSS(filePath) {
|
|
1217
|
+
this.cssFiles.push(filePath);
|
|
1218
|
+
}
|
|
1219
|
+
getCSSFiles() {
|
|
1220
|
+
return this.cssFiles;
|
|
1221
|
+
}
|
|
1222
|
+
addIcon(...names) {
|
|
1223
|
+
this.additionalIcons.push(...names);
|
|
1224
|
+
}
|
|
1225
|
+
getAdditionalIcons() {
|
|
1226
|
+
return this.additionalIcons;
|
|
1227
|
+
}
|
|
1195
1228
|
addFeatureFragment(name) {
|
|
1196
1229
|
if (this.featureFragments.has(name)) {
|
|
1197
1230
|
throw new Error(`A feature fragment with name "${name}" already exists.`);
|
|
@@ -1567,7 +1600,8 @@ const icons = defineCodeTemplate(
|
|
|
1567
1600
|
...blockIcons,
|
|
1568
1601
|
...featureIcons,
|
|
1569
1602
|
...USED_MATERIAL_ICONS,
|
|
1570
|
-
...globalOptionsIcons
|
|
1603
|
+
...globalOptionsIcons,
|
|
1604
|
+
...ctx.getAdditionalIcons()
|
|
1571
1605
|
].filter(falsy).filter(onlyUnique);
|
|
1572
1606
|
for (const file of files) {
|
|
1573
1607
|
const name = basename(file.filePath, ".svg").toLowerCase();
|
|
@@ -1797,16 +1831,94 @@ export default adapterExtensions
|
|
|
1797
1831
|
}
|
|
1798
1832
|
);
|
|
1799
1833
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1834
|
+
let processor = null;
|
|
1835
|
+
async function processCSS(css, from) {
|
|
1836
|
+
if (!processor) {
|
|
1837
|
+
processor = await createProcessor();
|
|
1838
|
+
}
|
|
1839
|
+
const result = await processor.process(css, { from: from || "module.css" });
|
|
1840
|
+
return result.css;
|
|
1841
|
+
}
|
|
1842
|
+
function resetProcessor() {
|
|
1843
|
+
processor = null;
|
|
1844
|
+
}
|
|
1845
|
+
async function createProcessor() {
|
|
1846
|
+
const _require = createRequire(import.meta.url);
|
|
1847
|
+
try {
|
|
1848
|
+
const postcss = _require("postcss");
|
|
1849
|
+
const { default: tailwindConfig } = await import('./chunks/tailwindConfig.mjs');
|
|
1850
|
+
const plugins = [
|
|
1851
|
+
_require("postcss-import"),
|
|
1852
|
+
_require("tailwindcss/nesting"),
|
|
1853
|
+
_require("tailwindcss")({
|
|
1854
|
+
...tailwindConfig,
|
|
1855
|
+
// Empty content prevents Tailwind from scanning the project.
|
|
1856
|
+
// @apply directives are resolved regardless of content scanning.
|
|
1857
|
+
content: [{ raw: " ", extension: "html" }]
|
|
1858
|
+
}),
|
|
1859
|
+
// Same scoping rules as postcss.config.cjs: scope selectors to .bk
|
|
1860
|
+
// and rename Tailwind CSS variables from --tw-* to --bk-tw-*.
|
|
1861
|
+
_require("postcss-replace")({
|
|
1862
|
+
pattern: /(--tw|\*, ::before, ::after)/g,
|
|
1863
|
+
data: {
|
|
1864
|
+
"--tw": "--bk-tw",
|
|
1865
|
+
"*, ::before, ::after": ".bk, .bk *, .bk-sidebar, .bk ::before, .bk ::after, .bk-vars, .bk-vars ::before, .bk-vars ::after",
|
|
1866
|
+
"::backdrop": ".bk::backdrop, .bk ::backdrop"
|
|
1867
|
+
}
|
|
1868
|
+
}),
|
|
1869
|
+
_require("@thedutchcoder/postcss-rem-to-px")({ baseValue: 16 })
|
|
1870
|
+
];
|
|
1871
|
+
return postcss(plugins);
|
|
1872
|
+
} catch (e) {
|
|
1873
|
+
if (e.code === "MODULE_NOT_FOUND") {
|
|
1874
|
+
const missing = e.message.match(/Cannot find module '([^']+)'/)?.[1] || "unknown";
|
|
1875
|
+
throw new Error(
|
|
1876
|
+
`Missing dependency "${missing}" required for processing module CSS.
|
|
1877
|
+
Install the required PostCSS packages:
|
|
1878
|
+
npm install -D postcss tailwindcss postcss-import postcss-replace @thedutchcoder/postcss-rem-to-px`
|
|
1879
|
+
);
|
|
1880
|
+
}
|
|
1881
|
+
throw e;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
const logger$1 = useLogger("@blokkli/editor");
|
|
1886
|
+
const styles = defineFileTemplate(
|
|
1887
|
+
"styles.css",
|
|
1888
|
+
async (ctx) => {
|
|
1889
|
+
const cssFilePath = ctx.helper.resolvers.module.resolve(
|
|
1890
|
+
"./runtime/editor/css/output.css"
|
|
1891
|
+
);
|
|
1892
|
+
let moduleCSS = "";
|
|
1893
|
+
const cssFiles = ctx.getCSSFiles();
|
|
1894
|
+
if (cssFiles.length > 0) {
|
|
1895
|
+
resetProcessor();
|
|
1896
|
+
const processed = [];
|
|
1897
|
+
for (const filePath of cssFiles) {
|
|
1898
|
+
const content = await ctx.helper.fileCache.read(filePath);
|
|
1899
|
+
try {
|
|
1900
|
+
const result = await processCSS(content, filePath);
|
|
1901
|
+
processed.push(result);
|
|
1902
|
+
} catch (e) {
|
|
1903
|
+
logger$1.error(
|
|
1904
|
+
`Failed to process module CSS "${filePath}":
|
|
1905
|
+
${e.message}`
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
if (processed.length > 0) {
|
|
1910
|
+
moduleCSS = "\n/* Module CSS */\n" + processed.join("\n");
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
return `
|
|
1805
1914
|
@import url("${cssFilePath}");
|
|
1806
1915
|
|
|
1807
1916
|
${ctx.theme.css}
|
|
1917
|
+
${moduleCSS}
|
|
1808
1918
|
`;
|
|
1809
|
-
}
|
|
1919
|
+
},
|
|
1920
|
+
{ dependencies: ["module-css"] }
|
|
1921
|
+
);
|
|
1810
1922
|
|
|
1811
1923
|
function mapVars(ctx) {
|
|
1812
1924
|
return {
|
|
@@ -3586,6 +3698,7 @@ const complexOptionTypes = defineCodeTemplate(
|
|
|
3586
3698
|
editorComponent: defineAsyncComponent(() => import('${ctx.helper.toModuleBuildRelative(t.editorComponentPath)}')),
|
|
3587
3699
|
editorButtonLabel: '${t.editorButtonLabel}',
|
|
3588
3700
|
editorIcon: '${t.editorIcon}',
|
|
3701
|
+
editorTitle: '${t.editorTitle || t.editorButtonLabel}',
|
|
3589
3702
|
}`
|
|
3590
3703
|
).join(",\n");
|
|
3591
3704
|
return `import { defineAsyncComponent } from 'vue'
|
|
@@ -3606,15 +3719,17 @@ export const COMPLEX_OPTION_TYPES: Record<string, never>`;
|
|
|
3606
3719
|
const entries = types.map((t) => ` '${t.id}': ${t.typeName}`).join("\n");
|
|
3607
3720
|
return `${imports}
|
|
3608
3721
|
import type { BlokkliIcon } from './icons'
|
|
3722
|
+
import type { Component } from 'vue'
|
|
3609
3723
|
|
|
3610
3724
|
export interface ComplexOptionTypeMap {
|
|
3611
3725
|
${entries}
|
|
3612
3726
|
}
|
|
3613
3727
|
|
|
3614
3728
|
export const COMPLEX_OPTION_TYPES: Record<string, {
|
|
3615
|
-
editorComponent:
|
|
3729
|
+
editorComponent: Component
|
|
3616
3730
|
editorButtonLabel: string
|
|
3617
3731
|
editorIcon: BlokkliIcon
|
|
3732
|
+
editorTitle: string
|
|
3618
3733
|
}>`;
|
|
3619
3734
|
},
|
|
3620
3735
|
{
|
|
@@ -3938,6 +4053,9 @@ const module$1 = defineNuxtModule({
|
|
|
3938
4053
|
"#blokkli/runtime-helpers",
|
|
3939
4054
|
resolver.resolve("runtime/helpers/runtimeHelpers")
|
|
3940
4055
|
);
|
|
4056
|
+
const blokkliModulesDir = resolve$1(nuxt.options.rootDir, "blokkli/modules");
|
|
4057
|
+
helper.addAppTsInclude(join(blokkliModulesDir, "*/app"));
|
|
4058
|
+
helper.addServerTsInclude(join(blokkliModulesDir, "*/server"));
|
|
3941
4059
|
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
3942
4060
|
nitroConfig.publicAssets ||= [];
|
|
3943
4061
|
nitroConfig.publicAssets.push({
|
|
@@ -3958,6 +4076,9 @@ const module$1 = defineNuxtModule({
|
|
|
3958
4076
|
);
|
|
3959
4077
|
addBuildPlugin(BlokkliEditingPlugin(nuxt));
|
|
3960
4078
|
if (nuxt.options.dev) {
|
|
4079
|
+
for (const cssFile of context.getCSSFiles()) {
|
|
4080
|
+
nuxt.options.watch.push(dirname$1(cssFile));
|
|
4081
|
+
}
|
|
3961
4082
|
nuxt.hook("builder:watch", async (event, providedFilePath) => {
|
|
3962
4083
|
const filePath = providedFilePath.startsWith("/") ? providedFilePath : helper.resolvers.src.resolve(providedFilePath);
|
|
3963
4084
|
helper.fileCache.handleWatchEvent(event, filePath);
|
|
@@ -3969,8 +4090,19 @@ const module$1 = defineNuxtModule({
|
|
|
3969
4090
|
dependenciesToUpdate.push(...collector.getDependencyTypes());
|
|
3970
4091
|
}
|
|
3971
4092
|
}
|
|
4093
|
+
const cssFiles = context.getCSSFiles();
|
|
4094
|
+
if (cssFiles.length > 0) {
|
|
4095
|
+
const cssFileDirs = cssFiles.map((f) => dirname$1(f));
|
|
4096
|
+
const isModuleCSSRelated = cssFiles.some(
|
|
4097
|
+
(cssFile, i) => filePath === cssFile || filePath.startsWith(cssFileDirs[i] + "/")
|
|
4098
|
+
);
|
|
4099
|
+
if (isModuleCSSRelated) {
|
|
4100
|
+
dependenciesToUpdate.push("module-css");
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
3972
4103
|
if (dependenciesToUpdate.length) {
|
|
3973
4104
|
await context.generateTemplates(dependenciesToUpdate);
|
|
4105
|
+
await updateTemplates();
|
|
3974
4106
|
}
|
|
3975
4107
|
});
|
|
3976
4108
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveFiles, createResolver, addServerHandler } from '@nuxt/kit';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
import { defineBlokkliModule } from '../index.mjs';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
6
|
import { C as Collector, a as CollectedFile, e as extractStringProperty } from '../../shared/editor.9vf8ZnOp.mjs';
|
|
7
7
|
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
@@ -651,22 +651,10 @@ export default defineNuxtConfig({
|
|
|
651
651
|
]
|
|
652
652
|
});
|
|
653
653
|
ctx.context.addCollector(promptsCollector);
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
projectToolsDir
|
|
657
|
-
);
|
|
658
|
-
nuxt.options.typescript.tsConfig ||= {};
|
|
659
|
-
nuxt.options.typescript.tsConfig.include ||= [];
|
|
660
|
-
nuxt.options.typescript.tsConfig.include.push(relativeToolsDir);
|
|
661
|
-
const relativePromptsDir = path.relative(
|
|
662
|
-
nuxt.options.buildDir,
|
|
663
|
-
projectPromptsDir
|
|
664
|
-
);
|
|
665
|
-
nuxt.options.typescript.tsConfig.include.push(relativePromptsDir);
|
|
654
|
+
ctx.helper.addAppTsInclude(projectToolsDir);
|
|
655
|
+
ctx.helper.addAppTsInclude(projectPromptsDir);
|
|
666
656
|
for (const dir of moduleBlokkliDirs) {
|
|
667
|
-
|
|
668
|
-
const relDir = path.relative(nuxt.options.buildDir, toolsDir);
|
|
669
|
-
nuxt.options.typescript.tsConfig.include.push(relDir);
|
|
657
|
+
ctx.helper.addAppTsInclude(path.join(dir, "tools"));
|
|
670
658
|
}
|
|
671
659
|
const moduleSkillsDir = moduleResolver.resolve(
|
|
672
660
|
"./runtime/server/default-skills"
|
|
@@ -746,20 +734,9 @@ export default defineNuxtConfig({
|
|
|
746
734
|
route: routes.routing,
|
|
747
735
|
handler: moduleResolver.resolve("./runtime/server/route")
|
|
748
736
|
});
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
projectSkillsDir
|
|
752
|
-
);
|
|
753
|
-
const relativeSystemPromptsDir = path.relative(
|
|
754
|
-
nuxt.options.buildDir,
|
|
755
|
-
projectSystemPromptsDir
|
|
756
|
-
);
|
|
737
|
+
ctx.helper.addServerTsInclude(projectSkillsDir);
|
|
738
|
+
ctx.helper.addServerTsInclude(projectSystemPromptsDir);
|
|
757
739
|
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
758
|
-
nitroConfig.typescript ||= {};
|
|
759
|
-
nitroConfig.typescript.tsConfig ||= {};
|
|
760
|
-
nitroConfig.typescript.tsConfig.include ||= [];
|
|
761
|
-
nitroConfig.typescript.tsConfig.include.push(relativeSkillsDir);
|
|
762
|
-
nitroConfig.typescript.tsConfig.include.push(relativeSystemPromptsDir);
|
|
763
740
|
nitroConfig.rollupConfig ||= {};
|
|
764
741
|
nitroConfig.rollupConfig.plugins ||= [];
|
|
765
742
|
nitroConfig.rollupConfig.plugins.push(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createResolver } from '@nuxt/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { defineBlokkliModule } from '../index.mjs';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
5
5
|
|
|
@@ -34,7 +34,6 @@ const index = defineBlokkliModule({
|
|
|
34
34
|
options.blokkliDirs.push(resolve("./runtime/blokkli"));
|
|
35
35
|
},
|
|
36
36
|
setup({ context, helper, $t }, options) {
|
|
37
|
-
context.features.addFile(resolve("./runtime/features/charts/index.vue"));
|
|
38
37
|
context.addTemplate(chartsConfigTemplate(options));
|
|
39
38
|
helper.addAlias("#blokkli/charts/types", resolve("./runtime/types"));
|
|
40
39
|
helper.addAlias(
|
|
@@ -49,7 +48,8 @@ const index = defineBlokkliModule({
|
|
|
49
48
|
"./runtime/features/charts/Editor/index.vue"
|
|
50
49
|
),
|
|
51
50
|
editorButtonLabel: $t("chartsEditButton", "Edit chart..."),
|
|
52
|
-
editorIcon: "bk_mdi_area_chart"
|
|
51
|
+
editorIcon: "bk_mdi_area_chart",
|
|
52
|
+
editorTitle: $t("chartsEditorTitle", "Edit chart")
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
});
|