anentrypoint-design 0.0.121 → 0.0.124
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/README.md +253 -253
- package/app-shell.css +931 -594
- package/colors_and_type.css +226 -226
- package/community.css +817 -1222
- package/dist/247420.css +2202 -2084
- package/dist/247420.js +13 -13
- package/package.json +80 -80
- package/src/bootstrap.js +25 -25
- package/src/components/chat.js +199 -199
- package/src/components/community.js +190 -208
- package/src/components/content.js +269 -269
- package/src/components/editor-primitives.js +100 -0
- package/src/components/files-modals.js +107 -107
- package/src/components/files.js +118 -118
- package/src/components/freddie/helpers.js +50 -50
- package/src/components/freddie.js +33 -33
- package/src/components/shell.js +117 -117
- package/src/components/theme-toggle.js +70 -70
- package/src/components.js +59 -57
- package/src/debug.js +30 -30
- package/src/deck-stage.js +21 -21
- package/src/highlight.js +65 -32
- package/src/index.js +86 -86
- package/src/kits/os/about-app.js +52 -52
- package/src/kits/os/app-panes.css +152 -152
- package/src/kits/os/browser-app.js +58 -58
- package/src/kits/os/files-app.js +44 -44
- package/src/kits/os/freddie/helpers.js +59 -59
- package/src/kits/os/freddie/pages-chat.js +143 -143
- package/src/kits/os/freddie/pages-core.js +101 -101
- package/src/kits/os/freddie/pages-os.js +51 -51
- package/src/kits/os/freddie/pages-tools.js +183 -183
- package/src/kits/os/freddie/routes.js +24 -24
- package/src/kits/os/freddie-dashboard.css +51 -51
- package/src/kits/os/freddie-dashboard.js +101 -101
- package/src/kits/os/icons.js +17 -17
- package/src/kits/os/index.js +17 -17
- package/src/kits/os/launcher.css +61 -61
- package/src/kits/os/launcher.js +79 -79
- package/src/kits/os/monitor-app.js +34 -34
- package/src/kits/os/shell.js +214 -214
- package/src/kits/os/terminal-app.js +45 -45
- package/src/kits/os/theme.css +450 -450
- package/src/kits/os/validate.css +19 -19
- package/src/kits/os/validator-app.js +55 -55
- package/src/kits/os/wm.css +115 -115
- package/src/kits/os/wm.js +111 -111
- package/src/markdown.js +39 -39
- package/src/motion.js +35 -35
- package/src/page-html.js +196 -196
- package/src/styles.js +25 -25
- package/src/theme.js +99 -99
- package/src/web-components/ds-chat.js +116 -116
- package/dist/.nojekyll +0 -0
- package/dist/app-shell.css +0 -594
- package/dist/colors_and_type.css +0 -197
- package/dist/favicon.svg +0 -1
- package/dist/index.html +0 -308
- package/dist/preview/buttons.html +0 -28
- package/dist/preview/colors-core.html +0 -45
- package/dist/preview/colors-lore.html +0 -28
- package/dist/preview/colors-semantic.html +0 -34
- package/dist/preview/dateline.html +0 -19
- package/dist/preview/dropzone.html +0 -30
- package/dist/preview/file-grid.html +0 -19
- package/dist/preview/file-row.html +0 -20
- package/dist/preview/file-toolbar.html +0 -40
- package/dist/preview/file-viewer.html +0 -31
- package/dist/preview/header.html +0 -24
- package/dist/preview/icons-unicode.html +0 -26
- package/dist/preview/index-row.html +0 -25
- package/dist/preview/inputs.html +0 -22
- package/dist/preview/manifesto.html +0 -52
- package/dist/preview/motion-default.js +0 -106
- package/dist/preview/rules.html +0 -16
- package/dist/preview/spacing.html +0 -18
- package/dist/preview/stamps-lore.html +0 -20
- package/dist/preview/stamps.html +0 -14
- package/dist/preview/theme-ink.html +0 -15
- package/dist/preview/type-display.html +0 -16
- package/dist/preview/type-mono.html +0 -15
- package/dist/preview/type-prose.html +0 -11
- package/dist/preview/type-scale.html +0 -20
- package/dist/preview/wordmarks.html +0 -28
- package/dist/robots.txt +0 -8
- package/dist/site/content/globals/navigation.yaml +0 -5
- package/dist/site/content/globals/site.yaml +0 -16
- package/dist/site/content/pages/freddie.yaml +0 -88
- package/dist/site/content/pages/home.yaml +0 -190
- package/dist/site/theme.mjs +0 -368
- package/dist/sitemap.xml +0 -31
- package/dist/slides/deck-stage-overlay.js +0 -63
- package/dist/slides/deck-stage-state.js +0 -81
- package/dist/slides/deck-stage-style.js +0 -117
- package/dist/slides/deck-stage.js +0 -159
- package/dist/slides/index.html +0 -276
- package/dist/src/bootstrap.js +0 -25
- package/dist/src/components/chat.js +0 -199
- package/dist/src/components/community.js +0 -167
- package/dist/src/components/content.js +0 -213
- package/dist/src/components/files-modals.js +0 -107
- package/dist/src/components/files.js +0 -118
- package/dist/src/components/freddie/helpers.js +0 -50
- package/dist/src/components/freddie.js +0 -33
- package/dist/src/components/shell.js +0 -117
- package/dist/src/components/theme-toggle.js +0 -70
- package/dist/src/components.js +0 -52
- package/dist/src/debug.js +0 -30
- package/dist/src/deck-stage.js +0 -21
- package/dist/src/highlight.js +0 -32
- package/dist/src/index.js +0 -86
- package/dist/src/kits/os/about-app.js +0 -52
- package/dist/src/kits/os/app-panes.css +0 -152
- package/dist/src/kits/os/browser-app.js +0 -58
- package/dist/src/kits/os/files-app.js +0 -44
- package/dist/src/kits/os/freddie/helpers.js +0 -59
- package/dist/src/kits/os/freddie/pages-chat.js +0 -143
- package/dist/src/kits/os/freddie/pages-core.js +0 -101
- package/dist/src/kits/os/freddie/pages-os.js +0 -51
- package/dist/src/kits/os/freddie/pages-tools.js +0 -183
- package/dist/src/kits/os/freddie/routes.js +0 -24
- package/dist/src/kits/os/freddie-dashboard.css +0 -51
- package/dist/src/kits/os/freddie-dashboard.js +0 -101
- package/dist/src/kits/os/icons.js +0 -17
- package/dist/src/kits/os/index.js +0 -5
- package/dist/src/kits/os/launcher.css +0 -61
- package/dist/src/kits/os/launcher.js +0 -79
- package/dist/src/kits/os/monitor-app.js +0 -34
- package/dist/src/kits/os/shell.js +0 -214
- package/dist/src/kits/os/terminal-app.js +0 -45
- package/dist/src/kits/os/theme.css +0 -412
- package/dist/src/kits/os/validate.css +0 -19
- package/dist/src/kits/os/validator-app.js +0 -55
- package/dist/src/kits/os/wm.css +0 -115
- package/dist/src/kits/os/wm.js +0 -111
- package/dist/src/markdown.js +0 -39
- package/dist/src/motion.js +0 -35
- package/dist/src/page-html.js +0 -196
- package/dist/src/styles.js +0 -25
- package/dist/src/theme.js +0 -99
- package/dist/src/web-components/ds-chat.js +0 -45
- package/dist/ui_kits/aicat/README.md +0 -7
- package/dist/ui_kits/aicat/app.js +0 -156
- package/dist/ui_kits/aicat/index.html +0 -26
- package/dist/ui_kits/aicat/sample-square.png +0 -0
- package/dist/ui_kits/aicat/sample-svg.svg +0 -1
- package/dist/ui_kits/aicat/sample.pdf +0 -32
- package/dist/ui_kits/blog/README.md +0 -3
- package/dist/ui_kits/blog/index.html +0 -90
- package/dist/ui_kits/chat/README.md +0 -5
- package/dist/ui_kits/chat/app.js +0 -110
- package/dist/ui_kits/chat/index.html +0 -26
- package/dist/ui_kits/chat/sample-square.png +0 -0
- package/dist/ui_kits/chat/sample-svg.svg +0 -1
- package/dist/ui_kits/chat/sample.pdf +0 -32
- package/dist/ui_kits/community/app.js +0 -134
- package/dist/ui_kits/community/index.html +0 -24
- package/dist/ui_kits/dashboard/app.js +0 -92
- package/dist/ui_kits/dashboard/index.html +0 -26
- package/dist/ui_kits/docs/README.md +0 -3
- package/dist/ui_kits/docs/index.html +0 -123
- package/dist/ui_kits/error_404/app.js +0 -56
- package/dist/ui_kits/error_404/index.html +0 -26
- package/dist/ui_kits/file_browser/README.md +0 -48
- package/dist/ui_kits/file_browser/app.js +0 -231
- package/dist/ui_kits/file_browser/index.html +0 -33
- package/dist/ui_kits/gallery/app.js +0 -121
- package/dist/ui_kits/gallery/index.html +0 -26
- package/dist/ui_kits/homepage/README.md +0 -7
- package/dist/ui_kits/homepage/app.js +0 -167
- package/dist/ui_kits/homepage/index.html +0 -46
- package/dist/ui_kits/project_page/README.md +0 -3
- package/dist/ui_kits/project_page/app.js +0 -154
- package/dist/ui_kits/project_page/index.html +0 -45
- package/dist/ui_kits/search/app.js +0 -107
- package/dist/ui_kits/search/index.html +0 -26
- package/dist/ui_kits/settings/app.js +0 -133
- package/dist/ui_kits/settings/index.html +0 -26
- package/dist/ui_kits/signin/app.js +0 -115
- package/dist/ui_kits/signin/index.html +0 -26
- package/dist/ui_kits/slide_deck/app.js +0 -174
- package/dist/ui_kits/slide_deck/index.html +0 -26
- package/dist/ui_kits/system_primer/app.js +0 -152
- package/dist/ui_kits/system_primer/index.html +0 -26
- package/dist/ui_kits/terminal/app.js +0 -150
- package/dist/ui_kits/terminal/index.html +0 -26
- package/dist/vendor/webjsx/applyDiff.js +0 -182
- package/dist/vendor/webjsx/attributes.js +0 -154
- package/dist/vendor/webjsx/constants.js +0 -4
- package/dist/vendor/webjsx/createDOMElement.js +0 -52
- package/dist/vendor/webjsx/createElement.js +0 -75
- package/dist/vendor/webjsx/elementTags.js +0 -115
- package/dist/vendor/webjsx/factory.js +0 -6
- package/dist/vendor/webjsx/index.js +0 -6
- package/dist/vendor/webjsx/jsx-dev-runtime.js +0 -2
- package/dist/vendor/webjsx/jsx-runtime.js +0 -30
- package/dist/vendor/webjsx/jsx.js +0 -2
- package/dist/vendor/webjsx/package.json +0 -39
- package/dist/vendor/webjsx/renderSuspension.js +0 -25
- package/dist/vendor/webjsx/types.js +0 -5
- package/dist/vendor/webjsx/utils.js +0 -84
- package/src/components/overlays.js +0 -151
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { definesRenderSuspension, withRenderSuspension, } from "./renderSuspension.js";
|
|
3
|
-
/**
|
|
4
|
-
* Updates an event listener on an element.
|
|
5
|
-
* @param el Target element
|
|
6
|
-
* @param eventName Name of the event (without 'on' prefix)
|
|
7
|
-
* @param newHandler New event handler function
|
|
8
|
-
* @param oldHandler Previous event handler function
|
|
9
|
-
*/
|
|
10
|
-
function updateEventListener(el, eventName, newHandler, oldHandler) {
|
|
11
|
-
if (oldHandler && oldHandler !== newHandler) {
|
|
12
|
-
el.removeEventListener(eventName, oldHandler);
|
|
13
|
-
}
|
|
14
|
-
if (newHandler && oldHandler !== newHandler) {
|
|
15
|
-
el.addEventListener(eventName, newHandler);
|
|
16
|
-
el.__webjsx_listeners =
|
|
17
|
-
el.__webjsx_listeners ?? {};
|
|
18
|
-
el.__webjsx_listeners[eventName] = newHandler;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Updates a single property or attribute on an element.
|
|
23
|
-
* @param el Target element
|
|
24
|
-
* @param key Property or attribute name
|
|
25
|
-
* @param value New value to set
|
|
26
|
-
*/
|
|
27
|
-
function updatePropOrAttr(el, key, value) {
|
|
28
|
-
if (el instanceof HTMLElement) {
|
|
29
|
-
if (key in el) {
|
|
30
|
-
// Fast path: property exists on HTMLElement
|
|
31
|
-
el[key] = value;
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (typeof value === "string") {
|
|
35
|
-
el.setAttribute(key, value);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
// Fallback for non-string values on HTMLElement
|
|
39
|
-
el[key] = value;
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
// SVG/Other namespace elements
|
|
43
|
-
const isSVG = el.namespaceURI === "http://www.w3.org/2000/svg";
|
|
44
|
-
if (isSVG) {
|
|
45
|
-
if (value !== undefined && value !== null) {
|
|
46
|
-
el.setAttribute(key, `${value}`);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
el.removeAttribute(key);
|
|
50
|
-
}
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// Fallback for other element types
|
|
54
|
-
if (typeof value === "string") {
|
|
55
|
-
el.setAttribute(key, value);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
el[key] = value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Updates all attributes and properties on a DOM element.
|
|
63
|
-
* @param el Target element
|
|
64
|
-
* @param newProps New properties to apply
|
|
65
|
-
* @param oldProps Previous properties for comparison (default empty object)
|
|
66
|
-
*/
|
|
67
|
-
function updateAttributesCore(el, newProps, oldProps = {}) {
|
|
68
|
-
// Handle new/updated props
|
|
69
|
-
for (const key of Object.keys(newProps)) {
|
|
70
|
-
const value = newProps[key];
|
|
71
|
-
if (key === "children" ||
|
|
72
|
-
key === "key" ||
|
|
73
|
-
key === "dangerouslySetInnerHTML" ||
|
|
74
|
-
key === "nodes")
|
|
75
|
-
continue;
|
|
76
|
-
if (key.startsWith("on") && typeof value === "function") {
|
|
77
|
-
const eventName = key.substring(2).toLowerCase();
|
|
78
|
-
updateEventListener(el, eventName, value, el.__webjsx_listeners?.[eventName]);
|
|
79
|
-
}
|
|
80
|
-
else if (value !== oldProps[key]) {
|
|
81
|
-
updatePropOrAttr(el, key, value);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// Handle dangerouslySetInnerHTML
|
|
85
|
-
if (newProps.dangerouslySetInnerHTML) {
|
|
86
|
-
if (!oldProps.dangerouslySetInnerHTML ||
|
|
87
|
-
newProps.dangerouslySetInnerHTML.__html !==
|
|
88
|
-
oldProps.dangerouslySetInnerHTML.__html) {
|
|
89
|
-
const html = newProps.dangerouslySetInnerHTML?.__html || "";
|
|
90
|
-
el.innerHTML = html;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
if (oldProps.dangerouslySetInnerHTML) {
|
|
95
|
-
el.innerHTML = "";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
// Remove old props/attributes
|
|
99
|
-
for (const key of Object.keys(oldProps)) {
|
|
100
|
-
if (!(key in newProps) &&
|
|
101
|
-
key !== "children" &&
|
|
102
|
-
key !== "key" &&
|
|
103
|
-
key !== "dangerouslySetInnerHTML" &&
|
|
104
|
-
key !== "nodes") {
|
|
105
|
-
if (key.startsWith("on")) {
|
|
106
|
-
const eventName = key.substring(2).toLowerCase();
|
|
107
|
-
const existingListener = el
|
|
108
|
-
.__webjsx_listeners?.[eventName];
|
|
109
|
-
if (existingListener) {
|
|
110
|
-
el.removeEventListener(eventName, existingListener);
|
|
111
|
-
delete el.__webjsx_listeners[eventName];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else if (key in el) {
|
|
115
|
-
el[key] = undefined;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
el.removeAttribute(key);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Sets initial attributes and properties on a DOM element.
|
|
125
|
-
* @param el Target element
|
|
126
|
-
* @param props Properties to apply
|
|
127
|
-
*/
|
|
128
|
-
export function setAttributes(el, props) {
|
|
129
|
-
if (definesRenderSuspension(el)) {
|
|
130
|
-
withRenderSuspension(el, () => {
|
|
131
|
-
updateAttributesCore(el, props);
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
updateAttributesCore(el, props);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Updates existing attributes and properties on a DOM element.
|
|
140
|
-
* @param el Target element
|
|
141
|
-
* @param newProps New properties to apply
|
|
142
|
-
* @param oldProps Previous properties for comparison
|
|
143
|
-
*/
|
|
144
|
-
export function updateAttributes(el, newProps, oldProps) {
|
|
145
|
-
if (definesRenderSuspension(el)) {
|
|
146
|
-
withRenderSuspension(el, () => {
|
|
147
|
-
updateAttributesCore(el, newProps, oldProps);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
updateAttributesCore(el, newProps, oldProps);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=attributes.js.map
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { setAttributes } from "./attributes.js";
|
|
2
|
-
import { SVG_NAMESPACE } from "./constants.js";
|
|
3
|
-
import { assignRef, isVElement, setWebJSXChildNodeCache, setWebJSXProps, } from "./utils.js";
|
|
4
|
-
/**
|
|
5
|
-
* Creates a real DOM node from a virtual node representation.
|
|
6
|
-
* @param velement Virtual node to convert
|
|
7
|
-
* @param parentNamespaceURI Namespace URI from parent element, if any
|
|
8
|
-
* @returns Created DOM node
|
|
9
|
-
*/
|
|
10
|
-
export function createDOMElement(velement, parentNamespaceURI) {
|
|
11
|
-
const namespaceURI = velement.props.xmlns !== undefined
|
|
12
|
-
? velement.props.xmlns
|
|
13
|
-
: velement.type === "svg"
|
|
14
|
-
? SVG_NAMESPACE
|
|
15
|
-
: parentNamespaceURI ?? undefined;
|
|
16
|
-
const el = velement.props.is !== undefined
|
|
17
|
-
? namespaceURI !== undefined
|
|
18
|
-
? document.createElementNS(namespaceURI, velement.type, {
|
|
19
|
-
is: velement.props.is,
|
|
20
|
-
})
|
|
21
|
-
: document.createElement(velement.type, {
|
|
22
|
-
is: velement.props.is,
|
|
23
|
-
})
|
|
24
|
-
: namespaceURI !== undefined
|
|
25
|
-
? document.createElementNS(namespaceURI, velement.type)
|
|
26
|
-
: document.createElement(velement.type);
|
|
27
|
-
if (velement.props) {
|
|
28
|
-
setAttributes(el, velement.props);
|
|
29
|
-
}
|
|
30
|
-
if (velement.props.key !== undefined) {
|
|
31
|
-
el.__webjsx_key = velement.props.key;
|
|
32
|
-
}
|
|
33
|
-
if (velement.props.ref) {
|
|
34
|
-
assignRef(el, velement.props.ref);
|
|
35
|
-
}
|
|
36
|
-
if (velement.props.children && !velement.props.dangerouslySetInnerHTML) {
|
|
37
|
-
const children = velement.props.children;
|
|
38
|
-
const nodes = [];
|
|
39
|
-
for (let i = 0; i < children.length; i++) {
|
|
40
|
-
const child = children[i];
|
|
41
|
-
const node = isVElement(child)
|
|
42
|
-
? createDOMElement(child, namespaceURI)
|
|
43
|
-
: document.createTextNode(`${child}`);
|
|
44
|
-
nodes.push(node);
|
|
45
|
-
el.appendChild(node);
|
|
46
|
-
}
|
|
47
|
-
setWebJSXProps(el, velement.props);
|
|
48
|
-
setWebJSXChildNodeCache(el, nodes);
|
|
49
|
-
}
|
|
50
|
-
return el;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=createDOMElement.js.map
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { KNOWN_ELEMENTS } from "./elementTags.js";
|
|
2
|
-
import { flattenVNodes } from "./utils.js";
|
|
3
|
-
/**
|
|
4
|
-
* Creates a virtual element representing a DOM node or Fragment.
|
|
5
|
-
* @param type Element type (tag name) or Fragment
|
|
6
|
-
* @param props Properties and attributes for the element
|
|
7
|
-
* @param children Child elements or content
|
|
8
|
-
* @returns Virtual element representation
|
|
9
|
-
*/
|
|
10
|
-
export function createElement(type, props, ...children) {
|
|
11
|
-
if (typeof type === "string") {
|
|
12
|
-
const normalizedProps = props ? props : {};
|
|
13
|
-
const flatChildren = flattenVNodes(children);
|
|
14
|
-
if (flatChildren.length > 0) {
|
|
15
|
-
// Set children property only if dangerouslySetInnerHTML is not present
|
|
16
|
-
if (!normalizedProps.dangerouslySetInnerHTML) {
|
|
17
|
-
normalizedProps.children = flatChildren;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
normalizedProps.children = [];
|
|
21
|
-
console.warn("WebJSX: Ignoring children since dangerouslySetInnerHTML is set.");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
normalizedProps.children = [];
|
|
26
|
-
}
|
|
27
|
-
const result = {
|
|
28
|
-
type,
|
|
29
|
-
tagName: KNOWN_ELEMENTS.get(type) ?? type.toUpperCase(),
|
|
30
|
-
props: normalizedProps ?? {},
|
|
31
|
-
};
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return flattenVNodes(children);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// As called from jsx-runtime.jsx function.
|
|
39
|
-
export function createElementJSX(type, props, key) {
|
|
40
|
-
if (typeof type === "string") {
|
|
41
|
-
props = props || {};
|
|
42
|
-
const flatChildren = props
|
|
43
|
-
? flattenVNodes(props.children)
|
|
44
|
-
: [];
|
|
45
|
-
if (key !== undefined) {
|
|
46
|
-
props.key = key;
|
|
47
|
-
}
|
|
48
|
-
if (flatChildren.length > 0) {
|
|
49
|
-
// Set children property only if dangerouslySetInnerHTML is not present
|
|
50
|
-
if (!props.dangerouslySetInnerHTML) {
|
|
51
|
-
props.children = flatChildren;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
props.children = [];
|
|
55
|
-
console.warn("WebJSX: Ignoring children since dangerouslySetInnerHTML is set.");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
props.children = [];
|
|
60
|
-
}
|
|
61
|
-
const result = {
|
|
62
|
-
type,
|
|
63
|
-
tagName: KNOWN_ELEMENTS.get(type) ?? type.toUpperCase(),
|
|
64
|
-
props: props ?? {},
|
|
65
|
-
};
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
const flatChildren = props
|
|
70
|
-
? flattenVNodes(props.children)
|
|
71
|
-
: [];
|
|
72
|
-
return flatChildren;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=createElement.js.map
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// Create a Map for faster lookups
|
|
2
|
-
export const KNOWN_ELEMENTS = new Map(Object.entries({
|
|
3
|
-
a: "A",
|
|
4
|
-
abbr: "ABBR",
|
|
5
|
-
address: "ADDRESS",
|
|
6
|
-
area: "AREA",
|
|
7
|
-
article: "ARTICLE",
|
|
8
|
-
aside: "ASIDE",
|
|
9
|
-
audio: "AUDIO",
|
|
10
|
-
b: "B",
|
|
11
|
-
base: "BASE",
|
|
12
|
-
bdi: "BDI",
|
|
13
|
-
bdo: "BDO",
|
|
14
|
-
blockquote: "BLOCKQUOTE",
|
|
15
|
-
body: "BODY",
|
|
16
|
-
br: "BR",
|
|
17
|
-
button: "BUTTON",
|
|
18
|
-
canvas: "CANVAS",
|
|
19
|
-
caption: "CAPTION",
|
|
20
|
-
cite: "CITE",
|
|
21
|
-
code: "CODE",
|
|
22
|
-
col: "COL",
|
|
23
|
-
colgroup: "COLGROUP",
|
|
24
|
-
data: "DATA",
|
|
25
|
-
datalist: "DATALIST",
|
|
26
|
-
dd: "DD",
|
|
27
|
-
del: "DEL",
|
|
28
|
-
details: "DETAILS",
|
|
29
|
-
dfn: "DFN",
|
|
30
|
-
dialog: "DIALOG",
|
|
31
|
-
div: "DIV",
|
|
32
|
-
dl: "DL",
|
|
33
|
-
dt: "DT",
|
|
34
|
-
em: "EM",
|
|
35
|
-
embed: "EMBED",
|
|
36
|
-
fieldset: "FIELDSET",
|
|
37
|
-
figcaption: "FIGCAPTION",
|
|
38
|
-
figure: "FIGURE",
|
|
39
|
-
footer: "FOOTER",
|
|
40
|
-
form: "FORM",
|
|
41
|
-
h1: "H1",
|
|
42
|
-
h2: "H2",
|
|
43
|
-
h3: "H3",
|
|
44
|
-
h4: "H4",
|
|
45
|
-
h5: "H5",
|
|
46
|
-
h6: "H6",
|
|
47
|
-
head: "HEAD",
|
|
48
|
-
header: "HEADER",
|
|
49
|
-
hgroup: "HGROUP",
|
|
50
|
-
hr: "HR",
|
|
51
|
-
html: "HTML",
|
|
52
|
-
i: "I",
|
|
53
|
-
iframe: "IFRAME",
|
|
54
|
-
img: "IMG",
|
|
55
|
-
input: "INPUT",
|
|
56
|
-
ins: "INS",
|
|
57
|
-
kbd: "KBD",
|
|
58
|
-
label: "LABEL",
|
|
59
|
-
legend: "LEGEND",
|
|
60
|
-
li: "LI",
|
|
61
|
-
link: "LINK",
|
|
62
|
-
main: "MAIN",
|
|
63
|
-
map: "MAP",
|
|
64
|
-
mark: "MARK",
|
|
65
|
-
menu: "MENU",
|
|
66
|
-
meta: "META",
|
|
67
|
-
meter: "METER",
|
|
68
|
-
nav: "NAV",
|
|
69
|
-
noscript: "NOSCRIPT",
|
|
70
|
-
object: "OBJECT",
|
|
71
|
-
ol: "OL",
|
|
72
|
-
optgroup: "OPTGROUP",
|
|
73
|
-
option: "OPTION",
|
|
74
|
-
output: "OUTPUT",
|
|
75
|
-
p: "P",
|
|
76
|
-
picture: "PICTURE",
|
|
77
|
-
pre: "PRE",
|
|
78
|
-
progress: "PROGRESS",
|
|
79
|
-
q: "Q",
|
|
80
|
-
rp: "RP",
|
|
81
|
-
rt: "RT",
|
|
82
|
-
ruby: "RUBY",
|
|
83
|
-
s: "S",
|
|
84
|
-
samp: "SAMP",
|
|
85
|
-
script: "SCRIPT",
|
|
86
|
-
section: "SECTION",
|
|
87
|
-
select: "SELECT",
|
|
88
|
-
slot: "SLOT",
|
|
89
|
-
small: "SMALL",
|
|
90
|
-
source: "SOURCE",
|
|
91
|
-
span: "SPAN",
|
|
92
|
-
strong: "STRONG",
|
|
93
|
-
style: "STYLE",
|
|
94
|
-
sub: "SUB",
|
|
95
|
-
summary: "SUMMARY",
|
|
96
|
-
sup: "SUP",
|
|
97
|
-
table: "TABLE",
|
|
98
|
-
tbody: "TBODY",
|
|
99
|
-
td: "TD",
|
|
100
|
-
template: "TEMPLATE",
|
|
101
|
-
textarea: "TEXTAREA",
|
|
102
|
-
tfoot: "TFOOT",
|
|
103
|
-
th: "TH",
|
|
104
|
-
thead: "THEAD",
|
|
105
|
-
time: "TIME",
|
|
106
|
-
title: "TITLE",
|
|
107
|
-
tr: "TR",
|
|
108
|
-
track: "TRACK",
|
|
109
|
-
u: "U",
|
|
110
|
-
ul: "UL",
|
|
111
|
-
var: "VAR",
|
|
112
|
-
video: "VIDEO",
|
|
113
|
-
wbr: "WBR",
|
|
114
|
-
}));
|
|
115
|
-
//# sourceMappingURL=elementTags.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createElementJSX } from "./createElement.js";
|
|
2
|
-
import { Fragment } from "./types.js";
|
|
3
|
-
export * from "./jsx.js";
|
|
4
|
-
export { Fragment };
|
|
5
|
-
/**
|
|
6
|
-
* JSX transform factory function.
|
|
7
|
-
* @param type Element type or component
|
|
8
|
-
* @param props Element properties
|
|
9
|
-
* @param key Optional key for element identification
|
|
10
|
-
* @returns Virtual element
|
|
11
|
-
*/
|
|
12
|
-
export function jsx(type, props, key) {
|
|
13
|
-
return createElementJSX(type, props, key);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* JSX transform factory for elements with multiple children.
|
|
17
|
-
* Functionally identical to jsx() in this implementation.
|
|
18
|
-
*/
|
|
19
|
-
export function jsxs(type, props, key) {
|
|
20
|
-
return jsx(type, props, key);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Development mode JSX transform factory.
|
|
24
|
-
* Currently identical to jsx() in this implementation.
|
|
25
|
-
*/
|
|
26
|
-
export function jsxDEV(type, props, key) {
|
|
27
|
-
return jsx(type, props, key);
|
|
28
|
-
}
|
|
29
|
-
export const JSXFragment = Fragment;
|
|
30
|
-
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "webjsx",
|
|
3
|
-
"version": "0.0.73",
|
|
4
|
-
"main": "./dist/index.js",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"author": "Jeswin Kumar<jeswinpk@agilehead.com>",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/webjsx/webjsx"
|
|
10
|
-
},
|
|
11
|
-
"exports": {
|
|
12
|
-
".": "./dist/index.js",
|
|
13
|
-
"./jsx-runtime": "./dist/jsx-runtime.js",
|
|
14
|
-
"./jsx-dev-runtime": "./dist/jsx-dev-runtime.js"
|
|
15
|
-
},
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@eslint/js": "^9.31.0",
|
|
18
|
-
"@types/chai": "^5.2.2",
|
|
19
|
-
"@types/jsdom": "^21.1.7",
|
|
20
|
-
"@types/mocha": "^10.0.10",
|
|
21
|
-
"@types/source-map-support": "^0.5.10",
|
|
22
|
-
"chai": "^5.2.1",
|
|
23
|
-
"eslint": "^9.31.0",
|
|
24
|
-
"globals": "^16.3.0",
|
|
25
|
-
"jsdom": "^26.1.0",
|
|
26
|
-
"mocha": "^11.7.1",
|
|
27
|
-
"source-map-support": "^0.5.21",
|
|
28
|
-
"typescript": "^5.8.3",
|
|
29
|
-
"typescript-eslint": "^8.38.0"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"clean": "rm -rf ./dist",
|
|
33
|
-
"build": "npm run clean && npx tsc",
|
|
34
|
-
"build-dev": "npx tsc",
|
|
35
|
-
"test": "npm run build && npx mocha \"dist/test/**/*.test.js\"",
|
|
36
|
-
"test:grep": "npm run build && npx mocha \"dist/test/**/*.test.js\" --grep"
|
|
37
|
-
},
|
|
38
|
-
"license": "MIT"
|
|
39
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export function definesRenderSuspension(el) {
|
|
2
|
-
return !!el.__webjsx_suspendRendering;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Executes a callback with render suspension handling.
|
|
6
|
-
* @param el Element that may have render suspension
|
|
7
|
-
* @param callback Function to execute during suspension
|
|
8
|
-
* @returns Result of the callback
|
|
9
|
-
*/
|
|
10
|
-
export function withRenderSuspension(el, callback) {
|
|
11
|
-
const isRenderingSuspended = !!el
|
|
12
|
-
.__webjsx_suspendRendering;
|
|
13
|
-
if (isRenderingSuspended) {
|
|
14
|
-
el.__webjsx_suspendRendering();
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
return callback();
|
|
18
|
-
}
|
|
19
|
-
finally {
|
|
20
|
-
if (isRenderingSuspended) {
|
|
21
|
-
el.__webjsx_resumeRendering();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=renderSuspension.js.map
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { HTML_NAMESPACE } from "./constants.js";
|
|
2
|
-
/**
|
|
3
|
-
* Flattens nested virtual nodes by replacing Fragments with their children.
|
|
4
|
-
* @param vnodes Virtual nodes to flatten
|
|
5
|
-
* @returns Array of flattened virtual nodes
|
|
6
|
-
*/
|
|
7
|
-
export function flattenVNodes(vnodes, result = []) {
|
|
8
|
-
if (Array.isArray(vnodes)) {
|
|
9
|
-
for (const vnode of vnodes) {
|
|
10
|
-
flattenVNodes(vnode, result);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
else if (isValidVNode(vnodes)) {
|
|
14
|
-
result.push(vnodes);
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
export function isValidVNode(vnode) {
|
|
19
|
-
const typeofVNode = typeof vnode;
|
|
20
|
-
return (vnode !== null &&
|
|
21
|
-
vnode !== undefined &&
|
|
22
|
-
(typeofVNode === "string" ||
|
|
23
|
-
typeofVNode === "object" ||
|
|
24
|
-
typeofVNode === "number" ||
|
|
25
|
-
typeofVNode === "bigint"));
|
|
26
|
-
}
|
|
27
|
-
/* Get Child Nodes Efficiently */
|
|
28
|
-
export function getChildNodes(parent) {
|
|
29
|
-
const nodes = [];
|
|
30
|
-
let current = parent.firstChild;
|
|
31
|
-
while (current) {
|
|
32
|
-
nodes.push(current);
|
|
33
|
-
current = current.nextSibling;
|
|
34
|
-
}
|
|
35
|
-
return nodes;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Assigns a ref to a DOM node.
|
|
39
|
-
* @param node Target DOM node
|
|
40
|
-
* @param ref Reference to assign (function or object with current property)
|
|
41
|
-
*/
|
|
42
|
-
export function assignRef(node, ref) {
|
|
43
|
-
if (typeof ref === "function") {
|
|
44
|
-
ref(node);
|
|
45
|
-
}
|
|
46
|
-
else if (ref && typeof ref === "object") {
|
|
47
|
-
ref.current = node;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export function isVElement(vnode) {
|
|
51
|
-
const typeofVNode = typeof vnode;
|
|
52
|
-
return (typeofVNode !== "string" &&
|
|
53
|
-
typeofVNode !== "number" &&
|
|
54
|
-
typeofVNode !== "bigint");
|
|
55
|
-
}
|
|
56
|
-
export function isNonBooleanPrimitive(vnode) {
|
|
57
|
-
const typeofVNode = typeof vnode;
|
|
58
|
-
return (typeofVNode === "string" ||
|
|
59
|
-
typeofVNode === "number" ||
|
|
60
|
-
typeofVNode === "bigint");
|
|
61
|
-
}
|
|
62
|
-
export function getNamespaceURI(node) {
|
|
63
|
-
return node instanceof Element && node.namespaceURI !== HTML_NAMESPACE
|
|
64
|
-
? node.namespaceURI ?? undefined
|
|
65
|
-
: undefined;
|
|
66
|
-
}
|
|
67
|
-
export function setWebJSXProps(element, props) {
|
|
68
|
-
element.__webjsx_props = props;
|
|
69
|
-
}
|
|
70
|
-
export function getWebJSXProps(element) {
|
|
71
|
-
let props = element.__webjsx_props;
|
|
72
|
-
if (!props) {
|
|
73
|
-
props = {};
|
|
74
|
-
element.__webjsx_props = props;
|
|
75
|
-
}
|
|
76
|
-
return props;
|
|
77
|
-
}
|
|
78
|
-
export function setWebJSXChildNodeCache(element, childNodes) {
|
|
79
|
-
element.__webjsx_childNodes = childNodes;
|
|
80
|
-
}
|
|
81
|
-
export function getWebJSXChildNodeCache(element) {
|
|
82
|
-
return element.__webjsx_childNodes;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=utils.js.map
|