@devtools-ui/console 0.4.0-next.1 → 0.4.1--canary.62.3837

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.
@@ -48,10 +48,10 @@ var ConsoleComponent = (props) => {
48
48
 
49
49
  // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/dsl/index.tsx
50
50
  var import_react2 = __toESM(require("react"));
51
- var import_dsl = require("@player-tools/dsl");
51
+ var import_react_dsl = require("@player-lang/react-dsl");
52
52
  var Console2 = (props) => {
53
53
  const { exp, binding } = props;
54
- return /* @__PURE__ */ import_react2.default.createElement(import_dsl.Asset, { type: "console" }, exp && /* @__PURE__ */ import_react2.default.createElement("property", { name: "exp" }, exp.toValue()), binding && /* @__PURE__ */ import_react2.default.createElement("property", { name: "binding" }, binding.toValue()));
54
+ return /* @__PURE__ */ import_react2.default.createElement(import_react_dsl.Asset, { type: "console" }, exp && /* @__PURE__ */ import_react2.default.createElement("property", { name: "exp" }, exp.toValue()), binding && /* @__PURE__ */ import_react2.default.createElement("property", { name: "binding" }, binding.toValue()));
55
55
  };
56
56
 
57
57
  // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/transform/index.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/component/index.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/dsl/index.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/transform/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./component\";\nexport * from \"./dsl\";\nexport * from \"./transform\";\n","import React from \"react\";\nimport { Console } from \"@devtools-ds/console\";\nimport type { TransformedConsole } from \"../types\";\n\nexport const ConsoleComponent = (props: TransformedConsole) => {\n const { evaluate, history } = props;\n\n return <Console execute={evaluate} history={history} />;\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n BindingTemplateInstance,\n ExpressionTemplateInstance,\n} from \"@player-tools/dsl\";\nimport type { ConsoleAsset } from \"../types\";\n\n/**\n * Defines the component DSL representation for the Console asset,\n * a component that emulates a REPL environment that you see in browsers.\n */\nexport const Console = (\n props: Omit<AssetPropsWithChildren<ConsoleAsset>, \"binding\"> & {\n /** Binding as template string */\n binding: BindingTemplateInstance;\n /** Expression as template string */\n exp: ExpressionTemplateInstance;\n }\n) => {\n const { exp, binding } = props;\n\n return (\n <Asset type=\"console\">\n {exp && <property name=\"exp\">{exp.toValue()}</property>}\n {binding && <property name=\"binding\">{binding.toValue()}</property>}\n </Asset>\n );\n};\n","import type {\n Asset,\n BeforeTransformFunction,\n TransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport { ConsoleAsset, TransformedConsole } from \"../types\";\n\n/**\n * Platform-agnostic transform function that takes the properties we get from the Player Content (DSL > JSON)\n * and embeds Player state and methods:\n */\nexport const transform: TransformFunction<ConsoleAsset, TransformedConsole> = (\n asset,\n options\n) => {\n return {\n ...asset,\n history:\n asset.binding === undefined\n ? undefined\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: false,\n }),\n evaluate(expression: string) {\n if (asset.exp) {\n // get the referenced expression property holder from the expression\n const referencedExpression = asset.exp.match(/{{\\s*(.*?)\\s*}}/);\n // set the referenced expression property to the new expression\n // so it is available to the asset.exp\n referencedExpression &&\n options.data.model.set([[referencedExpression[1], expression]]);\n options.evaluate(asset.exp);\n }\n },\n };\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const consoleTransform = compose(\n transform,\n composeBefore(expPropTransform)\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,qBAAwB;AAGjB,IAAM,mBAAmB,CAAC,UAA8B;AAC7D,QAAM,EAAE,UAAU,QAAQ,IAAI;AAE9B,SAAO,6BAAAC,QAAA,cAAC,0BAAQ,SAAS,UAAU,SAAkB;AACvD;;;ACRA,IAAAC,gBAAkB;AAClB,iBAKO;AAOA,IAAMC,WAAU,CACrB,UAMG;AACH,QAAM,EAAE,KAAK,QAAQ,IAAI;AAEzB,SACE,8BAAAC,QAAA,cAAC,oBAAM,MAAK,aACT,OAAO,8BAAAA,QAAA,cAAC,cAAS,MAAK,SAAO,IAAI,QAAQ,CAAE,GAC3C,WAAW,8BAAAA,QAAA,cAAC,cAAS,MAAK,aAAW,QAAQ,QAAQ,CAAE,CAC1D;AAEJ;;;ACxBA,oCAAuC;AAOhC,IAAM,YAAiE,CAC5E,OACA,YACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SACE,MAAM,YAAY,SACd,SACA,QAAQ,KAAK,MAAM,IAAI,MAAM,SAAS;AAAA,MACpC,gBAAgB;AAAA,MAChB,WAAW;AAAA,IACb,CAAC;AAAA,IACP,SAAS,YAAoB;AAC3B,UAAI,MAAM,KAAK;AAEb,cAAM,uBAAuB,MAAM,IAAI,MAAM,iBAAiB;AAG9D,gCACE,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,UAAU,CAAC,CAAC;AAChE,gBAAQ,SAAS,MAAM,GAAG;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,mBAAmD,CAAC,UAAU;AACzE,QAAM,YAAY,MAAM,SAAS,gBAAgB;AAEjD,MAAI,aAAa,UAAU,QAAQ,KAAK,IAAI,GAAG;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACP,GAAG,MAAM;AAAA,MACT,gBAAgB;AAAA,QACd,GAAG,OAAO,SAAS;AAAA,QACnB,kBAAkB;AAAA,UAChB,GAAI,MAAM,SAAS,gBAAgB,oBAAoB,CAAC;AAAA,UACxD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,uBAAmB;AAAA,EAC9B;AAAA,MACA,6CAAc,gBAAgB;AAChC;","names":["Console","React","import_react","Console","React"]}
1
+ {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/component/index.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/dsl/index.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/transform/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./component\";\nexport * from \"./dsl\";\nexport * from \"./transform\";\n","import React from \"react\";\nimport { Console } from \"@devtools-ds/console\";\nimport type { TransformedConsole } from \"../types\";\n\nexport const ConsoleComponent = (props: TransformedConsole) => {\n const { evaluate, history } = props;\n\n return <Console execute={evaluate} history={history} />;\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n BindingTemplateInstance,\n ExpressionTemplateInstance,\n} from \"@player-lang/react-dsl\";\nimport type { ConsoleAsset } from \"../types\";\n\n/**\n * Defines the component DSL representation for the Console asset,\n * a component that emulates a REPL environment that you see in browsers.\n */\nexport const Console = (\n props: Omit<AssetPropsWithChildren<ConsoleAsset>, \"binding\"> & {\n /** Binding as template string */\n binding: BindingTemplateInstance;\n /** Expression as template string */\n exp: ExpressionTemplateInstance;\n }\n) => {\n const { exp, binding } = props;\n\n return (\n <Asset type=\"console\">\n {exp && <property name=\"exp\">{exp.toValue()}</property>}\n {binding && <property name=\"binding\">{binding.toValue()}</property>}\n </Asset>\n );\n};\n","import type {\n Asset,\n BeforeTransformFunction,\n TransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport { ConsoleAsset, TransformedConsole } from \"../types\";\n\n/**\n * Platform-agnostic transform function that takes the properties we get from the Player Content (DSL > JSON)\n * and embeds Player state and methods:\n */\nexport const transform: TransformFunction<ConsoleAsset, TransformedConsole> = (\n asset,\n options\n) => {\n return {\n ...asset,\n history:\n asset.binding === undefined\n ? undefined\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: false,\n }),\n evaluate(expression: string) {\n if (asset.exp) {\n // get the referenced expression property holder from the expression\n const referencedExpression = asset.exp.match(/{{\\s*(.*?)\\s*}}/);\n // set the referenced expression property to the new expression\n // so it is available to the asset.exp\n referencedExpression &&\n options.data.model.set([[referencedExpression[1], expression]]);\n options.evaluate(asset.exp);\n }\n },\n };\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const consoleTransform = compose(\n transform,\n composeBefore(expPropTransform)\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAClB,qBAAwB;AAGjB,IAAM,mBAAmB,CAAC,UAA8B;AAC7D,QAAM,EAAE,UAAU,QAAQ,IAAI;AAE9B,SAAO,6BAAAC,QAAA,cAAC,0BAAQ,SAAS,UAAU,SAAkB;AACvD;;;ACRA,IAAAC,gBAAkB;AAClB,uBAKO;AAOA,IAAMC,WAAU,CACrB,UAMG;AACH,QAAM,EAAE,KAAK,QAAQ,IAAI;AAEzB,SACE,8BAAAC,QAAA,cAAC,0BAAM,MAAK,aACT,OAAO,8BAAAA,QAAA,cAAC,cAAS,MAAK,SAAO,IAAI,QAAQ,CAAE,GAC3C,WAAW,8BAAAA,QAAA,cAAC,cAAS,MAAK,aAAW,QAAQ,QAAQ,CAAE,CAC1D;AAEJ;;;ACxBA,oCAAuC;AAOhC,IAAM,YAAiE,CAC5E,OACA,YACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SACE,MAAM,YAAY,SACd,SACA,QAAQ,KAAK,MAAM,IAAI,MAAM,SAAS;AAAA,MACpC,gBAAgB;AAAA,MAChB,WAAW;AAAA,IACb,CAAC;AAAA,IACP,SAAS,YAAoB;AAC3B,UAAI,MAAM,KAAK;AAEb,cAAM,uBAAuB,MAAM,IAAI,MAAM,iBAAiB;AAG9D,gCACE,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,UAAU,CAAC,CAAC;AAChE,gBAAQ,SAAS,MAAM,GAAG;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,mBAAmD,CAAC,UAAU;AACzE,QAAM,YAAY,MAAM,SAAS,gBAAgB;AAEjD,MAAI,aAAa,UAAU,QAAQ,KAAK,IAAI,GAAG;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACP,GAAG,MAAM;AAAA,MACT,gBAAgB;AAAA,QACd,GAAG,OAAO,SAAS;AAAA,QACnB,kBAAkB;AAAA,UAChB,GAAI,MAAM,SAAS,gBAAgB,oBAAoB,CAAC;AAAA,UACxD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,uBAAmB;AAAA,EAC9B;AAAA,MACA,6CAAc,gBAAgB;AAChC;","names":["Console","React","import_react","Console","React"]}
@@ -10,7 +10,7 @@ var ConsoleComponent = (props) => {
10
10
  import React2 from "react";
11
11
  import {
12
12
  Asset
13
- } from "@player-tools/dsl";
13
+ } from "@player-lang/react-dsl";
14
14
  var Console2 = (props) => {
15
15
  const { exp, binding } = props;
16
16
  return /* @__PURE__ */ React2.createElement(Asset, { type: "console" }, exp && /* @__PURE__ */ React2.createElement("property", { name: "exp" }, exp.toValue()), binding && /* @__PURE__ */ React2.createElement("property", { name: "binding" }, binding.toValue()));
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ var ConsoleComponent = (props) => {
10
10
  import React2 from "react";
11
11
  import {
12
12
  Asset
13
- } from "@player-tools/dsl";
13
+ } from "@player-lang/react-dsl";
14
14
  var Console2 = (props) => {
15
15
  const { exp, binding } = props;
16
16
  return /* @__PURE__ */ React2.createElement(Asset, { type: "console" }, exp && /* @__PURE__ */ React2.createElement("property", { name: "exp" }, exp.toValue()), binding && /* @__PURE__ */ React2.createElement("property", { name: "binding" }, binding.toValue()));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/component/index.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/dsl/index.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/transform/index.ts"],"sourcesContent":["import React from \"react\";\nimport { Console } from \"@devtools-ds/console\";\nimport type { TransformedConsole } from \"../types\";\n\nexport const ConsoleComponent = (props: TransformedConsole) => {\n const { evaluate, history } = props;\n\n return <Console execute={evaluate} history={history} />;\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n BindingTemplateInstance,\n ExpressionTemplateInstance,\n} from \"@player-tools/dsl\";\nimport type { ConsoleAsset } from \"../types\";\n\n/**\n * Defines the component DSL representation for the Console asset,\n * a component that emulates a REPL environment that you see in browsers.\n */\nexport const Console = (\n props: Omit<AssetPropsWithChildren<ConsoleAsset>, \"binding\"> & {\n /** Binding as template string */\n binding: BindingTemplateInstance;\n /** Expression as template string */\n exp: ExpressionTemplateInstance;\n }\n) => {\n const { exp, binding } = props;\n\n return (\n <Asset type=\"console\">\n {exp && <property name=\"exp\">{exp.toValue()}</property>}\n {binding && <property name=\"binding\">{binding.toValue()}</property>}\n </Asset>\n );\n};\n","import type {\n Asset,\n BeforeTransformFunction,\n TransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport { ConsoleAsset, TransformedConsole } from \"../types\";\n\n/**\n * Platform-agnostic transform function that takes the properties we get from the Player Content (DSL > JSON)\n * and embeds Player state and methods:\n */\nexport const transform: TransformFunction<ConsoleAsset, TransformedConsole> = (\n asset,\n options\n) => {\n return {\n ...asset,\n history:\n asset.binding === undefined\n ? undefined\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: false,\n }),\n evaluate(expression: string) {\n if (asset.exp) {\n // get the referenced expression property holder from the expression\n const referencedExpression = asset.exp.match(/{{\\s*(.*?)\\s*}}/);\n // set the referenced expression property to the new expression\n // so it is available to the asset.exp\n referencedExpression &&\n options.data.model.set([[referencedExpression[1], expression]]);\n options.evaluate(asset.exp);\n }\n },\n };\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const consoleTransform = compose(\n transform,\n composeBefore(expPropTransform)\n);\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,eAAe;AAGjB,IAAM,mBAAmB,CAAC,UAA8B;AAC7D,QAAM,EAAE,UAAU,QAAQ,IAAI;AAE9B,SAAO,oCAAC,WAAQ,SAAS,UAAU,SAAkB;AACvD;;;ACRA,OAAOA,YAAW;AAClB;AAAA,EAEE;AAAA,OAGK;AAOA,IAAMC,WAAU,CACrB,UAMG;AACH,QAAM,EAAE,KAAK,QAAQ,IAAI;AAEzB,SACE,gBAAAD,OAAA,cAAC,SAAM,MAAK,aACT,OAAO,gBAAAA,OAAA,cAAC,cAAS,MAAK,SAAO,IAAI,QAAQ,CAAE,GAC3C,WAAW,gBAAAA,OAAA,cAAC,cAAS,MAAK,aAAW,QAAQ,QAAQ,CAAE,CAC1D;AAEJ;;;ACxBA,SAAS,SAAS,qBAAqB;AAOhC,IAAM,YAAiE,CAC5E,OACA,YACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SACE,MAAM,YAAY,SACd,SACA,QAAQ,KAAK,MAAM,IAAI,MAAM,SAAS;AAAA,MACpC,gBAAgB;AAAA,MAChB,WAAW;AAAA,IACb,CAAC;AAAA,IACP,SAAS,YAAoB;AAC3B,UAAI,MAAM,KAAK;AAEb,cAAM,uBAAuB,MAAM,IAAI,MAAM,iBAAiB;AAG9D,gCACE,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,UAAU,CAAC,CAAC;AAChE,gBAAQ,SAAS,MAAM,GAAG;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,mBAAmD,CAAC,UAAU;AACzE,QAAM,YAAY,MAAM,SAAS,gBAAgB;AAEjD,MAAI,aAAa,UAAU,QAAQ,KAAK,IAAI,GAAG;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACP,GAAG,MAAM;AAAA,MACT,gBAAgB;AAAA,QACd,GAAG,OAAO,SAAS;AAAA,QACnB,kBAAkB;AAAA,UAChB,GAAI,MAAM,SAAS,gBAAgB,oBAAoB,CAAC;AAAA,UACxD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA,cAAc,gBAAgB;AAChC;","names":["React","Console"]}
1
+ {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/component/index.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/dsl/index.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/console/src/transform/index.ts"],"sourcesContent":["import React from \"react\";\nimport { Console } from \"@devtools-ds/console\";\nimport type { TransformedConsole } from \"../types\";\n\nexport const ConsoleComponent = (props: TransformedConsole) => {\n const { evaluate, history } = props;\n\n return <Console execute={evaluate} history={history} />;\n};\n","import React from \"react\";\nimport {\n AssetPropsWithChildren,\n Asset,\n BindingTemplateInstance,\n ExpressionTemplateInstance,\n} from \"@player-lang/react-dsl\";\nimport type { ConsoleAsset } from \"../types\";\n\n/**\n * Defines the component DSL representation for the Console asset,\n * a component that emulates a REPL environment that you see in browsers.\n */\nexport const Console = (\n props: Omit<AssetPropsWithChildren<ConsoleAsset>, \"binding\"> & {\n /** Binding as template string */\n binding: BindingTemplateInstance;\n /** Expression as template string */\n exp: ExpressionTemplateInstance;\n }\n) => {\n const { exp, binding } = props;\n\n return (\n <Asset type=\"console\">\n {exp && <property name=\"exp\">{exp.toValue()}</property>}\n {binding && <property name=\"binding\">{binding.toValue()}</property>}\n </Asset>\n );\n};\n","import type {\n Asset,\n BeforeTransformFunction,\n TransformFunction,\n} from \"@player-ui/player\";\nimport { compose, composeBefore } from \"@player-ui/asset-transform-plugin\";\nimport { ConsoleAsset, TransformedConsole } from \"../types\";\n\n/**\n * Platform-agnostic transform function that takes the properties we get from the Player Content (DSL > JSON)\n * and embeds Player state and methods:\n */\nexport const transform: TransformFunction<ConsoleAsset, TransformedConsole> = (\n asset,\n options\n) => {\n return {\n ...asset,\n history:\n asset.binding === undefined\n ? undefined\n : options.data.model.get(asset.binding, {\n includeInvalid: true,\n formatted: false,\n }),\n evaluate(expression: string) {\n if (asset.exp) {\n // get the referenced expression property holder from the expression\n const referencedExpression = asset.exp.match(/{{\\s*(.*?)\\s*}}/);\n // set the referenced expression property to the new expression\n // so it is available to the asset.exp\n referencedExpression &&\n options.data.model.set([[referencedExpression[1], expression]]);\n options.evaluate(asset.exp);\n }\n },\n };\n};\n\n/**\n * Appends `exp` to the plugins.stringResolver.propertiesToSkip array or creates it if it doesn't exist\n */\nexport const expPropTransform: BeforeTransformFunction<Asset> = (asset) => {\n const skipArray = asset.plugins?.stringResolver?.propertiesToSkip;\n\n if (skipArray && skipArray.indexOf(\"exp\") > 1) {\n return asset;\n }\n\n return {\n ...asset,\n plugins: {\n ...asset.plugins,\n stringResolver: {\n ...asset?.plugins?.stringResolver,\n propertiesToSkip: [\n ...(asset.plugins?.stringResolver?.propertiesToSkip ?? []),\n \"exp\",\n ],\n },\n },\n };\n};\n\nexport const consoleTransform = compose(\n transform,\n composeBefore(expPropTransform)\n);\n"],"mappings":";AAAA,OAAO,WAAW;AAClB,SAAS,eAAe;AAGjB,IAAM,mBAAmB,CAAC,UAA8B;AAC7D,QAAM,EAAE,UAAU,QAAQ,IAAI;AAE9B,SAAO,oCAAC,WAAQ,SAAS,UAAU,SAAkB;AACvD;;;ACRA,OAAOA,YAAW;AAClB;AAAA,EAEE;AAAA,OAGK;AAOA,IAAMC,WAAU,CACrB,UAMG;AACH,QAAM,EAAE,KAAK,QAAQ,IAAI;AAEzB,SACE,gBAAAD,OAAA,cAAC,SAAM,MAAK,aACT,OAAO,gBAAAA,OAAA,cAAC,cAAS,MAAK,SAAO,IAAI,QAAQ,CAAE,GAC3C,WAAW,gBAAAA,OAAA,cAAC,cAAS,MAAK,aAAW,QAAQ,QAAQ,CAAE,CAC1D;AAEJ;;;ACxBA,SAAS,SAAS,qBAAqB;AAOhC,IAAM,YAAiE,CAC5E,OACA,YACG;AACH,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SACE,MAAM,YAAY,SACd,SACA,QAAQ,KAAK,MAAM,IAAI,MAAM,SAAS;AAAA,MACpC,gBAAgB;AAAA,MAChB,WAAW;AAAA,IACb,CAAC;AAAA,IACP,SAAS,YAAoB;AAC3B,UAAI,MAAM,KAAK;AAEb,cAAM,uBAAuB,MAAM,IAAI,MAAM,iBAAiB;AAG9D,gCACE,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,qBAAqB,CAAC,GAAG,UAAU,CAAC,CAAC;AAChE,gBAAQ,SAAS,MAAM,GAAG;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AACF;AAKO,IAAM,mBAAmD,CAAC,UAAU;AACzE,QAAM,YAAY,MAAM,SAAS,gBAAgB;AAEjD,MAAI,aAAa,UAAU,QAAQ,KAAK,IAAI,GAAG;AAC7C,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACP,GAAG,MAAM;AAAA,MACT,gBAAgB;AAAA,QACd,GAAG,OAAO,SAAS;AAAA,QACnB,kBAAkB;AAAA,UAChB,GAAI,MAAM,SAAS,gBAAgB,oBAAoB,CAAC;AAAA,UACxD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA,cAAc,gBAAgB;AAChC;","names":["React","Console"]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@devtools-ui/console",
3
- "version": "0.4.0-next.1",
3
+ "version": "0.4.1--canary.62.3837",
4
4
  "main": "dist/cjs/index.cjs",
5
5
  "dependencies": {
6
- "@devtools-ui/text": "0.4.0-next.1",
7
- "@devtools-ui/collection": "0.4.0-next.1",
6
+ "@devtools-ui/text": "0.4.1--canary.62.3837",
7
+ "@devtools-ui/collection": "0.4.1--canary.62.3837",
8
8
  "@chakra-ui/react": "^2.8.2",
9
9
  "@devtools-ds/console": "^1.2.1",
10
10
  "@emotion/react": "^11.11.4",
@@ -33,10 +33,10 @@
33
33
  "types"
34
34
  ],
35
35
  "peerDependencies": {
36
- "@player-tools/dsl": "0.7.0-next.3",
37
- "@player-ui/asset-transform-plugin": "0.9.1-next.0",
38
- "@player-ui/player": "0.9.1-next.0",
39
- "@player-ui/react": "0.9.1-next.0",
40
- "@player-ui/types": "0.9.1-next.0"
36
+ "@player-lang/react-dsl": "1.0.1",
37
+ "@player-ui/asset-transform-plugin": "0.15.5",
38
+ "@player-ui/player": "0.15.5",
39
+ "@player-ui/react": "0.15.5",
40
+ "@player-ui/types": "0.15.5"
41
41
  }
42
42
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { describe, expect, test } from "vitest";
3
- import { render, expression as e, binding as b } from "@player-tools/dsl";
3
+ import { render, expression as e, binding as b } from "@player-lang/react-dsl";
4
4
  import { Console } from "../";
5
5
 
6
6
  describe("DSL: Console", () => {
package/src/dsl/index.tsx CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  Asset,
5
5
  BindingTemplateInstance,
6
6
  ExpressionTemplateInstance,
7
- } from "@player-tools/dsl";
7
+ } from "@player-lang/react-dsl";
8
8
  import type { ConsoleAsset } from "../types";
9
9
 
10
10
  /**
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AssetPropsWithChildren, BindingTemplateInstance, ExpressionTemplateInstance } from "@player-tools/dsl";
2
+ import { AssetPropsWithChildren, BindingTemplateInstance, ExpressionTemplateInstance } from "@player-lang/react-dsl";
3
3
  import type { ConsoleAsset } from "../types";
4
4
  /**
5
5
  * Defines the component DSL representation for the Console asset,