@luna-park/plugin 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-DmZsz62R.cjs");function o(e){return e}async function r(e,n){return typeof e=="function"?e({app:n.app,config:n.config,internal:n.internal,mode:n.mode||"editor"}):e}exports.ELogicScope=i.J;exports.ELogicType=i._;exports.EVarType=i.i;exports.LogicType=i.u;exports.LogicUtil=i.x;exports.makeLogicNode=i.T;exports.getPluginParam=r;exports.makePlugin=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DmZsz62R.cjs");var n=(i=>(i.Color="color",i.FontSize="font-size",i.FontWeight="font-weight",i.FontFamily="font-family",i.Length="length",i.Time="time",i))(n||{});function e(i){return i}async function r(i,o){return typeof i=="function"?i({app:o.app,config:o.config,internal:o.internal,mode:o.mode||"editor"}):i}exports.ELogicScope=t.J;exports.ELogicType=t._;exports.EVarType=t.i;exports.LogicType=t.u;exports.LogicUtil=t.x;exports.makeLogicNode=t.T;exports.ETokenType=n;exports.getPluginParam=r;exports.makePlugin=e;
package/dist/index.d.ts CHANGED
@@ -122,7 +122,7 @@ declare enum EThemeMode {
122
122
  Auto = "auto"
123
123
  }
124
124
 
125
- declare enum ETokenType {
125
+ export declare enum ETokenType {
126
126
  Color = "color",
127
127
  FontSize = "font-size",
128
128
  FontWeight = "font-weight",
@@ -344,9 +344,6 @@ declare type TCanvasExport = {
344
344
 
345
345
  export declare type TComponent = {
346
346
  component: Component;
347
- custom?: {
348
- slots: (attributes: Record<string, unknown>) => Record<string, false | TSchema>;
349
- };
350
347
  emits?: Record<string, TSchema>;
351
348
  import?: Array<{
352
349
  name: string;
@@ -355,7 +352,7 @@ export declare type TComponent = {
355
352
  models?: Record<string, TSchema>;
356
353
  name: string;
357
354
  properties?: Record<string, TSchema>;
358
- slots?: Record<string, TSchema<TObject> | TSchema<TVoid>>;
355
+ slots?: Record<string, TSlot> | ((attributes: Record<string, unknown>) => Record<string, TSlot>);
359
356
  };
360
357
 
361
358
  declare type TComponentExport = {
@@ -764,7 +761,7 @@ export declare type TPlugin<TConfig extends TSchema = TSchema, TInternal = unkno
764
761
  editor?: {
765
762
  components?: TOption<TEnv<TConfig, TInternal>, Array<TComponent>>;
766
763
  nodes?: TOption<TEnv<TConfig, TInternal>, Array<TLogicNode>>;
767
- tokens?: TOption<TEnv<TConfig, TInternal>, Record<ETokenType, Record<string, TToken>>>;
764
+ tokens?: TOption<TEnv<TConfig, TInternal>, Array<TToken>>;
768
765
  wrapper?: TOption<TEnv<TConfig, TInternal>, Component>;
769
766
  };
770
767
  icon: string;
@@ -821,6 +818,8 @@ declare type TScriptExport = {
821
818
  state: TStateExport;
822
819
  };
823
820
 
821
+ declare type TSlot = TSchema<TObject> | TSchema<TVoid>;
822
+
824
823
  declare type TStateExport = Record<string, unknown>;
825
824
 
826
825
  declare type TStoreExport = {
@@ -852,8 +851,10 @@ declare type TTextExport = {
852
851
  state: TStateExport;
853
852
  };
854
853
 
855
- declare type TToken = {
854
+ export declare type TToken = {
855
+ id: string;
856
856
  name?: string;
857
+ type: ETokenType;
857
858
  value: string;
858
859
  };
859
860
 
package/dist/index.js CHANGED
@@ -1,22 +1,24 @@
1
- import { J as r, _ as p, i as t, u, x as f, T as g } from "./index-CxGB_fZK.js";
2
- function n(o) {
3
- return o;
1
+ import { J as e, _ as f, i as g, u as l, x as m, T as u } from "./index-CxGB_fZK.js";
2
+ var t = /* @__PURE__ */ ((i) => (i.Color = "color", i.FontSize = "font-size", i.FontWeight = "font-weight", i.FontFamily = "font-family", i.Length = "length", i.Time = "time", i))(t || {});
3
+ function n(i) {
4
+ return i;
4
5
  }
5
- async function a(o, i) {
6
- return typeof o == "function" ? o({
7
- app: i.app,
8
- config: i.config,
9
- internal: i.internal,
10
- mode: i.mode || "editor"
11
- }) : o;
6
+ async function a(i, o) {
7
+ return typeof i == "function" ? i({
8
+ app: o.app,
9
+ config: o.config,
10
+ internal: o.internal,
11
+ mode: o.mode || "editor"
12
+ }) : i;
12
13
  }
13
14
  export {
14
- r as ELogicScope,
15
- p as ELogicType,
16
- t as EVarType,
17
- u as LogicType,
18
- f as LogicUtil,
15
+ e as ELogicScope,
16
+ f as ELogicType,
17
+ t as ETokenType,
18
+ g as EVarType,
19
+ l as LogicType,
20
+ m as LogicUtil,
19
21
  a as getPluginParam,
20
- g as makeLogicNode,
22
+ u as makeLogicNode,
21
23
  n as makePlugin
22
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luna-park/plugin",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "description": "Plugin helper for Luna Park.",
6
6
  "homepage": "https://luna-park.app",