@luna-park/plugin 1.3.1 → 1.4.1

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.
@@ -0,0 +1,941 @@
1
+ import { a as LogicUtil, c as TObject, d as makeLogicNode, f as CVector, h as TVector, i as LogicType, l as TSchema, m as MaybePromise, n as ELogicType, o as Static, p as DeepPartial, r as EVarType, s as TLogicNode, t as ELogicScope, u as TVoid } from "./index-X3hhfmWd.mjs";
2
+ import * as _$vue from "vue";
3
+ import { Component, ComputedRef } from "vue";
4
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
5
+ import { PGliteWorker } from "@electric-sql/pglite/worker";
6
+ import { Cron } from "lite-cron";
7
+
8
+ //#region src/components/LSettingsStoryWrapper.vue.d.ts
9
+ declare var __VLS_1: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_1) => any;
12
+ };
13
+ declare const __VLS_base: _$vue.DefineComponent<{}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
21
+ //#endregion
22
+ //#region src/types/component.d.ts
23
+ type TSlot = TSchema<TObject> | TSchema<TVoid>;
24
+ type StaticOfProps<T extends Record<string, TSchema>> = { [K in keyof T]: {
25
+ schema: TSchema;
26
+ value: Static<T[K]>;
27
+ } };
28
+ type TComponent<TProps extends Record<string, TSchema> = Record<string, TSchema>, TInternals = unknown> = {
29
+ build?: {
30
+ imports?: Array<{
31
+ default?: boolean;
32
+ from: string;
33
+ name: string;
34
+ }>;
35
+ name?: string;
36
+ };
37
+ component: Component;
38
+ documentation?: {
39
+ description?: string;
40
+ link?: string;
41
+ };
42
+ emits?: Record<string, TSchema>;
43
+ icon?: IconDefinition | string;
44
+ internals?: TInternals;
45
+ models?: Record<string, TSchema>;
46
+ name: string;
47
+ preview?: {
48
+ properties?: Partial<{ [TKey in keyof TProps]: Static<TProps[TKey]> }>;
49
+ slots?: Record<string, string>;
50
+ style?: string;
51
+ };
52
+ properties?: TProps;
53
+ slots?: Record<string, TSlot> | ((attributes: StaticOfProps<TProps> & {
54
+ internals: TInternals;
55
+ }) => Record<string, TSlot>);
56
+ };
57
+ //#endregion
58
+ //#region src/types/hooks.d.ts
59
+ declare enum EPluginHooks {
60
+ BackendMiddleware = "backend/middleware",
61
+ BackendInputNode = "backend/input-node"
62
+ }
63
+ type THookParams = {
64
+ [EPluginHooks.BackendMiddleware]: {
65
+ cookies: Record<string, {
66
+ options?: Record<string, unknown>;
67
+ value: string;
68
+ }>;
69
+ setContextVar: (key: string, value: unknown) => void;
70
+ };
71
+ [EPluginHooks.BackendInputNode]: {
72
+ addInput: (key: string, schema: TSchema) => void;
73
+ };
74
+ };
75
+ //#endregion
76
+ //#region ../shared/dist/layout-w4K7EDPE.d.mts
77
+ declare enum ELayoutElement {
78
+ input = "input",
79
+ div = "div",
80
+ media = "media",
81
+ customText = "customText",
82
+ component = "component",
83
+ package = "package",
84
+ customHtml = "customHtml",
85
+ slot = "slot",
86
+ template = "template",
87
+ variable = "variable",
88
+ link = "link"
89
+ }
90
+ declare enum ELayoutEvent {
91
+ click = "click",
92
+ keydown = "keydown",
93
+ mouseenter = "mouseenter",
94
+ mouseleave = "mouseleave",
95
+ mousedown = "mousedown",
96
+ mouseup = "mouseup",
97
+ mousemove = "mousemove",
98
+ wheel = "wheel"
99
+ }
100
+ //#endregion
101
+ //#region src/layout/template.d.ts
102
+ declare enum EElementTemplate {
103
+ If = "if",
104
+ For = "for"
105
+ } //#endregion
106
+ //#endregion
107
+ //#region ../logic-dts/dist/nodes.d.ts
108
+ type TExportNodeFunction = {
109
+ name?: string;
110
+ description?: string;
111
+ parameters?: Array<TSchema>;
112
+ return?: TSchema;
113
+ };
114
+ type TExportNodeResult = {
115
+ components: Record<string, {
116
+ properties: Record<string, TSchema>;
117
+ slots: Record<string, TSchema>;
118
+ }>;
119
+ functions: Record<string, TExportNodeFunction>;
120
+ types: Record<string, TSchema>;
121
+ };
122
+ //#endregion
123
+ //#region ../shared/dist/index.d.mts
124
+ //#endregion
125
+ //#region src/types/editor/node.d.ts
126
+ type TBaseNode = {
127
+ id: string;
128
+ data?: object;
129
+ dbNode: TGeneratedNode;
130
+ inputs: Record<string, CNodeAnchor>;
131
+ location: TVector;
132
+ outputs: Record<string, CNodeAnchor>;
133
+ };
134
+ type TGeneratedNode<TLogic extends TLogicNode = TLogicNode> = TLogic & {
135
+ node?: CNode;
136
+ origin: TLogic;
137
+ proxy: any;
138
+ };
139
+ type TNodeData = {
140
+ config?: Record<string, unknown>;
141
+ multiple?: {
142
+ isArray?: boolean;
143
+ number: number;
144
+ };
145
+ optionals?: Record<string, boolean>;
146
+ size?: TVector;
147
+ } & Record<string, unknown>;
148
+ declare class CNode {
149
+ id: string;
150
+ dbNode: TGeneratedNode;
151
+ element?: HTMLElement;
152
+ invert: boolean;
153
+ parent?: TAnyLogic;
154
+ config: {
155
+ animate: boolean;
156
+ processing: boolean;
157
+ };
158
+ inputs: Record<string, CNodeAnchor>;
159
+ outputs: Record<string, CNodeAnchor>;
160
+ cache: {
161
+ location?: CVector;
162
+ relativeLocation?: CVector;
163
+ reloadKey: number;
164
+ size?: CVector;
165
+ };
166
+ _data: TNodeData;
167
+ constructor(node: TBaseNode);
168
+ get orderedInputs(): Array<CNodeAnchor>;
169
+ get orderedOutputs(): Array<CNodeAnchor>;
170
+ set location(location: TVector);
171
+ get location(): TVector;
172
+ reload(): void;
173
+ getSafeInputs(): Record<string, CNodeAnchor>;
174
+ getSafeOutputs(): Record<string, CNodeAnchor>;
175
+ set data(data: Record<string, unknown>);
176
+ get data(): TNodeData;
177
+ reset(): void;
178
+ setLocation(location: TVector): CNode;
179
+ getAnchorLocation(anchor: CNodeAnchor): CVector;
180
+ getRelativeAnchorLocation(anchor: CNodeAnchor): CVector;
181
+ getRelativeAnchorLocation_internal(anchor: CNodeAnchor): CVector;
182
+ getLocation(): CVector;
183
+ getSize(): TVector;
184
+ execute(outputKey: string, stack?: TStack): MaybePromise<void>;
185
+ get isAsync(): boolean;
186
+ getInput(inputKey: string, stack?: TStack): unknown;
187
+ setOutput(outputKey: string, value: unknown, stack?: TStack): void;
188
+ }
189
+ type TNode<TExport extends boolean = false> = TExport extends true ? {
190
+ data?: Record<string, unknown>;
191
+ internal?: {
192
+ inputs?: Record<string, unknown>;
193
+ outputs?: Record<string, unknown>;
194
+ };
195
+ location: TVector;
196
+ logic: string;
197
+ } : CNode; //#endregion
198
+ //#region src/types/editor/wire.d.ts
199
+ declare class CPathPoint {
200
+ direction: CVector;
201
+ location: CVector;
202
+ constructor({
203
+ direction,
204
+ location
205
+ }: {
206
+ direction: TVector;
207
+ location: TVector;
208
+ });
209
+ move(offset: TVector, config?: {
210
+ reverse: boolean;
211
+ }): CPathPoint;
212
+ }
213
+ type Path = Array<CPathPoint>;
214
+ declare class CWire {
215
+ id: string;
216
+ from: CAnchor;
217
+ to: CAnchor;
218
+ animate: boolean;
219
+ constructor(wire: {
220
+ id: string;
221
+ from: CAnchor;
222
+ temp?: boolean;
223
+ to: CAnchor;
224
+ });
225
+ get type(): TSchema;
226
+ get toType(): TSchema;
227
+ getPoints(): string;
228
+ registerRibbon(path: Path): void;
229
+ }
230
+ type TWire<TExport extends boolean = false> = TExport extends true ? {
231
+ from: {
232
+ key: string;
233
+ node: string;
234
+ };
235
+ to: {
236
+ key: string;
237
+ node: string;
238
+ };
239
+ } : CWire; //#endregion
240
+ //#region src/types/editor/anchor.d.ts
241
+ type TDBAnchor = {
242
+ id?: string;
243
+ schema: TSchema;
244
+ };
245
+ declare enum EAnchorDirection {
246
+ input = "input",
247
+ output = "output",
248
+ none = "none"
249
+ }
250
+ declare class CAnchor {
251
+ connections: Array<CWire>;
252
+ dbAnchor: TDBAnchor;
253
+ padding?: number;
254
+ protected constructor(anchor: {
255
+ connections?: Array<CWire>;
256
+ dbAnchor: TDBAnchor;
257
+ padding?: number;
258
+ });
259
+ getLocation(): TVector;
260
+ getPadding(): number;
261
+ get schema(): TSchema;
262
+ get schemaRaw(): TSchema;
263
+ get toSchema(): TSchema;
264
+ }
265
+ declare class CNodeAnchor extends CAnchor {
266
+ key: string;
267
+ index: number;
268
+ node: CNode;
269
+ direction: EAnchorDirection;
270
+ value: unknown;
271
+ element?: HTMLElement;
272
+ cache: {
273
+ preview?: unknown;
274
+ relativeLocation?: CVector;
275
+ };
276
+ constructor(anchor: {
277
+ connections?: Array<CWire>;
278
+ dbAnchor: TDBAnchor;
279
+ direction: EAnchorDirection;
280
+ element?: HTMLElement;
281
+ index: number;
282
+ key: string;
283
+ node: CNode;
284
+ padding?: number;
285
+ });
286
+ get schema(): TSchema;
287
+ get toSchema(): TSchema;
288
+ get schemaRaw(): TSchema;
289
+ getLocation(): CVector;
290
+ getRelativeLocation(): CVector;
291
+ resetCache(): void;
292
+ getPadding(): number;
293
+ isDisabled(): boolean;
294
+ errorMessage(): string | undefined;
295
+ setValue(value: string | number | boolean): void;
296
+ resetValue(): void;
297
+ } //#endregion
298
+ //#region src/types/file.d.ts
299
+ declare enum EElementType {
300
+ Script = "script",
301
+ Standalone = "standalone",
302
+ Folder = "folder",
303
+ MainLogic = "main",
304
+ Logic = "logic",
305
+ Config = "config",
306
+ Text = "text",
307
+ Store = "store",
308
+ Database = "database",
309
+ Component = "component",
310
+ Route = "route",
311
+ Type = "type",
312
+ Cron = "cron",
313
+ Media = "media"
314
+ }
315
+ /**
316
+ * Check if the source scope is compatible with the target scope
317
+ * @param source - The source scope (from)
318
+ * @param target - The target scope (to)
319
+ */
320
+ //#endregion
321
+ //#region src/types/files/folder.d.ts
322
+ type TFolder<TExport extends boolean = false> = TFileBase<TExport> & {
323
+ type: EElementType.Folder;
324
+ children: Record<string, TFile<TExport>>;
325
+ color?: string;
326
+ }; //#endregion
327
+ //#region src/types/files/common.d.ts
328
+ type TFileState = {
329
+ expand?: boolean;
330
+ isEditing?: boolean;
331
+ logic?: {
332
+ location: TVector;
333
+ zoom: number;
334
+ };
335
+ opened?: boolean;
336
+ panel?: string;
337
+ };
338
+ type TFileBase<TExport extends boolean = false> = {
339
+ name: string;
340
+ state: TFileState;
341
+ } & (TExport extends false ? {
342
+ id: string;
343
+ parent?: TFolder<TExport>;
344
+ } : {}); //#endregion
345
+ //#region src/types/files/database.d.ts
346
+ type TFileDatabase<TExport extends boolean = false> = TFileBase<TExport> & {
347
+ type: EElementType.Database;
348
+ data: Array<Record<string, unknown>>;
349
+ schema: TSchema<TObject>;
350
+ } & (TExport extends false ? {
351
+ db: CDatabase;
352
+ scope: ELogicScope.Backend;
353
+ } : {}); //#endregion
354
+ //#region src/types/editor/database.d.ts
355
+ type TQueryValue = string | number | boolean;
356
+ type TQueryOperation = Record<string, {
357
+ $eq?: TQueryValue;
358
+ $exists?: boolean;
359
+ $gt?: TQueryValue;
360
+ $gte?: TQueryValue;
361
+ $ilike?: string;
362
+ $in?: Array<TQueryValue>;
363
+ $like?: string;
364
+ $lt?: TQueryValue;
365
+ $lte?: TQueryValue;
366
+ $neq?: TQueryValue;
367
+ $nin?: Array<TQueryValue>;
368
+ }>;
369
+ type TQuery = TQueryOperation | {
370
+ $and?: Array<TQuery>;
371
+ $not?: TQuery;
372
+ $or?: Array<TQuery>;
373
+ };
374
+ type TQueryOptions = {
375
+ limit?: number;
376
+ offset?: number;
377
+ order?: Array<TOrder>;
378
+ };
379
+ type TOrder = {
380
+ column: string;
381
+ direction: "asc" | "desc";
382
+ };
383
+ declare class CDatabase {
384
+ file: TFileDatabase;
385
+ db: PGliteWorker;
386
+ ready: boolean;
387
+ exist: boolean;
388
+ constructor(file: TFileDatabase);
389
+ init(): Promise<void>;
390
+ findById(id: string): Promise<Record<string, unknown> | undefined>;
391
+ find(filter: Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
392
+ findWithQuery(query: TQuery, options?: TQueryOptions): Promise<Array<Record<string, unknown>>>;
393
+ updateById(id: string, data: Record<string, unknown>): Promise<void>;
394
+ update(filter: Record<string, unknown>, data: Record<string, unknown>): Promise<void>;
395
+ updateWithQuery(query: TQuery, data: Record<string, unknown>): Promise<void>;
396
+ deleteById(id: string): Promise<Record<string, unknown> | undefined>;
397
+ delete(filter: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
398
+ deleteWithQuery(query: TQuery): Promise<Record<string, unknown> | undefined>;
399
+ insert(data: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
400
+ toRealKey(row: Record<string, unknown>): Record<string, unknown>;
401
+ toSchemaKey(row: Record<string, unknown>): Record<string, unknown>;
402
+ updateColumns(init: boolean): Promise<void>;
403
+ save(): Promise<Array<Record<string, unknown>> | unknown>;
404
+ load(): Promise<void>;
405
+ getUpdate(data: Record<string, unknown>): unknown;
406
+ getQueryFilter(filter: Record<string, unknown>): unknown;
407
+ getQueryOptions(options?: TQueryOptions): unknown;
408
+ getQuery(query: TQuery): unknown;
409
+ getOperation(query: TQueryOperation): unknown;
410
+ } //#endregion
411
+ //#region src/types/editor/stack.d.ts
412
+ type TStackParent = {
413
+ logic?: TLogic;
414
+ node?: CNode;
415
+ stack: TStack;
416
+ };
417
+ type TStack = {
418
+ id: string;
419
+ config?: Record<string, unknown>;
420
+ context: object;
421
+ parent?: TStackParent;
422
+ variables: Record<string, unknown>;
423
+ }; //#endregion
424
+ //#region src/types/logic.d.ts
425
+ declare enum ELogicMode {
426
+ Pure = "pure",
427
+ Macro = "macro",
428
+ Code = "code"
429
+ }
430
+ type TLogicBase<TExport extends boolean = false> = {
431
+ name: string;
432
+ type: EElementType;
433
+ graph: TGraph<TExport>;
434
+ values: {
435
+ variables: Record<string, TValue<TExport>>;
436
+ };
437
+ } & (TExport extends false ? {
438
+ id: string;
439
+ db: Record<string, TLogicNode>;
440
+ isEditing?: boolean;
441
+ parent: TFile<TExport>;
442
+ } : {});
443
+ type TLogic<TExport extends boolean = false> = TLogicBase<TExport> & {
444
+ type: EElementType.Logic | EElementType.Standalone;
445
+ async: boolean;
446
+ code?: string;
447
+ export: boolean;
448
+ inputs: Record<string, TAnchor<TExport>>;
449
+ mode: ELogicMode;
450
+ outputs: Record<string, TAnchor<TExport>>;
451
+ packages?: Array<string>;
452
+ } & (TExport extends false ? {
453
+ id: string;
454
+ } : {});
455
+ type TLogicMain<TExport extends boolean = false> = TLogicBase<TExport> & {
456
+ name: "Main";
457
+ type: EElementType.MainLogic;
458
+ } & (TExport extends false ? {
459
+ id: "main";
460
+ } : {});
461
+ type TCanvas = {
462
+ location: TVector;
463
+ zoom: number;
464
+ };
465
+ type TGraph<TExport extends boolean = false> = {
466
+ canvas: TCanvas;
467
+ nodes: Record<string, TNode<TExport>>;
468
+ wires: Record<string, TWire<TExport>>;
469
+ };
470
+ type TAnchor<TExport extends boolean = false> = TExport extends true ? TSchema : {
471
+ id: string;
472
+ parent?: TLogic<TExport>;
473
+ schema: TSchema;
474
+ };
475
+ type TAnyLogic<TExport extends boolean = false> = TLogic<TExport> | TLogicMain<TExport>; //#endregion
476
+ //#region src/types/value.d.ts
477
+ declare enum ELayoutValueType {
478
+ variable = "variable",
479
+ property = "property",
480
+ attribute = "attribute",
481
+ context = "context",
482
+ computed = "computed",
483
+ event = "event",
484
+ file = "file",
485
+ model = "model",
486
+ logic = "logic"
487
+ }
488
+ type TContextValue = {
489
+ schema: TSchema;
490
+ value: unknown;
491
+ };
492
+ type TLayoutContext = Record<string, TContextValue>;
493
+ type TLayoutValue<TExport extends boolean = false> = {
494
+ id: string;
495
+ type?: ELayoutValueType;
496
+ baseType?: ELayoutValueType;
497
+ child: Array<string>;
498
+ component: TFileComponent<TExport>;
499
+ context: TLayoutContext;
500
+ stackId: string;
501
+ get value(): unknown;
502
+ set value(value: unknown);
503
+ get schema(): TSchema;
504
+ get baseSchema(): TSchema;
505
+ }; //#endregion
506
+ //#region src/types/variable.d.ts
507
+ declare enum EDynamicVariableType {
508
+ Constant = "constant",
509
+ Dynamic = "dynamic",
510
+ Token = "token"
511
+ }
512
+ declare enum EDynamicVariableOperation {
513
+ Equal = "equal",
514
+ Greater = "greater",
515
+ Less = "less",
516
+ StartsWith = "starts-with",
517
+ EndsWith = "ends-with",
518
+ Contains = "contains"
519
+ }
520
+ type TBaseDynamicVariable<TExport extends boolean = false> = {
521
+ type: EDynamicVariableType;
522
+ _dynamic: true;
523
+ access: Array<string>;
524
+ target: {
525
+ invert?: boolean;
526
+ operation: EDynamicVariableOperation;
527
+ variable?: TDynamicVariable<TExport>;
528
+ };
529
+ token: string;
530
+ value: unknown;
531
+ };
532
+ type TDynamicVariable<TExport extends boolean = false> = (TExport extends true ? TBaseDynamicVariable<TExport> : TBaseDynamicVariable<TExport> & {
533
+ getComputed(component: TFileComponent, options: {
534
+ context?: TLayoutContext;
535
+ stackId?: string;
536
+ }): ComputedRef<TContextValue | TLayoutValue>;
537
+ getValue(component: TFileComponent, options: {
538
+ base?: boolean;
539
+ context?: TLayoutContext;
540
+ stackId?: string;
541
+ }): TContextValue;
542
+ getRawValue(): unknown;
543
+ toJSON(): unknown;
544
+ }) | unknown;
545
+ type TValue<TExport extends boolean = false> = TExport extends false ? {
546
+ id: string;
547
+ isEditing?: boolean;
548
+ parent?: TLogic<TExport>;
549
+ schema: TSchema;
550
+ } : TSchema; //#endregion
551
+ //#region src/types/layout.d.ts
552
+ type TTextBlock = {
553
+ content: string;
554
+ key: string;
555
+ };
556
+ type TLayoutContentType<TElement extends ELayoutElement, TExport extends boolean = false> = TElement extends ELayoutElement.variable ? {
557
+ var: TDynamicVariable | unknown;
558
+ } : TElement extends ELayoutElement.component ? {
559
+ id: string;
560
+ slot: boolean;
561
+ slots: Record<string, TLayoutSchema<TElement, TExport>>;
562
+ } : TElement extends ELayoutElement.customText ? {
563
+ text: TTextBlock;
564
+ variables: Array<string>;
565
+ } : TElement extends ELayoutElement.customHtml ? {
566
+ html: string;
567
+ variables: Array<string>;
568
+ } : TElement extends ELayoutElement.template ? {
569
+ preview: string;
570
+ template: EElementTemplate;
571
+ var: TDynamicVariable | unknown;
572
+ } : TElement extends ELayoutElement.package ? {
573
+ slot: boolean;
574
+ slots: Record<string, TLayoutSchema<TElement, TExport>>;
575
+ target: Array<string>;
576
+ } : Record<string, unknown>;
577
+ type TLayoutSchema<TElement extends ELayoutElement = ELayoutElement, TExport extends boolean = false> = { [TInnerElement in TElement]: {
578
+ id: string;
579
+ name: string;
580
+ children: Array<TLayoutSchema<ELayoutElement, TExport>>;
581
+ classes: Array<TDynamicVariable<TExport>>;
582
+ collapsed?: boolean;
583
+ component: TFileComponent<TExport>;
584
+ content: TLayoutContentType<TInnerElement>;
585
+ element: TInnerElement;
586
+ events: Array<ELayoutEvent | string>;
587
+ model?: Array<string>;
588
+ properties: Record<string, TDynamicVariable<TExport>>;
589
+ style: { [key in "base" | string]: { [key in "default" | "hover"]: { [key in string]: TDynamicVariable<TExport> } } } & {
590
+ quick?: Array<string>;
591
+ };
592
+ tag?: string;
593
+ } }[TElement] & (TExport extends false ? {
594
+ parent?: TLayoutSchema<ELayoutElement, TExport>;
595
+ } : {}); //#endregion
596
+ //#region src/types/files/component.d.ts
597
+ declare enum EComponentType {
598
+ Component = "component",
599
+ Page = "page"
600
+ }
601
+ declare enum EComponentPreview {
602
+ Compact = "compact",
603
+ Stretch = "stretch",
604
+ Full = "full"
605
+ }
606
+ type TComponentOptions = {
607
+ type: EComponentType;
608
+ path: string;
609
+ preview: EComponentPreview;
610
+ previewSize: string;
611
+ };
612
+ type TFileComponent<TExport extends boolean = false> = TFileBase<TExport> & {
613
+ type: EElementType.Component;
614
+ collapsed?: boolean;
615
+ layout: TLayoutSchema<ELayoutElement, TExport>;
616
+ logics: Record<string, TLogic<TExport> | TLogicMain<TExport>>;
617
+ options: TComponentOptions;
618
+ values: {
619
+ computed: Record<string, TValue<TExport>>;
620
+ events: Record<string, TValue<TExport>>;
621
+ model?: TSchema;
622
+ properties: Record<string, TValue<TExport>>;
623
+ variables: Record<string, TValue<TExport>>;
624
+ };
625
+ } & (TExport extends false ? {
626
+ flat: Record<string, TLayoutSchema>;
627
+ } : {}); //#endregion
628
+ //#region src/types/files/config.d.ts
629
+ type TFileConfig<TExport extends boolean = false> = TFileBase<TExport> & {
630
+ type: EElementType.Config;
631
+ content: unknown;
632
+ display: EConfigDisplay;
633
+ schema: TSchema;
634
+ scope: ELogicScope;
635
+ };
636
+ declare enum EConfigDisplay {
637
+ Smart = "smart",
638
+ Performance = "performance"
639
+ } //#endregion
640
+ //#region src/types/files/cron.d.ts
641
+ type TFileCron<TExport extends boolean = false> = TFileBase<TExport> & {
642
+ type: EElementType.Cron;
643
+ active: boolean;
644
+ editorTrigger: boolean;
645
+ logics: Record<string, TAnyLogic<TExport>>;
646
+ time: string;
647
+ } & (TExport extends false ? {
648
+ cron?: Cron;
649
+ scope: ELogicScope.Backend;
650
+ } : {}); //#endregion
651
+ //#region src/types/files/media.d.ts
652
+ type TFileMedia<TExport extends boolean = false> = TFileBase<TExport> & {
653
+ type: EElementType.Media;
654
+ mimeType: string;
655
+ target: string;
656
+ }; //#endregion
657
+ //#region src/types/files/route.d.ts
658
+ declare enum ERouteMethod {
659
+ Get = "get",
660
+ Post = "post",
661
+ Put = "put",
662
+ Delete = "delete"
663
+ }
664
+ type TFileRoute<TExport extends boolean = false> = TFileBase<TExport> & {
665
+ type: EElementType.Route;
666
+ dev?: boolean;
667
+ input: {
668
+ body: TSchema;
669
+ headers: TSchema;
670
+ query: TSchema;
671
+ };
672
+ logics: Record<string, TAnyLogic<TExport>>;
673
+ method: ERouteMethod;
674
+ output: TSchema;
675
+ path: string;
676
+ } & (TExport extends false ? {
677
+ scope: ELogicScope.Backend;
678
+ } : {}); //#endregion
679
+ //#region src/types/files/script.d.ts
680
+ type TFileScript<TExport extends boolean = false> = TFileBase<TExport> & {
681
+ type: EElementType.Script;
682
+ logics: Record<string, TAnyLogic<TExport>>;
683
+ options?: {
684
+ autoReload?: boolean;
685
+ };
686
+ scope: ELogicScope;
687
+ }; //#endregion
688
+ //#region src/types/files/store.d.ts
689
+ declare enum EStoreType {
690
+ Memory = "memory",
691
+ Session = "session",
692
+ Local = "local"
693
+ }
694
+ type TStoreOptions = {
695
+ type: EStoreType;
696
+ };
697
+ type TFileStore<TExport extends boolean = false> = TFileBase<TExport> & {
698
+ type: EElementType.Store;
699
+ default: unknown;
700
+ logics: Record<string, TLogic<TExport>>;
701
+ options: TStoreOptions;
702
+ schema: TSchema;
703
+ } & (TExport extends false ? {
704
+ proxy: TSchema;
705
+ scope: ELogicScope.Frontend;
706
+ value: Record<string, unknown>;
707
+ } : {}); //#endregion
708
+ //#region src/types/files/text.d.ts
709
+ type TFileText<TExport extends boolean = false> = TFileBase<TExport> & {
710
+ type: EElementType.Text;
711
+ blocks: Array<{
712
+ content: string;
713
+ key: string;
714
+ }>;
715
+ } & (TExport extends false ? {
716
+ scope: ELogicScope.Frontend;
717
+ } : {}); //#endregion
718
+ //#region src/types/files/type.d.ts
719
+ type TFileType<TExport extends boolean = false> = TFileBase<TExport> & {
720
+ name: string;
721
+ type: EElementType.Type;
722
+ schemas: Record<string, TSchema>;
723
+ } & (TExport extends false ? {
724
+ scope: ELogicScope.Shared;
725
+ } : {}); //#endregion
726
+ //#region src/types/files/index.d.ts
727
+ type TApplication<TExport extends boolean = false> = {
728
+ name: string;
729
+ config: TApplicationConfig;
730
+ tree: TFile<TExport>;
731
+ version: number;
732
+ };
733
+ declare enum EHistoryMode {
734
+ Hash = "hash",
735
+ Web = "web",
736
+ Memory = "memory"
737
+ }
738
+ declare enum EResponsiveStrategy {
739
+ DesktopFirst = "desktop-first",
740
+ MobileFirst = "mobile-first"
741
+ }
742
+ declare enum EFileSortStrategy {
743
+ Name = "name",
744
+ Type = "type"
745
+ }
746
+ type TApplicationConfig = {
747
+ backend: {
748
+ proxy: string;
749
+ salt: string;
750
+ };
751
+ database: {
752
+ type: string;
753
+ };
754
+ description?: string;
755
+ desktop: {
756
+ fullscreen: boolean;
757
+ height: number;
758
+ resizable: boolean;
759
+ version: string;
760
+ width: number;
761
+ };
762
+ libraries: Record<string, boolean>;
763
+ packages: Record<string, {
764
+ name: string;
765
+ components: TExportNodeResult["components"];
766
+ description?: string;
767
+ functions: TExportNodeResult["functions"];
768
+ types: TExportNodeResult["types"];
769
+ }>;
770
+ palette: {
771
+ inject: {
772
+ css: string;
773
+ head: string;
774
+ html: string;
775
+ js: string;
776
+ };
777
+ tokens: {
778
+ colors: Array<{
779
+ id: string;
780
+ name: string;
781
+ value: string;
782
+ }>;
783
+ fonts: Array<{
784
+ id: string;
785
+ name: string;
786
+ value: string;
787
+ }>;
788
+ lengths: Array<{
789
+ id: string;
790
+ name: string;
791
+ value: string;
792
+ }>;
793
+ };
794
+ };
795
+ plugins: Record<string, {
796
+ config?: unknown;
797
+ internals?: unknown;
798
+ target: string;
799
+ }>;
800
+ state: {
801
+ currentTab: string;
802
+ explorerSort: EFileSortStrategy;
803
+ tabs: Array<string>;
804
+ };
805
+ style: {
806
+ strategy: EResponsiveStrategy;
807
+ };
808
+ web: {
809
+ history: EHistoryMode;
810
+ pwa: boolean;
811
+ };
812
+ };
813
+ type TFile<TExport extends boolean = false> = (TFolder<TExport> | TFileComponent<TExport> | TFileConfig<TExport> | TFileCron<TExport> | TFileDatabase<TExport> | TFileRoute<TExport> | TFileScript<TExport> | TFileStore<TExport> | TFileText<TExport> | TFileType<TExport> | TFileMedia<TExport>) & {
814
+ isEditing?: boolean;
815
+ };
816
+ //#endregion
817
+ //#region src/types/interface.d.ts
818
+ type TInterface = {
819
+ arguments?: Array<TSchema>;
820
+ class?: new (...args: Array<unknown>) => unknown;
821
+ methods?: Array<{
822
+ name: string;
823
+ parameters?: Array<TSchema>;
824
+ return: TSchema;
825
+ }>;
826
+ name: string;
827
+ };
828
+ //#endregion
829
+ //#region src/types/template.d.ts
830
+ type TTemplate = {
831
+ name: string;
832
+ preview?: string;
833
+ template: TFile<true>;
834
+ };
835
+ //#endregion
836
+ //#region src/types/token.d.ts
837
+ declare enum ETokenType {
838
+ Color = "color",
839
+ FontSize = "font-size",
840
+ FontWeight = "font-weight",
841
+ FontFamily = "font-family",
842
+ Length = "length",
843
+ Time = "time"
844
+ }
845
+ type TToken = {
846
+ id: string;
847
+ name?: string;
848
+ type: ETokenType;
849
+ value: string;
850
+ };
851
+ //#endregion
852
+ //#region src/types/plugin.d.ts
853
+ declare enum EInjectionKey {
854
+ ViteImport = "viteImport",
855
+ VitePlugin = "vitePlugin",
856
+ AppImport = "appImport",
857
+ AppBody = "appBody",
858
+ AppSetup = "appSetup",
859
+ Style = "style",
860
+ ServerImport = "serverImport",
861
+ ServerBody = "serverBody"
862
+ }
863
+ type TBasePlugin<TConfig extends TSchema = TSchema, TInternals = unknown> = {
864
+ build?: {
865
+ backImports?: Array<{
866
+ name: string;
867
+ version?: string;
868
+ }>;
869
+ frontImports?: Array<{
870
+ name: string;
871
+ version?: string;
872
+ }>;
873
+ injections?: Partial<Record<EInjectionKey, string>>;
874
+ };
875
+ color?: string;
876
+ config?: TConfig;
877
+ dependencies?: Array<{
878
+ id: string;
879
+ name: string;
880
+ target: string;
881
+ }>;
882
+ description?: string;
883
+ editor?: {
884
+ components?: Array<TComponent>;
885
+ interfaces?: Array<TInterface>;
886
+ nodes?: Array<TLogicNode>;
887
+ templates?: Array<TTemplate>;
888
+ tokens?: Array<TToken>;
889
+ wrapper?: TComponent & {
890
+ attributes?: Record<string, unknown>;
891
+ };
892
+ };
893
+ hooks?: { [THook in EPluginHooks]?: (params: THookParams[THook]) => MaybePromise<void> };
894
+ icon: string;
895
+ id: string;
896
+ inject?: {
897
+ css?: string;
898
+ js?: string;
899
+ };
900
+ interface?: Component;
901
+ internals?: TInternals;
902
+ lifecycle?: {
903
+ mount?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
904
+ unmount?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
905
+ update?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
906
+ };
907
+ name: string;
908
+ settings?: Array<{
909
+ component: Component;
910
+ icon?: IconDefinition | string;
911
+ label: string;
912
+ }>;
913
+ windows?: Record<string, Component>;
914
+ };
915
+ type TPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & { [TCategory in "build" | "editor" | "inject"]?: { [TKey in keyof NonNullable<TBase[TCategory]>]: TOption<TEnv<TConfig, TInternal>, NonNullable<TBase[TCategory]>[TKey]> } };
916
+ type TProxyPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & { [TCategory in "build" | "editor" | "inject"]?: { [TKey in keyof NonNullable<TBase[TCategory]>]: Promise<NonNullable<TBase[TCategory]>[TKey]> } };
917
+ type TEnv<TConfig extends TSchema = TSchema, TInternals = unknown> = {
918
+ addFile: (file: DeepPartial<TFile<true>> & {
919
+ type: EElementType;
920
+ }, parentId?: string) => TFile;
921
+ app: TApplication;
922
+ backend: {
923
+ cookies: Record<string, {
924
+ options?: Record<string, string>;
925
+ value: string;
926
+ }>;
927
+ };
928
+ config: Static<TConfig>;
929
+ getFile: (id: string) => TFile | undefined;
930
+ internals: TInternals;
931
+ mode: "build" | "editor";
932
+ };
933
+ type TOption<TParams = unknown, TResult = unknown> = TResult | ((env: TParams) => Promise<TResult> | TResult);
934
+ //#endregion
935
+ //#region src/index.d.ts
936
+ declare function makePlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>): TPlugin<TConfig, TInternal>;
937
+ declare function makeComponent<TProps extends Record<string, TSchema>>(component: TComponent<TProps>): TComponent<TProps>;
938
+ declare function loadPlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>, env: Partial<TEnv>): Promise<TBasePlugin<TConfig, TInternal>>;
939
+ declare function getPluginParam<T>(target: TOption<TEnv, T>, env: Partial<TEnv>): Promise<T>;
940
+ //#endregion
941
+ export { EElementType, EInjectionKey, ELogicScope, ELogicType, EPluginHooks, ETokenType, EVarType, _default as LSettingsStoryWrapper, LogicType, LogicUtil, type Static, type TAnyLogic, type TApplication, type TBasePlugin, type TComponent, type TEnv, type TFile, type TFileComponent, type TFileConfig, type TFileCron, type TFileDatabase, type TFileMedia, type TFileRoute, type TFileScript, type TFileStore, type TFileText, type TFileType, type TFolder, type THookParams, type TLogic, type TLogicMain, type TLogicNode, type TOption, type TPlugin, type TProxyPlugin, type TSchema, type TSlot, type TTemplate, type TToken, getPluginParam, loadPlugin, makeComponent, makeLogicNode, makePlugin };