@bonsae/nrg 0.5.0 → 0.5.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.
@@ -1,5 +1,5 @@
1
- (function(){var s=document.createElement("style");s.textContent="[data-v-5e87f030] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-5e87f030] .form-row input[type=text],[data-v-5e87f030] .form-row input[type=number],[data-v-5e87f030] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-label[data-v-9ffd05ad]{display:inline-block;width:100%;cursor:default}.nrg-label i[data-v-9ffd05ad]{margin-right:5px}.nrg-required[data-v-9ffd05ad]{color:var(--red-ui-text-color-error);margin-left:2px}.container[data-v-be13a2a5]{position:relative}.expand-button[data-v-be13a2a5]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}\n";document.head.appendChild(s);})();
2
- import { defineComponent as Oe, resolveComponent as me, openBlock as Q, createElementBlock as re, Fragment as Ge, createElementVNode as pe, createVNode as Ve, createCommentVNode as ue, normalizeClass as bs, renderSlot as Ce, createTextVNode as Es, toDisplayString as qe, createBlock as $e, withDirectives as Ss, vShow as Ps, renderList as mr, createApp as Ns } from "/nrg/assets/vue.esm-browser.prod.js";
1
+ (function(){var s=document.createElement("style");s.textContent="[data-v-5e87f030] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-5e87f030] .form-row input[type=text],[data-v-5e87f030] .form-row input[type=number],[data-v-5e87f030] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-label[data-v-9ffd05ad]{display:inline-block;width:100%;cursor:default}.nrg-label i[data-v-9ffd05ad]{margin-right:5px}.nrg-required[data-v-9ffd05ad]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-4077a6c2]{position:relative}.expand-button[data-v-4077a6c2]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}\n";document.head.appendChild(s);})();
2
+ import { defineComponent as Oe, resolveComponent as me, openBlock as Q, createElementBlock as re, Fragment as Ge, createElementVNode as le, createVNode as Ve, createCommentVNode as ue, normalizeClass as bs, renderSlot as Ce, createTextVNode as Es, toDisplayString as qe, createBlock as $e, withDirectives as Ss, vShow as Ps, renderList as mr, createApp as Ns } from "/nrg/assets/vue.esm-browser.prod.js";
3
3
  function Os() {
4
4
  }
5
5
  function Rs(e) {
@@ -2226,18 +2226,18 @@ function Ze() {
2226
2226
  D instanceof i.Name && R.assign((0, i._)`${I}.props`, D), C instanceof i.Name && R.assign((0, i._)`${I}.items`, C);
2227
2227
  }
2228
2228
  function ne(R, I, D, C) {
2229
- const { gen: G, schema: Z, data: ae, allErrors: ge, opts: le, self: fe } = R, { RULES: oe } = fe;
2230
- if (Z.$ref && (le.ignoreKeywordsWithRef || !(0, y.schemaHasRulesButRef)(Z, oe))) {
2229
+ const { gen: G, schema: Z, data: ae, allErrors: ge, opts: fe, self: pe } = R, { RULES: oe } = pe;
2230
+ if (Z.$ref && (fe.ignoreKeywordsWithRef || !(0, y.schemaHasRulesButRef)(Z, oe))) {
2231
2231
  G.block(() => F(R, "$ref", oe.all.$ref.definition));
2232
2232
  return;
2233
2233
  }
2234
- le.jtd || ee(R, I), G.block(() => {
2234
+ fe.jtd || ee(R, I), G.block(() => {
2235
2235
  for (const ye of oe.rules)
2236
2236
  Te(ye);
2237
2237
  Te(oe.post);
2238
2238
  });
2239
2239
  function Te(ye) {
2240
- (0, r.shouldUseGroup)(Z, ye) && (ye.type ? (G.if((0, s.checkDataType)(ye.type, ae, le.strictNumbers)), se(R, ye), I.length === 1 && I[0] === ye.type && D && (G.else(), (0, s.reportTypeError)(R)), G.endIf()) : se(R, ye), ge || G.if((0, i._)`${m.default.errors} === ${C || 0}`));
2240
+ (0, r.shouldUseGroup)(Z, ye) && (ye.type ? (G.if((0, s.checkDataType)(ye.type, ae, fe.strictNumbers)), se(R, ye), I.length === 1 && I[0] === ye.type && D && (G.else(), (0, s.reportTypeError)(R)), G.endIf()) : se(R, ye), ge || G.if((0, i._)`${m.default.errors} === ${C || 0}`));
2241
2241
  }
2242
2242
  }
2243
2243
  function se(R, I) {
@@ -2362,15 +2362,15 @@ function Ze() {
2362
2362
  if (C.length) {
2363
2363
  if (!(D instanceof i.Name))
2364
2364
  throw new Error("ajv implementation error");
2365
- const le = Array.isArray(C) ? C : [C];
2366
- return (0, i._)`${(0, s.checkDataTypes)(le, D, Z.opts.strictNumbers, s.DataType.Wrong)}`;
2365
+ const fe = Array.isArray(C) ? C : [C];
2366
+ return (0, i._)`${(0, s.checkDataTypes)(fe, D, Z.opts.strictNumbers, s.DataType.Wrong)}`;
2367
2367
  }
2368
2368
  return i.nil;
2369
2369
  }
2370
2370
  function ge() {
2371
2371
  if (G.validateSchema) {
2372
- const le = I.scopeValue("validate$data", { ref: G.validateSchema });
2373
- return (0, i._)`!${le}(${D})`;
2372
+ const fe = I.scopeValue("validate$data", { ref: G.validateSchema });
2373
+ return (0, i._)`!${fe}(${D})`;
2374
2374
  }
2375
2375
  return i.nil;
2376
2376
  }
@@ -2406,27 +2406,27 @@ function Ze() {
2406
2406
  throw new Error(`Invalid JSON-pointer: ${R}`);
2407
2407
  G = R, Z = m.default.rootData;
2408
2408
  } else {
2409
- const fe = B.exec(R);
2410
- if (!fe)
2409
+ const pe = B.exec(R);
2410
+ if (!pe)
2411
2411
  throw new Error(`Invalid JSON-pointer: ${R}`);
2412
- const oe = +fe[1];
2413
- if (G = fe[2], G === "#") {
2412
+ const oe = +pe[1];
2413
+ if (G = pe[2], G === "#") {
2414
2414
  if (oe >= I)
2415
- throw new Error(le("property/index", oe));
2415
+ throw new Error(fe("property/index", oe));
2416
2416
  return C[I - oe];
2417
2417
  }
2418
2418
  if (oe > I)
2419
- throw new Error(le("data", oe));
2419
+ throw new Error(fe("data", oe));
2420
2420
  if (Z = D[I - oe], !G)
2421
2421
  return Z;
2422
2422
  }
2423
2423
  let ae = Z;
2424
2424
  const ge = G.split("/");
2425
- for (const fe of ge)
2426
- fe && (Z = (0, i._)`${Z}${(0, i.getProperty)((0, y.unescapeJsonPointer)(fe))}`, ae = (0, i._)`${ae} && ${Z}`);
2425
+ for (const pe of ge)
2426
+ pe && (Z = (0, i._)`${Z}${(0, i.getProperty)((0, y.unescapeJsonPointer)(pe))}`, ae = (0, i._)`${ae} && ${Z}`);
2427
2427
  return ae;
2428
- function le(fe, oe) {
2429
- return `Cannot access ${fe} ${oe} levels up, current level is ${I}`;
2428
+ function fe(pe, oe) {
2429
+ return `Cannot access ${pe} ${oe} levels up, current level is ${I}`;
2430
2430
  }
2431
2431
  }
2432
2432
  return we.getData = J, we;
@@ -3089,7 +3089,7 @@ function na() {
3089
3089
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
3090
3090
  }, n = 200;
3091
3091
  function d(z) {
3092
- var j, k, O, l, E, A, F, V, B, J, R, I, D, C, G, Z, ae, ge, le, fe, oe, Te, ye, Ut, Kt;
3092
+ var j, k, O, l, E, A, F, V, B, J, R, I, D, C, G, Z, ae, ge, fe, pe, oe, Te, ye, Ut, Kt;
3093
3093
  const Fe = z.strict, Ht = (j = z.code) === null || j === void 0 ? void 0 : j.optimize, pr = Ht === !0 || Ht === void 0 ? 1 : Ht || 0, hr = (O = (k = z.code) === null || k === void 0 ? void 0 : k.regExp) !== null && O !== void 0 ? O : v, ws = (l = z.uriResolver) !== null && l !== void 0 ? l : c.default;
3094
3094
  return {
3095
3095
  strictSchema: (A = (E = z.strictSchema) !== null && E !== void 0 ? E : Fe) !== null && A !== void 0 ? A : !0,
@@ -3102,8 +3102,8 @@ function na() {
3102
3102
  loopEnum: (Z = z.loopEnum) !== null && Z !== void 0 ? Z : n,
3103
3103
  meta: (ae = z.meta) !== null && ae !== void 0 ? ae : !0,
3104
3104
  messages: (ge = z.messages) !== null && ge !== void 0 ? ge : !0,
3105
- inlineRefs: (le = z.inlineRefs) !== null && le !== void 0 ? le : !0,
3106
- schemaId: (fe = z.schemaId) !== null && fe !== void 0 ? fe : "$id",
3105
+ inlineRefs: (fe = z.inlineRefs) !== null && fe !== void 0 ? fe : !0,
3106
+ schemaId: (pe = z.schemaId) !== null && pe !== void 0 ? pe : "$id",
3107
3107
  addUsedSchema: (oe = z.addUsedSchema) !== null && oe !== void 0 ? oe : !0,
3108
3108
  validateSchema: (Te = z.validateSchema) !== null && Te !== void 0 ? Te : !0,
3109
3109
  validateFormats: (ye = z.validateFormats) !== null && ye !== void 0 ? ye : !0,
@@ -5445,7 +5445,7 @@ function co(e, t, r, s, h, o) {
5445
5445
  Ge,
5446
5446
  { key: 0 },
5447
5447
  [
5448
- pe("input", {
5448
+ le("input", {
5449
5449
  id: `node-input-validateInput-${e.localNode.id}`,
5450
5450
  type: "checkbox",
5451
5451
  checked: e.localNode.validateInput,
@@ -5464,7 +5464,7 @@ function co(e, t, r, s, h, o) {
5464
5464
  Ge,
5465
5465
  { key: 1 },
5466
5466
  [
5467
- pe("input", {
5467
+ le("input", {
5468
5468
  id: `node-input-validateOutput-${e.localNode.id}`,
5469
5469
  type: "checkbox",
5470
5470
  checked: e.localNode.validateOutput,
@@ -5480,7 +5480,7 @@ function co(e, t, r, s, h, o) {
5480
5480
  /* STABLE_FRAGMENT */
5481
5481
  )) : ue("v-if", !0)
5482
5482
  ])) : ue("v-if", !0),
5483
- pe("div", uo, [
5483
+ le("div", uo, [
5484
5484
  Ve(i, {
5485
5485
  node: e.localNode,
5486
5486
  schema: e.schema,
@@ -5607,7 +5607,7 @@ function $o(e, t, r, s, h, o) {
5607
5607
  required: e.required
5608
5608
  }, null, 8, ["label", "icon", "required"])) : ue("v-if", !0)
5609
5609
  ]),
5610
- pe("input", {
5610
+ le("input", {
5611
5611
  ref: "inputField",
5612
5612
  type: e.type,
5613
5613
  value: e.internalValue,
@@ -5752,7 +5752,7 @@ function No(e, t, r, s, h, o) {
5752
5752
  required: e.required
5753
5753
  }, null, 8, ["label", "icon", "required"])) : ue("v-if", !0)
5754
5754
  ]),
5755
- pe(
5755
+ le(
5756
5756
  "input",
5757
5757
  So,
5758
5758
  null,
@@ -5837,7 +5837,7 @@ function ko(e, t, r, s, h, o) {
5837
5837
  required: e.required
5838
5838
  }, null, 8, ["label", "icon", "required"])) : ue("v-if", !0)
5839
5839
  ]),
5840
- pe("input", {
5840
+ le("input", {
5841
5841
  id: e.inputId,
5842
5842
  type: "text",
5843
5843
  style: { width: "100%" }
@@ -5935,7 +5935,7 @@ function Mo(e, t, r, s, h, o) {
5935
5935
  required: e.required
5936
5936
  }, null, 8, ["label", "icon", "required"])) : ue("v-if", !0)
5937
5937
  ]),
5938
- pe(
5938
+ le(
5939
5939
  "input",
5940
5940
  To,
5941
5941
  null,
@@ -6175,8 +6175,8 @@ const ys = /* @__PURE__ */ Re(qo, [["render", Mo]]), zo = Oe({
6175
6175
  }), Vo = {
6176
6176
  ref: "container",
6177
6177
  class: "container"
6178
- }, Co = ["id"];
6179
- function Fo(e, t, r, s, h, o) {
6178
+ }, Co = { class: "editor-wrapper" }, Fo = ["id"];
6179
+ function Lo(e, t, r, s, h, o) {
6180
6180
  const a = me("NodeRedInputLabel");
6181
6181
  return Q(), re(
6182
6182
  "div",
@@ -6190,30 +6190,32 @@ function Fo(e, t, r, s, h, o) {
6190
6190
  required: e.required
6191
6191
  }, null, 8, ["label", "icon", "required"])) : ue("v-if", !0)
6192
6192
  ], !0),
6193
- pe(
6194
- "button",
6195
- {
6196
- ref: "expand-button",
6197
- class: "red-ui-button red-ui-button-small expand-button",
6198
- onClick: t[0] || (t[0] = (...i) => e.onClickExpand && e.onClickExpand(...i))
6199
- },
6200
- [...t[1] || (t[1] = [
6201
- pe(
6202
- "i",
6203
- { class: "fa fa-expand" },
6204
- null,
6205
- -1
6206
- /* CACHED */
6207
- )
6208
- ])],
6209
- 512
6210
- /* NEED_PATCH */
6211
- ),
6212
- pe("div", {
6213
- id: e.editorId,
6214
- ref: "editor"
6215
- }, null, 8, Co),
6216
- Ss(pe(
6193
+ le("div", Co, [
6194
+ le(
6195
+ "button",
6196
+ {
6197
+ ref: "expand-button",
6198
+ class: "red-ui-button red-ui-button-small expand-button",
6199
+ onClick: t[0] || (t[0] = (...i) => e.onClickExpand && e.onClickExpand(...i))
6200
+ },
6201
+ [...t[1] || (t[1] = [
6202
+ le(
6203
+ "i",
6204
+ { class: "fa fa-expand" },
6205
+ null,
6206
+ -1
6207
+ /* CACHED */
6208
+ )
6209
+ ])],
6210
+ 512
6211
+ /* NEED_PATCH */
6212
+ ),
6213
+ le("div", {
6214
+ id: e.editorId,
6215
+ ref: "editor"
6216
+ }, null, 8, Fo)
6217
+ ]),
6218
+ Ss(le(
6217
6219
  "div",
6218
6220
  { class: "node-red-vue-input-error-message" },
6219
6221
  qe(e.error),
@@ -6227,7 +6229,7 @@ function Fo(e, t, r, s, h, o) {
6227
6229
  /* NEED_PATCH */
6228
6230
  );
6229
6231
  }
6230
- const gs = /* @__PURE__ */ Re(zo, [["render", Fo], ["__scopeId", "data-v-be13a2a5"]]), Lo = /* @__PURE__ */ new Set([
6232
+ const gs = /* @__PURE__ */ Re(zo, [["render", Lo], ["__scopeId", "data-v-4077a6c2"]]), Uo = /* @__PURE__ */ new Set([
6231
6233
  "id",
6232
6234
  "type",
6233
6235
  "x",
@@ -6240,16 +6242,16 @@ const gs = /* @__PURE__ */ Re(zo, [["render", Fo], ["__scopeId", "data-v-be13a2a
6240
6242
  "validateInput",
6241
6243
  "validateOutput"
6242
6244
  ]);
6243
- function Uo(e) {
6245
+ function Ko(e) {
6244
6246
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (t) => t.toUpperCase()).trim();
6245
6247
  }
6246
- function Ko(e) {
6248
+ function Ho(e) {
6247
6249
  var t, r;
6248
6250
  return e.type === "object" && !!((t = e.properties) != null && t.value) && !!((r = e.properties) != null && r.type);
6249
6251
  }
6250
6252
  function zn(e, t, r) {
6251
6253
  var i;
6252
- const s = t.title || Uo(e), h = t["x-nrg-form"] ?? {}, o = h.icon || "";
6254
+ const s = t.title || Ko(e), h = t["x-nrg-form"] ?? {}, o = h.icon || "";
6253
6255
  if (t["x-nrg-node-type"])
6254
6256
  return {
6255
6257
  key: e,
@@ -6259,7 +6261,7 @@ function zn(e, t, r) {
6259
6261
  required: r,
6260
6262
  configType: t["x-nrg-node-type"]
6261
6263
  };
6262
- if (Ko(t))
6264
+ if (Ho(t))
6263
6265
  return {
6264
6266
  key: e,
6265
6267
  label: s,
@@ -6350,7 +6352,7 @@ function zn(e, t, r) {
6350
6352
  };
6351
6353
  }
6352
6354
  }
6353
- const Ho = Oe({
6355
+ const Bo = Oe({
6354
6356
  name: "NodeRedJsonSchemaForm",
6355
6357
  components: {
6356
6358
  NodeRedInputLabel: Ae,
@@ -6379,7 +6381,7 @@ const Ho = Oe({
6379
6381
  var t;
6380
6382
  if (!((t = this.schema) != null && t.properties)) return [];
6381
6383
  const e = new Set(this.schema.required ?? []);
6382
- return Object.entries(this.schema.properties).filter(([r]) => !Lo.has(r)).map(
6384
+ return Object.entries(this.schema.properties).filter(([r]) => !Uo.has(r)).map(
6383
6385
  ([r, s]) => zn(r, s, e.has(r))
6384
6386
  );
6385
6387
  },
@@ -6398,11 +6400,11 @@ const Ho = Oe({
6398
6400
  });
6399
6401
  }
6400
6402
  }
6401
- }), Bo = { key: 1 }, Go = ["checked", "onChange"], Jo = { key: 5 }, Wo = ["value", "onInput"], Yo = {
6403
+ }), Go = { key: 1 }, Jo = ["checked", "onChange"], Wo = { key: 5 }, Yo = ["value", "onInput"], Zo = {
6402
6404
  key: 0,
6403
6405
  class: "node-red-vue-input-error-message"
6404
6406
  };
6405
- function Zo(e, t, r, s, h, o) {
6407
+ function Qo(e, t, r, s, h, o) {
6406
6408
  const a = me("NodeRedInput"), i = me("NodeRedInputLabel"), m = me("NodeRedSelectInput"), g = me("NodeRedTypedInput"), y = me("NodeRedConfigInput"), N = me("NodeRedEditorInput");
6407
6409
  return Q(), re("div", null, [
6408
6410
  (Q(!0), re(
@@ -6421,21 +6423,21 @@ function Zo(e, t, r, s, h, o) {
6421
6423
  required: c.required,
6422
6424
  error: e.errors[`node.${c.key}`],
6423
6425
  "onUpdate:value": (v) => e.node[c.key] = v
6424
- }, null, 8, ["value", "type", "label", "icon", "required", "error", "onUpdate:value"])) : c.inputType === "boolean" ? (Q(), re("div", Bo, [
6426
+ }, null, 8, ["value", "type", "label", "icon", "required", "error", "onUpdate:value"])) : c.inputType === "boolean" ? (Q(), re("div", Go, [
6425
6427
  Ve(i, {
6426
6428
  label: c.label,
6427
6429
  icon: c.icon,
6428
6430
  required: c.required,
6429
6431
  style: { width: "auto" }
6430
6432
  }, null, 8, ["label", "icon", "required"]),
6431
- pe("input", {
6433
+ le("input", {
6432
6434
  type: "checkbox",
6433
6435
  checked: e.node[c.key],
6434
6436
  style: { width: "auto", margin: "0" },
6435
6437
  onChange: (v) => {
6436
6438
  e.node[c.key] = v.target.checked;
6437
6439
  }
6438
- }, null, 40, Go)
6440
+ }, null, 40, Jo)
6439
6441
  ])) : c.inputType === "select" ? (Q(), $e(m, {
6440
6442
  key: 2,
6441
6443
  value: e.node[c.key],
@@ -6466,30 +6468,30 @@ function Zo(e, t, r, s, h, o) {
6466
6468
  required: c.required,
6467
6469
  error: e.errors[`node.${c.key}`],
6468
6470
  "onUpdate:value": (v) => e.node[c.key] = v
6469
- }, null, 8, ["value", "type", "node", "prop-name", "label", "icon", "required", "error", "onUpdate:value"])) : c.inputType === "array-text" ? (Q(), re("div", Jo, [
6471
+ }, null, 8, ["value", "type", "node", "prop-name", "label", "icon", "required", "error", "onUpdate:value"])) : c.inputType === "array-text" ? (Q(), re("div", Wo, [
6470
6472
  Ve(i, {
6471
6473
  label: c.label,
6472
6474
  icon: c.icon,
6473
6475
  required: c.required
6474
6476
  }, null, 8, ["label", "icon", "required"]),
6475
- t[0] || (t[0] = pe(
6477
+ t[0] || (t[0] = le(
6476
6478
  "span",
6477
6479
  { style: { display: "block", "font-size": "11px", color: "var(--red-ui-text-color-disabled, #999)", "margin-bottom": "4px" } },
6478
6480
  " One entry per line ",
6479
6481
  -1
6480
6482
  /* CACHED */
6481
6483
  )),
6482
- pe("textarea", {
6484
+ le("textarea", {
6483
6485
  value: Array.isArray(e.node[c.key]) ? e.node[c.key].join(`
6484
6486
  `) : e.node[c.key] ?? "",
6485
6487
  rows: "4",
6486
6488
  style: { width: "100%", resize: "vertical", "font-family": "monospace", "font-size": "13px" },
6487
6489
  onInput: (v) => e.node[c.key] = v.target.value.split(`
6488
6490
  `).filter(Boolean)
6489
- }, null, 40, Wo),
6491
+ }, null, 40, Yo),
6490
6492
  e.errors[`node.${c.key}`] ? (Q(), re(
6491
6493
  "span",
6492
- Yo,
6494
+ Zo,
6493
6495
  qe(e.errors[`node.${c.key}`]),
6494
6496
  1
6495
6497
  /* TEXT */
@@ -6530,14 +6532,14 @@ function Zo(e, t, r, s, h, o) {
6530
6532
  ))
6531
6533
  ]);
6532
6534
  }
6533
- const Vn = /* @__PURE__ */ Re(Ho, [["render", Zo]]), _s = {}, ir = {};
6534
- function ti(e) {
6535
+ const Vn = /* @__PURE__ */ Re(Bo, [["render", Qo]]), _s = {}, ir = {};
6536
+ function ri(e) {
6535
6537
  Object.assign(_s, e);
6536
6538
  }
6537
- function ri(e) {
6539
+ function ni(e) {
6538
6540
  Object.assign(ir, e);
6539
6541
  }
6540
- function Qo(e, t, r, s) {
6542
+ function Xo(e, t, r, s) {
6541
6543
  const h = Ns(lo, {
6542
6544
  node: e,
6543
6545
  schema: r,
@@ -6545,8 +6547,8 @@ function Qo(e, t, r, s) {
6545
6547
  });
6546
6548
  return h.component("NodeRedInputLabel", Ae), h.component("NodeRedInput", ps), h.component("NodeRedTypedInput", hs), h.component("NodeRedConfigInput", ms), h.component("NodeRedSelectInput", ys), h.component("NodeRedEditorInput", gs), h.component("NodeRedJsonSchemaForm", Vn), h.component("NodeRedNodeForm", (t == null ? void 0 : t.component) ?? Vn), h.config.globalProperties.$i18n = (o) => e._(`${e.type}.${o}`), h;
6547
6549
  }
6548
- function Xo(e, t, r, s, h) {
6549
- $(`#${h}`).empty(), e._newState = Ds(e), e._app = Qo(e._newState, t, r, s), e._app.mount(`#${h}`);
6550
+ function xo(e, t, r, s, h) {
6551
+ $(`#${h}`).empty(), e._newState = Ds(e), e._app = Xo(e._newState, t, r, s), e._app.mount(`#${h}`);
6550
6552
  }
6551
6553
  function nr(e) {
6552
6554
  e._app && (e._app.unmount(), e._app = null);
@@ -6578,10 +6580,10 @@ function $s(e, t) {
6578
6580
  Array.isArray(s) ? e[r] = [...s] : s !== null && typeof s == "object" ? ((!e[r] || typeof e[r] != "object" || Array.isArray(e[r])) && (e[r] = {}), $s(e[r], s)) : e[r] = s;
6579
6581
  }
6580
6582
  }
6581
- function ni(e) {
6583
+ function si(e) {
6582
6584
  return e;
6583
6585
  }
6584
- async function xo(e) {
6586
+ async function ei(e) {
6585
6587
  const { type: t } = e;
6586
6588
  try {
6587
6589
  let r = function() {
@@ -6600,7 +6602,7 @@ async function xo(e) {
6600
6602
  hasInputSchema: !!a.inputSchema,
6601
6603
  hasOutputSchema: !!a.outputsSchema
6602
6604
  };
6603
- Xo(this, N, y, c, g);
6605
+ xo(this, N, y, c, g);
6604
6606
  }, s = function() {
6605
6607
  var f;
6606
6608
  const y = this;
@@ -6696,17 +6698,17 @@ async function xo(e) {
6696
6698
  throw console.error(`Error while registering node type ${t}:`, r), r;
6697
6699
  }
6698
6700
  }
6699
- async function si(e) {
6701
+ async function ai(e) {
6700
6702
  try {
6701
- console.log("Registering node types in parallel"), await Promise.all(e.map((t) => xo(t))), console.log("All node types registered in parallel");
6703
+ console.log("Registering node types in parallel"), await Promise.all(e.map((t) => ei(t))), console.log("All node types registered in parallel");
6702
6704
  } catch (t) {
6703
6705
  throw console.error("Error registering node types:", t), t;
6704
6706
  }
6705
6707
  }
6706
6708
  export {
6707
- ri as __setForms,
6708
- ti as __setSchemas,
6709
- ni as defineNode,
6710
- xo as registerType,
6711
- si as registerTypes
6709
+ ni as __setForms,
6710
+ ri as __setSchemas,
6711
+ si as defineNode,
6712
+ ei as registerType,
6713
+ ai as registerTypes
6712
6714
  };
@@ -1843,10 +1843,22 @@ function buildPlugin(options) {
1843
1843
  const tsconfigsToCheck = [serverTsconfig, clientTsconfig].filter(
1844
1844
  (p) => fs11.existsSync(p)
1845
1845
  );
1846
- for (const tsconfig of tsconfigsToCheck) {
1847
- execSync(`npx tsc -p ${tsconfig} --noEmit`, { stdio: "inherit" });
1846
+ try {
1847
+ for (const tsconfig of tsconfigsToCheck) {
1848
+ execSync(`npx tsc -p ${tsconfig} --noEmit`, {
1849
+ stdio: ["inherit", "pipe", "pipe"],
1850
+ encoding: "utf-8"
1851
+ });
1852
+ }
1853
+ logger.stopSpinner("Type checked");
1854
+ } catch (e) {
1855
+ logger.stopSpinner("Type check failed");
1856
+ const output = (e.stdout || "") + (e.stderr || "");
1857
+ if (output) {
1858
+ console.error(output);
1859
+ }
1860
+ throw new BuildError("type-check", e);
1848
1861
  }
1849
- logger.stopSpinner("Type checked");
1850
1862
  logger.startSpinner("Cleaning");
1851
1863
  cleanDir(buildContext.outDir);
1852
1864
  logger.stopSpinner("Cleaned");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonsae/nrg",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "NRG framework — build Node-RED nodes with Vue 3, TypeScript, and JSON Schema",
5
5
  "author": "Allan Oricil <allanoricil@duck.com>",
6
6
  "license": "MIT",
@@ -8,14 +8,16 @@
8
8
  :required="required"
9
9
  />
10
10
  </slot>
11
- <button
12
- ref="expand-button"
13
- class="red-ui-button red-ui-button-small expand-button"
14
- @click="onClickExpand"
15
- >
16
- <i class="fa fa-expand"></i>
17
- </button>
18
- <div :id="editorId" ref="editor"></div>
11
+ <div class="editor-wrapper">
12
+ <button
13
+ ref="expand-button"
14
+ class="red-ui-button red-ui-button-small expand-button"
15
+ @click="onClickExpand"
16
+ >
17
+ <i class="fa fa-expand"></i>
18
+ </button>
19
+ <div :id="editorId" ref="editor"></div>
20
+ </div>
19
21
  <div v-show="error" class="node-red-vue-input-error-message">
20
22
  {{ error }}
21
23
  </div>
@@ -290,7 +292,7 @@ export default defineComponent({
290
292
  });
291
293
  </script>
292
294
  <style scoped>
293
- .container {
295
+ .editor-wrapper {
294
296
  position: relative;
295
297
  }
296
298
 
@@ -37,10 +37,22 @@ function buildPlugin(options: BuildPluginOptions): Plugin {
37
37
  const tsconfigsToCheck = [serverTsconfig, clientTsconfig].filter((p) =>
38
38
  fs.existsSync(p),
39
39
  );
40
- for (const tsconfig of tsconfigsToCheck) {
41
- execSync(`npx tsc -p ${tsconfig} --noEmit`, { stdio: "inherit" });
40
+ try {
41
+ for (const tsconfig of tsconfigsToCheck) {
42
+ execSync(`npx tsc -p ${tsconfig} --noEmit`, {
43
+ stdio: ["inherit", "pipe", "pipe"],
44
+ encoding: "utf-8",
45
+ });
46
+ }
47
+ logger.stopSpinner("Type checked");
48
+ } catch (e: any) {
49
+ logger.stopSpinner("Type check failed");
50
+ const output = (e.stdout || "") + (e.stderr || "");
51
+ if (output) {
52
+ console.error(output);
53
+ }
54
+ throw new BuildError("type-check", e);
42
55
  }
43
- logger.stopSpinner("Type checked");
44
56
 
45
57
  logger.startSpinner("Cleaning");
46
58
  cleanDir(buildContext.outDir);