@servlyadmin/runtime-core 0.1.31 → 0.1.33

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.js CHANGED
@@ -18,7 +18,6 @@ import {
18
18
  extractDependencies,
19
19
  extractDependenciesFromCode
20
20
  } from "./chunk-CIUQK4GA.js";
21
- import "./chunk-MCKGQKYU.js";
22
21
 
23
22
  // src/analyticsTypes.ts
24
23
  var DEFAULT_ANALYTICS_CONFIG = {
@@ -3525,7 +3524,7 @@ async function createServlyRenderer(options) {
3525
3524
  container = containerOption;
3526
3525
  }
3527
3526
  if (shouldInjectTailwind) {
3528
- const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-37JUQFRW.js");
3527
+ const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-DMUQ7TOT.js");
3529
3528
  await initServlyTailwind2(tailwindConfig);
3530
3529
  }
3531
3530
  const activeRenders = [];
@@ -4121,7 +4120,7 @@ async function fetchComponent(id, options = {}) {
4121
4120
  async function fetchComponentWithDependencies(id, options = {}) {
4122
4121
  const result = await fetchComponent(id, { ...options, includeBundle: true });
4123
4122
  if (result.pendingDependencies && result.pendingDependencies.length > 0) {
4124
- const { createRegistry: createRegistry2 } = await import("./registry-7UL42655.js");
4123
+ const { createRegistry: createRegistry2 } = await import("./registry-GCCVK65D.js");
4125
4124
  const registry = result.registry || createRegistry2();
4126
4125
  await Promise.all(
4127
4126
  result.pendingDependencies.map(async (dep) => {
@@ -4593,142 +4592,6 @@ function getSampleValue(def) {
4593
4592
  return def.defaultValue;
4594
4593
  }
4595
4594
  }
4596
-
4597
- // src/iconExtractor.ts
4598
- var REACT_ICONS_PACKAGES = {
4599
- Ai: "react-icons/ai",
4600
- Bi: "react-icons/bi",
4601
- Bs: "react-icons/bs",
4602
- Cg: "react-icons/cg",
4603
- Di: "react-icons/di",
4604
- Fa: "react-icons/fa",
4605
- Fa6: "react-icons/fa6",
4606
- Fc: "react-icons/fc",
4607
- Fi: "react-icons/fi",
4608
- Gi: "react-icons/gi",
4609
- Go: "react-icons/go",
4610
- Gr: "react-icons/gr",
4611
- Hi: "react-icons/hi",
4612
- Hi2: "react-icons/hi2",
4613
- Im: "react-icons/im",
4614
- Io: "react-icons/io",
4615
- Io5: "react-icons/io5",
4616
- Lu: "react-icons/lu",
4617
- Md: "react-icons/md",
4618
- Pi: "react-icons/pi",
4619
- Ri: "react-icons/ri",
4620
- Rx: "react-icons/rx",
4621
- Si: "react-icons/si",
4622
- Sl: "react-icons/sl",
4623
- Tb: "react-icons/tb",
4624
- Tfi: "react-icons/tfi",
4625
- Vsc: "react-icons/vsc",
4626
- Wi: "react-icons/wi"
4627
- };
4628
- async function extractIconFromReactIcons(iconName, iconSet) {
4629
- const packagePath = REACT_ICONS_PACKAGES[iconSet];
4630
- if (!packagePath) {
4631
- console.warn(`Unknown icon set: ${iconSet}`);
4632
- return null;
4633
- }
4634
- try {
4635
- const iconModule = await import(packagePath);
4636
- const IconComponent = iconModule[iconName];
4637
- if (!IconComponent) {
4638
- console.warn(`Icon not found: ${iconName} in ${packagePath}`);
4639
- return null;
4640
- }
4641
- const React = await import("./react-EKMBDYIU.js");
4642
- const { renderToStaticMarkup } = await import("./server.node-CQL3CG75.js");
4643
- const svgString = renderToStaticMarkup(React.createElement(IconComponent, { size: 24 }));
4644
- return parseSvgString(svgString);
4645
- } catch (error) {
4646
- console.error(`Failed to extract icon ${iconSet}:${iconName}:`, error);
4647
- return null;
4648
- }
4649
- }
4650
- function parseSvgString(svgString) {
4651
- const viewBoxMatch = svgString.match(/viewBox="([^"]+)"/);
4652
- const viewBox = viewBoxMatch ? viewBoxMatch[1] : "0 0 24 24";
4653
- const widthMatch = svgString.match(/width="(\d+)"/);
4654
- const heightMatch = svgString.match(/height="(\d+)"/);
4655
- const width = widthMatch ? parseInt(widthMatch[1], 10) : 24;
4656
- const height = heightMatch ? parseInt(heightMatch[1], 10) : 24;
4657
- const bodyMatch = svgString.match(/<svg[^>]*>([\s\S]*)<\/svg>/);
4658
- const body = bodyMatch ? bodyMatch[1].trim() : "";
4659
- if (!body) {
4660
- return null;
4661
- }
4662
- return {
4663
- body,
4664
- viewBox,
4665
- width,
4666
- height
4667
- };
4668
- }
4669
- function findIconsInLayout(elements) {
4670
- const icons = [];
4671
- const seen = /* @__PURE__ */ new Set();
4672
- for (const element of elements) {
4673
- if (element.componentId === "icon" && element.configuration?.icon) {
4674
- const icon = element.configuration.icon;
4675
- const key = `${icon.set}:${icon.name}`;
4676
- if (!seen.has(key)) {
4677
- seen.add(key);
4678
- icons.push({
4679
- name: icon.name,
4680
- set: icon.set,
4681
- setName: icon.setName
4682
- });
4683
- }
4684
- }
4685
- }
4686
- return icons;
4687
- }
4688
- async function extractIconsForLayout(elements) {
4689
- const icons = findIconsInLayout(elements);
4690
- const result = {};
4691
- for (const icon of icons) {
4692
- const data = await extractIconFromReactIcons(icon.name, icon.set);
4693
- if (data) {
4694
- if (!result[icon.set]) {
4695
- result[icon.set] = {};
4696
- }
4697
- result[icon.set][icon.name] = data;
4698
- }
4699
- }
4700
- return result;
4701
- }
4702
- function generateIconBundle(icons) {
4703
- const lines = [
4704
- "// Auto-generated icon bundle",
4705
- "// Do not edit manually",
4706
- "",
4707
- "import { registerIcons, type IconData } from '@servlyadmin/runtime-core';",
4708
- "",
4709
- "const BUNDLED_ICONS: Record<string, Record<string, IconData>> = {"
4710
- ];
4711
- for (const [set, setIcons] of Object.entries(icons)) {
4712
- lines.push(` ${set}: {`);
4713
- for (const [name, data] of Object.entries(setIcons)) {
4714
- const escapedBody = data.body.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n");
4715
- lines.push(` ${name}: {`);
4716
- lines.push(` body: '${escapedBody}',`);
4717
- lines.push(` viewBox: '${data.viewBox}',`);
4718
- if (data.width) lines.push(` width: ${data.width},`);
4719
- if (data.height) lines.push(` height: ${data.height},`);
4720
- lines.push(` },`);
4721
- }
4722
- lines.push(` },`);
4723
- }
4724
- lines.push("};");
4725
- lines.push("");
4726
- lines.push("// Register all bundled icons");
4727
- lines.push("registerIcons(BUNDLED_ICONS);");
4728
- lines.push("");
4729
- lines.push("export { BUNDLED_ICONS };");
4730
- return lines.join("\n");
4731
- }
4732
4595
  export {
4733
4596
  AnalyticsCollector,
4734
4597
  DEFAULT_CACHE_CONFIG,
@@ -4771,16 +4634,12 @@ export {
4771
4634
  extractBindingKeys,
4772
4635
  extractDependencies,
4773
4636
  extractDependenciesFromCode,
4774
- extractIconFromReactIcons,
4775
- extractIconsForLayout,
4776
4637
  extractOverrideDependencies,
4777
4638
  extractReferencedViewIds,
4778
4639
  fetchComponent,
4779
4640
  fetchComponentWithDependencies,
4780
- findIconsInLayout,
4781
4641
  formatStyleValue,
4782
4642
  formatVersion,
4783
- generateIconBundle,
4784
4643
  generateTestCases,
4785
4644
  getAnalytics,
4786
4645
  getCacheKey,
@@ -6,7 +6,6 @@ import {
6
6
  extractDependencies,
7
7
  extractDependenciesFromCode
8
8
  } from "./chunk-CIUQK4GA.js";
9
- import "./chunk-MCKGQKYU.js";
10
9
  export {
11
10
  buildRegistryFromBundle,
12
11
  collectAllDependencies,
@@ -11,7 +11,6 @@ import {
11
11
  tailwind_default,
12
12
  updateTailwindConfig
13
13
  } from "./chunk-SMHCCKAZ.js";
14
- import "./chunk-MCKGQKYU.js";
15
14
  export {
16
15
  DEFAULT_SERVLY_TAILWIND_CONFIG,
17
16
  addCustomStyles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,15 +0,0 @@
1
- var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined") return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
- var __commonJS = (cb, mod) => function __require2() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
-
12
- export {
13
- __require,
14
- __commonJS
15
- };