@ignite-element/renderer 3.0.0-beta.2
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 +21 -0
- package/README.md +9 -0
- package/dist/ignite-renderer.cjs.js +1 -0
- package/dist/ignite-renderer.es.js +38 -0
- package/dist/jsx/index.cjs.js +1 -0
- package/dist/jsx/index.es.js +25 -0
- package/dist/jsx-dev-runtime.cjs.js +1 -0
- package/dist/jsx-dev-runtime.es.js +6 -0
- package/dist/jsx-runtime.cjs.js +1 -0
- package/dist/jsx-runtime.es.js +7 -0
- package/dist/jsx.cjs.js +1 -0
- package/dist/jsx.es.js +359 -0
- package/dist/lit.cjs.js +1 -0
- package/dist/lit.es.js +24 -0
- package/dist/registry-BuMBTjzo.cjs +1 -0
- package/dist/registry-i8Eveq_U.js +162 -0
- package/dist/types/config.d.ts +21 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/globalStyles.d.ts +9 -0
- package/dist/types/globalStyles.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/injectStyles.d.ts +3 -0
- package/dist/types/injectStyles.d.ts.map +1 -0
- package/dist/types/internal/setupDomPolyfill.d.ts +2 -0
- package/dist/types/internal/setupDomPolyfill.d.ts.map +1 -0
- package/dist/types/jsx/index.d.ts +4 -0
- package/dist/types/jsx/index.d.ts.map +1 -0
- package/dist/types/jsx/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/types/jsx/jsx-runtime.d.ts +2 -0
- package/dist/types/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/types/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/jsx-runtime.d.ts +2 -0
- package/dist/types/jsx.d.ts +2 -0
- package/dist/types/lit.d.ts +2 -0
- package/dist/types/renderers/LitRenderStrategy.d.ts +10 -0
- package/dist/types/renderers/LitRenderStrategy.d.ts.map +1 -0
- package/dist/types/renderers/RenderStrategy.d.ts +7 -0
- package/dist/types/renderers/RenderStrategy.d.ts.map +1 -0
- package/dist/types/renderers/ignite-jsx.d.ts +5 -0
- package/dist/types/renderers/ignite-jsx.d.ts.map +1 -0
- package/dist/types/renderers/jsx/IgniteJsxRenderStrategy.d.ts +22 -0
- package/dist/types/renderers/jsx/IgniteJsxRenderStrategy.d.ts.map +1 -0
- package/dist/types/renderers/jsx/index.d.ts +5 -0
- package/dist/types/renderers/jsx/index.d.ts.map +1 -0
- package/dist/types/renderers/jsx/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/renderers/jsx/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/types/renderers/jsx/jsx-runtime.d.ts +8 -0
- package/dist/types/renderers/jsx/jsx-runtime.d.ts.map +1 -0
- package/dist/types/renderers/jsx/noDiffDenylist.d.ts +6 -0
- package/dist/types/renderers/jsx/noDiffDenylist.d.ts.map +1 -0
- package/dist/types/renderers/jsx/renderer.d.ts +23 -0
- package/dist/types/renderers/jsx/renderer.d.ts.map +1 -0
- package/dist/types/renderers/jsx/types.d.ts +37 -0
- package/dist/types/renderers/jsx/types.d.ts.map +1 -0
- package/dist/types/renderers/lit.d.ts +2 -0
- package/dist/types/renderers/lit.d.ts.map +1 -0
- package/dist/types/renderers/registry.d.ts +6 -0
- package/dist/types/renderers/registry.d.ts.map +1 -0
- package/dist/types-CfguvA5C.js +12 -0
- package/dist/types-D0dEGodK.cjs +1 -0
- package/package.json +95 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 JOSΞ
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# ignite-renderer
|
|
2
|
+
|
|
3
|
+
Advanced renderer and runtime utilities for Ignite.
|
|
4
|
+
|
|
5
|
+
This package contains the JSX and lit renderer layers, renderer registry, and configuration/runtime helpers used by `ignite-element`.
|
|
6
|
+
|
|
7
|
+
Use it directly only for custom renderer integration or lower-level library work.
|
|
8
|
+
|
|
9
|
+
Most application and component authors should install `ignite-element` instead.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./registry-BuMBTjzo.cjs"),a=require("./types-D0dEGodK.cjs"),g=Symbol.for("ignite-element.config"),o=globalThis;function d(e){const t={},s="styles"in e,i="globalStyles"in e,l=s?e.styles:i?e.globalStyles:void 0;if(l!==void 0&&(!s&&i&&console.warn("[ignite-element] `globalStyles` is deprecated. Use `styles` in ignite.config instead."),t.styles=l),"renderer"in e){const r=e.renderer;r==="lit"||r==="ignite-jsx"?t.renderer=r:(console.warn(`[ignite-element] Unknown renderer "${String(r)}" in ignite.config. Supported values are "lit" and "ignite-jsx". Falling back to "lit".`),t.renderer="lit")}return"strategy"in e&&(t.strategy=e.strategy),"logging"in e&&(t.logging=e.logging),t}function y(e){const t=d(e);return o[g]=t,"styles"in t&&n.setGlobalStyles(t.styles),t}function S(){return o[g]}exports.clearRegisteredRenderStrategiesForTests=n.clearRegisteredRenderStrategiesForTests;exports.flushPendingStyles=n.flushPendingStyles;exports.getGlobalStyles=n.getGlobalStyles;exports.getRegisteredRenderStrategies=n.getRegisteredRenderStrategies;exports.injectStyles=n.injectStyles;exports.registerRenderStrategy=n.registerRenderStrategy;exports.resolveRenderStrategy=n.resolveRenderStrategy;exports.setGlobalStyles=n.setGlobalStyles;exports.Fragment=a.Fragment;exports.defineIgniteConfig=y;exports.getIgniteConfig=S;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { s as o } from "./registry-i8Eveq_U.js";
|
|
2
|
+
import { c as m, f as b, g as u, a as p, i as R, r as x, b as F } from "./registry-i8Eveq_U.js";
|
|
3
|
+
import { F as v } from "./types-CfguvA5C.js";
|
|
4
|
+
const l = /* @__PURE__ */ Symbol.for("ignite-element.config"), a = globalThis;
|
|
5
|
+
function g(e) {
|
|
6
|
+
const t = {}, n = "styles" in e, r = "globalStyles" in e, i = n ? e.styles : r ? e.globalStyles : void 0;
|
|
7
|
+
if (i !== void 0 && (!n && r && console.warn(
|
|
8
|
+
"[ignite-element] `globalStyles` is deprecated. Use `styles` in ignite.config instead."
|
|
9
|
+
), t.styles = i), "renderer" in e) {
|
|
10
|
+
const s = e.renderer;
|
|
11
|
+
s === "lit" || s === "ignite-jsx" ? t.renderer = s : (console.warn(
|
|
12
|
+
`[ignite-element] Unknown renderer "${String(
|
|
13
|
+
s
|
|
14
|
+
)}" in ignite.config. Supported values are "lit" and "ignite-jsx". Falling back to "lit".`
|
|
15
|
+
), t.renderer = "lit");
|
|
16
|
+
}
|
|
17
|
+
return "strategy" in e && (t.strategy = e.strategy), "logging" in e && (t.logging = e.logging), t;
|
|
18
|
+
}
|
|
19
|
+
function y(e) {
|
|
20
|
+
const t = g(e);
|
|
21
|
+
return a[l] = t, "styles" in t && o(t.styles), t;
|
|
22
|
+
}
|
|
23
|
+
function S() {
|
|
24
|
+
return a[l];
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
v as Fragment,
|
|
28
|
+
m as clearRegisteredRenderStrategiesForTests,
|
|
29
|
+
y as defineIgniteConfig,
|
|
30
|
+
b as flushPendingStyles,
|
|
31
|
+
u as getGlobalStyles,
|
|
32
|
+
S as getIgniteConfig,
|
|
33
|
+
p as getRegisteredRenderStrategies,
|
|
34
|
+
R as injectStyles,
|
|
35
|
+
x as registerRenderStrategy,
|
|
36
|
+
F as resolveRenderStrategy,
|
|
37
|
+
o as setGlobalStyles
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../types-D0dEGodK.cjs");function s(n,e,t){const r=e?{...e}:{},i=c.normalizeChildren(r.children);return r.children=i,{type:n,props:r,key:t??null}}function u(n,e,t){return s(n,e,t)}function l(n,e,t){return s(n,e,t)}function o(n,e,t,r,i,d){return s(n,e,t)}exports.Fragment=c.Fragment;exports.jsx=u;exports.jsxDEV=o;exports.jsxs=l;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { n as c } from "../types-CfguvA5C.js";
|
|
2
|
+
import { F as h } from "../types-CfguvA5C.js";
|
|
3
|
+
function i(r, n, e) {
|
|
4
|
+
const t = n ? { ...n } : {}, o = c(t.children);
|
|
5
|
+
return t.children = o, {
|
|
6
|
+
type: r,
|
|
7
|
+
props: t,
|
|
8
|
+
key: e ?? null
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function u(r, n, e) {
|
|
12
|
+
return i(r, n, e);
|
|
13
|
+
}
|
|
14
|
+
function f(r, n, e) {
|
|
15
|
+
return i(r, n, e);
|
|
16
|
+
}
|
|
17
|
+
function m(r, n, e, t, o, s) {
|
|
18
|
+
return i(r, n, e);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
h as Fragment,
|
|
22
|
+
u as jsx,
|
|
23
|
+
m as jsxDEV,
|
|
24
|
+
f as jsxs
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx/index.cjs.js"),t=require("./types-D0dEGodK.cjs");exports.jsxDEV=e.jsxDEV;exports.Fragment=t.Fragment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx/index.cjs.js"),s=require("./types-D0dEGodK.cjs");exports.jsx=e.jsx;exports.jsxs=e.jsxs;exports.Fragment=s.Fragment;
|
package/dist/jsx.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./ignite-renderer.cjs.js"),E=require("./registry-BuMBTjzo.cjs"),l=require("./types-D0dEGodK.cjs"),y=require("./jsx/index.cjs.js"),v=new Set;function z(t){v.add(t.toLowerCase())}function $(){v.clear()}function j(t){return t?v.has(t.toLowerCase()):!1}const h="http://www.w3.org/2000/svg",O=new Set(["viewBox","preserveAspectRatio","clipPathUnits","gradientUnits","patternUnits","spreadMethod","startOffset","textLength","lengthAdjust"]);function k(t,i){const e=A(i);return m(t,e),e}function F(t,i,e,r={}){const n=A(i);return r.mode==="replace"||!e||t.childNodes.length===0?(m(t,n),n):(T(t,e,n,r.onFallbackReplace)||m(t,n),n)}function A(t){return g(t,void 0)}function g(t,i){if(Array.isArray(t))return t.flatMap(a=>g(a,i));if(t==null||t===!1||t===!0)return[{kind:"comment"}];if(typeof t=="string"||typeof t=="number")return[{kind:"text",value:String(t)}];if(!l.isIgniteJsxElement(t))return[{kind:"comment",comment:"ignite-unknown"}];if(t.type===l.Fragment)return l.normalizeChildren(t.props.children).flatMap(a=>g(a,i));if(typeof t.type=="function"){const a=t.type(t.props);return g(a,i)}const e=String(t.type),r=e==="slot",n=e==="svg",s=n||i===h,o=n||s&&e!=="foreignObject"?h:void 0,c=r?[]:l.normalizeChildren(t.props.children).flatMap(a=>g(a,o));return[{kind:"element",tag:e,props:t.props,namespace:s?h:void 0,children:c}]}function T(t,i,e,r){if(!M(i,e)){const s=Math.max(i.length,e.length);for(let o=0;o<s;o++){const c=t.childNodes[o];if(o<i.length&&o<e.length&&c){const a=x(c,i[o],e[o],r);a!==c&&t.replaceChild(a,c)}else o>=i.length?t.appendChild(f(e[o])):o>=e.length&&c&&t.removeChild(c)}for(;t.childNodes.length>e.length&&t.lastChild;)t.removeChild(t.lastChild);return!0}let n=0;for(;n<i.length;n++){const s=t.childNodes[n];if(!s)return!1;const o=x(s,i[n],e[n],r);o!==s&&t.replaceChild(o,s)}for(;n<e.length;n++)t.appendChild(f(e[n]));return!0}function x(t,i,e,r){if(i.kind!==e.kind)return f(e);if(e.kind==="text")return t.nodeType!==Node.TEXT_NODE?f(e):(t.textContent!==e.value&&(t.textContent=e.value),t);if(e.kind==="comment")return t.nodeType!==Node.COMMENT_NODE?f(e):t;if(e.kind!=="element"||i.kind!=="element")return f(e);if(j(e.tag))return r?.(`denylist:${e.tag.toLowerCase()}`),f(e);if(t.nodeType!==Node.ELEMENT_NODE||t.namespaceURI!==(e.namespace??t.namespaceURI)||t.tagName.toLowerCase()!==e.tag.toLowerCase())return f(e);const n=t;C(n,i.props,e.props);const s=e.namespace===h&&e.tag!=="foreignObject"?h:void 0,o=e.children.map(c=>c.kind==="element"&&c.namespace===void 0?{...c,namespace:s}:c);if(!T(n,i.children,o,r)){for(;n.firstChild;)n.removeChild(n.firstChild);for(const c of o)n.appendChild(f(c))}return t}function f(t){switch(t.kind){case"text":return document.createTextNode(t.value);case"comment":return document.createComment("comment"in t&&typeof t.comment=="string"?t.comment:"ignite-empty");case"element":{const i=t.namespace?document.createElementNS(t.namespace,t.tag):document.createElement(t.tag);C(i,{},t.props);for(const e of t.children)i.appendChild(f(e));return i}}}function M(t,i){if(i.length<t.length)return!1;for(let e=0;e<t.length;e++)if(!N(t[e],i[e]))return!1;if(t.length>1&&i.length===t.length){const e=t.map(p).join("|"),r=i.map(p).join("|");if(e!==r){const n=[...t].map(p).sort().join("|"),s=[...i].map(p).sort().join("|");if(n===s)return!1}}return!0}function N(t,i){return t.kind!==i.kind?!1:t.kind==="element"&&i.kind==="element"?t.tag===i.tag&&(t.namespace??"")===(i.namespace??""):!0}function p(t){switch(t.kind){case"text":return`t:${t.value}`;case"comment":return`c:${t.comment??""}`;case"element":return`e:${t.namespace??""}:${t.tag}:${t.children.map(i=>p(i)).join(",")}`}}function C(t,i,e){const r=t instanceof SVGElement;for(const n of Object.keys(i))n==="children"||n==="ref"||n in e||S(t,n,i[n],r);for(const[n,s]of Object.entries(e)){if(n==="children"||n==="ref")continue;const o=i[n];if(n==="class"||n==="className"){const u=s!==!1&&s!=null?String(s):"";t.getAttribute("class")!==u&&(u?t.setAttribute("class",u):t.removeAttribute("class"));continue}if(n==="style"){_(t,o,s);continue}if(n.startsWith("on")&&n.length>2){J(t,n,o,s);continue}if(s===o)continue;if(s===!1||s===null||s===void 0){S(t,n,o,r);continue}if(!r&&n in t&&n!=="list"){H(t,n,s);continue}const c=r?D(n):n,a=String(s);t.getAttribute(c)!==a&&t.setAttribute(c,a)}}function _(t,i,e){const r=t.style;if(i&&typeof i=="object"&&e&&typeof e=="object"){const s=i,o=e;for(const c of Object.keys(s))c in o||r.removeProperty(d(c));for(const[c,a]of Object.entries(o))if(a!=null){const u=d(c),R=String(a);r.getPropertyValue(u)!==R&&r.setProperty(u,R)}return}if(e&&typeof e=="object"){r.cssText="";for(const[s,o]of Object.entries(e))o!=null&&r.setProperty(d(s),String(o));return}if(e==null||e===!1){r.cssText="";return}const n=String(e);r.cssText!==n&&(r.cssText=n)}function J(t,i,e,r){const n=b(i.slice(2)),s=typeof e=="function"?e:null,o=typeof r=="function"?r:null;s&&s!==o&&t.removeEventListener(n,s),o&&o!==s&&t.addEventListener(n,o)}function S(t,i,e,r){if(i==="class"||i==="className"){t.removeAttribute("class");return}if(i==="style"){t.style.cssText="";return}if(i.startsWith("on")&&i.length>2&&typeof e=="function"){const s=b(i.slice(2));t.removeEventListener(s,e);return}!r&&i in t&&i!=="list"&&Reflect.set(t,i,void 0);const n=r?D(i):i;t.hasAttribute(n)&&t.removeAttribute(n)}function H(t,i,e){if(i==="value"||i==="checked"){Reflect.get(t,i)!==e&&!(P(t)&&i==="value")&&Reflect.set(t,i,e);return}Reflect.get(t,i)!==e&&Reflect.set(t,i,e)}function P(t){return"isComposing"in t&&!!t.isComposing}function m(t,i){for(;t.firstChild;)t.removeChild(t.firstChild);for(const e of i)t.appendChild(f(e))}function b(t){return t.replace(/^[^a-zA-Z0-9]+/,"").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}function D(t){return t.includes("-")||t.includes(":")||O.has(t)?t:t.startsWith("data")||t.startsWith("aria")?b(t):t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_+/g,"-").toLowerCase()}function d(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}class V{constructor(){this.contentRoot=null,this.previousTree=null,this.forceReplace=!1,this.forceReplaceReason=null;const{strategy:i,logging:e}=I.getIgniteConfig()??{},r=globalThis.process?.env?.IGNITE_DIFF_ENABLED;this.diffEnabled=(r??"true")!=="false",this.mode=i==="replace"?"replace":"diff",this.logging=this.normalizeLogging(e)}normalizeLogging(i){return i==="debug"||i==="warn"||i==="off"?i:"off"}attach(i){E.injectStyles(i);const e=i.querySelector("[data-ignite-jsx-root]");if(e){this.contentRoot=e;return}const r=document.createElement("ignite-jsx-root");r.setAttribute("data-ignite-jsx-root",""),i.appendChild(r),this.contentRoot=r;const n=i.host,s=n?.tagName?.toLowerCase(),o=j(s);(n?.hasAttribute?.("data-ignite-nodiff")||n?.hasAttribute?.("data-ignite-hydrated")||o)&&(this.forceReplace=!0,this.forceReplaceReason=o?`denylist:${s}`:n?.hasAttribute?.("data-ignite-hydrated")?"hydrated":"nodiff-attr")}render(i){if(!this.contentRoot)throw new Error("[IgniteJsxRenderStrategy] Cannot render before attach has been invoked.");const e=this.forceReplace||!this.diffEnabled?"replace":this.mode,r=this.forceReplaceReason??(e==="replace"&&this.mode==="replace"?"config-replace":this.diffEnabled?null:"flag-disabled");this.previousTree=this.previousTree===null?k(this.contentRoot,i):F(this.contentRoot,i,this.previousTree??void 0,{mode:e,onFallbackReplace:n=>this.logFallback(n,this.getHostTag())}),r&&this.logFallback(r,this.getHostTag())}detach(){this.contentRoot?.parentNode&&this.contentRoot.parentNode.removeChild(this.contentRoot),this.contentRoot=null,this.previousTree=null}getHostTag(){return this.contentRoot?.getRootNode()?.host?.tagName?.toLowerCase()??null}logFallback(i,e){if(this.logging==="off")return;const r=`[IgniteJsxRenderStrategy] Falling back to replace (${i}${e?`, tag=${e}`:""})`;this.logging==="debug"?console.debug(r):console.warn(r)}}const L=()=>new V;E.registerRenderStrategy("ignite-jsx",L);exports.Fragment=l.Fragment;exports.isIgniteJsxElement=l.isIgniteJsxElement;exports.normalizeChildren=l.normalizeChildren;exports.jsx=y.jsx;exports.jsxDEV=y.jsxDEV;exports.jsxs=y.jsxs;exports.clearNoDiffDenylistForTests=$;exports.createIgniteJsxRenderStrategy=L;exports.registerNoDiffDenylistTag=z;
|
package/dist/jsx.es.js
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { getIgniteConfig as C } from "./ignite-renderer.es.js";
|
|
2
|
+
import { i as L, r as $ } from "./registry-i8Eveq_U.js";
|
|
3
|
+
import { i as D, F as k, n as b } from "./types-CfguvA5C.js";
|
|
4
|
+
import { jsx as X, jsxDEV as Q, jsxs as Y } from "./jsx/index.es.js";
|
|
5
|
+
const d = /* @__PURE__ */ new Set();
|
|
6
|
+
function W(t) {
|
|
7
|
+
d.add(t.toLowerCase());
|
|
8
|
+
}
|
|
9
|
+
function B() {
|
|
10
|
+
d.clear();
|
|
11
|
+
}
|
|
12
|
+
function x(t) {
|
|
13
|
+
return t ? d.has(t.toLowerCase()) : !1;
|
|
14
|
+
}
|
|
15
|
+
const p = "http://www.w3.org/2000/svg", I = /* @__PURE__ */ new Set([
|
|
16
|
+
"viewBox",
|
|
17
|
+
"preserveAspectRatio",
|
|
18
|
+
"clipPathUnits",
|
|
19
|
+
"gradientUnits",
|
|
20
|
+
"patternUnits",
|
|
21
|
+
"spreadMethod",
|
|
22
|
+
"startOffset",
|
|
23
|
+
"textLength",
|
|
24
|
+
"lengthAdjust"
|
|
25
|
+
]);
|
|
26
|
+
function O(t, i) {
|
|
27
|
+
const e = E(i);
|
|
28
|
+
return h(t, e), e;
|
|
29
|
+
}
|
|
30
|
+
function z(t, i, e, r = {}) {
|
|
31
|
+
const n = E(i);
|
|
32
|
+
return r.mode === "replace" || !e || t.childNodes.length === 0 ? (h(t, n), n) : (A(
|
|
33
|
+
t,
|
|
34
|
+
e,
|
|
35
|
+
n,
|
|
36
|
+
r.onFallbackReplace
|
|
37
|
+
) || h(t, n), n);
|
|
38
|
+
}
|
|
39
|
+
function E(t) {
|
|
40
|
+
return u(t, void 0);
|
|
41
|
+
}
|
|
42
|
+
function u(t, i) {
|
|
43
|
+
if (Array.isArray(t))
|
|
44
|
+
return t.flatMap((a) => u(a, i));
|
|
45
|
+
if (t == null || t === !1 || t === !0)
|
|
46
|
+
return [{ kind: "comment" }];
|
|
47
|
+
if (typeof t == "string" || typeof t == "number")
|
|
48
|
+
return [{ kind: "text", value: String(t) }];
|
|
49
|
+
if (!D(t))
|
|
50
|
+
return [
|
|
51
|
+
{ kind: "comment", comment: "ignite-unknown" }
|
|
52
|
+
];
|
|
53
|
+
if (t.type === k)
|
|
54
|
+
return b(t.props.children).flatMap(
|
|
55
|
+
(a) => u(a, i)
|
|
56
|
+
);
|
|
57
|
+
if (typeof t.type == "function") {
|
|
58
|
+
const a = t.type(t.props);
|
|
59
|
+
return u(a, i);
|
|
60
|
+
}
|
|
61
|
+
const e = String(t.type), r = e === "slot", n = e === "svg", s = n || i === p, o = n || s && e !== "foreignObject" ? p : void 0, c = r ? [] : b(t.props.children).flatMap(
|
|
62
|
+
(a) => u(a, o)
|
|
63
|
+
);
|
|
64
|
+
return [
|
|
65
|
+
{
|
|
66
|
+
kind: "element",
|
|
67
|
+
tag: e,
|
|
68
|
+
props: t.props,
|
|
69
|
+
namespace: s ? p : void 0,
|
|
70
|
+
children: c
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
function A(t, i, e, r) {
|
|
75
|
+
if (!F(i, e)) {
|
|
76
|
+
const s = Math.max(i.length, e.length);
|
|
77
|
+
for (let o = 0; o < s; o++) {
|
|
78
|
+
const c = t.childNodes[o];
|
|
79
|
+
if (o < i.length && o < e.length && c) {
|
|
80
|
+
const a = R(
|
|
81
|
+
c,
|
|
82
|
+
i[o],
|
|
83
|
+
e[o],
|
|
84
|
+
r
|
|
85
|
+
);
|
|
86
|
+
a !== c && t.replaceChild(a, c);
|
|
87
|
+
} else o >= i.length ? t.appendChild(f(e[o])) : o >= e.length && c && t.removeChild(c);
|
|
88
|
+
}
|
|
89
|
+
for (; t.childNodes.length > e.length && t.lastChild; )
|
|
90
|
+
t.removeChild(t.lastChild);
|
|
91
|
+
return !0;
|
|
92
|
+
}
|
|
93
|
+
let n = 0;
|
|
94
|
+
for (; n < i.length; n++) {
|
|
95
|
+
const s = t.childNodes[n];
|
|
96
|
+
if (!s)
|
|
97
|
+
return !1;
|
|
98
|
+
const o = R(
|
|
99
|
+
s,
|
|
100
|
+
i[n],
|
|
101
|
+
e[n],
|
|
102
|
+
r
|
|
103
|
+
);
|
|
104
|
+
o !== s && t.replaceChild(o, s);
|
|
105
|
+
}
|
|
106
|
+
for (; n < e.length; n++)
|
|
107
|
+
t.appendChild(f(e[n]));
|
|
108
|
+
return !0;
|
|
109
|
+
}
|
|
110
|
+
function R(t, i, e, r) {
|
|
111
|
+
if (i.kind !== e.kind)
|
|
112
|
+
return f(e);
|
|
113
|
+
if (e.kind === "text")
|
|
114
|
+
return t.nodeType !== Node.TEXT_NODE ? f(e) : (t.textContent !== e.value && (t.textContent = e.value), t);
|
|
115
|
+
if (e.kind === "comment")
|
|
116
|
+
return t.nodeType !== Node.COMMENT_NODE ? f(e) : t;
|
|
117
|
+
if (e.kind !== "element" || i.kind !== "element")
|
|
118
|
+
return f(e);
|
|
119
|
+
if (x(e.tag))
|
|
120
|
+
return r?.(`denylist:${e.tag.toLowerCase()}`), f(e);
|
|
121
|
+
if (t.nodeType !== Node.ELEMENT_NODE || t.namespaceURI !== (e.namespace ?? t.namespaceURI) || t.tagName.toLowerCase() !== e.tag.toLowerCase())
|
|
122
|
+
return f(e);
|
|
123
|
+
const n = t;
|
|
124
|
+
T(n, i.props, e.props);
|
|
125
|
+
const s = e.namespace === p && e.tag !== "foreignObject" ? p : void 0, o = e.children.map(
|
|
126
|
+
(c) => c.kind === "element" && c.namespace === void 0 ? { ...c, namespace: s } : c
|
|
127
|
+
);
|
|
128
|
+
if (!A(
|
|
129
|
+
n,
|
|
130
|
+
i.children,
|
|
131
|
+
o,
|
|
132
|
+
r
|
|
133
|
+
)) {
|
|
134
|
+
for (; n.firstChild; )
|
|
135
|
+
n.removeChild(n.firstChild);
|
|
136
|
+
for (const c of o)
|
|
137
|
+
n.appendChild(f(c));
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
}
|
|
141
|
+
function f(t) {
|
|
142
|
+
switch (t.kind) {
|
|
143
|
+
case "text":
|
|
144
|
+
return document.createTextNode(t.value);
|
|
145
|
+
case "comment":
|
|
146
|
+
return document.createComment(
|
|
147
|
+
"comment" in t && typeof t.comment == "string" ? t.comment : "ignite-empty"
|
|
148
|
+
);
|
|
149
|
+
case "element": {
|
|
150
|
+
const i = t.namespace ? document.createElementNS(t.namespace, t.tag) : document.createElement(t.tag);
|
|
151
|
+
T(i, {}, t.props);
|
|
152
|
+
for (const e of t.children)
|
|
153
|
+
i.appendChild(f(e));
|
|
154
|
+
return i;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function F(t, i) {
|
|
159
|
+
if (i.length < t.length)
|
|
160
|
+
return !1;
|
|
161
|
+
for (let e = 0; e < t.length; e++)
|
|
162
|
+
if (!_(t[e], i[e]))
|
|
163
|
+
return !1;
|
|
164
|
+
if (t.length > 1 && i.length === t.length) {
|
|
165
|
+
const e = t.map(g).join("|"), r = i.map(g).join("|");
|
|
166
|
+
if (e !== r) {
|
|
167
|
+
const n = [...t].map(g).sort().join("|"), s = [...i].map(g).sort().join("|");
|
|
168
|
+
if (n === s)
|
|
169
|
+
return !1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return !0;
|
|
173
|
+
}
|
|
174
|
+
function _(t, i) {
|
|
175
|
+
return t.kind !== i.kind ? !1 : t.kind === "element" && i.kind === "element" ? t.tag === i.tag && (t.namespace ?? "") === (i.namespace ?? "") : !0;
|
|
176
|
+
}
|
|
177
|
+
function g(t) {
|
|
178
|
+
switch (t.kind) {
|
|
179
|
+
case "text":
|
|
180
|
+
return `t:${t.value}`;
|
|
181
|
+
case "comment":
|
|
182
|
+
return `c:${t.comment ?? ""}`;
|
|
183
|
+
case "element":
|
|
184
|
+
return `e:${t.namespace ?? ""}:${t.tag}:${t.children.map((i) => g(i)).join(",")}`;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function T(t, i, e) {
|
|
188
|
+
const r = t instanceof SVGElement;
|
|
189
|
+
for (const n of Object.keys(i))
|
|
190
|
+
n === "children" || n === "ref" || n in e || S(t, n, i[n], r);
|
|
191
|
+
for (const [n, s] of Object.entries(e)) {
|
|
192
|
+
if (n === "children" || n === "ref") continue;
|
|
193
|
+
const o = i[n];
|
|
194
|
+
if (n === "class" || n === "className") {
|
|
195
|
+
const l = s !== !1 && s != null ? String(s) : "";
|
|
196
|
+
t.getAttribute("class") !== l && (l ? t.setAttribute("class", l) : t.removeAttribute("class"));
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (n === "style") {
|
|
200
|
+
M(t, o, s);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (n.startsWith("on") && n.length > 2) {
|
|
204
|
+
N(t, n, o, s);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (s === o)
|
|
208
|
+
continue;
|
|
209
|
+
if (s === !1 || s === null || s === void 0) {
|
|
210
|
+
S(t, n, o, r);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (!r && n in t && n !== "list") {
|
|
214
|
+
H(t, n, s);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const c = r ? j(n) : n, a = String(s);
|
|
218
|
+
t.getAttribute(c) !== a && t.setAttribute(c, a);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function M(t, i, e) {
|
|
222
|
+
const r = t.style;
|
|
223
|
+
if (i && typeof i == "object" && e && typeof e == "object") {
|
|
224
|
+
const s = i, o = e;
|
|
225
|
+
for (const c of Object.keys(s))
|
|
226
|
+
c in o || r.removeProperty(m(c));
|
|
227
|
+
for (const [c, a] of Object.entries(o))
|
|
228
|
+
if (a != null) {
|
|
229
|
+
const l = m(c), y = String(a);
|
|
230
|
+
r.getPropertyValue(l) !== y && r.setProperty(l, y);
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (e && typeof e == "object") {
|
|
235
|
+
r.cssText = "";
|
|
236
|
+
for (const [s, o] of Object.entries(
|
|
237
|
+
e
|
|
238
|
+
))
|
|
239
|
+
o != null && r.setProperty(m(s), String(o));
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (e == null || e === !1) {
|
|
243
|
+
r.cssText = "";
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
const n = String(e);
|
|
247
|
+
r.cssText !== n && (r.cssText = n);
|
|
248
|
+
}
|
|
249
|
+
function N(t, i, e, r) {
|
|
250
|
+
const n = v(i.slice(2)), s = typeof e == "function" ? e : null, o = typeof r == "function" ? r : null;
|
|
251
|
+
s && s !== o && t.removeEventListener(n, s), o && o !== s && t.addEventListener(n, o);
|
|
252
|
+
}
|
|
253
|
+
function S(t, i, e, r) {
|
|
254
|
+
if (i === "class" || i === "className") {
|
|
255
|
+
t.removeAttribute("class");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (i === "style") {
|
|
259
|
+
t.style.cssText = "";
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (i.startsWith("on") && i.length > 2 && typeof e == "function") {
|
|
263
|
+
const s = v(i.slice(2));
|
|
264
|
+
t.removeEventListener(s, e);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
!r && i in t && i !== "list" && Reflect.set(t, i, void 0);
|
|
268
|
+
const n = r ? j(i) : i;
|
|
269
|
+
t.hasAttribute(n) && t.removeAttribute(n);
|
|
270
|
+
}
|
|
271
|
+
function H(t, i, e) {
|
|
272
|
+
if (i === "value" || i === "checked") {
|
|
273
|
+
Reflect.get(t, i) !== e && !(J(t) && i === "value") && Reflect.set(t, i, e);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
Reflect.get(t, i) !== e && Reflect.set(t, i, e);
|
|
277
|
+
}
|
|
278
|
+
function J(t) {
|
|
279
|
+
return "isComposing" in t && !!t.isComposing;
|
|
280
|
+
}
|
|
281
|
+
function h(t, i) {
|
|
282
|
+
for (; t.firstChild; )
|
|
283
|
+
t.removeChild(t.firstChild);
|
|
284
|
+
for (const e of i)
|
|
285
|
+
t.appendChild(f(e));
|
|
286
|
+
}
|
|
287
|
+
function v(t) {
|
|
288
|
+
return t.replace(/^[^a-zA-Z0-9]+/, "").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
289
|
+
}
|
|
290
|
+
function j(t) {
|
|
291
|
+
return t.includes("-") || t.includes(":") || I.has(t) ? t : t.startsWith("data") || t.startsWith("aria") ? v(t) : t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_+/g, "-").toLowerCase();
|
|
292
|
+
}
|
|
293
|
+
function m(t) {
|
|
294
|
+
return t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
295
|
+
}
|
|
296
|
+
class P {
|
|
297
|
+
constructor() {
|
|
298
|
+
this.contentRoot = null, this.previousTree = null, this.forceReplace = !1, this.forceReplaceReason = null;
|
|
299
|
+
const { strategy: i, logging: e } = C() ?? {}, r = globalThis.process?.env?.IGNITE_DIFF_ENABLED;
|
|
300
|
+
this.diffEnabled = (r ?? "true") !== "false", this.mode = i === "replace" ? "replace" : "diff", this.logging = this.normalizeLogging(e);
|
|
301
|
+
}
|
|
302
|
+
normalizeLogging(i) {
|
|
303
|
+
return i === "debug" || i === "warn" || i === "off" ? i : "off";
|
|
304
|
+
}
|
|
305
|
+
attach(i) {
|
|
306
|
+
L(i);
|
|
307
|
+
const e = i.querySelector(
|
|
308
|
+
"[data-ignite-jsx-root]"
|
|
309
|
+
);
|
|
310
|
+
if (e) {
|
|
311
|
+
this.contentRoot = e;
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const r = document.createElement("ignite-jsx-root");
|
|
315
|
+
r.setAttribute("data-ignite-jsx-root", ""), i.appendChild(r), this.contentRoot = r;
|
|
316
|
+
const n = i.host, s = n?.tagName?.toLowerCase(), o = x(s);
|
|
317
|
+
(n?.hasAttribute?.("data-ignite-nodiff") || n?.hasAttribute?.("data-ignite-hydrated") || o) && (this.forceReplace = !0, this.forceReplaceReason = o ? `denylist:${s}` : n?.hasAttribute?.("data-ignite-hydrated") ? "hydrated" : "nodiff-attr");
|
|
318
|
+
}
|
|
319
|
+
render(i) {
|
|
320
|
+
if (!this.contentRoot)
|
|
321
|
+
throw new Error(
|
|
322
|
+
"[IgniteJsxRenderStrategy] Cannot render before attach has been invoked."
|
|
323
|
+
);
|
|
324
|
+
const e = this.forceReplace || !this.diffEnabled ? "replace" : this.mode, r = this.forceReplaceReason ?? (e === "replace" && this.mode === "replace" ? "config-replace" : this.diffEnabled ? null : "flag-disabled");
|
|
325
|
+
this.previousTree = this.previousTree === null ? O(this.contentRoot, i) : z(
|
|
326
|
+
this.contentRoot,
|
|
327
|
+
i,
|
|
328
|
+
this.previousTree ?? void 0,
|
|
329
|
+
{
|
|
330
|
+
mode: e,
|
|
331
|
+
onFallbackReplace: (n) => this.logFallback(n, this.getHostTag())
|
|
332
|
+
}
|
|
333
|
+
), r && this.logFallback(r, this.getHostTag());
|
|
334
|
+
}
|
|
335
|
+
detach() {
|
|
336
|
+
this.contentRoot?.parentNode && this.contentRoot.parentNode.removeChild(this.contentRoot), this.contentRoot = null, this.previousTree = null;
|
|
337
|
+
}
|
|
338
|
+
getHostTag() {
|
|
339
|
+
return this.contentRoot?.getRootNode()?.host?.tagName?.toLowerCase() ?? null;
|
|
340
|
+
}
|
|
341
|
+
logFallback(i, e) {
|
|
342
|
+
if (this.logging === "off") return;
|
|
343
|
+
const r = `[IgniteJsxRenderStrategy] Falling back to replace (${i}${e ? `, tag=${e}` : ""})`;
|
|
344
|
+
this.logging === "debug" ? console.debug(r) : console.warn(r);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const V = () => new P();
|
|
348
|
+
$("ignite-jsx", V);
|
|
349
|
+
export {
|
|
350
|
+
k as Fragment,
|
|
351
|
+
B as clearNoDiffDenylistForTests,
|
|
352
|
+
V as createIgniteJsxRenderStrategy,
|
|
353
|
+
D as isIgniteJsxElement,
|
|
354
|
+
X as jsx,
|
|
355
|
+
Q as jsxDEV,
|
|
356
|
+
Y as jsxs,
|
|
357
|
+
b as normalizeChildren,
|
|
358
|
+
W as registerNoDiffDenylistTag
|
|
359
|
+
};
|
package/dist/lit.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lit-html"),t=require("./registry-BuMBTjzo.cjs");class i{constructor(){this.host=null}attach(e){this.host=e,t.injectStyles(e)}render(e){if(!this.host)throw new Error("[LitRenderStrategy] Cannot render before attach has been invoked.");n.render(e,this.host)}detach(){}}const r=()=>new i;t.registerRenderStrategy("lit",r);exports.createLitRenderStrategy=r;
|
package/dist/lit.es.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render as e } from "lit-html";
|
|
2
|
+
import { i as r, r as n } from "./registry-i8Eveq_U.js";
|
|
3
|
+
class o {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.host = null;
|
|
6
|
+
}
|
|
7
|
+
attach(t) {
|
|
8
|
+
this.host = t, r(t);
|
|
9
|
+
}
|
|
10
|
+
render(t) {
|
|
11
|
+
if (!this.host)
|
|
12
|
+
throw new Error(
|
|
13
|
+
"[LitRenderStrategy] Cannot render before attach has been invoked."
|
|
14
|
+
);
|
|
15
|
+
e(t, this.host);
|
|
16
|
+
}
|
|
17
|
+
detach() {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const s = () => new o();
|
|
21
|
+
n("lit", s);
|
|
22
|
+
export {
|
|
23
|
+
s as createLitRenderStrategy
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";let O;function v(e){if(Array.isArray(e))throw new Error("setGlobalStyles does not accept arrays. Provide a single string or StyleObject.");O=e}function h(){return O}const R=new WeakMap,m=new WeakSet,a=new Set,y=new WeakMap,k=globalThis.WeakRef;let S=null;function i(e,t,...r){}function I(e){return k?new k(e):{deref:()=>e}}function P(e){if(y.has(e))return;const t={ref:I(e)};a.add(t),y.set(e,t)}function W(e){a.delete(e);const t=e.ref.deref();t&&y.delete(t)}function x(){const e=[];for(const t of Array.from(a)){const r=t.ref.deref();if(!r){W(t);continue}e.push(r)}return e}function j(e){return typeof e=="string"?`string:${e}`:e&&typeof e=="object"&&"href"in e?`object:${e.href}`:"unknown"}function w(e,t,r){S!==r&&(S=r,console.warn(e,t))}function G(e){if(m.has(e)){i();return}i();const t=h();if(!t){i(),P(e);return}let r=R.get(e);r||(r=new Set,R.set(e,r),i());const g=(n,s)=>{if(r.has(n))return i(),!0;i("Inject Styles","Loading new stylesheet:",{href:n,attributes:s});const c=document.createElement("link");return c.rel="stylesheet",c.href=n,s&&(s.integrity&&(c.integrity=s.integrity),s.crossOrigin&&(c.crossOrigin=s.crossOrigin)),e.appendChild(c),r.add(n),i("Link Element","Added to DOM:",c.outerHTML),!0},o=n=>{const s=n.trim();return s.split("?")[0]?.split("#")[0]??s},l=n=>o(n).endsWith(".css"),f=n=>o(n).endsWith(".scss"),p=n=>{i(),w("Invalid global style path:",n,j(t))},b=n=>{i(),w("Skipping non-browser stylesheet path:",n,j(t))};let u=!1;if(typeof t=="string"?(i("Global Styles","Processing string:",t),l(t)?u=g(t):f(t)?b(t):p(t)):typeof t=="object"&&t&&"href"in t&&(i("Global Styles","Processing object:",t),l(t.href)?u=g(t.href,{integrity:t.integrity,crossOrigin:t.crossOrigin}):f(t.href)?b(t.href):p(t.href)),!u){P(e);return}y.delete(e);for(const n of Array.from(a))if(n.ref.deref()===e){a.delete(n);break}S=null,m.add(e)}function M(){if(!h()){i();return}for(const t of x())i(),G(t)}const E=Symbol.for("ignite-renderer.renderStrategyRegistry");function d(){const e=globalThis;let t=e[E];return t||(t=new Map,e[E]=t),t}function T(e,t){d().set(e,t)}function A(e){const t=d(),r=t.get(e);if(r)return r;const g=t.get("ignite-jsx");let o,l;if(g)o="ignite-jsx",l=g;else{const f=t.entries().next().value;f&&([o,l]=f)}if(!o||!l)throw new Error('[ignite-renderer] No render strategies have been registered. Import "@ignite-element/renderer/jsx" (or another strategy entry point) before registering components.');return e!==o&&console.warn(`[ignite-renderer] Render strategy "${e}" is not registered. Ensure you import "@ignite-element/renderer/${e}" before registering components. Falling back to "${o}".`),l}function F(){d().clear()}function L(){return[...d().keys()]}exports.clearRegisteredRenderStrategiesForTests=F;exports.flushPendingStyles=M;exports.getGlobalStyles=h;exports.getRegisteredRenderStrategies=L;exports.injectStyles=G;exports.registerRenderStrategy=T;exports.resolveRenderStrategy=A;exports.setGlobalStyles=v;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
let E;
|
|
2
|
+
function G(e) {
|
|
3
|
+
if (Array.isArray(e))
|
|
4
|
+
throw new Error(
|
|
5
|
+
"setGlobalStyles does not accept arrays. Provide a single string or StyleObject."
|
|
6
|
+
);
|
|
7
|
+
E = e;
|
|
8
|
+
}
|
|
9
|
+
function O() {
|
|
10
|
+
return E;
|
|
11
|
+
}
|
|
12
|
+
const b = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakSet(), g = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new WeakMap(), k = globalThis.WeakRef;
|
|
13
|
+
let S = null;
|
|
14
|
+
function i(e, t, ...r) {
|
|
15
|
+
}
|
|
16
|
+
function x(e) {
|
|
17
|
+
return k ? new k(e) : {
|
|
18
|
+
deref: () => e
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function R(e) {
|
|
22
|
+
if (y.has(e))
|
|
23
|
+
return;
|
|
24
|
+
const t = {
|
|
25
|
+
ref: x(e)
|
|
26
|
+
};
|
|
27
|
+
g.add(t), y.set(e, t);
|
|
28
|
+
}
|
|
29
|
+
function I(e) {
|
|
30
|
+
g.delete(e);
|
|
31
|
+
const t = e.ref.deref();
|
|
32
|
+
t && y.delete(t);
|
|
33
|
+
}
|
|
34
|
+
function W() {
|
|
35
|
+
const e = [];
|
|
36
|
+
for (const t of Array.from(g)) {
|
|
37
|
+
const r = t.ref.deref();
|
|
38
|
+
if (!r) {
|
|
39
|
+
I(t);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
e.push(r);
|
|
43
|
+
}
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
function w(e) {
|
|
47
|
+
return typeof e == "string" ? `string:${e}` : e && typeof e == "object" && "href" in e ? `object:${e.href}` : "unknown";
|
|
48
|
+
}
|
|
49
|
+
function P(e, t, r) {
|
|
50
|
+
S !== r && (S = r, console.warn(e, t));
|
|
51
|
+
}
|
|
52
|
+
function v(e) {
|
|
53
|
+
if (m.has(e)) {
|
|
54
|
+
i();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
i();
|
|
58
|
+
const t = O();
|
|
59
|
+
if (!t) {
|
|
60
|
+
i(), R(e);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let r = b.get(e);
|
|
64
|
+
r || (r = /* @__PURE__ */ new Set(), b.set(e, r), i());
|
|
65
|
+
const f = (n, s) => {
|
|
66
|
+
if (r.has(n))
|
|
67
|
+
return i(), !0;
|
|
68
|
+
i("Inject Styles", "Loading new stylesheet:", {
|
|
69
|
+
href: n,
|
|
70
|
+
attributes: s
|
|
71
|
+
});
|
|
72
|
+
const c = document.createElement("link");
|
|
73
|
+
return c.rel = "stylesheet", c.href = n, s && (s.integrity && (c.integrity = s.integrity), s.crossOrigin && (c.crossOrigin = s.crossOrigin)), e.appendChild(c), r.add(n), i(
|
|
74
|
+
"Link Element",
|
|
75
|
+
"Added to DOM:",
|
|
76
|
+
c.outerHTML
|
|
77
|
+
), !0;
|
|
78
|
+
}, o = (n) => {
|
|
79
|
+
const s = n.trim();
|
|
80
|
+
return s.split("?")[0]?.split("#")[0] ?? s;
|
|
81
|
+
}, l = (n) => o(n).endsWith(".css"), a = (n) => o(n).endsWith(".scss"), h = (n) => {
|
|
82
|
+
i(), P(
|
|
83
|
+
"Invalid global style path:",
|
|
84
|
+
n,
|
|
85
|
+
w(t)
|
|
86
|
+
);
|
|
87
|
+
}, p = (n) => {
|
|
88
|
+
i(), P(
|
|
89
|
+
"Skipping non-browser stylesheet path:",
|
|
90
|
+
n,
|
|
91
|
+
w(t)
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
let u = !1;
|
|
95
|
+
if (typeof t == "string" ? (i("Global Styles", "Processing string:", t), l(t) ? u = f(t) : a(t) ? p(t) : h(t)) : typeof t == "object" && t && "href" in t && (i("Global Styles", "Processing object:", t), l(t.href) ? u = f(t.href, {
|
|
96
|
+
integrity: t.integrity,
|
|
97
|
+
crossOrigin: t.crossOrigin
|
|
98
|
+
}) : a(t.href) ? p(t.href) : h(t.href)), !u) {
|
|
99
|
+
R(e);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
y.delete(e);
|
|
103
|
+
for (const n of Array.from(g))
|
|
104
|
+
if (n.ref.deref() === e) {
|
|
105
|
+
g.delete(n);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
S = null, m.add(e);
|
|
109
|
+
}
|
|
110
|
+
function M() {
|
|
111
|
+
if (!O()) {
|
|
112
|
+
i();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const t of W())
|
|
116
|
+
i(), v(t);
|
|
117
|
+
}
|
|
118
|
+
const j = /* @__PURE__ */ Symbol.for("ignite-renderer.renderStrategyRegistry");
|
|
119
|
+
function d() {
|
|
120
|
+
const e = globalThis;
|
|
121
|
+
let t = e[j];
|
|
122
|
+
return t || (t = /* @__PURE__ */ new Map(), e[j] = t), t;
|
|
123
|
+
}
|
|
124
|
+
function A(e, t) {
|
|
125
|
+
d().set(e, t);
|
|
126
|
+
}
|
|
127
|
+
function L(e) {
|
|
128
|
+
const t = d(), r = t.get(e);
|
|
129
|
+
if (r)
|
|
130
|
+
return r;
|
|
131
|
+
const f = t.get("ignite-jsx");
|
|
132
|
+
let o, l;
|
|
133
|
+
if (f)
|
|
134
|
+
o = "ignite-jsx", l = f;
|
|
135
|
+
else {
|
|
136
|
+
const a = t.entries().next().value;
|
|
137
|
+
a && ([o, l] = a);
|
|
138
|
+
}
|
|
139
|
+
if (!o || !l)
|
|
140
|
+
throw new Error(
|
|
141
|
+
'[ignite-renderer] No render strategies have been registered. Import "@ignite-element/renderer/jsx" (or another strategy entry point) before registering components.'
|
|
142
|
+
);
|
|
143
|
+
return e !== o && console.warn(
|
|
144
|
+
`[ignite-renderer] Render strategy "${e}" is not registered. Ensure you import "@ignite-element/renderer/${e}" before registering components. Falling back to "${o}".`
|
|
145
|
+
), l;
|
|
146
|
+
}
|
|
147
|
+
function T() {
|
|
148
|
+
d().clear();
|
|
149
|
+
}
|
|
150
|
+
function $() {
|
|
151
|
+
return [...d().keys()];
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
$ as a,
|
|
155
|
+
L as b,
|
|
156
|
+
T as c,
|
|
157
|
+
M as f,
|
|
158
|
+
O as g,
|
|
159
|
+
v as i,
|
|
160
|
+
A as r,
|
|
161
|
+
G as s
|
|
162
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GlobalStyles } from './globalStyles';
|
|
2
|
+
export type IgniteRendererId = "lit" | "ignite-jsx";
|
|
3
|
+
export type IgniteRenderStrategyId = "diff" | "replace" | (string & {});
|
|
4
|
+
export type IgniteLoggingLevel = "off" | "warn" | "debug" | (string & {});
|
|
5
|
+
/**
|
|
6
|
+
* Optional project-wide compatibility config.
|
|
7
|
+
* The default Ignite JSX path stays config-free; use this only for
|
|
8
|
+
* shared styles, diagnostics, or a non-default renderer.
|
|
9
|
+
* `globalStyles` remains as a deprecated alias for `styles` during migration.
|
|
10
|
+
*/
|
|
11
|
+
export interface IgniteConfig {
|
|
12
|
+
styles?: GlobalStyles;
|
|
13
|
+
renderer?: IgniteRendererId;
|
|
14
|
+
strategy?: IgniteRenderStrategyId;
|
|
15
|
+
logging?: IgniteLoggingLevel;
|
|
16
|
+
/** @deprecated Use `styles` instead. */
|
|
17
|
+
globalStyles?: GlobalStyles;
|
|
18
|
+
}
|
|
19
|
+
export declare function defineIgniteConfig(config: IgniteConfig): IgniteConfig;
|
|
20
|
+
export declare function getIgniteConfig(): IgniteConfig | undefined;
|
|
21
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,gBAAgB,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,YAAY,CAAC;AACpD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,wCAAwC;IACxC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC5B;AAuDD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CASrE;AAED,wBAAgB,eAAe,IAAI,YAAY,GAAG,SAAS,CAE1D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StyleObject {
|
|
2
|
+
href: string;
|
|
3
|
+
integrity?: string;
|
|
4
|
+
crossOrigin?: string;
|
|
5
|
+
}
|
|
6
|
+
export type GlobalStyles = string | StyleObject | undefined;
|
|
7
|
+
export declare function setGlobalStyles(style: GlobalStyles): void;
|
|
8
|
+
export declare function getGlobalStyles(): GlobalStyles;
|
|
9
|
+
//# sourceMappingURL=globalStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalStyles.d.ts","sourceRoot":"","sources":["../../src/globalStyles.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAI5D,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAOzD;AAED,wBAAgB,eAAe,IAAI,YAAY,CAE9C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { IgniteConfig, IgniteLoggingLevel, IgniteRendererId, IgniteRenderStrategyId, } from './config';
|
|
2
|
+
export { defineIgniteConfig, getIgniteConfig } from './config';
|
|
3
|
+
export type { GlobalStyles } from './globalStyles';
|
|
4
|
+
export { getGlobalStyles, setGlobalStyles } from './globalStyles';
|
|
5
|
+
export { default as injectStyles, flushPendingStyles } from './injectStyles';
|
|
6
|
+
export type { IgniteJsxChild, IgniteJsxElement, IgniteJsxProps, } from './renderers/jsx/types';
|
|
7
|
+
export { Fragment } from './renderers/jsx/types';
|
|
8
|
+
export type { RenderStrategy, RenderStrategyFactory, } from './renderers/RenderStrategy';
|
|
9
|
+
export { clearRegisteredRenderStrategiesForTests, getRegisteredRenderStrategies, registerRenderStrategy, resolveRenderStrategy, } from './renderers/registry';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,YAAY,EACX,cAAc,EACd,gBAAgB,EAChB,cAAc,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAAY,EACX,cAAc,EACd,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,uCAAuC,EACvC,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectStyles.d.ts","sourceRoot":"","sources":["../../src/injectStyles.ts"],"names":[],"mappings":"AA2HA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAkJjE;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAczC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupDomPolyfill.d.ts","sourceRoot":"","sources":["../../../src/internal/setupDomPolyfill.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EACX,cAAc,EACd,gBAAgB,EAChB,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
import { RenderStrategy } from './RenderStrategy';
|
|
3
|
+
export declare class LitRenderStrategy implements RenderStrategy<TemplateResult> {
|
|
4
|
+
private host;
|
|
5
|
+
attach(host: ShadowRoot): void;
|
|
6
|
+
render(view: TemplateResult): void;
|
|
7
|
+
detach(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const createLitRenderStrategy: () => LitRenderStrategy;
|
|
10
|
+
//# sourceMappingURL=LitRenderStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LitRenderStrategy.d.ts","sourceRoot":"","sources":["../../../src/renderers/LitRenderStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,qBAAa,iBAAkB,YAAW,cAAc,CAAC,cAAc,CAAC;IACvE,OAAO,CAAC,IAAI,CAA2B;IAEvC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAK9B,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAUlC,MAAM,IAAI,IAAI;CAGd;AAED,eAAO,MAAM,uBAAuB,yBAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderStrategy.d.ts","sourceRoot":"","sources":["../../../src/renderers/RenderStrategy.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc,CAAC,IAAI;IACnC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,MAAM,qBAAqB,CAAC,IAAI,IAAI,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { clearNoDiffDenylistForTests, createIgniteJsxRenderStrategy, registerNoDiffDenylistTag, } from './jsx/IgniteJsxRenderStrategy';
|
|
2
|
+
export { Fragment, jsx, jsxDEV, jsxs } from './jsx/jsx-runtime';
|
|
3
|
+
export type { IgniteJsxChild, IgniteJsxComponent, IgniteJsxElement, IgniteJsxProps, } from './jsx/types';
|
|
4
|
+
export { isIgniteJsxElement, normalizeChildren } from './jsx/types';
|
|
5
|
+
//# sourceMappingURL=ignite-jsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignite-jsx.d.ts","sourceRoot":"","sources":["../../../src/renderers/ignite-jsx.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAOtC,OAAO,EACN,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RenderStrategy } from '../RenderStrategy';
|
|
2
|
+
import { IgniteJsxChild } from './types';
|
|
3
|
+
declare class IgniteJsxRenderStrategy implements RenderStrategy<IgniteJsxChild> {
|
|
4
|
+
private contentRoot;
|
|
5
|
+
private previousTree;
|
|
6
|
+
private readonly mode;
|
|
7
|
+
private readonly logging;
|
|
8
|
+
private readonly diffEnabled;
|
|
9
|
+
private forceReplace;
|
|
10
|
+
private forceReplaceReason;
|
|
11
|
+
private normalizeLogging;
|
|
12
|
+
constructor();
|
|
13
|
+
attach(host: ShadowRoot): void;
|
|
14
|
+
render(view: IgniteJsxChild): void;
|
|
15
|
+
detach(): void;
|
|
16
|
+
private getHostTag;
|
|
17
|
+
private logFallback;
|
|
18
|
+
}
|
|
19
|
+
export declare const createIgniteJsxRenderStrategy: () => IgniteJsxRenderStrategy;
|
|
20
|
+
export type { IgniteJsxChild };
|
|
21
|
+
export { clearNoDiffDenylistForTests, registerNoDiffDenylistTag, } from './noDiffDenylist';
|
|
22
|
+
//# sourceMappingURL=IgniteJsxRenderStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IgniteJsxRenderStrategy.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/IgniteJsxRenderStrategy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,cAAM,uBAAwB,YAAW,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,YAAY,CAAiC;IACrD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,kBAAkB,CAAuB;IAEjD,OAAO,CAAC,gBAAgB;;IAmBxB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAgC9B,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAmClC,MAAM,IAAI,IAAI;IAQd,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;CAWnB;AAED,eAAO,MAAM,6BAA6B,+BACZ,CAAC;AAE/B,YAAY,EAAE,cAAc,EAAE,CAAC;AAC/B,OAAO,EACN,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createIgniteJsxRenderStrategy } from './IgniteJsxRenderStrategy';
|
|
2
|
+
export { Fragment, jsx, jsxDEV, jsxs } from './jsx-runtime';
|
|
3
|
+
export type { IgniteJsxChild, IgniteJsxComponent, IgniteJsxElement, IgniteJsxProps, } from './types';
|
|
4
|
+
export { isIgniteJsxElement, normalizeChildren } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment, IgniteJsxChild, IgniteJsxElement, IgniteJsxProps } from './types';
|
|
2
|
+
type ElementType = IgniteJsxElement["type"];
|
|
3
|
+
export declare function jsx(type: ElementType, props: IgniteJsxProps | null | undefined, key?: string | number | null): IgniteJsxElement;
|
|
4
|
+
export declare function jsxs(type: ElementType, props: IgniteJsxProps | null | undefined, key?: string | number | null): IgniteJsxElement;
|
|
5
|
+
export declare function jsxDEV(type: ElementType, props: IgniteJsxProps | null | undefined, key?: string | number | null, isStaticChildren?: boolean, source?: unknown, self?: unknown): IgniteJsxElement;
|
|
6
|
+
export { Fragment };
|
|
7
|
+
export type { IgniteJsxChild, IgniteJsxElement, IgniteJsxProps };
|
|
8
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEnB,MAAM,SAAS,CAAC;AAEjB,KAAK,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAkB5C,wBAAgB,GAAG,CAClB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACxC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAC1B,gBAAgB,CAElB;AAED,wBAAgB,IAAI,CACnB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACxC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAC1B,gBAAgB,CAElB;AAED,wBAAgB,MAAM,CACrB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACxC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAC5B,gBAAgB,CAAC,EAAE,OAAO,EAC1B,MAAM,CAAC,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,OAAO,GACZ,gBAAgB,CAKlB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const noDiffDenylist: Set<string>;
|
|
2
|
+
export declare function registerNoDiffDenylistTag(tagName: string): void;
|
|
3
|
+
export declare function clearNoDiffDenylistForTests(): void;
|
|
4
|
+
export declare function isNoDiffDenylistedTag(tagName: string | null | undefined): boolean;
|
|
5
|
+
export { noDiffDenylist };
|
|
6
|
+
//# sourceMappingURL=noDiffDenylist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noDiffDenylist.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/noDiffDenylist.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,aAAoB,CAAC;AAEzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/D;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAChC,OAAO,CAGT;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IgniteJsxChild, IgniteJsxProps } from './types';
|
|
2
|
+
type NormalizedNode = {
|
|
3
|
+
kind: "element";
|
|
4
|
+
tag: string;
|
|
5
|
+
props: IgniteJsxProps;
|
|
6
|
+
children: NormalizedNode[];
|
|
7
|
+
namespace?: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "text";
|
|
10
|
+
value: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "comment";
|
|
13
|
+
comment?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function createDomNode(node: IgniteJsxChild, namespace?: string): Node | DocumentFragment;
|
|
16
|
+
export declare function mountIgniteJsx(host: (Node & ParentNode) | ShadowRoot, view: IgniteJsxChild): NormalizedNode[];
|
|
17
|
+
type RenderOptions = {
|
|
18
|
+
mode?: "diff" | "replace";
|
|
19
|
+
onFallbackReplace?: (reason: string) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare function renderIgniteJsx(host: (Node & ParentNode) | ShadowRoot, view: IgniteJsxChild, previous?: NormalizedNode[], options?: RenderOptions): NormalizedNode[];
|
|
22
|
+
export type { NormalizedNode };
|
|
23
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,cAAc,EAGnB,MAAM,SAAS,CAAC;AAejB,KAAK,cAAc,GAChB;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CAClB,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,wBAAgB,aAAa,CAC5B,IAAI,EAAE,cAAc,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,GAAG,gBAAgB,CAUzB;AAED,wBAAgB,cAAc,CAC7B,IAAI,EAAE,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,UAAU,EACtC,IAAI,EAAE,cAAc,GAClB,cAAc,EAAE,CAIlB;AAED,KAAK,aAAa,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,wBAAgB,eAAe,CAC9B,IAAI,EAAE,CAAC,IAAI,GAAG,UAAU,CAAC,GAAG,UAAU,EACtC,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE,cAAc,EAAE,EAC3B,OAAO,GAAE,aAAkB,GACzB,cAAc,EAAE,CAuBlB;AAigBD,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type IgniteJsxChild = IgniteJsxElement | PrimitiveChild | IgniteJsxChild[];
|
|
2
|
+
type PrimitiveChild = string | number | boolean | null | undefined;
|
|
3
|
+
export type IgniteJsxComponent = (props: IgniteJsxProps) => IgniteJsxChild;
|
|
4
|
+
export interface IgniteJsxProps {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
children?: IgniteJsxChild;
|
|
7
|
+
}
|
|
8
|
+
export interface IgniteJsxElement {
|
|
9
|
+
type: string | IgniteJsxComponent | typeof Fragment;
|
|
10
|
+
props: IgniteJsxProps;
|
|
11
|
+
key?: string | number | null;
|
|
12
|
+
}
|
|
13
|
+
export declare const Fragment: unique symbol;
|
|
14
|
+
export declare function isIgniteJsxElement(value: unknown): value is IgniteJsxElement;
|
|
15
|
+
export declare function normalizeChildren(children: IgniteJsxProps["children"]): IgniteJsxChild[];
|
|
16
|
+
declare global {
|
|
17
|
+
namespace JSX {
|
|
18
|
+
type Element = IgniteJsxElement;
|
|
19
|
+
interface ElementClass {
|
|
20
|
+
render: (...args: unknown[]) => IgniteJsxChild;
|
|
21
|
+
}
|
|
22
|
+
interface ElementAttributesProperty {
|
|
23
|
+
props: IgniteJsxProps;
|
|
24
|
+
}
|
|
25
|
+
interface ElementChildrenAttribute {
|
|
26
|
+
children: IgniteJsxChild;
|
|
27
|
+
}
|
|
28
|
+
interface IntrinsicAttributes {
|
|
29
|
+
key?: string | number | null;
|
|
30
|
+
}
|
|
31
|
+
interface IntrinsicElements {
|
|
32
|
+
[element: string]: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/renderers/jsx/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACvB,gBAAgB,GAChB,cAAc,GACd,cAAc,EAAE,CAAC;AAEpB,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc,CAAC;AAE3E,MAAM,WAAW,cAAc;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,OAAO,QAAQ,CAAC;IACpD,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,QAAQ,eAAwC,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAO5E;AAED,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAClC,cAAc,EAAE,CAMlB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,GAAG,CAAC;QACb,KAAK,OAAO,GAAG,gBAAgB,CAAC;QAChC,UAAU,YAAY;YACrB,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,cAAc,CAAC;SAC/C;QACD,UAAU,yBAAyB;YAClC,KAAK,EAAE,cAAc,CAAC;SACtB;QACD,UAAU,wBAAwB;YACjC,QAAQ,EAAE,cAAc,CAAC;SACzB;QACD,UAAU,mBAAmB;YAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;SAC7B;QACD,UAAU,iBAAiB;YAC1B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SAC3C;KACD;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit.d.ts","sourceRoot":"","sources":["../../../src/renderers/lit.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAOtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RenderStrategyFactory } from './RenderStrategy';
|
|
2
|
+
export declare function registerRenderStrategy(renderer: string, factory: RenderStrategyFactory<unknown>): void;
|
|
3
|
+
export declare function resolveRenderStrategy(renderer: string): RenderStrategyFactory<unknown>;
|
|
4
|
+
export declare function clearRegisteredRenderStrategiesForTests(): void;
|
|
5
|
+
export declare function getRegisteredRenderStrategies(): string[];
|
|
6
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/renderers/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAoB9D,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,qBAAqB,CAAC,OAAO,CAAC,GACrC,IAAI,CAGN;AAED,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,GACd,qBAAqB,CAAC,OAAO,CAAC,CAqChC;AAED,wBAAgB,uCAAuC,IAAI,IAAI,CAG9D;AAED,wBAAgB,6BAA6B,IAAI,MAAM,EAAE,CAExD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const t = /* @__PURE__ */ Symbol.for("ignite-element.fragment");
|
|
2
|
+
function r(n) {
|
|
3
|
+
return !!n && typeof n == "object" && "type" in n && "props" in n;
|
|
4
|
+
}
|
|
5
|
+
function e(n) {
|
|
6
|
+
return n == null ? [] : Array.isArray(n) ? n : [n];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
t as F,
|
|
10
|
+
r as i,
|
|
11
|
+
e as n
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=Symbol.for("ignite-element.fragment");function e(n){return!!n&&typeof n=="object"&&"type"in n&&"props"in n}function r(n){return n==null?[]:Array.isArray(n)?n:[n]}exports.Fragment=t;exports.isIgniteJsxElement=e;exports.normalizeChildren=r;
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ignite-element/renderer",
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/ignite-renderer.cjs.js",
|
|
6
|
+
"module": "dist/ignite-renderer.es.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"description": "Advanced renderer and runtime utilities for ignite-element.",
|
|
9
|
+
"typesVersions": {
|
|
10
|
+
"*": {
|
|
11
|
+
"jsx": [
|
|
12
|
+
"dist/types/renderers/ignite-jsx.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"lit": [
|
|
15
|
+
"dist/types/renderers/lit.d.ts"
|
|
16
|
+
],
|
|
17
|
+
"jsx-runtime": [
|
|
18
|
+
"dist/types/jsx/jsx-runtime.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"jsx-dev-runtime": [
|
|
21
|
+
"dist/types/jsx/jsx-dev-runtime.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"jsx/index": [
|
|
24
|
+
"dist/types/jsx/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
31
|
+
"import": "./dist/ignite-renderer.es.js",
|
|
32
|
+
"require": "./dist/ignite-renderer.cjs.js",
|
|
33
|
+
"default": "./dist/ignite-renderer.es.js"
|
|
34
|
+
},
|
|
35
|
+
"./jsx": {
|
|
36
|
+
"types": "./dist/types/renderers/ignite-jsx.d.ts",
|
|
37
|
+
"import": "./dist/jsx.es.js",
|
|
38
|
+
"require": "./dist/jsx.cjs.js",
|
|
39
|
+
"default": "./dist/jsx.es.js"
|
|
40
|
+
},
|
|
41
|
+
"./lit": {
|
|
42
|
+
"types": "./dist/types/renderers/lit.d.ts",
|
|
43
|
+
"import": "./dist/lit.es.js",
|
|
44
|
+
"require": "./dist/lit.cjs.js",
|
|
45
|
+
"default": "./dist/lit.es.js"
|
|
46
|
+
},
|
|
47
|
+
"./jsx-runtime": {
|
|
48
|
+
"types": "./dist/types/jsx/jsx-runtime.d.ts",
|
|
49
|
+
"import": "./dist/jsx-runtime.es.js",
|
|
50
|
+
"require": "./dist/jsx-runtime.cjs.js",
|
|
51
|
+
"default": "./dist/jsx-runtime.es.js"
|
|
52
|
+
},
|
|
53
|
+
"./jsx-dev-runtime": {
|
|
54
|
+
"types": "./dist/types/jsx/jsx-dev-runtime.d.ts",
|
|
55
|
+
"import": "./dist/jsx-dev-runtime.es.js",
|
|
56
|
+
"require": "./dist/jsx-dev-runtime.cjs.js",
|
|
57
|
+
"default": "./dist/jsx-dev-runtime.es.js"
|
|
58
|
+
},
|
|
59
|
+
"./jsx/index": {
|
|
60
|
+
"types": "./dist/types/jsx/index.d.ts",
|
|
61
|
+
"import": "./dist/jsx/index.es.js",
|
|
62
|
+
"require": "./dist/jsx/index.cjs.js",
|
|
63
|
+
"default": "./dist/jsx/index.es.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"sideEffects": [
|
|
67
|
+
"./dist/jsx.es.js",
|
|
68
|
+
"./dist/jsx.cjs.js",
|
|
69
|
+
"./dist/lit.es.js",
|
|
70
|
+
"./dist/lit.cjs.js"
|
|
71
|
+
],
|
|
72
|
+
"files": [
|
|
73
|
+
"dist",
|
|
74
|
+
"README.md"
|
|
75
|
+
],
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"typescript": "^5.9.3",
|
|
78
|
+
"vite": "^7.1.12",
|
|
79
|
+
"vite-plugin-dts": "^4.5.4"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"lit-html": ">=3.2.1"
|
|
83
|
+
},
|
|
84
|
+
"peerDependenciesMeta": {
|
|
85
|
+
"lit-html": {
|
|
86
|
+
"optional": true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build:types": "tsc",
|
|
91
|
+
"build:js": "vite build",
|
|
92
|
+
"build": "pnpm run build:types && pnpm run build:js",
|
|
93
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json"
|
|
94
|
+
}
|
|
95
|
+
}
|