@jxsuite/studio 1.3.0 → 1.4.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Shenk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -649,7 +649,7 @@ function track(target, type, key) {
649
649
  type,
650
650
  key
651
651
  });
652
- }
652
+ } else {}
653
653
  }
654
654
  }
655
655
  function trigger(target, type, key, newValue, oldValue, oldTarget) {
@@ -669,7 +669,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
669
669
  oldValue,
670
670
  oldTarget
671
671
  });
672
- }
672
+ } else {}
673
673
  }
674
674
  };
675
675
  startBatch();
@@ -1334,7 +1334,7 @@ class RefImpl {
1334
1334
  type: "get",
1335
1335
  key: "value"
1336
1336
  });
1337
- }
1337
+ } else {}
1338
1338
  return this._value;
1339
1339
  }
1340
1340
  set value(newValue) {
@@ -1352,7 +1352,7 @@ class RefImpl {
1352
1352
  newValue,
1353
1353
  oldValue
1354
1354
  });
1355
- }
1355
+ } else {}
1356
1356
  }
1357
1357
  }
1358
1358
  }
@@ -1954,6 +1954,12 @@ var SCHEMA_KEYWORDS = new Set([
1954
1954
  function isMappedArray(value) {
1955
1955
  return isJsonObject(value) && value.$prototype === "Array";
1956
1956
  }
1957
+ function isTemplateString(value) {
1958
+ return typeof value === "string" && value.includes("${");
1959
+ }
1960
+ function bodyReturnsValue(body) {
1961
+ return /\breturn\b/.test(body);
1962
+ }
1957
1963
  function isEventBinding(value) {
1958
1964
  return isRef2(value) || isFunctionDef(value) || isExpressionDef(value);
1959
1965
  }
@@ -2347,9 +2353,9 @@ async function resolveFunction(def2, state, key, base) {
2347
2353
  let isComputed = false;
2348
2354
  if (!hasParams) {
2349
2355
  if (typeof def2.body === "string") {
2350
- isComputed = /\breturn\b/.test(def2.body);
2356
+ isComputed = bodyReturnsValue(def2.body);
2351
2357
  } else if (fn) {
2352
- isComputed = fn.length <= 1 && /\breturn\b/.test(fn.toString());
2358
+ isComputed = fn.length <= 1 && bodyReturnsValue(fn.toString());
2353
2359
  }
2354
2360
  }
2355
2361
  if (isComputed) {
@@ -2395,6 +2401,7 @@ var RESERVED_KEYS = new Set([
2395
2401
  "cases",
2396
2402
  "observedAttributes"
2397
2403
  ]);
2404
+ var warnedRefChildren = new Set;
2398
2405
  function renderNode(def2, state, options) {
2399
2406
  const path = options?._path ?? [];
2400
2407
  if (typeof def2 === "string" || typeof def2 === "number" || typeof def2 === "boolean") {
@@ -2415,6 +2422,13 @@ function renderNode(def2, state, options) {
2415
2422
  localState[key] = isRefObj(val) ? resolveRef(val.$ref, state) : val;
2416
2423
  }
2417
2424
  }
2425
+ if ("$ref" in def2 && !def2.tagName) {
2426
+ const refTarget = String(def2.$ref ?? "");
2427
+ if (!warnedRefChildren.has(refTarget)) {
2428
+ warnedRefChildren.add(refTarget);
2429
+ console.warn(`Jx: a $ref child ("${refTarget}") is not a supported component instance; register the ` + `component in $elements and use its custom-element tag instead (spec §13).`);
2430
+ }
2431
+ }
2418
2432
  const tagName = def2.tagName ?? "div";
2419
2433
  const isCustomEl = tagName.includes("-") && customElements.get(tagName);
2420
2434
  if (def2.$props && isCustomEl) {
@@ -2451,9 +2465,6 @@ function renderNode(def2, state, options) {
2451
2465
  }
2452
2466
  return el;
2453
2467
  }
2454
- function isTemplateString(val) {
2455
- return typeof val === "string" && val.includes("${");
2456
- }
2457
2468
  function applyProperties(el, def2, state) {
2458
2469
  for (const [key, val] of Object.entries(def2)) {
2459
2470
  if (RESERVED_KEYS.has(key)) {
@@ -6938,5 +6949,5 @@ export {
6938
6949
  bootCanvasIframe
6939
6950
  };
6940
6951
 
6941
- //# debugId=4938332B50832C2764756E2164756E21
6952
+ //# debugId=EF2E01BCBF5955F664756E2164756E21
6942
6953
  //# sourceMappingURL=iframe-entry.js.map