@dxtmisha/scripts 1.1.1 → 1.1.2
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/CHANGELOG.md +10 -0
- package/dist/library-ui.js +403 -313
- package/package.json +1 -1
package/dist/library-ui.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as e, t } from "./PropertiesConfig-BBsuNndv.js";
|
|
2
|
-
import { UI_DIRS_COMPONENTS as n, UI_DIRS_CONSTRUCTOR as r, UI_DIRS_ICONS as i, UI_DIRS_LIBRARY as a, UI_DIRS_STYLES as o, UI_DIRS_TOKENS as s, UI_DIRS_WIKI as c, UI_DIR_COMPONENTS as l, UI_DIR_CONSTRUCTOR as u, UI_DIR_DIST as d, UI_DIR_STRUCTURE as f, UI_EXTENSION_STYLE as p, UI_FILE_NAME_DESIGN as ee, UI_FILE_NAME_MEDIA as te, UI_FILE_NAME_PLUGIN as ne, UI_FILE_NAME_STYLE as re, UI_FILE_NAME_WIKI as ie, UI_FILE_PACKAGE as
|
|
2
|
+
import { UI_DIRS_COMPONENTS as n, UI_DIRS_CONSTRUCTOR as r, UI_DIRS_ICONS as i, UI_DIRS_LIBRARY as a, UI_DIRS_STYLES as o, UI_DIRS_TOKENS as s, UI_DIRS_WIKI as c, UI_DIR_COMPONENTS as l, UI_DIR_CONSTRUCTOR as u, UI_DIR_DIST as d, UI_DIR_STRUCTURE as f, UI_EXTENSION_STYLE as p, UI_FILE_NAME_DESIGN as ee, UI_FILE_NAME_MEDIA as te, UI_FILE_NAME_PLUGIN as ne, UI_FILE_NAME_STYLE as re, UI_FILE_NAME_WIKI as ie, UI_FILE_PACKAGE as ae, UI_FILE_PROPERTY as m, UI_FILE_STYLE_PROPERTIES as oe, UI_FILE_STYLE_SCSS as se, UI_KEY_CUSTOM as ce, UI_PROJECT_CONSTRUCTOR_FULL_NAME as le, UI_PROJECT_CONSTRUCTOR_NAME as h, UI_PROPERTY_FOR_PROPS as ue, UI_STRUCTURE_CLASSES as de } from "./config.js";
|
|
3
3
|
import { a as g, i as fe, n as _, r as v, t as y } from "./propertyTypes-CstobYcc.js";
|
|
4
|
-
import { ServerStorage as pe, copyObject as me, forEach as b, getColumn as x, isArray as
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
4
|
+
import { ServerStorage as pe, copyObject as me, forEach as b, getColumn as x, isArray as S, isFilled as C, isNull as he, isObject as w, isObjectNotArray as T, isSelected as E, isString as ge, replaceComponentName as _e, replaceRecursive as D, splice as ve, strFill as ye, toArray as O, toCamelCase as k, toCamelCaseFirst as A, toKebabCase as j, uniqueArray as be } from "@dxtmisha/functional-basic";
|
|
5
|
+
import M from "typescript";
|
|
6
|
+
import * as xe from "sass";
|
|
7
7
|
//#region src/functions/getComponentPaths.ts
|
|
8
|
-
function
|
|
8
|
+
function Se(e) {
|
|
9
9
|
return [...n, e];
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/media/templates/componentDocTemplates.ts
|
|
13
|
-
var
|
|
13
|
+
var Ce = {
|
|
14
14
|
"ComponentDoc.vue": "<script setup lang=\"ts\">\nimport {\n ComponentDocDefaults,\n type ComponentDocEmits,\n type ComponentDocProps,\n type ComponentDocSlots\n} from './types'\n\ndefineOptions({\n name: 'ComponentDoc'\n})\n\nwithDefaults(defineProps<ComponentDocProps>(), ComponentDocDefaults)\ndefineEmits<ComponentDocEmits>()\ndefineSlots<ComponentDocSlots>()\n<\/script>\n\n<template>\n <div class=\"component-doc\"></div>\n</template>\n\n<style lang=\"scss\">\n.component-doc {\n // Your styles here\n}\n</style>\n",
|
|
15
15
|
"index.ts": "import type { DefineSetupFnComponent, ShortEmitsToObject, SlotsType } from 'vue'\nimport type { ComponentDocEmits, ComponentDocProps, ComponentDocSlots } from './types'\n\nimport item from './ComponentDoc.vue'\n\nexport type * from './types'\n\nexport const ComponentDoc: DefineSetupFnComponent<\n ComponentDocProps,\n ShortEmitsToObject<ComponentDocEmits>,\n SlotsType<ComponentDocSlots>\n> = item\n",
|
|
16
16
|
"types.ts": "export type ComponentDocEmits = {\n // click: [value: string]\n}\n\nexport interface ComponentDocSlots {\n // default? (props: any): any\n}\n\nexport interface ComponentDocProps {\n // value?: string\n}\n\nexport const ComponentDocDefaults: ComponentDocProps = {\n // value: 'value'\n}\n",
|
|
@@ -19,9 +19,9 @@ var we = {
|
|
|
19
19
|
"wiki/ComponentDoc.mdx": "import {Meta} from '@storybook/addon-docs/blocks'\nimport {StorybookMain} from '@dxtmisha/wiki/storybook'\n\nimport * as Component from './ComponentDoc.stories'\n\n<Meta of={Component}/>\n<StorybookMain\n name={'ComponentDoc'}\n description={'[description]'}\n story={Component.Component}\n/>\n\n[doc]\n",
|
|
20
20
|
"wiki/ComponentDoc.stories.ts": "import type { Meta, StoryObj } from '@storybook/vue3-vite'\n\nimport ComponentDoc from './../ComponentDoc.vue'\n\nconst meta = {\n title: '[project]/ComponentDoc',\n component: ComponentDoc\n} satisfies Meta<typeof ComponentDoc>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Component: Story = {\n render: args => ({\n components: { ComponentDoc },\n setup() {\n return { args }\n },\n template: `<div>\n <ComponentDoc v-bind=\"args\" />\n </div>`\n })\n}\n",
|
|
21
21
|
"wiki/prompt.md": "# AI Prompt: Component Documentation & Development\n\nYou **MUST** read, study, and strictly follow the documentation rules, output locations, and Storybook constraints specified in:\n- `node_modules/@dxtmisha/scripts/ai-resources/componentWiki.md`\n\n---\nCRITICAL PRIORITY RULE:\nEverything below this line has a higher priority than the text above it.\n"
|
|
22
|
-
},
|
|
22
|
+
}, we = class {
|
|
23
23
|
path;
|
|
24
|
-
sample =
|
|
24
|
+
sample = Ce;
|
|
25
25
|
constructor(e) {
|
|
26
26
|
this.path = e;
|
|
27
27
|
}
|
|
@@ -31,7 +31,7 @@ var we = {
|
|
|
31
31
|
}), console.info("end");
|
|
32
32
|
}
|
|
33
33
|
getFilePath(e) {
|
|
34
|
-
return [...
|
|
34
|
+
return [...Se(this.path), this.replacement(e)];
|
|
35
35
|
}
|
|
36
36
|
getFilesSample() {
|
|
37
37
|
return Object.keys(this.sample);
|
|
@@ -50,21 +50,21 @@ var we = {
|
|
|
50
50
|
return this.sample?.[e] ?? "";
|
|
51
51
|
}
|
|
52
52
|
replacement(t) {
|
|
53
|
-
return t.replace("_.gitignore.txt", ".gitignore").replace(/ComponentDoc/g, this.getName()).replace(/component-doc/g,
|
|
53
|
+
return t.replace("_.gitignore.txt", ".gitignore").replace(/ComponentDoc/g, this.getName()).replace(/component-doc/g, j(this.getName())).replace(/\[project]/g, this.getProjectName()).replace(/\[path]/g, e.splitForDir(this.path).join("/"));
|
|
54
54
|
}
|
|
55
55
|
writeFile(t, n) {
|
|
56
56
|
let r = this.getFilePath(t);
|
|
57
57
|
e.writeByPath(r, n), e.chmod(r);
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, Te = class {
|
|
60
60
|
constructor() {}
|
|
61
61
|
make() {
|
|
62
|
-
this.getDirs().forEach((e) => new
|
|
62
|
+
this.getDirs().forEach((e) => new we(e).make());
|
|
63
63
|
}
|
|
64
64
|
getDirs() {
|
|
65
|
-
return e.readDirOnlyRecursive(n).filter((t) => e.readDir(
|
|
65
|
+
return e.readDirOnlyRecursive(n).filter((t) => e.readDir(Se(t)).length === 0);
|
|
66
66
|
}
|
|
67
|
-
},
|
|
67
|
+
}, Ee = [".cache"], De = ["step"], N = "system", P = class {
|
|
68
68
|
static time = 0;
|
|
69
69
|
static files = {};
|
|
70
70
|
static sizes = {};
|
|
@@ -85,7 +85,7 @@ var we = {
|
|
|
85
85
|
return e.readFile(t);
|
|
86
86
|
}
|
|
87
87
|
static write(e, t) {
|
|
88
|
-
this.writeFile(
|
|
88
|
+
this.writeFile(De, e, t);
|
|
89
89
|
}
|
|
90
90
|
static clear() {
|
|
91
91
|
e.removeDir(this.getPath([]));
|
|
@@ -103,8 +103,8 @@ var we = {
|
|
|
103
103
|
static getPath(t) {
|
|
104
104
|
return [
|
|
105
105
|
e.getRoot(),
|
|
106
|
-
...
|
|
107
|
-
...
|
|
106
|
+
...Ee,
|
|
107
|
+
...O(t)
|
|
108
108
|
];
|
|
109
109
|
}
|
|
110
110
|
static getPathName(t, n, r = "json") {
|
|
@@ -124,17 +124,17 @@ var we = {
|
|
|
124
124
|
files: this.files,
|
|
125
125
|
sizes: this.sizes
|
|
126
126
|
};
|
|
127
|
-
this.writeFile([],
|
|
127
|
+
this.writeFile([], N, e), this.console("Writes the system data");
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
static console(e) {
|
|
131
131
|
console.info("[Cache]", e);
|
|
132
132
|
}
|
|
133
133
|
static {
|
|
134
|
-
let e = this.readFile([],
|
|
134
|
+
let e = this.readFile([], N);
|
|
135
135
|
e && (this.time = e.time, Object.assign(this.files, e.files), Object.assign(this.sizes, e.sizes));
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, Oe = {
|
|
138
138
|
ref: {
|
|
139
139
|
transitionDuration: {
|
|
140
140
|
1: "45ms",
|
|
@@ -190,7 +190,7 @@ var we = {
|
|
|
190
190
|
_type: "var",
|
|
191
191
|
_category: "root"
|
|
192
192
|
}
|
|
193
|
-
},
|
|
193
|
+
}, F = class e {
|
|
194
194
|
static isConstructor(e) {
|
|
195
195
|
return e === "d";
|
|
196
196
|
}
|
|
@@ -198,27 +198,27 @@ var we = {
|
|
|
198
198
|
return ["d", t.getDesignName()];
|
|
199
199
|
}
|
|
200
200
|
static getComponentName(e, t) {
|
|
201
|
-
return `${e}${t ? `-${
|
|
201
|
+
return `${e}${t ? `-${k(t)}` : ""}`;
|
|
202
202
|
}
|
|
203
203
|
static getClassName(e, t) {
|
|
204
204
|
return `.${this.getComponentName(e, t)}`;
|
|
205
205
|
}
|
|
206
206
|
static readFile(t, n) {
|
|
207
|
-
if (e.isConstructor(t)) return me(
|
|
208
|
-
if (n) return
|
|
207
|
+
if (e.isConstructor(t)) return me(Oe);
|
|
208
|
+
if (n) return P.read([...n, m]);
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, ke = "read", Ae = class {
|
|
211
211
|
designs;
|
|
212
212
|
paths;
|
|
213
213
|
constructorType = !1;
|
|
214
214
|
constructor(e) {
|
|
215
215
|
this.designs = e, this.paths = [], e.forEach((e) => {
|
|
216
216
|
this.paths.push({
|
|
217
|
-
design:
|
|
217
|
+
design: j(e),
|
|
218
218
|
paths: this.getDir(e),
|
|
219
219
|
pathsComponent: this.getDirComponents(e)
|
|
220
220
|
});
|
|
221
|
-
}), this.paths?.[1] &&
|
|
221
|
+
}), this.paths?.[1] && F.isConstructor(this.paths?.[1].design) && (delete this.paths[1], this.constructorType = !0);
|
|
222
222
|
}
|
|
223
223
|
isConstructor() {
|
|
224
224
|
return this.constructorType;
|
|
@@ -233,41 +233,41 @@ var we = {
|
|
|
233
233
|
return this.paths;
|
|
234
234
|
}
|
|
235
235
|
to(e, t, n) {
|
|
236
|
-
return
|
|
236
|
+
return P.get([ke, e], `${e}-${t}`, () => {
|
|
237
237
|
let e = {}, r = this.getPath(t);
|
|
238
|
-
return r && (e =
|
|
238
|
+
return r && (e = D(e, n(r.paths, r.pathsComponent, t))), e;
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
toAll(e, t) {
|
|
242
|
-
return
|
|
242
|
+
return P.get([ke], e, () => {
|
|
243
243
|
let n = {};
|
|
244
244
|
return this.designs.forEach((r) => {
|
|
245
|
-
n =
|
|
245
|
+
n = D(n, this.to(e, r, t));
|
|
246
246
|
}), n;
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
getDir(t) {
|
|
250
|
-
if (!
|
|
250
|
+
if (!F.isConstructor(t)) return [e.getRoot(), ...s];
|
|
251
251
|
}
|
|
252
252
|
getDirComponents(r) {
|
|
253
|
-
if (!
|
|
253
|
+
if (!F.isConstructor(r)) return [
|
|
254
254
|
e.getRoot(),
|
|
255
255
|
...n,
|
|
256
256
|
t.getProjectName()
|
|
257
257
|
];
|
|
258
258
|
}
|
|
259
|
-
},
|
|
259
|
+
}, je = [
|
|
260
260
|
v.design,
|
|
261
261
|
v.component,
|
|
262
262
|
v.classType
|
|
263
|
-
],
|
|
263
|
+
], I = class {
|
|
264
264
|
properties;
|
|
265
265
|
focusDesign;
|
|
266
266
|
constructor(e) {
|
|
267
267
|
this.properties = e;
|
|
268
268
|
}
|
|
269
269
|
isFocusDesign(e, t) {
|
|
270
|
-
return !!(t ||
|
|
270
|
+
return !!(t || he(this.focusDesign) || e === this.focusDesign || e === "d");
|
|
271
271
|
}
|
|
272
272
|
get() {
|
|
273
273
|
if (this.focusDesign) {
|
|
@@ -290,13 +290,13 @@ var we = {
|
|
|
290
290
|
name: n,
|
|
291
291
|
item: this.properties?.[n] ?? { value: "" }
|
|
292
292
|
}];
|
|
293
|
-
if (
|
|
293
|
+
if (T(i)) {
|
|
294
294
|
let e = r, o = i?.[r], s = a?.[0]?.item;
|
|
295
295
|
if (o) {
|
|
296
296
|
for (let n of t) if (a.push({
|
|
297
297
|
name: n,
|
|
298
298
|
item: o
|
|
299
|
-
}), s = o, e = n, o =
|
|
299
|
+
}), s = o, e = n, o = T(o.value) ? o.value?.[n] : void 0, !o) break;
|
|
300
300
|
}
|
|
301
301
|
if (o) return {
|
|
302
302
|
design: n,
|
|
@@ -312,7 +312,7 @@ var we = {
|
|
|
312
312
|
}
|
|
313
313
|
getKeys(e) {
|
|
314
314
|
let t = e.replace(/^\{|}$/gi, "").split(".");
|
|
315
|
-
return b(t, (e) => e.match(/^&/) ? e :
|
|
315
|
+
return b(t, (e) => e.match(/^&/) ? e : k(e));
|
|
316
316
|
}
|
|
317
317
|
getName(e, t) {
|
|
318
318
|
return this.getReName(e, t).replace(/\(.*?$/, "");
|
|
@@ -322,23 +322,23 @@ var we = {
|
|
|
322
322
|
}
|
|
323
323
|
getParentsName(e, t) {
|
|
324
324
|
return b(e, ({ name: e, item: n }) => {
|
|
325
|
-
if (!t || typeof n?.[_.variable] == "string" && (t.indexOf(n[_.variable]) !== -1 ||
|
|
325
|
+
if (!t || typeof n?.[_.variable] == "string" && (t.indexOf(n[_.variable]) !== -1 || je.indexOf(n[_.variable]) !== -1)) return k(e);
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
getMedia() {
|
|
329
329
|
let e = {};
|
|
330
330
|
return this.findCategory(y.media).forEach(({ design: t, item: n }) => {
|
|
331
|
-
|
|
331
|
+
T(n.value) && Object.assign(e, { [t]: n.value });
|
|
332
332
|
}), e;
|
|
333
333
|
}
|
|
334
334
|
getLink(e, t, n, r = ".") {
|
|
335
335
|
return n.match(/\?/) ? n.replace(/\?\?(?![ _-])/g, `${e}${r}${t}${r}`).replace(/\?\?(?=[ _-])/g, `${e}${r}${t}`).replace(/\?/g, `${e}${r}`) : this.getLinkByDesign(e, n);
|
|
336
336
|
}
|
|
337
337
|
getLinkToName(e, t, n) {
|
|
338
|
-
return this.getLink(e, t, n, "-").replace(/[a-zA-Z]+/gi, (e) =>
|
|
338
|
+
return this.getLink(e, t, n, "-").replace(/[a-zA-Z]+/gi, (e) => k(e));
|
|
339
339
|
}
|
|
340
340
|
getLinkToValue(e, t, n) {
|
|
341
|
-
return this.getLink(e, t, n).replace(/(?<=(?<!#)\{.*?)[a-zA-Z]+(?=.*?})/gi, (e) =>
|
|
341
|
+
return this.getLink(e, t, n).replace(/(?<=(?<!#)\{.*?)[a-zA-Z]+(?=.*?})/gi, (e) => k(e));
|
|
342
342
|
}
|
|
343
343
|
getLinkForName(e, t, n) {
|
|
344
344
|
return this.getLink(e, t, n, "-");
|
|
@@ -347,10 +347,10 @@ var we = {
|
|
|
347
347
|
return t.match("{") ? t?.replace(/(?<=(?<!#)\{)[^.{}]+/g, (t) => this.getDesigns().indexOf(t) === -1 ? `${e}.${t}` : t) : t;
|
|
348
348
|
}
|
|
349
349
|
each(e, t) {
|
|
350
|
-
return t ?
|
|
350
|
+
return t ? T(t.item.value) ? this.read(e, !0, t.design, t.component, t.item.value, t.item, t.parents) : [] : this.read(e);
|
|
351
351
|
}
|
|
352
352
|
eachMainOnly(e, t) {
|
|
353
|
-
return t ?
|
|
353
|
+
return t ? T(t.item.value) ? this.read(e, !1, t.design, t.component, t.item.value, t.item, t.parents) : [] : this.read(e, !1);
|
|
354
354
|
}
|
|
355
355
|
find(e) {
|
|
356
356
|
let t = [];
|
|
@@ -361,20 +361,20 @@ var we = {
|
|
|
361
361
|
findCategory(e) {
|
|
362
362
|
let t = [];
|
|
363
363
|
return this.each((n) => {
|
|
364
|
-
|
|
364
|
+
E(n.item?.[_.category], e) && t.push(n);
|
|
365
365
|
}), t;
|
|
366
366
|
}
|
|
367
367
|
findVariable(e) {
|
|
368
368
|
let t = [];
|
|
369
369
|
return this.each((n) => {
|
|
370
|
-
|
|
370
|
+
E(n.item?.[_.variable], e) && t.push(n);
|
|
371
371
|
}), t;
|
|
372
372
|
}
|
|
373
373
|
setFocusDesign(e) {
|
|
374
374
|
return this.focusDesign = e, this;
|
|
375
375
|
}
|
|
376
376
|
write(e) {
|
|
377
|
-
|
|
377
|
+
P.write(`${this.getDesigns().join("-")}-${e}`, this.properties);
|
|
378
378
|
}
|
|
379
379
|
getIndex(e) {
|
|
380
380
|
return `${x(e, "name").join(".")}`;
|
|
@@ -397,11 +397,11 @@ var we = {
|
|
|
397
397
|
parent: a,
|
|
398
398
|
parents: o
|
|
399
399
|
});
|
|
400
|
-
p !== void 0 && s.push(p), t &&
|
|
400
|
+
p !== void 0 && s.push(p), t && T(i.value) && s.push(...this.read(e, t, u, d, i.value, i, f)), c = i;
|
|
401
401
|
}
|
|
402
402
|
}), s;
|
|
403
403
|
}
|
|
404
|
-
},
|
|
404
|
+
}, Me = (t) => {
|
|
405
405
|
let n = {};
|
|
406
406
|
try {
|
|
407
407
|
let i = e.getRoot(), a = e.getRootProject(), o = [
|
|
@@ -422,7 +422,7 @@ var we = {
|
|
|
422
422
|
let r = e.readFile([
|
|
423
423
|
...o,
|
|
424
424
|
t,
|
|
425
|
-
|
|
425
|
+
m
|
|
426
426
|
]);
|
|
427
427
|
r && (n[t] = r);
|
|
428
428
|
});
|
|
@@ -430,7 +430,7 @@ var we = {
|
|
|
430
430
|
console.error("getConstructorProperties", e);
|
|
431
431
|
}
|
|
432
432
|
return n;
|
|
433
|
-
},
|
|
433
|
+
}, L = class {
|
|
434
434
|
static SYMBOLS = {
|
|
435
435
|
$: v.var,
|
|
436
436
|
"::": v.virtual,
|
|
@@ -444,7 +444,7 @@ var we = {
|
|
|
444
444
|
"--": v.none
|
|
445
445
|
};
|
|
446
446
|
static isInType(e, t) {
|
|
447
|
-
return
|
|
447
|
+
return C(e) && C(t) ? !!E(e, t) : !1;
|
|
448
448
|
}
|
|
449
449
|
static isTypeInName(e) {
|
|
450
450
|
return !!e.match(this.getExpSymbols());
|
|
@@ -464,7 +464,7 @@ var we = {
|
|
|
464
464
|
static getTypeInName(e) {
|
|
465
465
|
if (this.isTypeInName(e)) {
|
|
466
466
|
let t = e.replace(this.getExpSymbols(), "$1");
|
|
467
|
-
return t in this.SYMBOLS ? this.SYMBOLS[t] :
|
|
467
|
+
return t in this.SYMBOLS ? this.SYMBOLS[t] : j(t);
|
|
468
468
|
}
|
|
469
469
|
return null;
|
|
470
470
|
}
|
|
@@ -477,7 +477,7 @@ var we = {
|
|
|
477
477
|
static symbolsToString() {
|
|
478
478
|
return Object.keys(this.SYMBOLS).join("|");
|
|
479
479
|
}
|
|
480
|
-
},
|
|
480
|
+
}, R = class {
|
|
481
481
|
static isSpecialKey(e) {
|
|
482
482
|
return typeof e == "string" && ([
|
|
483
483
|
"value",
|
|
@@ -492,19 +492,19 @@ var we = {
|
|
|
492
492
|
return !!e.match(t.getSeparator());
|
|
493
493
|
}
|
|
494
494
|
static getName(e, t = !0) {
|
|
495
|
-
let n = e.replace(
|
|
496
|
-
return this.isSeparator(n) || !t ? n :
|
|
495
|
+
let n = e.replace(L.getExpSymbols(), "$2").replace(/^[|]/, "");
|
|
496
|
+
return this.isSeparator(n) || !t ? n : k(n);
|
|
497
497
|
}
|
|
498
498
|
static reKey(e, t) {
|
|
499
499
|
let n = this.getName(e);
|
|
500
500
|
if (t) {
|
|
501
|
-
if (
|
|
502
|
-
if (
|
|
503
|
-
if (
|
|
501
|
+
if (L.isMedia(t) && !n.match(/^media[A-Z]/) || L.isContainer(t) && !n.match(/^container[A-Z]/)) return k(`${t}-${n}`);
|
|
502
|
+
if (L.isScss(t)) return `&${this.getName(e, !1)}`;
|
|
503
|
+
if (L.isRoot(t)) return this.getName(e, !1);
|
|
504
504
|
}
|
|
505
505
|
return n;
|
|
506
506
|
}
|
|
507
|
-
},
|
|
507
|
+
}, z = class {
|
|
508
508
|
static isFull(e) {
|
|
509
509
|
return typeof e == "string" && !!e.match(this.getExpFull());
|
|
510
510
|
}
|
|
@@ -520,12 +520,12 @@ var we = {
|
|
|
520
520
|
static getExpFull() {
|
|
521
521
|
return /^=/;
|
|
522
522
|
}
|
|
523
|
-
},
|
|
523
|
+
}, B = class {
|
|
524
524
|
static to(e) {
|
|
525
525
|
let t = {};
|
|
526
526
|
return b(e, (e, n) => {
|
|
527
|
-
let r = this.getItem(n, e), i =
|
|
528
|
-
|
|
527
|
+
let r = this.getItem(n, e), i = R.reKey(n, r?.[_.type]);
|
|
528
|
+
T(r.value) && (r.value = this.to(r.value)), this.addValue(r), r[_.index] = n.replace(/^=/, ""), i in r ? t[i] = D(t[i] ?? {}, r) : t[i] = r;
|
|
529
529
|
}), t;
|
|
530
530
|
}
|
|
531
531
|
static getItem(e, t) {
|
|
@@ -535,25 +535,25 @@ var we = {
|
|
|
535
535
|
static getValueAndSpecial(e) {
|
|
536
536
|
let t = { value: e?.value || {} };
|
|
537
537
|
return b(e, (e, n) => {
|
|
538
|
-
|
|
538
|
+
R.isSpecialKey(n) ? t[n] = e : t.value[n] = e;
|
|
539
539
|
}), t;
|
|
540
540
|
}
|
|
541
541
|
static addType(e, t) {
|
|
542
542
|
if (!(_.type in t)) {
|
|
543
|
-
let n =
|
|
543
|
+
let n = L.getTypeInName(e);
|
|
544
544
|
n && (t[_.type] = n);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
static addFull(e, t) {
|
|
548
|
-
|
|
548
|
+
R.isFull(e) && (t[_.fullName] = !0), typeof t.value == "string" && (z.isFull(t.value) || e.match(/aspect/i)) && (t[_.fullValue] = !0);
|
|
549
549
|
}
|
|
550
550
|
static addValue(e) {
|
|
551
|
-
e.value =
|
|
551
|
+
e.value = z.reValue(e.value);
|
|
552
552
|
}
|
|
553
553
|
static toItem(e) {
|
|
554
|
-
return typeof e != "object" || Array.isArray(e) ? { value: e } :
|
|
554
|
+
return typeof e != "object" || Array.isArray(e) ? { value: e } : C(e) ? !("value" in e) || T(e.value) ? this.getValueAndSpecial(e) : e : { value: {} };
|
|
555
555
|
}
|
|
556
|
-
},
|
|
556
|
+
}, Ne = "settings", Pe = class {
|
|
557
557
|
path;
|
|
558
558
|
constructor(e) {
|
|
559
559
|
this.path = e;
|
|
@@ -569,21 +569,21 @@ var we = {
|
|
|
569
569
|
return this.path.isConstructor() && (a = [...r]), e.readDir(a).forEach((e) => i.push(e)), i;
|
|
570
570
|
}
|
|
571
571
|
getComponents() {
|
|
572
|
-
return this.path.toAll(
|
|
572
|
+
return this.path.toAll(Ne, (t, n, r) => {
|
|
573
573
|
let i = {};
|
|
574
574
|
return n && e.readDir(n).forEach((e) => {
|
|
575
|
-
let t =
|
|
576
|
-
|
|
575
|
+
let t = F.readFile(r, [...n, e]);
|
|
576
|
+
C(t) && (i = D(i, B.to({ [r]: { [j(e)]: t } })));
|
|
577
577
|
}), i;
|
|
578
578
|
});
|
|
579
579
|
}
|
|
580
580
|
getConstructors() {
|
|
581
|
-
return
|
|
581
|
+
return B.to({ d: Me(this.getComponentList()) });
|
|
582
582
|
}
|
|
583
583
|
};
|
|
584
584
|
//#endregion
|
|
585
585
|
//#region src/classes/Properties/convector/convectorColor.ts
|
|
586
|
-
function
|
|
586
|
+
function Fe(e) {
|
|
587
587
|
let t = e?.$extensions?.["studio.tokens"]?.modify?.type, n = e?.$extensions?.["studio.tokens"]?.modify?.value;
|
|
588
588
|
if (t) switch (t) {
|
|
589
589
|
case "alpha": e[_.cssColorOpacity] = n?.toString() ?? "1";
|
|
@@ -591,11 +591,11 @@ function Ie(e) {
|
|
|
591
591
|
}
|
|
592
592
|
//#endregion
|
|
593
593
|
//#region src/classes/Properties/convector/convectorShadow.ts
|
|
594
|
-
function
|
|
594
|
+
function Ie(e) {
|
|
595
595
|
let t = e?.value;
|
|
596
|
-
if (
|
|
596
|
+
if (w(t)) {
|
|
597
597
|
let n = [];
|
|
598
|
-
|
|
598
|
+
O(t).forEach((e) => {
|
|
599
599
|
let t = [], { type: r, color: i, x: a, y: o, blur: s, spread: c } = e, l = i.match(/^{/) ? `@ui.toCustomVarRgb(${i})` : i;
|
|
600
600
|
r === "innerShadow" && t.push("inset"), t.push(a && a !== "0" && a.match(/^[0-9]+$/) ? `${a}px` : a ?? "0", o && o !== "0" && o.match(/^[0-9]+$/) ? `${o}px` : o ?? "0", s && s !== "0" && s.match(/^[0-9]+$/) ? `${s}px` : s ?? "0", c && c !== "0" && c.match(/^-?[0-9]+$/) ? `${c}px` : c ?? "0", l ?? "rgba(0, 0, 0, 1)"), n.push(t.join(" ").trim());
|
|
601
601
|
}), e.value = n.join(", ");
|
|
@@ -603,28 +603,28 @@ function Le(e) {
|
|
|
603
603
|
}
|
|
604
604
|
//#endregion
|
|
605
605
|
//#region src/classes/Properties/convector/convectorFontFamilies.ts
|
|
606
|
-
function
|
|
606
|
+
function Le(e) {
|
|
607
607
|
typeof e?.value == "string" && !e.value.match(/[{}]/) && (e.value = `'${e.value}', sans-serif`);
|
|
608
608
|
}
|
|
609
609
|
//#endregion
|
|
610
610
|
//#region src/classes/Properties/convector/convectorTypography.ts
|
|
611
|
-
function
|
|
612
|
-
|
|
611
|
+
function Re(e) {
|
|
612
|
+
ge(e?.value) && (e.value = { basic: e.value });
|
|
613
613
|
}
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region src/classes/Properties/PropertiesConvector.ts
|
|
616
|
-
var
|
|
617
|
-
boxShadow:
|
|
618
|
-
color:
|
|
619
|
-
fontFamilies:
|
|
620
|
-
typography:
|
|
621
|
-
},
|
|
616
|
+
var ze = {
|
|
617
|
+
boxShadow: Ie,
|
|
618
|
+
color: Fe,
|
|
619
|
+
fontFamilies: Le,
|
|
620
|
+
typography: Re
|
|
621
|
+
}, V = class {
|
|
622
622
|
static to(e) {
|
|
623
623
|
b(e, (e) => {
|
|
624
|
-
e?.type && e.type in
|
|
624
|
+
e?.type && e.type in ze ? ze[e.type]?.(e) : e?.value && T(e.value) ? this.to(e.value) : T(e) && this.to(e);
|
|
625
625
|
});
|
|
626
626
|
}
|
|
627
|
-
},
|
|
627
|
+
}, Be = class {
|
|
628
628
|
properties;
|
|
629
629
|
root;
|
|
630
630
|
constructor(e, t) {
|
|
@@ -633,13 +633,13 @@ var Be = {
|
|
|
633
633
|
to(t = this.properties, n = this.root) {
|
|
634
634
|
let r = {};
|
|
635
635
|
return b(t, (t, i) => {
|
|
636
|
-
if (typeof t.value == "string" &&
|
|
636
|
+
if (typeof t.value == "string" && L.isInType(t[_.type], [v.file])) {
|
|
637
637
|
let { path: i, link: a } = this.initLink(n, t.value), o = this.readByLink(this.read(i), a);
|
|
638
|
-
|
|
639
|
-
} else r =
|
|
638
|
+
C(o) && (V.to(o), r = D(r, this.to(B.to(o), [e.getPathDir(i)])));
|
|
639
|
+
} else r = T(t.value) ? D(r, { [i]: {
|
|
640
640
|
...t,
|
|
641
641
|
value: this.to(t.value, n)
|
|
642
|
-
} }) :
|
|
642
|
+
} }) : D(r, { [i]: t });
|
|
643
643
|
}), r;
|
|
644
644
|
}
|
|
645
645
|
getPath(e, t) {
|
|
@@ -653,7 +653,7 @@ var Be = {
|
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
read(t) {
|
|
656
|
-
return e.isDir(t) ? this.readByDir(t) :
|
|
656
|
+
return e.isDir(t) ? this.readByDir(t) : P.read(t) ?? {};
|
|
657
657
|
}
|
|
658
658
|
readByLink(e, t) {
|
|
659
659
|
let n = e;
|
|
@@ -665,15 +665,15 @@ var Be = {
|
|
|
665
665
|
let n = e.readDir(t), r = {};
|
|
666
666
|
return n?.sort(), n?.forEach((n) => {
|
|
667
667
|
let i = e.parse(n);
|
|
668
|
-
i.ext === ".json" && (r[i.name] =
|
|
668
|
+
i.ext === ".json" && (r[i.name] = P.read([...t, n]) ?? {});
|
|
669
669
|
}), r;
|
|
670
670
|
}
|
|
671
|
-
},
|
|
671
|
+
}, H = class {
|
|
672
672
|
static is(e, n = t.getSeparatorLimit()) {
|
|
673
673
|
if (n > 0) for (let t in e) {
|
|
674
|
-
if (
|
|
674
|
+
if (R.isSeparator(t)) return !0;
|
|
675
675
|
let r = e?.[t]?.value;
|
|
676
|
-
if (r &&
|
|
676
|
+
if (r && T(r) && this.is(r, n - 1)) return !0;
|
|
677
677
|
}
|
|
678
678
|
return !1;
|
|
679
679
|
}
|
|
@@ -682,9 +682,9 @@ var Be = {
|
|
|
682
682
|
return b(e, (e, n) => {
|
|
683
683
|
let r = {
|
|
684
684
|
...e,
|
|
685
|
-
value:
|
|
685
|
+
value: T(e.value) ? this.to(e.value) : e.value
|
|
686
686
|
};
|
|
687
|
-
t =
|
|
687
|
+
t = R.isSeparator(n) ? D(t, this.wrap(r, this.removeBasicName(n))) : D(t, { [n]: r });
|
|
688
688
|
}), t;
|
|
689
689
|
}
|
|
690
690
|
static removeBasicName(e) {
|
|
@@ -700,10 +700,10 @@ var Be = {
|
|
|
700
700
|
} } };
|
|
701
701
|
}), n.value;
|
|
702
702
|
}
|
|
703
|
-
},
|
|
703
|
+
}, Ve = class {
|
|
704
704
|
static to(e) {
|
|
705
705
|
b(e, (e) => {
|
|
706
|
-
if (
|
|
706
|
+
if (T(e.value) && (this.to(e.value), e?.[_.wrap])) {
|
|
707
707
|
let t = e.value, n = this.getSelectors(t);
|
|
708
708
|
n.quantity > 1 && b(n.properties, (e, r) => {
|
|
709
709
|
if (r in t) {
|
|
@@ -732,7 +732,7 @@ var Be = {
|
|
|
732
732
|
quantity: 0
|
|
733
733
|
};
|
|
734
734
|
return b(e, (e) => {
|
|
735
|
-
|
|
735
|
+
T(e.value) && (t.quantity++, this.addItem(t.properties, e.value));
|
|
736
736
|
}), t;
|
|
737
737
|
}
|
|
738
738
|
static getMaxRepeat(e) {
|
|
@@ -756,24 +756,24 @@ var Be = {
|
|
|
756
756
|
static removeProperties(e, t) {
|
|
757
757
|
t?.forEach((t) => delete t[e]);
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, He = "main", Ue = class {
|
|
760
760
|
path;
|
|
761
761
|
constructor(e) {
|
|
762
762
|
this.path = e;
|
|
763
763
|
}
|
|
764
764
|
get() {
|
|
765
|
-
return this.path.toAll(
|
|
766
|
-
let r =
|
|
767
|
-
return
|
|
765
|
+
return this.path.toAll(He, (e, t, n) => {
|
|
766
|
+
let r = F.readFile(n, e);
|
|
767
|
+
return C(r) && (V.to(r), r = B.to({ [n]: r }), e && (r = new Be(r, e).to()), H.is(r) && (r = H.to(r), Ve.to(r))), r ?? {};
|
|
768
768
|
});
|
|
769
769
|
}
|
|
770
770
|
getBySettings(e) {
|
|
771
771
|
let t = this.get();
|
|
772
772
|
return b(e, (e, n) => {
|
|
773
773
|
let r = t?.[n]?.value;
|
|
774
|
-
r &&
|
|
774
|
+
r && T(r) && T(e.value) && b(e.value, (e, t) => {
|
|
775
775
|
let n = r?.[t]?.value;
|
|
776
|
-
n &&
|
|
776
|
+
n && T(n) && T(e.value) && b(e.value, (e, t) => {
|
|
777
777
|
this.copySettings(e, n?.[t]);
|
|
778
778
|
});
|
|
779
779
|
});
|
|
@@ -784,7 +784,7 @@ var Be = {
|
|
|
784
784
|
n.match(/^_/) && n in t && t[n] !== e && (t[n] = e);
|
|
785
785
|
}), this;
|
|
786
786
|
}
|
|
787
|
-
},
|
|
787
|
+
}, U = class {
|
|
788
788
|
items;
|
|
789
789
|
constructor(e) {
|
|
790
790
|
this.items = e;
|
|
@@ -795,7 +795,7 @@ var Be = {
|
|
|
795
795
|
write() {
|
|
796
796
|
this.items.write(this.FILE_CACHE);
|
|
797
797
|
}
|
|
798
|
-
},
|
|
798
|
+
}, We = class extends U {
|
|
799
799
|
FILE_CACHE = "001-replace";
|
|
800
800
|
init() {
|
|
801
801
|
this.items.each(({ item: e }) => {
|
|
@@ -816,7 +816,7 @@ var Be = {
|
|
|
816
816
|
getValue(e, t) {
|
|
817
817
|
return e?.pattern ? t.replace(new RegExp(e.pattern, e.flags), e.replace) : t;
|
|
818
818
|
}
|
|
819
|
-
},
|
|
819
|
+
}, Ge = "basic", W = "palette", Ke = class extends U {
|
|
820
820
|
items;
|
|
821
821
|
FILE_CACHE = "002-palette";
|
|
822
822
|
palette;
|
|
@@ -824,14 +824,14 @@ var Be = {
|
|
|
824
824
|
super(e), this.items = e, this.palette = this.items.findCategory(y.palette);
|
|
825
825
|
}
|
|
826
826
|
init() {
|
|
827
|
-
this.read(), this.items.findCategory(y.theme).forEach(({ design: e, name: t, item: n }) => n?.value &&
|
|
827
|
+
this.read(), this.items.findCategory(y.theme).forEach(({ design: e, name: t, item: n }) => n?.value && T(n.value) && this.read(n.value, t, e));
|
|
828
828
|
}
|
|
829
829
|
getParent(e, t) {
|
|
830
|
-
return
|
|
830
|
+
return W in t || (t[W] = {
|
|
831
831
|
value: {},
|
|
832
832
|
[_.type]: e === y.colors ? v.classType : v.component,
|
|
833
833
|
[_.category]: e
|
|
834
|
-
}), t[
|
|
834
|
+
}), t[W].value;
|
|
835
835
|
}
|
|
836
836
|
getClass(e, t) {
|
|
837
837
|
return e?.[t] || (e[t] = {
|
|
@@ -847,17 +847,17 @@ var Be = {
|
|
|
847
847
|
}
|
|
848
848
|
getValueDefault(e, t) {
|
|
849
849
|
let n = e?.[_.default];
|
|
850
|
-
return
|
|
850
|
+
return C(n) ? w(n) ? n?.[t] : n : "default";
|
|
851
851
|
}
|
|
852
|
-
read(e, t =
|
|
852
|
+
read(e, t = Ge, n) {
|
|
853
853
|
this.palette.forEach(({ design: r, item: i, parents: a, index: o }) => {
|
|
854
854
|
if (!n || n === r) {
|
|
855
855
|
let n = i?.[_.theme];
|
|
856
856
|
if (!n || n === t) {
|
|
857
857
|
let n = this.getParent(e ? y.colors : y.class, e ?? a?.[0]?.item.value);
|
|
858
|
-
n &&
|
|
858
|
+
n && T(i.value) && b(i.value, (e, r) => {
|
|
859
859
|
let a = this.getClass(n, r);
|
|
860
|
-
|
|
860
|
+
T(e.value) && e?.[_.category] !== y.paletteNone && this.addItem(a, `${o}.${r}`, t, e.value), this.addDefault(a, t, i);
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
}
|
|
@@ -879,25 +879,25 @@ var Be = {
|
|
|
879
879
|
[_.fullName]: !0
|
|
880
880
|
});
|
|
881
881
|
}
|
|
882
|
-
},
|
|
882
|
+
}, qe = 32, Je = 24, Ye = [
|
|
883
883
|
v.link,
|
|
884
884
|
v.var,
|
|
885
885
|
v.property,
|
|
886
886
|
v.selector,
|
|
887
887
|
v.virtual,
|
|
888
888
|
v.scss
|
|
889
|
-
],
|
|
889
|
+
], Xe = class extends U {
|
|
890
890
|
FILE_CACHE = "004-link";
|
|
891
891
|
update = 1;
|
|
892
892
|
ignore = [];
|
|
893
893
|
links = [];
|
|
894
894
|
init() {
|
|
895
|
-
let e =
|
|
895
|
+
let e = qe;
|
|
896
896
|
for (; this.update > 0 && e-- > 0;) this.update = 0, this.read();
|
|
897
897
|
}
|
|
898
898
|
read(e, t, n = this.items.get(), r = []) {
|
|
899
899
|
let i = [], a = !1;
|
|
900
|
-
if (r.length >
|
|
900
|
+
if (r.length > Je) return a;
|
|
901
901
|
for (let [o, s] of Object.entries(n)) {
|
|
902
902
|
let c = [...r, o];
|
|
903
903
|
if (e && t && this.isType(s) && this.isValue(s.value) && !this.isIgnore(s.value)) {
|
|
@@ -917,12 +917,12 @@ var Be = {
|
|
|
917
917
|
}
|
|
918
918
|
typeof l.value == "string" && this.addIgnore(l.value);
|
|
919
919
|
}
|
|
920
|
-
} else
|
|
920
|
+
} else T(s.value) && this.read(e ?? o, e && (t ?? o), s.value, c) && (a = !0);
|
|
921
921
|
}
|
|
922
922
|
return i.length > 0 && this.add(r, i), a;
|
|
923
923
|
}
|
|
924
924
|
isType(e) {
|
|
925
|
-
return !e?.[_.type] ||
|
|
925
|
+
return !e?.[_.type] || L.isInType(e[_.type], Ye);
|
|
926
926
|
}
|
|
927
927
|
isValue(e) {
|
|
928
928
|
return typeof e == "string" && !!e.match(/^{[^{}]+}$/) && !e.match(/[{?.]sys/);
|
|
@@ -934,12 +934,12 @@ var Be = {
|
|
|
934
934
|
return this.links.indexOf(e) !== -1;
|
|
935
935
|
}
|
|
936
936
|
isData(e) {
|
|
937
|
-
return
|
|
937
|
+
return T(e) && Object.keys(e).length > 0;
|
|
938
938
|
}
|
|
939
939
|
add(e, t) {
|
|
940
940
|
let n = this.items.getInfo(`{${e.join(".")}}`);
|
|
941
941
|
n && t.forEach(({ name: e, data: t, properties: r }) => {
|
|
942
|
-
n.item.value =
|
|
942
|
+
n.item.value = ve(r, t, e);
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
945
|
addIgnore(e) {
|
|
@@ -948,7 +948,7 @@ var Be = {
|
|
|
948
948
|
addLink(e) {
|
|
949
949
|
this.links.push(e);
|
|
950
950
|
}
|
|
951
|
-
},
|
|
951
|
+
}, G = /(?<={[^}]*?){([^{}]+)}/g, Ze = class extends U {
|
|
952
952
|
FILE_CACHE = "006-sub";
|
|
953
953
|
init() {
|
|
954
954
|
this.items.each((e) => {
|
|
@@ -956,17 +956,17 @@ var Be = {
|
|
|
956
956
|
});
|
|
957
957
|
}
|
|
958
958
|
is(e) {
|
|
959
|
-
return typeof e == "string" && !!e.match(
|
|
959
|
+
return typeof e == "string" && !!e.match(G);
|
|
960
960
|
}
|
|
961
961
|
getValue(e, t, n) {
|
|
962
962
|
let r = 24, i = !0;
|
|
963
|
-
for (; i && r-- > 0;) i = !1, n = n.replace(
|
|
963
|
+
for (; i && r-- > 0;) i = !1, n = n.replace(G, (n, r) => (i = !0, this.items.getItem(this.items.getLink(e, t, n))?.value ?? r));
|
|
964
964
|
return n.trim();
|
|
965
965
|
}
|
|
966
966
|
read({ design: e, component: t, item: n }) {
|
|
967
967
|
t && typeof n.value == "string" && (n.value = this.getValue(e, t, n.value), n?.[_.fullValue] && (n.value = n.value.replace(/[{}]/g, "")));
|
|
968
968
|
}
|
|
969
|
-
},
|
|
969
|
+
}, Qe = [_.value, _.settingClone], $e = [v.var, v.property], et = class extends U {
|
|
970
970
|
FILE_CACHE = "007-01-clone";
|
|
971
971
|
init() {
|
|
972
972
|
this.items.each(({ name: e, item: t, parent: n }) => {
|
|
@@ -975,21 +975,21 @@ var Be = {
|
|
|
975
975
|
}
|
|
976
976
|
findItem(e, t) {
|
|
977
977
|
let n = [];
|
|
978
|
-
return
|
|
979
|
-
r === t &&
|
|
978
|
+
return T(e.value) && b(e.value, (e, r) => {
|
|
979
|
+
r === t && $e.indexOf(e?.type ?? "") < 0 && n.push(e), n.push(...this.findItem(e, t));
|
|
980
980
|
}), n;
|
|
981
981
|
}
|
|
982
982
|
update(e, t) {
|
|
983
983
|
let n = e.value;
|
|
984
984
|
t.forEach((t) => {
|
|
985
985
|
b(e, (e, n) => {
|
|
986
|
-
n && !(n in t) &&
|
|
987
|
-
}),
|
|
986
|
+
n && !(n in t) && Qe.indexOf(n) < 0 && (t[n] = e);
|
|
987
|
+
}), T(n) && T(t.value) && b(t.value, (e, t) => {
|
|
988
988
|
n?.[t] && this.update(n[t], [e]);
|
|
989
989
|
});
|
|
990
990
|
});
|
|
991
991
|
}
|
|
992
|
-
},
|
|
992
|
+
}, tt = class extends U {
|
|
993
993
|
FILE_CACHE = "007-03-drag";
|
|
994
994
|
init() {
|
|
995
995
|
this.read();
|
|
@@ -1018,7 +1018,7 @@ var Be = {
|
|
|
1018
1018
|
parents: a
|
|
1019
1019
|
}), n?.[_.drag]) {
|
|
1020
1020
|
let i = this.getDragSetting(e), o = this.drag(a, n, i ?? {});
|
|
1021
|
-
r &&
|
|
1021
|
+
r && T(r.value) && o && this.toGo(n, o) && delete r.value[t];
|
|
1022
1022
|
}
|
|
1023
1023
|
}, e);
|
|
1024
1024
|
}
|
|
@@ -1034,33 +1034,33 @@ var Be = {
|
|
|
1034
1034
|
case "..":
|
|
1035
1035
|
o || (--t < 0 && (t = 0), a = e[t].item);
|
|
1036
1036
|
break;
|
|
1037
|
-
default: a &&
|
|
1037
|
+
default: a && T(a.value) && (n in a.value || (a.value[n] = r?.[n] ?? r._all ?? { value: {} }), o = !0, a = a.value[n]);
|
|
1038
1038
|
}
|
|
1039
1039
|
}), a !== n) return a;
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
toGo(e, t) {
|
|
1043
1043
|
let n = t.value;
|
|
1044
|
-
if (
|
|
1045
|
-
if (
|
|
1046
|
-
n?.[t] ?
|
|
1044
|
+
if (T(n)) {
|
|
1045
|
+
if (T(e.value)) b(e.value, (e, t) => {
|
|
1046
|
+
n?.[t] ? C(n[t].value) || (n[t].value = e.value) : n[t] = e;
|
|
1047
1047
|
});
|
|
1048
1048
|
else {
|
|
1049
1049
|
let t = e?.[_.index];
|
|
1050
|
-
t && (n?.[t] ?
|
|
1050
|
+
t && (n?.[t] ? C(n[t].value) || (n[t].value = e.value) : n[t] = e);
|
|
1051
1051
|
}
|
|
1052
1052
|
return !0;
|
|
1053
1053
|
}
|
|
1054
1054
|
return !1;
|
|
1055
1055
|
}
|
|
1056
|
-
},
|
|
1056
|
+
}, nt = class extends U {
|
|
1057
1057
|
FILE_CACHE = "007-02-remove";
|
|
1058
1058
|
init() {
|
|
1059
1059
|
this.items.find(({ item: e }) => e?.[_.remove] ?? !1).forEach(({ name: e, parent: t, parents: n }) => {
|
|
1060
|
-
t &&
|
|
1060
|
+
t && T(t.value) && (console.warn("[Remove]", `{${x(n, "name").join(".")}.${e}}`), delete t.value[e]);
|
|
1061
1061
|
});
|
|
1062
1062
|
}
|
|
1063
|
-
},
|
|
1063
|
+
}, K = /* @__PURE__ */ "direction.unicode-bidi.appearance.aspect-ratio.aspect-ratio-width.aspect-ratio-height.position.absolute.absolute-bottom.absolute-top.absolute-after.z-index.inset.inset-block.inset-block-start.inset-block-end.inset-inline.inset-inline-start.inset-inline-end.top.right.bottom.left.display.visibility.clear.contain.overflow.overflow-x.overflow-y.overflow-block.overflow-inline.overflow-wrap.overflow-clip-margin.overflow-anchor.float.shape-outside.shape-margin.shape-image-threshold.min-zoom.max-zoom".split("."), q = /* @__PURE__ */ "flex.flex-position.flex-flow.flex-basis.flex-direction.flex-grow.flex-shrink.flex-wrap.flex-dynamic.grid.grid-area.grid-auto-flow.grid-auto-columns.grid-auto-rows.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.grid-column.grid-column-start.grid-column-end.grid-row.grid-row-start.grid-row-end.align-content.align-items.align-self.align-tracks.justify-content.justify-items.justify-self.justify-tracks.place-content.place-items.place-self.gap.row-gap.order.masonry-auto-flow".split("."), rt = [
|
|
1064
1064
|
"columns",
|
|
1065
1065
|
"column-count",
|
|
1066
1066
|
"column-width",
|
|
@@ -1246,9 +1246,9 @@ var Be = {
|
|
|
1246
1246
|
"stress",
|
|
1247
1247
|
"volume"
|
|
1248
1248
|
], wt = [
|
|
1249
|
-
...G,
|
|
1250
1249
|
...K,
|
|
1251
1250
|
...q,
|
|
1251
|
+
...rt,
|
|
1252
1252
|
...it,
|
|
1253
1253
|
...at,
|
|
1254
1254
|
...ot,
|
|
@@ -1277,7 +1277,7 @@ var Be = {
|
|
|
1277
1277
|
"first-letter",
|
|
1278
1278
|
"first-line",
|
|
1279
1279
|
"selection"
|
|
1280
|
-
], Dt = class extends
|
|
1280
|
+
], Dt = class extends U {
|
|
1281
1281
|
FILE_CACHE = "008-variable";
|
|
1282
1282
|
init() {
|
|
1283
1283
|
this.items.each(({ design: e, component: t, name: n, item: r, parent: i }) => {
|
|
@@ -1295,28 +1295,28 @@ var Be = {
|
|
|
1295
1295
|
if (n === t) return v.component;
|
|
1296
1296
|
}
|
|
1297
1297
|
getByProperty(e) {
|
|
1298
|
-
return wt.indexOf(
|
|
1298
|
+
return wt.indexOf(j(e)) === -1 ? void 0 : v.property;
|
|
1299
1299
|
}
|
|
1300
1300
|
getBySelector(e) {
|
|
1301
|
-
return Tt.indexOf(
|
|
1301
|
+
return Tt.indexOf(j(e)) === -1 ? void 0 : v.selector;
|
|
1302
1302
|
}
|
|
1303
1303
|
getBySubclass(e) {
|
|
1304
|
-
if (Object.keys(e).length <= 1 && !
|
|
1304
|
+
if (Object.keys(e).length <= 1 && !C(e.value)) return v.subclass;
|
|
1305
1305
|
}
|
|
1306
1306
|
getByVarParent(e) {
|
|
1307
|
-
return
|
|
1307
|
+
return L.isInType(e?.[_.variable], [v.var]) ? v.var : void 0;
|
|
1308
1308
|
}
|
|
1309
1309
|
getByNone(e) {
|
|
1310
1310
|
return e?.[_.type] === v.none ? v.none : void 0;
|
|
1311
1311
|
}
|
|
1312
1312
|
getByVirtual(e) {
|
|
1313
|
-
return Et.indexOf(
|
|
1313
|
+
return Et.indexOf(j(e)) === -1 ? void 0 : v.virtual;
|
|
1314
1314
|
}
|
|
1315
1315
|
findType(e, t) {
|
|
1316
1316
|
let n = this.items.getName(e, t);
|
|
1317
|
-
return
|
|
1317
|
+
return T(t.value) ? this.getBySubclass(t) || this.getBySelector(n) || this.getByVirtual(n) || this.getByProperty(n) || v.state : this.getByProperty(n) || v.var;
|
|
1318
1318
|
}
|
|
1319
|
-
}, Ot = [v.var, v.property], kt = [v.classType, v.subclass], At = class extends
|
|
1319
|
+
}, Ot = [v.var, v.property], kt = [v.classType, v.subclass], At = class extends U {
|
|
1320
1320
|
FILE_CACHE = "010-similar";
|
|
1321
1321
|
init() {
|
|
1322
1322
|
this.items.each(({ item: e, name: t, parents: n }) => {
|
|
@@ -1328,7 +1328,7 @@ var Be = {
|
|
|
1328
1328
|
let r = [...n].reverse();
|
|
1329
1329
|
if (!t?.[_.type] && !t?.[_.rename] && !this.isException(t) && !this.isException(r?.[0]?.item)) {
|
|
1330
1330
|
r.shift();
|
|
1331
|
-
for (let { item: t } of r) if (
|
|
1331
|
+
for (let { item: t } of r) if (T(t.value)) {
|
|
1332
1332
|
let n = t.value?.[e];
|
|
1333
1333
|
if (this.isException(t)) break;
|
|
1334
1334
|
if (n && this.is(n) && (n?.[_.type] || n?.[_.rename])) return n;
|
|
@@ -1341,7 +1341,7 @@ var Be = {
|
|
|
1341
1341
|
isException(e) {
|
|
1342
1342
|
return e && e?.[_.variable] ? kt.indexOf(e[_.variable]) !== -1 : !1;
|
|
1343
1343
|
}
|
|
1344
|
-
}, jt = [v.var, v.state], Mt = class extends
|
|
1344
|
+
}, jt = [v.var, v.state], Mt = class extends U {
|
|
1345
1345
|
FILE_CACHE = "012-multi";
|
|
1346
1346
|
init() {
|
|
1347
1347
|
this.getList().forEach(({ item: e, name: t, value: n }) => {
|
|
@@ -1351,7 +1351,7 @@ var Be = {
|
|
|
1351
1351
|
getList() {
|
|
1352
1352
|
return this.items.each((e) => {
|
|
1353
1353
|
let { item: t, value: n } = e;
|
|
1354
|
-
if (t?.[_.variable] === v.property &&
|
|
1354
|
+
if (t?.[_.variable] === v.property && C(n) && T(n)) return e;
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
read(e, t, n) {
|
|
@@ -1362,11 +1362,11 @@ var Be = {
|
|
|
1362
1362
|
} });
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
|
-
}, Nt = class extends
|
|
1365
|
+
}, Nt = class extends U {
|
|
1366
1366
|
FILE_CACHE = "016-style";
|
|
1367
1367
|
init() {
|
|
1368
1368
|
this.items.each(({ item: e, name: t, design: n, component: r }) => {
|
|
1369
|
-
e?.[_.style] &&
|
|
1369
|
+
e?.[_.style] && T(e.value) && !e.value?.custom && (e[_.variable] = v.state, e.value[ce] = {
|
|
1370
1370
|
value: { [t]: {
|
|
1371
1371
|
value: `{${n}.${r}.sys.${t}}`,
|
|
1372
1372
|
[_.variable]: e?.[_.varKey] ? v.var : v.property
|
|
@@ -1375,14 +1375,14 @@ var Be = {
|
|
|
1375
1375
|
});
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
1378
|
-
}, Pt = class extends
|
|
1378
|
+
}, Pt = class extends U {
|
|
1379
1379
|
FILE_CACHE = "018-full";
|
|
1380
1380
|
init() {
|
|
1381
1381
|
this.items.each(({ design: e, component: t, name: n, value: r, item: i }) => {
|
|
1382
1382
|
t && (i[_.name] = this.items.getLinkToName(e, t, this.items.getReName(n, i)), typeof r == "string" && (i[_.css] = this.items.getLinkToValue(e, t, r)));
|
|
1383
1383
|
});
|
|
1384
1384
|
}
|
|
1385
|
-
}, Ft = /(?<!#)\{([^{}]+)}/gi, It = class extends
|
|
1385
|
+
}, Ft = /(?<!#)\{([^{}]+)}/gi, It = class extends U {
|
|
1386
1386
|
FILE_CACHE = "020-var";
|
|
1387
1387
|
type = v.var;
|
|
1388
1388
|
init() {
|
|
@@ -1395,7 +1395,7 @@ var Be = {
|
|
|
1395
1395
|
});
|
|
1396
1396
|
}
|
|
1397
1397
|
getName({ design: e, component: t, name: n, item: r, parents: i }) {
|
|
1398
|
-
return t && r?.[_.fullName] ? `--${this.items.getLink(e, t, r?.[_.index] ?? n, "-")}` : `--${this.items.getParentsName(i, [v.var]).join("-")}-${
|
|
1398
|
+
return t && r?.[_.fullName] ? `--${this.items.getLink(e, t, r?.[_.index] ?? n, "-")}` : `--${this.items.getParentsName(i, [v.var]).join("-")}-${k(n)}`;
|
|
1399
1399
|
}
|
|
1400
1400
|
toCalculator(e, t) {
|
|
1401
1401
|
return !t && e.match(/([+*/]|(?<![\w-])-(?![\w-]))/gi) && e.match(/calc/gi) === null ? `calc(${e})` : e;
|
|
@@ -1413,11 +1413,11 @@ var Be = {
|
|
|
1413
1413
|
isColorWithOpacity(e) {
|
|
1414
1414
|
let { design: t, component: n, value: r, item: i } = e;
|
|
1415
1415
|
if (i?.[_.cssColorOpacity]) return !0;
|
|
1416
|
-
if (n &&
|
|
1416
|
+
if (n && ge(r)) {
|
|
1417
1417
|
if (r.match(/^\{[^}]+}$/)) {
|
|
1418
1418
|
let e = this.items.getLink(t, n, r), i = this.items.getInfo(e);
|
|
1419
1419
|
if (i) return this.isColorWithOpacity(i);
|
|
1420
|
-
} else return
|
|
1420
|
+
} else return z.isColorWithOpacity(r);
|
|
1421
1421
|
}
|
|
1422
1422
|
return !1;
|
|
1423
1423
|
}
|
|
@@ -1425,9 +1425,9 @@ var Be = {
|
|
|
1425
1425
|
FILE_CACHE = "024-property";
|
|
1426
1426
|
type = v.property;
|
|
1427
1427
|
getName({ name: e, item: t }) {
|
|
1428
|
-
return
|
|
1428
|
+
return j(this.items.getReName(e, t));
|
|
1429
1429
|
}
|
|
1430
|
-
}, Rt = class extends
|
|
1430
|
+
}, Rt = class extends U {
|
|
1431
1431
|
FILE_CACHE = "028-component";
|
|
1432
1432
|
init() {
|
|
1433
1433
|
this.items.findVariable([v.component, v.theme]).forEach(({ name: e, item: t, parents: n }) => {
|
|
@@ -1438,7 +1438,7 @@ var Be = {
|
|
|
1438
1438
|
let r = this.items.getReName(e, t);
|
|
1439
1439
|
return t?.[_.fullName] ? `${r}` : `${this.items.getParentsName(n).join("-")}-${r}`;
|
|
1440
1440
|
}
|
|
1441
|
-
}, zt = class extends
|
|
1441
|
+
}, zt = class extends U {
|
|
1442
1442
|
FILE_CACHE = "030-class";
|
|
1443
1443
|
init() {
|
|
1444
1444
|
this.items.findVariable(v.classType).forEach(({ name: e, item: t, parents: n }) => {
|
|
@@ -1449,7 +1449,7 @@ var Be = {
|
|
|
1449
1449
|
let r = this.items.getReName(e, t);
|
|
1450
1450
|
return t?.[_.fullName] ? `& .${r}` : `& .${n?.[0]?.name}-${r}`;
|
|
1451
1451
|
}
|
|
1452
|
-
}, Bt = class extends
|
|
1452
|
+
}, Bt = class extends U {
|
|
1453
1453
|
FILE_CACHE = "032-state";
|
|
1454
1454
|
init() {
|
|
1455
1455
|
this.items.findVariable([v.state]).forEach(({ name: e, item: t, parents: n }) => {
|
|
@@ -1460,9 +1460,9 @@ var Be = {
|
|
|
1460
1460
|
let r = this.items.getReName(e, t);
|
|
1461
1461
|
if (t?.[_.fullName]) return `&.${r}`;
|
|
1462
1462
|
let i = n?.[1]?.item.value;
|
|
1463
|
-
return !t?.[_.state] && n.length > 2 &&
|
|
1463
|
+
return !t?.[_.state] && n.length > 2 && T(i) && i?.[e] && i[e][_.variable] === v.state ? `&.${n?.[1]?.item[_.name]}--${r}` : `&--${r}`;
|
|
1464
1464
|
}
|
|
1465
|
-
}, Vt = class extends
|
|
1465
|
+
}, Vt = class extends U {
|
|
1466
1466
|
FILE_CACHE = "036-subclass";
|
|
1467
1467
|
init() {
|
|
1468
1468
|
this.items.findVariable(v.subclass).forEach(({ name: e, item: t, parents: n }) => {
|
|
@@ -1481,7 +1481,7 @@ var Be = {
|
|
|
1481
1481
|
getName(e, t, n) {
|
|
1482
1482
|
return t?.[_.fullName] ? `& .${e}` : this.isParentState(n) ? `& .${this.items.getParentsName(n, [v.subclass]).join("__").replace("__", "-")}__${e}` : `&__${e}`;
|
|
1483
1483
|
}
|
|
1484
|
-
}, Ht = class extends
|
|
1484
|
+
}, Ht = class extends U {
|
|
1485
1485
|
FILE_CACHE = "038-root";
|
|
1486
1486
|
init() {
|
|
1487
1487
|
this.items.findVariable(v.root).forEach(({ design: e, component: t, name: n, item: r }) => {
|
|
@@ -1491,7 +1491,7 @@ var Be = {
|
|
|
1491
1491
|
getName(e, t, n) {
|
|
1492
1492
|
return `${this.items.getLink(e, t, n)} &`;
|
|
1493
1493
|
}
|
|
1494
|
-
}, Ut = class extends
|
|
1494
|
+
}, Ut = class extends U {
|
|
1495
1495
|
items;
|
|
1496
1496
|
FILE_CACHE = "040-media";
|
|
1497
1497
|
media;
|
|
@@ -1505,7 +1505,7 @@ var Be = {
|
|
|
1505
1505
|
v.containerGroup,
|
|
1506
1506
|
v.containerMaxGroup
|
|
1507
1507
|
]).forEach(({ design: e, name: t, item: n, parent: r }) => {
|
|
1508
|
-
r?.value &&
|
|
1508
|
+
r?.value && T(r.value) && (t in r.value && delete r.value[t], Object.assign(r.value, this.toValueGroup(e, t, n, this.getTypeByGroup(n))));
|
|
1509
1509
|
}), this.items.findVariable([
|
|
1510
1510
|
v.media,
|
|
1511
1511
|
v.mediaMax,
|
|
@@ -1529,7 +1529,7 @@ var Be = {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
toValueForMedia(e, t) {
|
|
1531
1531
|
return b(t, (t) => {
|
|
1532
|
-
let n =
|
|
1532
|
+
let n = k(t.replace(/^mediaMax|media|containerMax|container/, "")), r = this.media?.[e]?.[n]?.value;
|
|
1533
1533
|
return typeof r == "string" && r || n;
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
@@ -1538,7 +1538,7 @@ var Be = {
|
|
|
1538
1538
|
if (i) {
|
|
1539
1539
|
let e = {};
|
|
1540
1540
|
return Object.keys(i).forEach((i) => {
|
|
1541
|
-
let a =
|
|
1541
|
+
let a = k(`${t}-${i}`), o = k(`${r}-${i}`);
|
|
1542
1542
|
e[a] = {
|
|
1543
1543
|
value: { [o]: {
|
|
1544
1544
|
value: n.value,
|
|
@@ -1553,11 +1553,11 @@ var Be = {
|
|
|
1553
1553
|
}), e;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
}, Wt = class extends
|
|
1556
|
+
}, Wt = class extends U {
|
|
1557
1557
|
FILE_CACHE = "044-animate";
|
|
1558
1558
|
init() {
|
|
1559
1559
|
this.items.findVariable(v.animate).forEach(({ name: e, value: t, item: n, parents: r }) => {
|
|
1560
|
-
n[_.name] = this.getName(this.items.getReName(e, n), n, r),
|
|
1560
|
+
n[_.name] = this.getName(this.items.getReName(e, n), n, r), T(t) && b(t, (e, t) => {
|
|
1561
1561
|
e[_.variable] = v.animateFrame, e[_.name] = e?.[_.index] ?? t;
|
|
1562
1562
|
});
|
|
1563
1563
|
});
|
|
@@ -1573,9 +1573,9 @@ var Be = {
|
|
|
1573
1573
|
{
|
|
1574
1574
|
index: v.property,
|
|
1575
1575
|
value: [
|
|
1576
|
-
G,
|
|
1577
1576
|
K,
|
|
1578
1577
|
q,
|
|
1578
|
+
rt,
|
|
1579
1579
|
it,
|
|
1580
1580
|
at,
|
|
1581
1581
|
ot,
|
|
@@ -1638,7 +1638,7 @@ var Be = {
|
|
|
1638
1638
|
index: v.other,
|
|
1639
1639
|
value: []
|
|
1640
1640
|
}
|
|
1641
|
-
], Kt = class extends
|
|
1641
|
+
], Kt = class extends U {
|
|
1642
1642
|
FILE_CACHE = "048-sort";
|
|
1643
1643
|
init() {
|
|
1644
1644
|
this.read();
|
|
@@ -1647,7 +1647,7 @@ var Be = {
|
|
|
1647
1647
|
let t = [];
|
|
1648
1648
|
return this.items.eachMainOnly((e) => {
|
|
1649
1649
|
let { name: n, value: r, item: i } = e, a = this.getKeys(i);
|
|
1650
|
-
|
|
1650
|
+
T(r) && (i.value = this.read(e)), i[_.sort] = a.index, t.push({
|
|
1651
1651
|
name: n,
|
|
1652
1652
|
item: i,
|
|
1653
1653
|
order: a.value
|
|
@@ -1684,14 +1684,14 @@ var Be = {
|
|
|
1684
1684
|
t[e] = n;
|
|
1685
1685
|
}), t;
|
|
1686
1686
|
}
|
|
1687
|
-
}, qt = [v.var, v.property], Jt = class extends
|
|
1687
|
+
}, qt = [v.var, v.property], Jt = class extends U {
|
|
1688
1688
|
FILE_CACHE = "900-none";
|
|
1689
1689
|
init() {
|
|
1690
1690
|
this.items.findVariable(qt).forEach(({ name: e, value: t, parent: n, parents: r }) => {
|
|
1691
|
-
n && !
|
|
1691
|
+
n && !C(t) && T(t) && T(n.value) && (console.error("[None]", `{${x(r, "name").join(".")}.${e}}`), delete n.value[e]);
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
|
-
}, Yt = class extends
|
|
1694
|
+
}, Yt = class extends U {
|
|
1695
1695
|
FILE_CACHE = "910-duplicate";
|
|
1696
1696
|
init() {
|
|
1697
1697
|
let e = this.initList(), t = this.initDuplicate(e);
|
|
@@ -1713,7 +1713,7 @@ var Be = {
|
|
|
1713
1713
|
e.forEach((e) => {
|
|
1714
1714
|
r.indexOf(e) === -1 && r.push(e);
|
|
1715
1715
|
});
|
|
1716
|
-
}),
|
|
1716
|
+
}), k(r.join("-"));
|
|
1717
1717
|
}
|
|
1718
1718
|
findDuplicate(e, t) {
|
|
1719
1719
|
let n = {};
|
|
@@ -1725,7 +1725,7 @@ var Be = {
|
|
|
1725
1725
|
initList() {
|
|
1726
1726
|
let e = {}, n = t.getSeparator();
|
|
1727
1727
|
return this.items.each((t) => {
|
|
1728
|
-
if (t?.design && t?.component &&
|
|
1728
|
+
if (t?.design && t?.component && T(t.value) && Object.keys(t.value).length >= 5) {
|
|
1729
1729
|
let r = x(t.parents, "name").join(n);
|
|
1730
1730
|
e[`${r}${n}${t.name}`] = {
|
|
1731
1731
|
value: `${t.design}::${t.component}::${JSON.stringify(t.value)}`,
|
|
@@ -1753,7 +1753,7 @@ var Be = {
|
|
|
1753
1753
|
}
|
|
1754
1754
|
getShade() {
|
|
1755
1755
|
return b(this.items.findCategory(y.shade), ({ design: e, value: t }) => {
|
|
1756
|
-
if (
|
|
1756
|
+
if (T(t)) return {
|
|
1757
1757
|
design: e,
|
|
1758
1758
|
value: x(t, "value")
|
|
1759
1759
|
};
|
|
@@ -1765,7 +1765,7 @@ var Be = {
|
|
|
1765
1765
|
if (r && typeof i == "string" && a?.[_.variable] === v.var && a?.[_.category] !== y.color && a?.[_.name]) {
|
|
1766
1766
|
let s = this.getFocusUsed(e, n, r, i);
|
|
1767
1767
|
if (s) {
|
|
1768
|
-
let e = a[_.name], r = t.find((t) => t.name === e), i = o.find((e) => e.item[_.category] === "theme")?.name || "basic", c = `--${n}-palette-${
|
|
1768
|
+
let e = a[_.name], r = t.find((t) => t.name === e), i = o.find((e) => e.item[_.category] === "theme")?.name || "basic", c = `--${n}-palette-${k(`${i}-${s.match(/\.([^.{}]+)}/)?.[1]}`)}`;
|
|
1769
1769
|
r ? r.value.push(c) : t.push({
|
|
1770
1770
|
name: e,
|
|
1771
1771
|
value: [c]
|
|
@@ -1802,7 +1802,7 @@ var Be = {
|
|
|
1802
1802
|
getMedia() {
|
|
1803
1803
|
let e = "";
|
|
1804
1804
|
return b(this.items.getMedia(), (t, n) => {
|
|
1805
|
-
|
|
1805
|
+
T(t) && b(t, (t, r) => {
|
|
1806
1806
|
e += `\r\n '${n}-${r}': ${this.getValueItem(t)},`;
|
|
1807
1807
|
});
|
|
1808
1808
|
}), this.getPropertiesValue($t, e);
|
|
@@ -1830,7 +1830,7 @@ var Be = {
|
|
|
1830
1830
|
return this.items.findCategory(e).forEach((e) => t.push(`\r\n '${e.index}',`)), t.join("");
|
|
1831
1831
|
}
|
|
1832
1832
|
getValue(e, t) {
|
|
1833
|
-
return
|
|
1833
|
+
return T(e.value) ? `value: (${this.to(e.value, `${t} `)}\r\n${t} ),` : Array.isArray(e.value) ? `value: (${e.value.join(", ")}),` : `value: ${this.getValueItem(e)},`;
|
|
1834
1834
|
}
|
|
1835
1835
|
getValueItem(e) {
|
|
1836
1836
|
let t = e?.[_.css] || e.value;
|
|
@@ -1849,19 +1849,19 @@ var Be = {
|
|
|
1849
1849
|
designs;
|
|
1850
1850
|
items;
|
|
1851
1851
|
constructor() {
|
|
1852
|
-
this.designs =
|
|
1852
|
+
this.designs = F.getDesigns(), this.items = new I(this.read());
|
|
1853
1853
|
}
|
|
1854
1854
|
get() {
|
|
1855
1855
|
return this.items;
|
|
1856
1856
|
}
|
|
1857
1857
|
getScss() {
|
|
1858
|
-
return
|
|
1858
|
+
return P.get([], this.getPathName(), () => {
|
|
1859
1859
|
let e = new an(this.items).get();
|
|
1860
1860
|
return console.info("[Scss]", "init"), e;
|
|
1861
1861
|
}, "scss");
|
|
1862
1862
|
}
|
|
1863
1863
|
read() {
|
|
1864
|
-
return
|
|
1864
|
+
return P.get([], this.getPathName(), () => {
|
|
1865
1865
|
console.info("[Properties]", "start");
|
|
1866
1866
|
let e = this.readFiles();
|
|
1867
1867
|
return this.toBasic(e), new At(e).to(), new Mt(e).to(), new Nt(e).to(), new Pt(e).to(), new It(e).to(), new Lt(e).to(), new Rt(e).to(), new zt(e).to(), new Bt(e).to(), new Vt(e).to(), new Ht(e).to(), new Ut(e).to(), new Wt(e).to(), new Kt(e).to(), new Jt(e).to(), new Yt(e).to(), console.info("[Properties]", "init"), e.get();
|
|
@@ -1871,11 +1871,11 @@ var Be = {
|
|
|
1871
1871
|
return `${this.designs.join("-")}-${on}`;
|
|
1872
1872
|
}
|
|
1873
1873
|
readFiles() {
|
|
1874
|
-
let e = new
|
|
1875
|
-
return new
|
|
1874
|
+
let e = new Ae(this.designs), t = new Pe(e).get();
|
|
1875
|
+
return new I(D(t, new Ue(e).getBySettings(t)));
|
|
1876
1876
|
}
|
|
1877
1877
|
toBasic(e) {
|
|
1878
|
-
new
|
|
1878
|
+
new We(e).to(), new Ke(e).to(), new Xe(e).to(), new Ze(e).to(), new et(e).to(), new nt(e).to(), new tt(e).to(), new Dt(e).to();
|
|
1879
1879
|
}
|
|
1880
1880
|
}, J = class {
|
|
1881
1881
|
component;
|
|
@@ -1901,7 +1901,7 @@ var Be = {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
isProps(e) {
|
|
1903
1903
|
let t = e?.[_.prop];
|
|
1904
|
-
return t !== !1 && (
|
|
1904
|
+
return t !== !1 && (C(t) || e?.[_.variable] === v.state || ue.indexOf(e?.[_.name]) !== -1);
|
|
1905
1905
|
}
|
|
1906
1906
|
isLinkClass(e) {
|
|
1907
1907
|
return typeof e.value == "string" && e?.[_.variable] === v.linkClass;
|
|
@@ -1914,7 +1914,7 @@ var Be = {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
makeState(e) {
|
|
1916
1916
|
let t = [];
|
|
1917
|
-
return
|
|
1917
|
+
return C(e) && T(e) && b(e, (e, n) => {
|
|
1918
1918
|
if (this.isProps(e) && t.push({
|
|
1919
1919
|
index: n,
|
|
1920
1920
|
type: v.property,
|
|
@@ -1967,7 +1967,7 @@ var Be = {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
makeValueUnique() {
|
|
1969
1969
|
return b(this.data, (e) => {
|
|
1970
|
-
e.valueAll =
|
|
1970
|
+
e.valueAll = be(e.valueAll), C(e.value) || (e.value = [!0]), C(e.valueAll) || (e.valueAll = [!0]);
|
|
1971
1971
|
}), this;
|
|
1972
1972
|
}
|
|
1973
1973
|
makeValueState(e = this.states, t) {
|
|
@@ -1988,10 +1988,10 @@ var Be = {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
toName(e, t) {
|
|
1990
1990
|
let n = e?.[_.prop];
|
|
1991
|
-
return
|
|
1991
|
+
return k(typeof n == "string" && n || e?.[_.rename] || e?.[_.index] || t);
|
|
1992
1992
|
}
|
|
1993
1993
|
toValue(e) {
|
|
1994
|
-
if (
|
|
1994
|
+
if (C(e) && T(e)) {
|
|
1995
1995
|
let t = [], n = !1;
|
|
1996
1996
|
return b(e, (e, r) => {
|
|
1997
1997
|
(!(r in this.data) || e?.[_.prop]) && (e?.[_.variable] === v.state ? t.push(r) : n = !0);
|
|
@@ -2006,11 +2006,11 @@ var Be = {
|
|
|
2006
2006
|
}
|
|
2007
2007
|
make(e, t = []) {
|
|
2008
2008
|
let n = [];
|
|
2009
|
-
return
|
|
2009
|
+
return C(e) && T(e) && b(e, (e) => {
|
|
2010
2010
|
if (this.isClasses(e)) {
|
|
2011
2011
|
let r = this.getNames(e, t);
|
|
2012
2012
|
n.push({
|
|
2013
|
-
index:
|
|
2013
|
+
index: k(r.join("-")),
|
|
2014
2014
|
full: e?.[_.fullName] ?? !1,
|
|
2015
2015
|
className: r.join("__")
|
|
2016
2016
|
}, ...this.make(e?.value, r));
|
|
@@ -2032,7 +2032,7 @@ var Be = {
|
|
|
2032
2032
|
return Y;
|
|
2033
2033
|
}
|
|
2034
2034
|
static addSpace(e) {
|
|
2035
|
-
return
|
|
2035
|
+
return ye(Y, e);
|
|
2036
2036
|
}
|
|
2037
2037
|
static addImport(e) {
|
|
2038
2038
|
return `@import "${e}";`;
|
|
@@ -2101,9 +2101,9 @@ var Be = {
|
|
|
2101
2101
|
}, fn = class extends Z {
|
|
2102
2102
|
treatment() {
|
|
2103
2103
|
let { value: e } = this.property;
|
|
2104
|
-
if (
|
|
2104
|
+
if (T(e)) {
|
|
2105
2105
|
let t = [];
|
|
2106
|
-
return new
|
|
2106
|
+
return new I(e).each(({ item: e }) => {
|
|
2107
2107
|
e?.[_.variable] === v.var && e?.[_.css] && (t.push(this.getCode(e)), e?.[_.cssColorOpacity] && t.push(this.getCodeColorOpacity(e)));
|
|
2108
2108
|
}), t;
|
|
2109
2109
|
}
|
|
@@ -2112,7 +2112,7 @@ var Be = {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
getCode(e = this.item) {
|
|
2114
2114
|
let t = e?.[_.css];
|
|
2115
|
-
return t = typeof t != "string" || t === "" ? "unset" :
|
|
2115
|
+
return t = typeof t != "string" || t === "" ? "unset" : z.isColor(t) ? `#{ui.toColorRbg(${t})}` : t.replace(/\\#/g, "#"), `${e?.[_.name]}: ${X.toFunctionCss(t)};`;
|
|
2116
2116
|
}
|
|
2117
2117
|
getCodeColorOpacity(e = this.item) {
|
|
2118
2118
|
let t = e?.[_.css], n = e?.[_.cssColorOpacity];
|
|
@@ -2125,17 +2125,17 @@ var Be = {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
getVar() {
|
|
2127
2127
|
let { design: e, component: t } = this.property, n = this.getName(), r = this.getValue();
|
|
2128
|
-
return `--${
|
|
2128
|
+
return `--${F.getComponentName(e, t)}-${n}: ${r};`;
|
|
2129
2129
|
}
|
|
2130
2130
|
getPropertyValue() {
|
|
2131
2131
|
let e = this.getName(), t = this.getValue() ?? "unset";
|
|
2132
|
-
if (this.item?.[_.modification] !== !1 && pn.indexOf(e) !== -1) return `@include ui.${
|
|
2132
|
+
if (this.item?.[_.modification] !== !1 && pn.indexOf(e) !== -1) return `@include ui.${k(e)}(#{${t}});${this.initAuxiliaryValue()}`;
|
|
2133
2133
|
let n = `${e}: ${X.toFunctionCss(t)}`;
|
|
2134
2134
|
return e === "font-family" ? `${n}, sans-serif;` : `${n};`;
|
|
2135
2135
|
}
|
|
2136
2136
|
initAuxiliaryValue() {
|
|
2137
2137
|
let e = this.getName(), t = this.property.parent?.value;
|
|
2138
|
-
if (
|
|
2138
|
+
if (T(t)) switch (e) {
|
|
2139
2139
|
case "color-opacity":
|
|
2140
2140
|
if (!("color" in t)) return " @include ui.color('init');";
|
|
2141
2141
|
break;
|
|
@@ -2160,7 +2160,7 @@ var Be = {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
getClassName() {
|
|
2162
2162
|
let { design: e, component: t } = this.property;
|
|
2163
|
-
return `'${
|
|
2163
|
+
return `'${F.getClassName(e, t)}'`;
|
|
2164
2164
|
}
|
|
2165
2165
|
getSelector() {
|
|
2166
2166
|
let e = this.getName(), t = this.getClassName(), n = t === `'.${this.property.parent?.[_.name]}'`;
|
|
@@ -2170,7 +2170,7 @@ var Be = {
|
|
|
2170
2170
|
case "focus":
|
|
2171
2171
|
case "disabled":
|
|
2172
2172
|
case "readonly": return `@include ui.${e}${n ? "" : `(${t})`}`;
|
|
2173
|
-
default: return `&:${
|
|
2173
|
+
default: return `&:${j(e)}`;
|
|
2174
2174
|
}
|
|
2175
2175
|
}
|
|
2176
2176
|
}, gn = class extends Z {
|
|
@@ -2230,7 +2230,7 @@ var Be = {
|
|
|
2230
2230
|
this.space = e, this.property = t, this.parent = n, this.item = t.item;
|
|
2231
2231
|
}
|
|
2232
2232
|
make() {
|
|
2233
|
-
return new
|
|
2233
|
+
return new I({}).eachMainOnly((t) => {
|
|
2234
2234
|
let { item: n } = t;
|
|
2235
2235
|
if (this.isAuxiliary() && this.isAuxiliary(n) && this.isNotBasic(n)) {
|
|
2236
2236
|
let n = new e(X.increaseSpace(this.space), t, this.item).make();
|
|
@@ -2297,7 +2297,7 @@ var Be = {
|
|
|
2297
2297
|
itemsClasses;
|
|
2298
2298
|
itemsStyles;
|
|
2299
2299
|
constructor(e) {
|
|
2300
|
-
this.component =
|
|
2300
|
+
this.component = k(e ?? "component");
|
|
2301
2301
|
}
|
|
2302
2302
|
get() {
|
|
2303
2303
|
return this.items === void 0 && (this.items = this.make()), this.items;
|
|
@@ -2312,19 +2312,19 @@ var Be = {
|
|
|
2312
2312
|
return t.getDesignName();
|
|
2313
2313
|
}
|
|
2314
2314
|
getDesignFirst() {
|
|
2315
|
-
return
|
|
2315
|
+
return A(t.getDesignName());
|
|
2316
2316
|
}
|
|
2317
2317
|
getComponentName() {
|
|
2318
2318
|
return this.component;
|
|
2319
2319
|
}
|
|
2320
2320
|
getComponentNameFirst() {
|
|
2321
|
-
return
|
|
2321
|
+
return A(this.component);
|
|
2322
2322
|
}
|
|
2323
2323
|
getFullComponentName() {
|
|
2324
2324
|
return `${this.getDesignFirst()}${this.getComponentNameFirst()}`;
|
|
2325
2325
|
}
|
|
2326
2326
|
getFileName() {
|
|
2327
|
-
return
|
|
2327
|
+
return A(this.getPathName());
|
|
2328
2328
|
}
|
|
2329
2329
|
getPathName() {
|
|
2330
2330
|
return `${t.getDesignName()}-${this.component}`;
|
|
@@ -2333,10 +2333,10 @@ var Be = {
|
|
|
2333
2333
|
return `${this.getPathName()}-${de}`;
|
|
2334
2334
|
}
|
|
2335
2335
|
make() {
|
|
2336
|
-
return
|
|
2336
|
+
return P.get([f], this.getPathName(), () => new cn(this.component).get());
|
|
2337
2337
|
}
|
|
2338
2338
|
makeClasses() {
|
|
2339
|
-
return
|
|
2339
|
+
return P.get([f], this.getPathClasses(), () => new ln(this.component).get());
|
|
2340
2340
|
}
|
|
2341
2341
|
makeStyles() {
|
|
2342
2342
|
return new wn(this.component).get();
|
|
@@ -2347,7 +2347,7 @@ var Be = {
|
|
|
2347
2347
|
component;
|
|
2348
2348
|
mark;
|
|
2349
2349
|
constructor(e, t, n) {
|
|
2350
|
-
this.structure = e, this.sample = n, this.mark =
|
|
2350
|
+
this.structure = e, this.sample = n, this.mark = A(t), this.component = this.structure.getComponentNameFirst();
|
|
2351
2351
|
}
|
|
2352
2352
|
get() {
|
|
2353
2353
|
return this.sample;
|
|
@@ -2356,7 +2356,7 @@ var Be = {
|
|
|
2356
2356
|
return "../../";
|
|
2357
2357
|
}
|
|
2358
2358
|
getNameFile(e) {
|
|
2359
|
-
return e.replace(/\[project]/g, t.getProjectName()).replace(/\[design]/g, this.structure.getDesign()).replace(/\[Design]/g,
|
|
2359
|
+
return e.replace(/\[project]/g, t.getProjectName()).replace(/\[design]/g, this.structure.getDesign()).replace(/\[Design]/g, A(this.structure.getDesign())).replace(/\[component]/g, this.structure.getComponentName()).replace(/DesignComponent/g, this.structure.getFileName()).replace(new RegExp(this.mark, "g"), this.component).replace(RegExp(`DefineSetupFn${this.component}`, "g"), "DefineSetupFnComponent");
|
|
2360
2360
|
}
|
|
2361
2361
|
replaceName() {
|
|
2362
2362
|
return this.sample = this.getNameFile(this.sample), this;
|
|
@@ -2372,7 +2372,7 @@ var Be = {
|
|
|
2372
2372
|
}
|
|
2373
2373
|
return this;
|
|
2374
2374
|
}
|
|
2375
|
-
replaceOnce(e =
|
|
2375
|
+
replaceOnce(e = k(this.mark), t = !1) {
|
|
2376
2376
|
let n = RegExp(`\\/\\/ :${e}\\.once ([^\r\n]+)([\r\n ]*)`, "g"), r = RegExp(`\\/\\* :${e}\\.once \\*\\/([\\S\\s]*?)\\/\\* :${e}\\.once\\.end \\*\\/([\r\n ]*)`, "g"), i = RegExp(`\\/\\* :${e}\\.once (.*?) \\*\\/([\r\n ]*)`, "g"), a = RegExp(`<!-- :${e}\\.once -->([\\S\\s]*?)<!-- :${e}\\.once\\.end -->([\r\n ]*)`, "g"), o = RegExp(`<!-- :${e}\\.once (.*?) -->([\r\n ]*)`, "g"), s = (...e) => typeof t == "function" ? `${t(e[1])}${e[2]}` : t ? "" : `${e[1]}${e[2]}`;
|
|
2377
2377
|
return this.sample = this.sample.replace(n, s).replace(r, s).replace(i, s).replace(a, s).replace(o, s), this;
|
|
2378
2378
|
}
|
|
@@ -2504,25 +2504,25 @@ var Be = {
|
|
|
2504
2504
|
this.command ? (console.info(`-- ${t.getDesignName()}.${this.command}:`), await this.initMain(), console.info("-- end")) : console.info("-- not name");
|
|
2505
2505
|
}
|
|
2506
2506
|
isFile(t) {
|
|
2507
|
-
return e.is([...this.dir, ...
|
|
2507
|
+
return e.is([...this.dir, ...O(t)]);
|
|
2508
2508
|
}
|
|
2509
2509
|
getCommand() {
|
|
2510
2510
|
return this.command;
|
|
2511
2511
|
}
|
|
2512
2512
|
getName() {
|
|
2513
|
-
return
|
|
2513
|
+
return A(this.getCommand());
|
|
2514
2514
|
}
|
|
2515
2515
|
getNameMin() {
|
|
2516
|
-
return
|
|
2516
|
+
return k(this.getCommand());
|
|
2517
2517
|
}
|
|
2518
2518
|
getCode() {
|
|
2519
|
-
return
|
|
2519
|
+
return j(this.getCommand());
|
|
2520
2520
|
}
|
|
2521
2521
|
getFullName() {
|
|
2522
|
-
return
|
|
2522
|
+
return A(`${t.getDesignName()}-${this.getCommand()}`);
|
|
2523
2523
|
}
|
|
2524
2524
|
getProjectName() {
|
|
2525
|
-
return
|
|
2525
|
+
return A(t.getProjectName());
|
|
2526
2526
|
}
|
|
2527
2527
|
getStructure() {
|
|
2528
2528
|
return this.structure ||= new Tn(this.getCommand()), this.structure;
|
|
@@ -2531,7 +2531,7 @@ var Be = {
|
|
|
2531
2531
|
return new En(this.getStructure(), this.mark, e ?? "");
|
|
2532
2532
|
}
|
|
2533
2533
|
read(t) {
|
|
2534
|
-
return e.readFile([...this.dir, ...
|
|
2534
|
+
return e.readFile([...this.dir, ...O(t)]);
|
|
2535
2535
|
}
|
|
2536
2536
|
readSample(e) {
|
|
2537
2537
|
return this.sample?.[e];
|
|
@@ -2550,7 +2550,7 @@ var Be = {
|
|
|
2550
2550
|
if (r && i) {
|
|
2551
2551
|
let a = t.split("|"), o = a.pop();
|
|
2552
2552
|
for (let e of a) e in i || (i[e] = {}), i = i[e];
|
|
2553
|
-
o && (i[o] = n), e.writeByPath(
|
|
2553
|
+
o && (i[o] = n), e.writeByPath(ae, r);
|
|
2554
2554
|
}
|
|
2555
2555
|
return this;
|
|
2556
2556
|
}
|
|
@@ -2624,8 +2624,8 @@ var Be = {
|
|
|
2624
2624
|
}), this;
|
|
2625
2625
|
}
|
|
2626
2626
|
makeLibrary() {
|
|
2627
|
-
let t =
|
|
2628
|
-
return e.writeByPath([...a, `${t}.ts`], `export * from '../${u}/${
|
|
2627
|
+
let t = k(this.getCommand());
|
|
2628
|
+
return e.writeByPath([...a, `${t}.ts`], `export * from '../${u}/${A(this.getCommand())}/index'
|
|
2629
2629
|
`), this;
|
|
2630
2630
|
}
|
|
2631
2631
|
}, Rn = class {
|
|
@@ -2634,7 +2634,7 @@ var Be = {
|
|
|
2634
2634
|
this.name = e;
|
|
2635
2635
|
}
|
|
2636
2636
|
async make() {
|
|
2637
|
-
if (
|
|
2637
|
+
if (P.clear(), C(this.name)) await new Ln(this.name).make();
|
|
2638
2638
|
else for (let e of this.getComponents()) console.log(`Constructor update: ${e}`), await new Ln(e).make();
|
|
2639
2639
|
this.makeStyle();
|
|
2640
2640
|
}
|
|
@@ -2644,7 +2644,7 @@ var Be = {
|
|
|
2644
2644
|
getComponentsStyle() {
|
|
2645
2645
|
let e = [];
|
|
2646
2646
|
return this.getComponents().forEach((t) => {
|
|
2647
|
-
let n =
|
|
2647
|
+
let n = A(t);
|
|
2648
2648
|
e.push(`@forward "../constructors/${n}/style";`);
|
|
2649
2649
|
}), e;
|
|
2650
2650
|
}
|
|
@@ -2659,20 +2659,20 @@ var Be = {
|
|
|
2659
2659
|
let t = [...a, se], n = this.getComponentsStyle();
|
|
2660
2660
|
e.writeByPath(t, n.join("\r\n"));
|
|
2661
2661
|
}
|
|
2662
|
-
}, zn = 2, Bn = "image/webp",
|
|
2662
|
+
}, zn = 2, Bn = "image/webp", Vn = "flags.webp", Hn = [
|
|
2663
2663
|
"src",
|
|
2664
2664
|
"assets",
|
|
2665
|
-
|
|
2666
|
-
],
|
|
2665
|
+
Vn
|
|
2666
|
+
], Un = [
|
|
2667
2667
|
".",
|
|
2668
2668
|
"..",
|
|
2669
2669
|
"assets",
|
|
2670
|
-
|
|
2671
|
-
],
|
|
2670
|
+
Vn
|
|
2671
|
+
], Wn = [
|
|
2672
2672
|
"src",
|
|
2673
2673
|
"styles",
|
|
2674
2674
|
"flags.css"
|
|
2675
|
-
],
|
|
2675
|
+
], Gn = ".ui-sys-flags", Kn = class {
|
|
2676
2676
|
dir;
|
|
2677
2677
|
width;
|
|
2678
2678
|
height;
|
|
@@ -2711,20 +2711,20 @@ var Be = {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
getStyle() {
|
|
2713
2713
|
let e = this.columns * (this.square / this.width), t = this.getLines() * (this.square / this.height), n = `
|
|
2714
|
-
${
|
|
2714
|
+
${Gn} {
|
|
2715
2715
|
--sys-flags-width: ${this.width}px;
|
|
2716
2716
|
--sys-flags-height: ${this.height}px;
|
|
2717
2717
|
--sys-flags-top: ${this.top}px;
|
|
2718
2718
|
--sys-flags-left: ${this.left}px;
|
|
2719
2719
|
--sys-flags-lines: ${this.getLines()};
|
|
2720
2720
|
|
|
2721
|
-
background-image: url("${
|
|
2721
|
+
background-image: url("${Un.join("/")}");
|
|
2722
2722
|
background-size: calc(100% * ${e}) calc(100% * ${t});
|
|
2723
2723
|
}
|
|
2724
2724
|
`.trim(), r = 100 / (this.getCanvasWidth() - this.width), i = 100 / (this.getCanvasHeight() - this.height);
|
|
2725
2725
|
return this.data.forEach((e) => {
|
|
2726
2726
|
n += `
|
|
2727
|
-
${
|
|
2727
|
+
${Gn}--${e.name} {
|
|
2728
2728
|
background-position: ${e.x * r}% ${e.y * i}%;
|
|
2729
2729
|
}`;
|
|
2730
2730
|
}), n;
|
|
@@ -2745,10 +2745,10 @@ ${Wn}--${e.name} {
|
|
|
2745
2745
|
}
|
|
2746
2746
|
save() {
|
|
2747
2747
|
let t = this.canvas.toBuffer(Bn, 64);
|
|
2748
|
-
t && e.writeByPath(
|
|
2748
|
+
t && e.writeByPath(Hn, t, !1);
|
|
2749
2749
|
}
|
|
2750
2750
|
saveStyle() {
|
|
2751
|
-
e.writeByPath(
|
|
2751
|
+
e.writeByPath(Wn, this.getStyle());
|
|
2752
2752
|
}
|
|
2753
2753
|
async initGraphics() {
|
|
2754
2754
|
let { createCanvas: e } = await import("@napi-rs/canvas");
|
|
@@ -2766,19 +2766,19 @@ ${Wn}--${e.name} {
|
|
|
2766
2766
|
initTop() {
|
|
2767
2767
|
return this.square / 2 - this.height / 2;
|
|
2768
2768
|
}
|
|
2769
|
-
},
|
|
2769
|
+
}, qn = class {
|
|
2770
2770
|
program;
|
|
2771
2771
|
checker;
|
|
2772
2772
|
sourceFile;
|
|
2773
2773
|
types;
|
|
2774
2774
|
constructor(e = "", t = {}) {
|
|
2775
|
-
this.program =
|
|
2775
|
+
this.program = M.createProgram([e], t), this.checker = this.program.getTypeChecker(), this.sourceFile = this.program.getSourceFiles().find((t) => t.fileName.endsWith(e));
|
|
2776
2776
|
}
|
|
2777
2777
|
getTypes() {
|
|
2778
2778
|
if (!this.types && this.sourceFile) {
|
|
2779
2779
|
let e = [];
|
|
2780
|
-
return
|
|
2781
|
-
if (
|
|
2780
|
+
return M.forEachChild(this.sourceFile, (t) => {
|
|
2781
|
+
if (M.isTypeAliasDeclaration(t) || M.isInterfaceDeclaration(t)) {
|
|
2782
2782
|
let n = this.checker.getTypeAtLocation(t.name), r = [];
|
|
2783
2783
|
this.checker.getPropertiesOfType(n).forEach((e) => {
|
|
2784
2784
|
r.push(this.getPropInformation(t, e));
|
|
@@ -2799,7 +2799,7 @@ ${Wn}--${e.name} {
|
|
|
2799
2799
|
if (e.isUnion() && n && n.length > 0) return e.types.every((e) => e.isNumberLiteral()) ? "number" : "string";
|
|
2800
2800
|
let r = this.checker.typeToString(e);
|
|
2801
2801
|
if (t && (r === "any" || r === "{}" || r === "unknown")) {
|
|
2802
|
-
let e = t.getDeclarations()?.find((e) =>
|
|
2802
|
+
let e = t.getDeclarations()?.find((e) => M.isPropertySignature(e) || M.isPropertyDeclaration(e));
|
|
2803
2803
|
e?.type && (r = e.type.getText().trim() || r);
|
|
2804
2804
|
}
|
|
2805
2805
|
return r.replace(/'/g, "\\'");
|
|
@@ -2813,15 +2813,15 @@ ${Wn}--${e.name} {
|
|
|
2813
2813
|
}
|
|
2814
2814
|
}
|
|
2815
2815
|
getPropOptionByNode(e) {
|
|
2816
|
-
if (
|
|
2816
|
+
if (M.isUnionTypeNode(e)) {
|
|
2817
2817
|
let t = [];
|
|
2818
|
-
for (let n of e.types)
|
|
2818
|
+
for (let n of e.types) M.isLiteralTypeNode(n) && M.isStringLiteral(n.literal) && t.push(n.literal.text);
|
|
2819
2819
|
return t;
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
2822
|
getPropOptionByDeclarations(e) {
|
|
2823
2823
|
if (e) {
|
|
2824
|
-
for (let t of e) if ((
|
|
2824
|
+
for (let t of e) if ((M.isPropertySignature(t) || M.isPropertyDeclaration(t)) && t.type) {
|
|
2825
2825
|
let e = this.getPropOptionByNode(t.type);
|
|
2826
2826
|
if (e && e.length > 0) return e;
|
|
2827
2827
|
}
|
|
@@ -2829,7 +2829,7 @@ ${Wn}--${e.name} {
|
|
|
2829
2829
|
return [];
|
|
2830
2830
|
}
|
|
2831
2831
|
getPropInformation(e, t) {
|
|
2832
|
-
let n = this.checker.getTypeOfSymbolAtLocation(t, e.name), r =
|
|
2832
|
+
let n = this.checker.getTypeOfSymbolAtLocation(t, e.name), r = M.displayPartsToString(t.getDocumentationComment(this.checker)).trim(), i = r.length > 0 ? r : void 0;
|
|
2833
2833
|
return {
|
|
2834
2834
|
name: t.name,
|
|
2835
2835
|
type: this.getPropType(n, t),
|
|
@@ -2837,7 +2837,7 @@ ${Wn}--${e.name} {
|
|
|
2837
2837
|
description: i
|
|
2838
2838
|
};
|
|
2839
2839
|
}
|
|
2840
|
-
},
|
|
2840
|
+
}, Jn = {
|
|
2841
2841
|
"DesignComponent.mdx": "import {Canvas, Meta} from '@storybook/addon-docs/blocks'\nimport {\n StorybookDescriptions,\n StorybookMain\n} from '@dxtmisha/wiki/storybook'\n\nimport * as Component from './DesignComponent.stories'\nimport {ComponentWikiStorybook} from './wiki'\n\n[//]: # (:documentation-import [!] System label / Системная метка)\n[//]: # (:documentation-import [!] System label / Системная метка)\n\n<Meta of={Component}/>\n<StorybookMain\n name={ComponentWikiStorybook.getName()}\n description={ComponentWikiStorybook.getDescription()}\n story={Component.Component}\n/>\n\n[//]: # (:documentation-body [!] System label / Системная метка)\n[//]: # (:documentation-body [!] System label / Системная метка)\n\n[//]: # (:documentation-events [!] System label / Системная метка)\n[//]: # (:documentation-events [!] System label / Системная метка)\n\n[//]: # (:documentation-expose [!] System label / Системная метка)\n[//]: # (:documentation-expose [!] System label / Системная метка)\n\n[//]: # (:documentation-slots [!] System label / Системная метка)\n[//]: # (:documentation-slots [!] System label / Системная метка)\n",
|
|
2842
2842
|
"DesignComponent.stories.ts": "import type { Meta, StoryObj } from '@storybook/vue3-vite'\n\nimport DesignComponent from './DesignComponent.vue'\n// :component.once import { ComponentWikiStorybook } from './wiki'\n\n// :story-import [!] System label / Системная метка\n// :story-import [!] System label / Системная метка\n\nconst meta = {\n// :component.once title: '[project]/Component',\n// :component.once component: DesignComponent,\n// :component.once parameters: {\n// :component.once design: '[design]',\n// :component.once docs: {\n// :component.once description: {\n// :component.once component: ComponentWikiStorybook.getDescription()\n// :component.once }\n// :component.once }\n// :component.once },\n// :component.once argTypes: ComponentWikiStorybook.getWiki(),\n// :component.once args: ComponentWikiStorybook.getValues()\n} satisfies Meta<typeof DesignComponent>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Component: Story = {\n // :story-main [!] System label / Системная метка\n // :story-main [!] System label / Системная метка\n}\n\n// :story-items [!] System label / Системная метка\n// :story-items [!] System label / Системная метка\n",
|
|
2843
2843
|
"DesignComponent.vue": "<script setup lang=\"ts\">\n// :component.once import { computed } from 'vue'\n// :component.once import {\n// :component.once inArray,\n// :component.once isFilled,\n// :component.once type ConstrClasses,\n// :component.once type ConstrStyles\n// :component.once } from '@dxtmisha/functional'\n// :component.once import {\n// :component.once ComponentDesign,\n// :component.once type ComponentEmits,\n// :component.once type ComponentSlots\n// :component.once } from '@dxtmisha/constructor/Component'\n\n// :component.once import { defaults, type ComponentProps, propsValues } from './props'\n// :component.once import './styleToken.scss'\n\n// :component.once defineOptions({\n// :component.once name: 'DesignComponent'\n// :component.once })\n\n// :component.once const emits = defineEmits<ComponentEmits>()\n// :component.once const props = withDefaults(defineProps<ComponentProps>(), defaults)\n\n// :component.once const classesToken = computed<ConstrClasses>(() => ({\n// :component.once main: {\n// :component.once // :classes-values [!] System label / Системная метка\n// :component.once // :classes-values [!] System label / Системная метка\n// :component.once }\n// :component.once }))\n// :component.once const stylesToken = computed<ConstrStyles>(() => ({\n// :component.once // :styles-values [!] System label / Системная метка\n// :component.once // :styles-values [!] System label / Системная метка\n// :component.once }))\n\n// :component.once const design = new ComponentDesign(\n// :component.once '[design].[component]',\n// :component.once props,\n// :component.once {\n// :component.once emits,\n// :component.once classes: classesToken,\n// :component.once styles: stylesToken\n// :component.once }\n// :component.once )\n\n// :component.once const render = design.render()\n\n// :component.once defineSlots<ComponentSlots>()\n// :component.once defineExpose(design.expose())\n<\/script>\n\n<!-- :component.once <template> -->\n<!-- :component.once <render/> -->\n<!-- :component.once </template> -->\n",
|
|
@@ -2847,8 +2847,8 @@ ${Wn}--${e.name} {
|
|
|
2847
2847
|
"styleToken.scss": "// :component.once @use \"../../../styles/[project]/properties\";\n@use \"@dxtmisha/styles/properties\" as ui;\n// :component.once @use \"@dxtmisha/constructor/style.scss\" as Component;\n\n@include ui.initDesignBasic('[design].[component]') {\n // Basic styles for a component\n // Базовый стили для компонента\n // :component.once @include Component.mixinComponent;\n\n // Styles from tokens\n // Стили из токенов\n // :style [!] System label / Системная метка\n // :style [!] System label / Системная метка\n\n // Here are the user styles\n // Здесь пользовательские стили\n}\n",
|
|
2848
2848
|
"wiki.ts": "// :component.once import { WikiStorybook } from '@dxtmisha/wiki'\n// :component.once import { wiki, wikiDescriptions } from '@dxtmisha/wiki/media'\n\n// :component.once import { ComponentWikiData } from './wikiData'\n\n// :component.once export const ComponentWikiStorybook = new WikiStorybook(\n// :component.once ComponentWikiData.component,\n// :component.once ComponentWikiData.props,\n// :component.once ComponentWikiData.defaults,\n// :component.once ComponentWikiData.wikiDesign,\n// :component.once wiki,\n// :component.once wikiDescriptions\n// :component.once )\n",
|
|
2849
2849
|
"wikiData.ts": "// :component.once import { type StorybookProps, type StorybookSlots, type WikiDataItem } from '@dxtmisha/wiki'\n\n// :component.once import { wiki[Design] } from '../../../wiki/wiki'\n// :component.once import { defaults } from './props'\n\n// :component.once const propsNames: StorybookProps = [\n// :component.once // :propsList [!] System label / Системная метка\n// :component.once // :propsList [!] System label / Системная метка\n// :component.once ]\n\n// :component.once const slotsNames: StorybookSlots = [\n// :component.once // :slotsList [!] System label / Системная метка\n// :component.once // :slotsList [!] System label / Системная метка\n// :component.once ]\n\n// :component.once const eventsNames: StorybookSlots = [\n// :component.once // :eventsList [!] System label / Системная метка\n// :component.once // :eventsList [!] System label / Системная метка\n// :component.once ]\n\n// :component.once export const ComponentWikiData: WikiDataItem = {\n// :component.once component: 'Component',\n// :component.once props: propsNames,\n// :component.once slots: slotsNames,\n// :component.once events: eventsNames,\n// :component.once defaults,\n// :component.once wikiDesign: wiki[Design]\n// :component.once }\n"
|
|
2850
|
-
},
|
|
2851
|
-
sample =
|
|
2850
|
+
}, Yn = "properties.json", Q = "props.ts", Xn = "styleToken.scss", Zn = "DesignComponent.vue", Qn = "DesignComponentAiWiki.vue", $n = "index.ts", er = "index.d.ts", tr = "wiki.ts", nr = "wikiData.ts", rr = "DesignComponent.stories.ts", ir = "DesignComponent.mdx", ar = class extends Dn {
|
|
2851
|
+
sample = Jn;
|
|
2852
2852
|
mark = "component";
|
|
2853
2853
|
dir;
|
|
2854
2854
|
propsType;
|
|
@@ -2868,11 +2868,11 @@ ${Wn}--${e.name} {
|
|
|
2868
2868
|
this.makeProperties().makeProps().makeStyle().makeMain().makeIndex().makeWiki().makeWikiData().makeFilePackage().makeLibrary(), await this.makeMainAi(), await this.makeStories(), await this.makeStoriesDocumentation();
|
|
2869
2869
|
}
|
|
2870
2870
|
makeProperties() {
|
|
2871
|
-
let e =
|
|
2871
|
+
let e = Yn;
|
|
2872
2872
|
return this.isFile(e) || this.write(e, `{\r\n "main": "{d.${this.getStructure().getComponentName()}}"\r\n}\r\n`), this;
|
|
2873
2873
|
}
|
|
2874
2874
|
makeProps() {
|
|
2875
|
-
let e =
|
|
2875
|
+
let e = Q, t = this.readDefinable(e), n = this.getFileConstructor(e);
|
|
2876
2876
|
return t.replaceType(n).replaceDefault().replaceProps().replacePropsValues(), this.write(e, t.get()), this;
|
|
2877
2877
|
}
|
|
2878
2878
|
makeStyle() {
|
|
@@ -2888,8 +2888,8 @@ ${Wn}--${e.name} {
|
|
|
2888
2888
|
if (a?.ai) {
|
|
2889
2889
|
let e = [];
|
|
2890
2890
|
if (a.ai.render) {
|
|
2891
|
-
let n =
|
|
2892
|
-
a.ai.render.includes("<button") && (e.push("import { DxtTestButton } from '@dxtmisha/test'"), n =
|
|
2891
|
+
let n = _e(a.ai.render, r, i);
|
|
2892
|
+
a.ai.render.includes("<button") && (e.push("import { DxtTestButton } from '@dxtmisha/test'"), n = _e(n, "button", "DxtTestButton")), n && t.replaceMark("component-render", [
|
|
2893
2893
|
"<template #render=\"{ args, classDemo }\">",
|
|
2894
2894
|
n,
|
|
2895
2895
|
"</template>"
|
|
@@ -2972,13 +2972,13 @@ ${Wn}--${e.name} {
|
|
|
2972
2972
|
if (!this.propsType) {
|
|
2973
2973
|
let n = this.getTypescriptPathsIndex(), r = this.getStructure().getComponentNameFirst();
|
|
2974
2974
|
if (n) {
|
|
2975
|
-
let i = new
|
|
2975
|
+
let i = new qn(e.joinPath([
|
|
2976
2976
|
e.getRoot(),
|
|
2977
2977
|
"src",
|
|
2978
2978
|
l,
|
|
2979
2979
|
t.getProjectName(),
|
|
2980
2980
|
r,
|
|
2981
|
-
|
|
2981
|
+
Q
|
|
2982
2982
|
]), { paths: { [`${le}/${r}`]: [n] } });
|
|
2983
2983
|
this.propsType = i.getType(`${r}Props`)?.props;
|
|
2984
2984
|
}
|
|
@@ -3025,11 +3025,11 @@ ${Wn}--${e.name} {
|
|
|
3025
3025
|
}
|
|
3026
3026
|
getTypesFromConstructor(e) {
|
|
3027
3027
|
let t = this.getTypescriptPathsType(), n = this.getStructure().getComponentNameFirst();
|
|
3028
|
-
if (t) return new
|
|
3028
|
+
if (t) return new qn(t).getType(`${n}${e}`)?.props;
|
|
3029
3029
|
}
|
|
3030
3030
|
toComponentName(e) {
|
|
3031
3031
|
let t = this.getStructure().getDesignFirst(), n = this.getStructure().getComponentName(), r = this.getStructure().getFullComponentName();
|
|
3032
|
-
return e.replace(/DesignComponent/g, r).trim().replace(/design-component/g, `${
|
|
3032
|
+
return e.replace(/DesignComponent/g, r).trim().replace(/design-component/g, `${k(t)}-${k(n)}`).trim().replace(/<(\/?)Design/g, `<$1${t}`);
|
|
3033
3033
|
}
|
|
3034
3034
|
replaceMarkStoriesRender(e, t) {
|
|
3035
3035
|
if (t.render) {
|
|
@@ -3057,9 +3057,9 @@ ${Wn}--${e.name} {
|
|
|
3057
3057
|
if (n.stories) {
|
|
3058
3058
|
let r = t.getWikiLanguage(), i = this.getStructure().getDesignFirst(), a = this.getStructure().getFullComponentName(), o = [], s = this.getPropsList();
|
|
3059
3059
|
n.stories.forEach((e) => {
|
|
3060
|
-
if (s && e.propsName && !
|
|
3060
|
+
if (s && e.propsName && !O(e.propsName).every((e) => s.some((t) => t.name === e))) return;
|
|
3061
3061
|
let t = e.components && b(e.components, (e) => `${i}${e}`), n = this.toComponentName(e.template);
|
|
3062
|
-
o.push(`export const ${e.id}: Story = {`),
|
|
3062
|
+
o.push(`export const ${e.id}: Story = {`), T(e.name) && e.name?.[r] && o.push(` name: '${e.name?.[r]}',`), o.push(" render: () => ({"), o.push(` components: { ${a}${t ? `, ${t.join(", ")}` : ""} },`), e.setup && (o.push(" setup() {"), o.push(` ${e.setup.trim()}`), o.push(" },")), o.push(" template: `"), o.push(` ${n}`), o.push(" `"), o.push(" })"), o.push("}");
|
|
3063
3063
|
}), e.replaceMark("story-items", o);
|
|
3064
3064
|
}
|
|
3065
3065
|
return this;
|
|
@@ -3118,12 +3118,12 @@ export * from '${t}index.js'
|
|
|
3118
3118
|
let n = [], r = e.readDir(this.getComponentsPath()), i = t.getDesignName();
|
|
3119
3119
|
return r.forEach((t) => {
|
|
3120
3120
|
if (e.isDir(t)) {
|
|
3121
|
-
let e =
|
|
3121
|
+
let e = j(t).trim();
|
|
3122
3122
|
n.push({
|
|
3123
3123
|
name: e,
|
|
3124
3124
|
design: i,
|
|
3125
3125
|
alias: `${i}.${e}`,
|
|
3126
|
-
codeFull:
|
|
3126
|
+
codeFull: A(`${i}-${e}`),
|
|
3127
3127
|
dir: t
|
|
3128
3128
|
});
|
|
3129
3129
|
}
|
|
@@ -3153,7 +3153,7 @@ export * from '${t}index.js'
|
|
|
3153
3153
|
}
|
|
3154
3154
|
getValue(e) {
|
|
3155
3155
|
if (e.match(/calc\(/) && !e.match(/var\(/)) {
|
|
3156
|
-
let t =
|
|
3156
|
+
let t = xe.compileString(`a{height: ${e};}`).css?.match(/height: ([^;]+);/)?.[1];
|
|
3157
3157
|
if (t) return t;
|
|
3158
3158
|
}
|
|
3159
3159
|
return e;
|
|
@@ -3174,9 +3174,9 @@ export * from '${t}index.js'
|
|
|
3174
3174
|
let e = [], t = {}, n = X.addSpace(1);
|
|
3175
3175
|
return this.getList().forEach((r) => {
|
|
3176
3176
|
let { value: i, item: a } = r;
|
|
3177
|
-
if (
|
|
3177
|
+
if (C(i) && T(i)) {
|
|
3178
3178
|
let i = a[_.name];
|
|
3179
|
-
e.push(X.addUse(`./classes/${
|
|
3179
|
+
e.push(X.addUse(`./classes/${j(i)}`)), t[i] = [
|
|
3180
3180
|
X.addImportProperties(),
|
|
3181
3181
|
"",
|
|
3182
3182
|
`.${i} {`,
|
|
@@ -3245,15 +3245,15 @@ export * from '${t}index.js'
|
|
|
3245
3245
|
getByDesigns(e) {
|
|
3246
3246
|
let t = this.properties.get().get();
|
|
3247
3247
|
this.properties.get().getDesigns().forEach((n) => {
|
|
3248
|
-
n !== "d" && e(n, new
|
|
3248
|
+
n !== "d" && e(n, new I(t).setFocusDesign(n));
|
|
3249
3249
|
});
|
|
3250
3250
|
}
|
|
3251
3251
|
removeExcess(e) {
|
|
3252
3252
|
let t = {};
|
|
3253
3253
|
return b(e, (e, n) => {
|
|
3254
|
-
if (e[_.variable] === v.var ||
|
|
3255
|
-
let r =
|
|
3256
|
-
|
|
3254
|
+
if (e[_.variable] === v.var || T(e.value)) {
|
|
3255
|
+
let r = T(e.value) ? this.removeExcess(e.value) : e.value;
|
|
3256
|
+
C(r) && (t[n] = {
|
|
3257
3257
|
name: e[_.name],
|
|
3258
3258
|
type: e[_.variable],
|
|
3259
3259
|
value: r
|
|
@@ -3271,7 +3271,7 @@ export * from '${t}index.js'
|
|
|
3271
3271
|
e.write(c, ie, [
|
|
3272
3272
|
"import type { StorybookArgsToList } from '@dxtmisha/wiki'",
|
|
3273
3273
|
"",
|
|
3274
|
-
`export const wiki${
|
|
3274
|
+
`export const wiki${A(n)}: StorybookArgsToList = {}`,
|
|
3275
3275
|
""
|
|
3276
3276
|
].join("\r\n"), "ts");
|
|
3277
3277
|
}
|
|
@@ -3369,7 +3369,7 @@ defineOptions({
|
|
|
3369
3369
|
this.items = e;
|
|
3370
3370
|
}
|
|
3371
3371
|
make() {
|
|
3372
|
-
let e =
|
|
3372
|
+
let e = A(t.getProjectName()), n = k(t.getDesignName());
|
|
3373
3373
|
this.getIconImport().length > 0 && this.items.write(te, [
|
|
3374
3374
|
"import { Icons } from '@dxtmisha/functional'",
|
|
3375
3375
|
"",
|
|
@@ -3385,7 +3385,7 @@ defineOptions({
|
|
|
3385
3385
|
return e.is(n) && e.readDirRecursive(n).forEach((e) => {
|
|
3386
3386
|
let n = e.replace("/", "-");
|
|
3387
3387
|
t.push({
|
|
3388
|
-
name:
|
|
3388
|
+
name: k(this.getIconName(n)),
|
|
3389
3389
|
path: this.getIconPath(e),
|
|
3390
3390
|
value: this.getIconName(n)
|
|
3391
3391
|
});
|
|
@@ -3458,10 +3458,10 @@ defineOptions({
|
|
|
3458
3458
|
return n = t ? `^${n}$` : `${n}(?![\\w-])`, `/${n}/ig`;
|
|
3459
3459
|
}
|
|
3460
3460
|
getRegName(e) {
|
|
3461
|
-
return b(e, (e) =>
|
|
3461
|
+
return b(e, (e) => j(e).replace("-", "-?")).join("|");
|
|
3462
3462
|
}
|
|
3463
3463
|
getVars() {
|
|
3464
|
-
let n =
|
|
3464
|
+
let n = k(t.getDesignName()), r = [
|
|
3465
3465
|
...o,
|
|
3466
3466
|
t.getProjectName(),
|
|
3467
3467
|
"vars.scss"
|
|
@@ -3476,7 +3476,7 @@ defineOptions({
|
|
|
3476
3476
|
}
|
|
3477
3477
|
});
|
|
3478
3478
|
}
|
|
3479
|
-
return
|
|
3479
|
+
return be(a);
|
|
3480
3480
|
}
|
|
3481
3481
|
getVarsReg() {
|
|
3482
3482
|
return `/(?<=var\\(--)(${this.getVars().join("|")})/ig`;
|
|
@@ -3506,7 +3506,7 @@ defineOptions({
|
|
|
3506
3506
|
" * Инициализирует плагин Vite для дизайн-системы.",
|
|
3507
3507
|
" * @param options plugin options / настройки плагина",
|
|
3508
3508
|
" */",
|
|
3509
|
-
`export function ui${
|
|
3509
|
+
`export function ui${A(e)}VitePlugin(`,
|
|
3510
3510
|
" options: PluginOptions = {}",
|
|
3511
3511
|
"): VitePlugin {",
|
|
3512
3512
|
" return new Plugin(",
|
|
@@ -3515,7 +3515,7 @@ defineOptions({
|
|
|
3515
3515
|
" componentsReg,",
|
|
3516
3516
|
" styleVarsReg,",
|
|
3517
3517
|
" componentsList,",
|
|
3518
|
-
` 'vite-plugin-${
|
|
3518
|
+
` 'vite-plugin-${j(e)}-ui',`,
|
|
3519
3519
|
" options",
|
|
3520
3520
|
" )",
|
|
3521
3521
|
" .init()",
|
|
@@ -3572,10 +3572,10 @@ defineOptions({
|
|
|
3572
3572
|
this.name = e, this.components = new or();
|
|
3573
3573
|
}
|
|
3574
3574
|
get component() {
|
|
3575
|
-
return
|
|
3575
|
+
return j(this.name).trim();
|
|
3576
3576
|
}
|
|
3577
3577
|
async make() {
|
|
3578
|
-
|
|
3578
|
+
P.clear(), new gr().make(), new _r().make(), await this.makeConstructorComponent(), this.makePackage().makeUiProperties(), new br(this.components).make(), new xr(this.components).make(), new Sr(this.components).make(), new yr(this.components).make(), new Cr(this.components).make();
|
|
3579
3579
|
}
|
|
3580
3580
|
async makeConstructorComponent() {
|
|
3581
3581
|
let e = this.component;
|
|
@@ -3584,7 +3584,7 @@ defineOptions({
|
|
|
3584
3584
|
return this;
|
|
3585
3585
|
}
|
|
3586
3586
|
makePackage() {
|
|
3587
|
-
let n = g(), r =
|
|
3587
|
+
let n = g(), r = A(t.getProjectName());
|
|
3588
3588
|
return n?.exports && (n.exports["."] = {
|
|
3589
3589
|
types: "./dist/library/types.d.ts",
|
|
3590
3590
|
default: "./dist/library/types.js"
|
|
@@ -3602,10 +3602,10 @@ defineOptions({
|
|
|
3602
3602
|
"*.scss",
|
|
3603
3603
|
"**/*.css",
|
|
3604
3604
|
"**/*.scss"
|
|
3605
|
-
], e.writeByPath(
|
|
3605
|
+
], e.writeByPath(ae, n)), this;
|
|
3606
3606
|
}
|
|
3607
3607
|
makeUiProperties() {
|
|
3608
|
-
let n =
|
|
3608
|
+
let n = A(t.getProjectName());
|
|
3609
3609
|
return e.writeByPath(oe, `@forward "./src/styles/${n}/style.scss";`), this;
|
|
3610
3610
|
}
|
|
3611
3611
|
}, Tr = class {
|
|
@@ -3619,7 +3619,7 @@ defineOptions({
|
|
|
3619
3619
|
}
|
|
3620
3620
|
async get() {
|
|
3621
3621
|
if (this.wiki) {
|
|
3622
|
-
let e = `${
|
|
3622
|
+
let e = `${A(t.getDesignName())}${this.wiki.getName()}`, n = {
|
|
3623
3623
|
name: e,
|
|
3624
3624
|
description: this.wiki.getDescription(),
|
|
3625
3625
|
source: {
|
|
@@ -3636,9 +3636,23 @@ defineOptions({
|
|
|
3636
3636
|
getDirName() {
|
|
3637
3637
|
return this.data.dir;
|
|
3638
3638
|
}
|
|
3639
|
+
async getEvents() {
|
|
3640
|
+
let e = await this.getData();
|
|
3641
|
+
if (e && e.events) {
|
|
3642
|
+
let t = [];
|
|
3643
|
+
return e.events.forEach((e) => {
|
|
3644
|
+
let n = "() => void";
|
|
3645
|
+
e.properties && e.properties.length > 0 && (n = `(${e.properties.map((e) => `${e.name}: ${e.type ? this.cleanType(e.type) : "any"}`).join(", ")}) => void`), t.push({
|
|
3646
|
+
name: e.name,
|
|
3647
|
+
description: e.description,
|
|
3648
|
+
type: n
|
|
3649
|
+
});
|
|
3650
|
+
}), t;
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3639
3653
|
getProp(e) {
|
|
3640
3654
|
let t, n = e.getOptions();
|
|
3641
|
-
if (n && (
|
|
3655
|
+
if (n && (S(n) ? t = n.map((e) => typeof e == "string" ? `'${e}'` : String(e)).join(" | ") : w(n) && (t = Object.keys(n).map((e) => `'${e}'`).join(" | "))), !t) {
|
|
3642
3656
|
let n = e.getType();
|
|
3643
3657
|
t = n ? this.cleanType(n) : void 0;
|
|
3644
3658
|
}
|
|
@@ -3660,8 +3674,7 @@ defineOptions({
|
|
|
3660
3674
|
return e.slots.forEach((e) => {
|
|
3661
3675
|
let n = (e.properties ?? []).map((e) => ({
|
|
3662
3676
|
name: e.name,
|
|
3663
|
-
type: e.type ? this.cleanType(e.type) : void 0
|
|
3664
|
-
description: e.description
|
|
3677
|
+
type: e.type ? this.cleanType(e.type) : void 0
|
|
3665
3678
|
}));
|
|
3666
3679
|
t.push({
|
|
3667
3680
|
name: e.name,
|
|
@@ -3671,35 +3684,54 @@ defineOptions({
|
|
|
3671
3684
|
}), t;
|
|
3672
3685
|
}
|
|
3673
3686
|
}
|
|
3674
|
-
async getEvents() {
|
|
3675
|
-
let e = await this.getData();
|
|
3676
|
-
if (e && e.events) {
|
|
3677
|
-
let t = [];
|
|
3678
|
-
return e.events.forEach((e) => {
|
|
3679
|
-
let n = "() => void";
|
|
3680
|
-
e.properties && e.properties.length > 0 && (n = `(${e.properties.map((e) => `${e.name}: ${e.type ? this.cleanType(e.type) : "any"}`).join(", ")}) => void`), t.push({
|
|
3681
|
-
name: e.name,
|
|
3682
|
-
description: e.description,
|
|
3683
|
-
type: n
|
|
3684
|
-
});
|
|
3685
|
-
}), t;
|
|
3686
|
-
}
|
|
3687
|
-
}
|
|
3688
3687
|
async init() {
|
|
3689
3688
|
return this.wiki = await this.initWiki(), this;
|
|
3690
3689
|
}
|
|
3691
3690
|
async getData() {
|
|
3692
3691
|
if (!this.dataComponent) {
|
|
3693
3692
|
let t = this.getPaths(["wikiData.ts"]);
|
|
3694
|
-
if (e.is(t))
|
|
3695
|
-
let n =
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3693
|
+
if (e.is(t)) {
|
|
3694
|
+
let n = e.readFileOnly(t);
|
|
3695
|
+
if (n) {
|
|
3696
|
+
let e = M.createSourceFile("wikiData.ts", n, M.ScriptTarget.Latest, !0), t = this.extractVariables(e), r;
|
|
3697
|
+
for (let [e, n] of t.entries()) if (e.endsWith("WikiData")) {
|
|
3698
|
+
r = n;
|
|
3699
|
+
break;
|
|
3700
|
+
}
|
|
3701
|
+
if (!r) {
|
|
3702
|
+
for (let e of t.values()) if (M.isObjectLiteralExpression(e) && e.properties.some((e) => M.isPropertyAssignment(e) && e.name.getText().replace(/^['"]|['"]$/g, "") === "component")) {
|
|
3703
|
+
r = e;
|
|
3704
|
+
break;
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
let i = r ? this.evalNode(r, t) : void 0, a = i?.component ?? this.getDirName(), o = i?.props ?? (t.has("propsNames") ? this.evalNode(t.get("propsNames"), t) : []), s = i?.slots ?? (t.has("slotsNames") ? this.evalNode(t.get("slotsNames"), t) : []), c = i?.events ?? (t.has("eventsNames") ? this.evalNode(t.get("eventsNames"), t) : []), l = i?.defaults && w(i.defaults) ? i.defaults : this.getDefaultsFromProps(), u = i?.wikiDesign && w(i.wikiDesign) ? i.wikiDesign : this.getWikiDesign();
|
|
3708
|
+
this.dataComponent = {
|
|
3709
|
+
component: a,
|
|
3710
|
+
props: S(o) ? o : [],
|
|
3711
|
+
slots: S(s) ? s : [],
|
|
3712
|
+
events: S(c) ? c : [],
|
|
3713
|
+
defaults: l,
|
|
3714
|
+
wikiDesign: u
|
|
3715
|
+
};
|
|
3716
|
+
}
|
|
3699
3717
|
}
|
|
3700
3718
|
}
|
|
3701
3719
|
return this.dataComponent;
|
|
3702
3720
|
}
|
|
3721
|
+
getDefaultsFromProps() {
|
|
3722
|
+
let t = this.getPaths(["props.ts"]);
|
|
3723
|
+
if (e.is(t)) {
|
|
3724
|
+
let n = e.readFileOnly(t);
|
|
3725
|
+
if (n) {
|
|
3726
|
+
let e = M.createSourceFile("props.ts", n, M.ScriptTarget.Latest, !0), t = this.extractVariables(e), r = t.get("defaults");
|
|
3727
|
+
if (r) {
|
|
3728
|
+
let e = this.evalNode(r, t);
|
|
3729
|
+
if (w(e)) return e;
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
return {};
|
|
3734
|
+
}
|
|
3703
3735
|
getDirs() {
|
|
3704
3736
|
return [
|
|
3705
3737
|
".",
|
|
@@ -3710,6 +3742,25 @@ defineOptions({
|
|
|
3710
3742
|
getPaths(e) {
|
|
3711
3743
|
return [...this.getDirs(), ...e];
|
|
3712
3744
|
}
|
|
3745
|
+
getWikiDesign() {
|
|
3746
|
+
let t = [
|
|
3747
|
+
".",
|
|
3748
|
+
"src",
|
|
3749
|
+
"wiki",
|
|
3750
|
+
"wiki.ts"
|
|
3751
|
+
];
|
|
3752
|
+
if (e.is(t)) {
|
|
3753
|
+
let n = e.readFileOnly(t);
|
|
3754
|
+
if (n) {
|
|
3755
|
+
let e = M.createSourceFile("wiki.ts", n, M.ScriptTarget.Latest, !0), t = this.extractVariables(e);
|
|
3756
|
+
for (let [e, n] of t.entries()) if (e.startsWith("wiki")) {
|
|
3757
|
+
let e = this.evalNode(n, t);
|
|
3758
|
+
if (w(e)) return e;
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
return {};
|
|
3763
|
+
}
|
|
3713
3764
|
cleanType(e) {
|
|
3714
3765
|
let t = e.trim();
|
|
3715
3766
|
for (t = t.replace(/\s*\|\s*undefined$/, "").trim(); t.startsWith("(") && t.endsWith(")");) {
|
|
@@ -3726,6 +3777,45 @@ defineOptions({
|
|
|
3726
3777
|
}
|
|
3727
3778
|
return t;
|
|
3728
3779
|
}
|
|
3780
|
+
evalNode(e, t) {
|
|
3781
|
+
if (M.isStringLiteral(e) || M.isNoSubstitutionTemplateLiteral(e)) return e.text;
|
|
3782
|
+
if (M.isNumericLiteral(e)) return Number(e.text);
|
|
3783
|
+
if (e.kind === M.SyntaxKind.TrueKeyword) return !0;
|
|
3784
|
+
if (e.kind === M.SyntaxKind.FalseKeyword) return !1;
|
|
3785
|
+
if (e.kind === M.SyntaxKind.NullKeyword) return null;
|
|
3786
|
+
if (e.kind !== M.SyntaxKind.UndefinedKeyword) {
|
|
3787
|
+
if (M.isPrefixUnaryExpression(e)) {
|
|
3788
|
+
if (e.operator === M.SyntaxKind.MinusToken && M.isNumericLiteral(e.operand)) return -Number(e.operand.text);
|
|
3789
|
+
if (e.operator === M.SyntaxKind.ExclamationToken) return !this.evalNode(e.operand, t);
|
|
3790
|
+
}
|
|
3791
|
+
if (M.isArrayLiteralExpression(e)) return e.elements.map((e) => this.evalNode(e, t));
|
|
3792
|
+
if (M.isObjectLiteralExpression(e)) {
|
|
3793
|
+
let n = {};
|
|
3794
|
+
for (let r of e.properties) if (M.isPropertyAssignment(r)) {
|
|
3795
|
+
let e = r.name.getText().replace(/^['"]|['"]$/g, "");
|
|
3796
|
+
n[e] = this.evalNode(r.initializer, t);
|
|
3797
|
+
} else if (M.isShorthandPropertyAssignment(r)) {
|
|
3798
|
+
let e = r.name.text;
|
|
3799
|
+
t.has(e) && (n[e] = this.evalNode(t.get(e), t));
|
|
3800
|
+
} else if (M.isSpreadAssignment(r)) {
|
|
3801
|
+
let e = this.evalNode(r.expression, t);
|
|
3802
|
+
w(e) && Object.assign(n, e);
|
|
3803
|
+
}
|
|
3804
|
+
return n;
|
|
3805
|
+
}
|
|
3806
|
+
if (M.isIdentifier(e)) {
|
|
3807
|
+
let n = e.text;
|
|
3808
|
+
return t.has(n) ? this.evalNode(t.get(n), t) : void 0;
|
|
3809
|
+
}
|
|
3810
|
+
if (M.isAsExpression(e) || M.isTypeAssertionExpression(e) || M.isParenthesizedExpression(e)) return this.evalNode(e.expression, t);
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
extractVariables(e) {
|
|
3814
|
+
let t = /* @__PURE__ */ new Map();
|
|
3815
|
+
return M.forEachChild(e, (e) => {
|
|
3816
|
+
if (M.isVariableStatement(e)) for (let n of e.declarationList.declarations) M.isIdentifier(n.name) && n.initializer && t.set(n.name.text, n.initializer);
|
|
3817
|
+
}), t;
|
|
3818
|
+
}
|
|
3729
3819
|
async initWiki() {
|
|
3730
3820
|
let e = await this.getData();
|
|
3731
3821
|
if (e) {
|
|
@@ -3745,7 +3835,7 @@ defineOptions({
|
|
|
3745
3835
|
let r = {
|
|
3746
3836
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3747
3837
|
framework: "vue",
|
|
3748
|
-
name:
|
|
3838
|
+
name: A(t.getDesignName()),
|
|
3749
3839
|
version: n.version,
|
|
3750
3840
|
"js-types-syntax": "typescript",
|
|
3751
3841
|
contributions: { html: {
|
|
@@ -3768,4 +3858,4 @@ defineOptions({
|
|
|
3768
3858
|
}
|
|
3769
3859
|
};
|
|
3770
3860
|
//#endregion
|
|
3771
|
-
export {
|
|
3861
|
+
export { Te as ComponentCreator, Rn as DesignConstructors, Kn as DesignFlags, wr as DesignUi, Er as DesignWikiStorm, fe as PackageInit };
|