@servlyadmin/runtime-core 0.1.15 → 0.1.17

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
@@ -19089,7 +19089,7 @@ function resetOverrideSystem() {
19089
19089
  }
19090
19090
 
19091
19091
  // src/icons.ts
19092
- var cdnEnabled = false;
19092
+ var cdnEnabled = true;
19093
19093
  function setIconCdnEnabled(enabled) {
19094
19094
  cdnEnabled = enabled;
19095
19095
  }
@@ -19425,22 +19425,6 @@ var COMPONENT_TO_TAG = {
19425
19425
  span: "span",
19426
19426
  div: "div"
19427
19427
  };
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
19428
  function getElementTag(element) {
19445
19429
  const config = element.configuration;
19446
19430
  if (config?.tag) {
@@ -19454,9 +19438,6 @@ function getElementTag(element) {
19454
19438
  }
19455
19439
  return "div";
19456
19440
  }
19457
- function isSelfClosing(tag) {
19458
- return SELF_CLOSING_TAGS.has(tag.toLowerCase());
19459
- }
19460
19441
  function buildTree(elements) {
19461
19442
  const tree = /* @__PURE__ */ new Map();
19462
19443
  for (const element of elements) {
@@ -19631,9 +19612,9 @@ function createElement(element, context, eventHandlers, isRootElement = false, s
19631
19612
  }
19632
19613
  applyAttributes(domElement, element, context);
19633
19614
  let textContent = "";
19634
- if (element.componentId === "text" || !isSelfClosing(tag)) {
19615
+ if (element.componentId === "text") {
19635
19616
  textContent = getTextContent(element, context);
19636
- if (textContent && !element.children?.length) {
19617
+ if (textContent) {
19637
19618
  domElement.textContent = textContent;
19638
19619
  }
19639
19620
  }
@@ -20153,13 +20134,15 @@ function update(state, newContext) {
20153
20134
  domElement.className = newClassName;
20154
20135
  elementState.className = newClassName;
20155
20136
  }
20156
- const newTextContent = getTextContent(element, newContext);
20157
- if (newTextContent !== elementState.textContent) {
20158
- const children = state.elements.filter((el) => el.parent === elementId);
20159
- if (children.length === 0) {
20160
- domElement.textContent = newTextContent;
20137
+ if (element.componentId === "text") {
20138
+ const newTextContent = getTextContent(element, newContext);
20139
+ if (newTextContent !== elementState.textContent) {
20140
+ const isComponentView = element.isComponentView;
20141
+ if (!isComponentView && domElement.children.length === 0) {
20142
+ domElement.textContent = newTextContent;
20143
+ }
20144
+ elementState.textContent = newTextContent;
20161
20145
  }
20162
- elementState.textContent = newTextContent;
20163
20146
  }
20164
20147
  applyAttributes(domElement, element, newContext);
20165
20148
  }
package/dist/index.js CHANGED
@@ -2293,7 +2293,7 @@ function resetOverrideSystem() {
2293
2293
  }
2294
2294
 
2295
2295
  // src/icons.ts
2296
- var cdnEnabled = false;
2296
+ var cdnEnabled = true;
2297
2297
  function setIconCdnEnabled(enabled) {
2298
2298
  cdnEnabled = enabled;
2299
2299
  }
@@ -2629,22 +2629,6 @@ var COMPONENT_TO_TAG = {
2629
2629
  span: "span",
2630
2630
  div: "div"
2631
2631
  };
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
2632
  function getElementTag(element) {
2649
2633
  const config = element.configuration;
2650
2634
  if (config?.tag) {
@@ -2658,9 +2642,6 @@ function getElementTag(element) {
2658
2642
  }
2659
2643
  return "div";
2660
2644
  }
2661
- function isSelfClosing(tag) {
2662
- return SELF_CLOSING_TAGS.has(tag.toLowerCase());
2663
- }
2664
2645
  function buildTree(elements) {
2665
2646
  const tree = /* @__PURE__ */ new Map();
2666
2647
  for (const element of elements) {
@@ -2835,9 +2816,9 @@ function createElement(element, context, eventHandlers, isRootElement = false, s
2835
2816
  }
2836
2817
  applyAttributes(domElement, element, context);
2837
2818
  let textContent = "";
2838
- if (element.componentId === "text" || !isSelfClosing(tag)) {
2819
+ if (element.componentId === "text") {
2839
2820
  textContent = getTextContent(element, context);
2840
- if (textContent && !element.children?.length) {
2821
+ if (textContent) {
2841
2822
  domElement.textContent = textContent;
2842
2823
  }
2843
2824
  }
@@ -3357,13 +3338,15 @@ function update(state, newContext) {
3357
3338
  domElement.className = newClassName;
3358
3339
  elementState.className = newClassName;
3359
3340
  }
3360
- const newTextContent = getTextContent(element, newContext);
3361
- if (newTextContent !== elementState.textContent) {
3362
- const children = state.elements.filter((el) => el.parent === elementId);
3363
- if (children.length === 0) {
3364
- domElement.textContent = newTextContent;
3341
+ if (element.componentId === "text") {
3342
+ const newTextContent = getTextContent(element, newContext);
3343
+ if (newTextContent !== elementState.textContent) {
3344
+ const isComponentView = element.isComponentView;
3345
+ if (!isComponentView && domElement.children.length === 0) {
3346
+ domElement.textContent = newTextContent;
3347
+ }
3348
+ elementState.textContent = newTextContent;
3365
3349
  }
3366
- elementState.textContent = newTextContent;
3367
3350
  }
3368
3351
  applyAttributes(domElement, element, newContext);
3369
3352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",