@servlyadmin/runtime-core 0.1.16 → 0.1.18

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
@@ -17804,11 +17804,8 @@ function applyStyles(element, styles) {
17804
17804
  }
17805
17805
  }
17806
17806
  var CANVAS_ONLY_STYLES = /* @__PURE__ */ new Set([
17807
- "transform",
17808
- "--translate-x",
17809
- "--translate-y",
17810
- "--width",
17811
- "--height",
17807
+ // Only filter out z-index which is purely for canvas layering
17808
+ // Keep --width, --height, --translate-x, --translate-y as they're used for sizing/positioning
17812
17809
  "z-index",
17813
17810
  "zIndex"
17814
17811
  ]);
@@ -17818,9 +17815,6 @@ function filterCanvasStyles(style) {
17818
17815
  if (CANVAS_ONLY_STYLES.has(key)) {
17819
17816
  continue;
17820
17817
  }
17821
- if (key === "transform" && typeof value === "string" && value.includes("translate(")) {
17822
- continue;
17823
- }
17824
17818
  filtered[key] = value;
17825
17819
  }
17826
17820
  return filtered;
@@ -19089,7 +19083,7 @@ function resetOverrideSystem() {
19089
19083
  }
19090
19084
 
19091
19085
  // src/icons.ts
19092
- var cdnEnabled = false;
19086
+ var cdnEnabled = true;
19093
19087
  function setIconCdnEnabled(enabled) {
19094
19088
  cdnEnabled = enabled;
19095
19089
  }
@@ -19425,22 +19419,6 @@ var COMPONENT_TO_TAG = {
19425
19419
  span: "span",
19426
19420
  div: "div"
19427
19421
  };
19428
- var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([
19429
- "input",
19430
- "img",
19431
- "br",
19432
- "hr",
19433
- "area",
19434
- "base",
19435
- "col",
19436
- "embed",
19437
- "link",
19438
- "meta",
19439
- "param",
19440
- "source",
19441
- "track",
19442
- "wbr"
19443
- ]);
19444
19422
  function getElementTag(element) {
19445
19423
  const config = element.configuration;
19446
19424
  if (config?.tag) {
@@ -19454,9 +19432,6 @@ function getElementTag(element) {
19454
19432
  }
19455
19433
  return "div";
19456
19434
  }
19457
- function isSelfClosing(tag) {
19458
- return SELF_CLOSING_TAGS.has(tag.toLowerCase());
19459
- }
19460
19435
  function buildTree(elements) {
19461
19436
  const tree = /* @__PURE__ */ new Map();
19462
19437
  for (const element of elements) {
@@ -19631,9 +19606,9 @@ function createElement(element, context, eventHandlers, isRootElement = false, s
19631
19606
  }
19632
19607
  applyAttributes(domElement, element, context);
19633
19608
  let textContent = "";
19634
- if (element.componentId === "text" || !isSelfClosing(tag)) {
19609
+ if (element.componentId === "text") {
19635
19610
  textContent = getTextContent(element, context);
19636
- if (textContent && !element.children?.length) {
19611
+ if (textContent) {
19637
19612
  domElement.textContent = textContent;
19638
19613
  }
19639
19614
  }
@@ -20153,14 +20128,15 @@ function update(state, newContext) {
20153
20128
  domElement.className = newClassName;
20154
20129
  elementState.className = newClassName;
20155
20130
  }
20156
- const newTextContent = getTextContent(element, newContext);
20157
- if (newTextContent !== elementState.textContent) {
20158
- const children = state.elements.filter((el) => el.parent === elementId);
20159
- const isComponentView = element.isComponentView;
20160
- if (children.length === 0 && !isComponentView && domElement.children.length === 0) {
20161
- domElement.textContent = newTextContent;
20131
+ if (element.componentId === "text") {
20132
+ const newTextContent = getTextContent(element, newContext);
20133
+ if (newTextContent !== elementState.textContent) {
20134
+ const isComponentView = element.isComponentView;
20135
+ if (!isComponentView && domElement.children.length === 0) {
20136
+ domElement.textContent = newTextContent;
20137
+ }
20138
+ elementState.textContent = newTextContent;
20162
20139
  }
20163
- elementState.textContent = newTextContent;
20164
20140
  }
20165
20141
  applyAttributes(domElement, element, newContext);
20166
20142
  }
package/dist/index.js CHANGED
@@ -1008,11 +1008,8 @@ function applyStyles(element, styles) {
1008
1008
  }
1009
1009
  }
1010
1010
  var CANVAS_ONLY_STYLES = /* @__PURE__ */ new Set([
1011
- "transform",
1012
- "--translate-x",
1013
- "--translate-y",
1014
- "--width",
1015
- "--height",
1011
+ // Only filter out z-index which is purely for canvas layering
1012
+ // Keep --width, --height, --translate-x, --translate-y as they're used for sizing/positioning
1016
1013
  "z-index",
1017
1014
  "zIndex"
1018
1015
  ]);
@@ -1022,9 +1019,6 @@ function filterCanvasStyles(style) {
1022
1019
  if (CANVAS_ONLY_STYLES.has(key)) {
1023
1020
  continue;
1024
1021
  }
1025
- if (key === "transform" && typeof value === "string" && value.includes("translate(")) {
1026
- continue;
1027
- }
1028
1022
  filtered[key] = value;
1029
1023
  }
1030
1024
  return filtered;
@@ -2293,7 +2287,7 @@ function resetOverrideSystem() {
2293
2287
  }
2294
2288
 
2295
2289
  // src/icons.ts
2296
- var cdnEnabled = false;
2290
+ var cdnEnabled = true;
2297
2291
  function setIconCdnEnabled(enabled) {
2298
2292
  cdnEnabled = enabled;
2299
2293
  }
@@ -2629,22 +2623,6 @@ var COMPONENT_TO_TAG = {
2629
2623
  span: "span",
2630
2624
  div: "div"
2631
2625
  };
2632
- var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([
2633
- "input",
2634
- "img",
2635
- "br",
2636
- "hr",
2637
- "area",
2638
- "base",
2639
- "col",
2640
- "embed",
2641
- "link",
2642
- "meta",
2643
- "param",
2644
- "source",
2645
- "track",
2646
- "wbr"
2647
- ]);
2648
2626
  function getElementTag(element) {
2649
2627
  const config = element.configuration;
2650
2628
  if (config?.tag) {
@@ -2658,9 +2636,6 @@ function getElementTag(element) {
2658
2636
  }
2659
2637
  return "div";
2660
2638
  }
2661
- function isSelfClosing(tag) {
2662
- return SELF_CLOSING_TAGS.has(tag.toLowerCase());
2663
- }
2664
2639
  function buildTree(elements) {
2665
2640
  const tree = /* @__PURE__ */ new Map();
2666
2641
  for (const element of elements) {
@@ -2835,9 +2810,9 @@ function createElement(element, context, eventHandlers, isRootElement = false, s
2835
2810
  }
2836
2811
  applyAttributes(domElement, element, context);
2837
2812
  let textContent = "";
2838
- if (element.componentId === "text" || !isSelfClosing(tag)) {
2813
+ if (element.componentId === "text") {
2839
2814
  textContent = getTextContent(element, context);
2840
- if (textContent && !element.children?.length) {
2815
+ if (textContent) {
2841
2816
  domElement.textContent = textContent;
2842
2817
  }
2843
2818
  }
@@ -3357,14 +3332,15 @@ function update(state, newContext) {
3357
3332
  domElement.className = newClassName;
3358
3333
  elementState.className = newClassName;
3359
3334
  }
3360
- const newTextContent = getTextContent(element, newContext);
3361
- if (newTextContent !== elementState.textContent) {
3362
- const children = state.elements.filter((el) => el.parent === elementId);
3363
- const isComponentView = element.isComponentView;
3364
- if (children.length === 0 && !isComponentView && domElement.children.length === 0) {
3365
- domElement.textContent = newTextContent;
3335
+ if (element.componentId === "text") {
3336
+ const newTextContent = getTextContent(element, newContext);
3337
+ if (newTextContent !== elementState.textContent) {
3338
+ const isComponentView = element.isComponentView;
3339
+ if (!isComponentView && domElement.children.length === 0) {
3340
+ domElement.textContent = newTextContent;
3341
+ }
3342
+ elementState.textContent = newTextContent;
3366
3343
  }
3367
- elementState.textContent = newTextContent;
3368
3344
  }
3369
3345
  applyAttributes(domElement, element, newContext);
3370
3346
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",