coralite 0.36.1 → 0.36.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.
Files changed (45) hide show
  1. package/dist/lib/coralite-element.d.ts +0 -7
  2. package/dist/lib/coralite-element.d.ts.map +1 -1
  3. package/dist/lib/coralite-element.js +510 -29
  4. package/dist/lib/coralite-element.js.map +4 -4
  5. package/dist/lib/index.d.ts +0 -1
  6. package/dist/lib/index.d.ts.map +1 -1
  7. package/dist/lib/index.js +5666 -13
  8. package/dist/lib/index.js.map +4 -4
  9. package/dist/lib/utils.d.ts.map +1 -1
  10. package/package.json +3 -12
  11. package/dist/lib/client-runtime.js +0 -62
  12. package/dist/lib/client-runtime.js.map +0 -7
  13. package/dist/lib/collection.js +0 -194
  14. package/dist/lib/collection.js.map +0 -7
  15. package/dist/lib/config.js +0 -43
  16. package/dist/lib/config.js.map +0 -7
  17. package/dist/lib/coralite.js +0 -2064
  18. package/dist/lib/coralite.js.map +0 -7
  19. package/dist/lib/dom.js +0 -496
  20. package/dist/lib/dom.js.map +0 -7
  21. package/dist/lib/errors.js +0 -21
  22. package/dist/lib/errors.js.map +0 -7
  23. package/dist/lib/html.js +0 -149
  24. package/dist/lib/html.js.map +0 -7
  25. package/dist/lib/parse.js +0 -502
  26. package/dist/lib/parse.js.map +0 -7
  27. package/dist/lib/plugin.js +0 -107
  28. package/dist/lib/plugin.js.map +0 -7
  29. package/dist/lib/render-helpers.js +0 -194
  30. package/dist/lib/render-helpers.js.map +0 -7
  31. package/dist/lib/script-manager.js +0 -610
  32. package/dist/lib/script-manager.js.map +0 -7
  33. package/dist/lib/style-transform.js +0 -68
  34. package/dist/lib/style-transform.js.map +0 -7
  35. package/dist/lib/tags.js +0 -255
  36. package/dist/lib/tags.js.map +0 -7
  37. package/dist/lib/type-helper.js +0 -62
  38. package/dist/lib/type-helper.js.map +0 -7
  39. package/dist/lib/utils.js +0 -649
  40. package/dist/lib/utils.js.map +0 -7
  41. package/dist/plugins/index.js +0 -4
  42. package/dist/plugins/metadata.js +0 -84
  43. package/dist/plugins/refs.js +0 -59
  44. package/dist/plugins/static-assets.js +0 -58
  45. package/dist/plugins/testing.js +0 -55
@@ -6,13 +6,6 @@
6
6
  * @returns {any} The coerced value.
7
7
  */
8
8
  export function coerce(value: any, type: Function | string): any;
9
- /**
10
- * Creates a read-only proxy that throws on mutation attempts.
11
- * @param {Object} target - The object to proxy.
12
- * @param {WeakMap} [proxies=new WeakMap()] - Cache for existing proxies.
13
- * @returns {Proxy} The read-only proxy.
14
- */
15
- export function createReadOnlyProxy(target: any, proxies?: WeakMap<any, any>): ProxyConstructor;
16
9
  /**
17
10
  * Factory function to create a Coralite element class.
18
11
  * It dynamically defines the class, including observed attributes and hook initialization.
@@ -1 +1 @@
1
- {"version":3,"file":"coralite-element.d.ts","sourceRoot":"","sources":["../../lib/coralite-element.js"],"names":[],"mappings":"AAsCA;;;;;;GAMG;AACH,8BAJW,GAAG,QACH,WAAS,MAAM,GACb,GAAG,CAmBf;AAED;;;;;GAKG;AACH,gGAwBC;AA2kBD;;;;;;;;;;GAUG;AACH,6CARW,wBAAwB,kBACxB,WAAS,IAAI,UAErB;IAAyE,uBAAuB,GAAxF,KAAK,CAAC,iDAAiD,CAAC;IACQ,sBAAsB,GAAtF,KAAK,CAAC,gDAAgD,CAAC;IACC,cAAc,GAAtE,KAAK,CAAC,wCAAwC,CAAC;CACvD,GAAU,OAAO,eAAe,CA8BlC;AA/mBD;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH;IAOI;;;;OAIG;IACH,4BAHU,eAAe,GAAC,IAAI,CAGF;IAE5B;;;;OAIG;IACH,uBAHU,MAAM,GAAC,IAAI,CAGE;IAEvB;;;;OAIG;IACH,kBAHU,MAAO,IAAI,CAGH;IAElB;;;;OAIG;IACH,qBAHU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAG1D;IAEnB;;;;OAIG;IACH,4BAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iCAHU,MAAM,GAAC,IAAI,CAGY;IAEjC;;;OAGG;IACH,qBAHU,gBAAgB,GAAC,IAAI,CAGV;IAErB;;;;OAIG;IACH,gCAHU,WAAS,IAAI,CAGS;IAEhC;;;;OAIG;IACH,mCAHU;YAAQ,MAAM,GAAE,eAAe;KAAC,GAAC,IAAI,CAGZ;IAEnC;;;;;;;;OAQG;IACH,kBAPU;QACL,uBAAuB,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAClF,sBAAsB,EAAE,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChF,cAAc,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAA;KAChE,CAOH;IAED;;;OAGG;IACH,kBAFU,wBAAwB,GAAC,IAAI,CAEX;IAG9B;;;;OAIG;IACH,0BAsDC;IAED;;;;OAIG;IACH,6BAkBC;IAED;;;;;;;OAOG;IACH,+BAJW,MAAM,UACN,MAAM,GAAC,IAAI,UACX,MAAM,GAAC,IAAI,QAWrB;IAED;;;;;OAKG;IACH,oBA2EC;IAED;;;;;;OAMG;IACH,6BAYC;IAED;;;;;OAKG;IACH,oBAHW,MAAM,EAAE,GACN,IAAI,GAAC,IAAI,CAYrB;IAED;;;;OAIG;IACH,uBAiCC;IAED;;;;OAIG;IACH,wBASC;IAED;;;;;;OAMG;IACH,mBA2GC;IAED;;;;OAIG;IACH,sBA4BC;IAED;;;;;;OAMG;IACH,cA8BC;CACF;;;;;iBApkBa,MAAM;;;;mBACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEA9FV,oBAAoB;sEAApB,oBAAoB;8DAApB,oBAAoB"}
1
+ {"version":3,"file":"coralite-element.d.ts","sourceRoot":"","sources":["../../lib/coralite-element.js"],"names":[],"mappings":"AAuCA;;;;;;GAMG;AACH,8BAJW,GAAG,QACH,WAAS,MAAM,GACb,GAAG,CAmBf;AA0kBD;;;;;;;;;;GAUG;AACH,6CARW,wBAAwB,kBACxB,WAAS,IAAI,UAErB;IAAyE,uBAAuB,GAAxF,KAAK,CAAC,iDAAiD,CAAC;IACQ,sBAAsB,GAAtF,KAAK,CAAC,gDAAgD,CAAC;IACC,cAAc,GAAtE,KAAK,CAAC,wCAAwC,CAAC;CACvD,GAAU,OAAO,eAAe,CA8BlC;AA/mBD;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH;IAOI;;;;OAIG;IACH,4BAHU,eAAe,GAAC,IAAI,CAGF;IAE5B;;;;OAIG;IACH,uBAHU,MAAM,GAAC,IAAI,CAGE;IAEvB;;;;OAIG;IACH,kBAHU,MAAO,IAAI,CAGH;IAElB;;;;OAIG;IACH,qBAHU,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAG1D;IAEnB;;;;OAIG;IACH,4BAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iCAHU,MAAM,GAAC,IAAI,CAGY;IAEjC;;;OAGG;IACH,qBAHU,gBAAgB,GAAC,IAAI,CAGV;IAErB;;;;OAIG;IACH,gCAHU,WAAS,IAAI,CAGS;IAEhC;;;;OAIG;IACH,mCAHU;YAAQ,MAAM,GAAE,eAAe;KAAC,GAAC,IAAI,CAGZ;IAEnC;;;;;;;;OAQG;IACH,kBAPU;QACL,uBAAuB,EAAE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAClF,sBAAsB,EAAE,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChF,cAAc,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAA;KAChE,CAOH;IAED;;;OAGG;IACH,kBAFU,wBAAwB,GAAC,IAAI,CAEX;IAG9B;;;;OAIG;IACH,0BAsDC;IAED;;;;OAIG;IACH,6BAkBC;IAED;;;;;;;OAOG;IACH,+BAJW,MAAM,UACN,MAAM,GAAC,IAAI,UACX,MAAM,GAAC,IAAI,QAWrB;IAED;;;;;OAKG;IACH,oBA2EC;IAED;;;;;;OAMG;IACH,6BAYC;IAED;;;;;OAKG;IACH,oBAHW,MAAM,EAAE,GACN,IAAI,GAAC,IAAI,CAYrB;IAED;;;;OAIG;IACH,uBAiCC;IAED;;;;OAIG;IACH,wBASC;IAED;;;;;;OAMG;IACH,mBA2GC;IAED;;;;OAIG;IACH,sBA4BC;IAED;;;;;;OAMG;IACH,cA8BC;CACF;;;;;iBApkBa,MAAM;;;;mBACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEA/DV,oBAAoB;sEAApB,oBAAoB;8DAApB,oBAAoB"}
@@ -1,4 +1,509 @@
1
- const BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
1
+ // lib/utils.js
2
+ import { parse as parseJS } from "acorn";
3
+ import { simple as walkJS } from "acorn-walk";
4
+ import render from "dom-serializer";
5
+ import { sanitize } from "isomorphic-dompurify";
6
+
7
+ // lib/parse.js
8
+ import { Parser } from "htmlparser2";
9
+
10
+ // lib/dom.js
11
+ var ELEMENT_NODE = 1;
12
+ var TEXT_NODE = 3;
13
+ var COMMENT_NODE = 8;
14
+ var DOCUMENT_NODE = 9;
15
+ var DOCUMENT_TYPE_NODE = 10;
16
+ var nodeTypes = {
17
+ tag: ELEMENT_NODE,
18
+ script: ELEMENT_NODE,
19
+ style: ELEMENT_NODE,
20
+ text: TEXT_NODE,
21
+ comment: COMMENT_NODE,
22
+ root: DOCUMENT_NODE,
23
+ directive: DOCUMENT_TYPE_NODE
24
+ };
25
+ function CoraliteNodeConstructor(node) {
26
+ for (const key in node) {
27
+ if (["parent", "prev", "next", "slots"].includes(key)) {
28
+ Object.defineProperty(this, key, {
29
+ value: node[key],
30
+ enumerable: false,
31
+ writable: true,
32
+ configurable: true
33
+ });
34
+ } else {
35
+ this[key] = node[key];
36
+ }
37
+ }
38
+ }
39
+ function makeCircularPropertiesNonEnumerable(node) {
40
+ for (const key of ["parent", "prev", "next", "slots"]) {
41
+ if (Object.hasOwn(node, key)) {
42
+ const value = node[key];
43
+ delete node[key];
44
+ Object.defineProperty(node, key, {
45
+ value,
46
+ enumerable: false,
47
+ writable: true,
48
+ configurable: true
49
+ });
50
+ }
51
+ }
52
+ }
53
+ Object.defineProperties(CoraliteNodeConstructor.prototype, {
54
+ nodeType: {
55
+ /**
56
+ * Returns an integer identifying the type of the node.
57
+ * @returns {number}
58
+ */
59
+ get() {
60
+ return nodeTypes[this.type] || ELEMENT_NODE;
61
+ }
62
+ },
63
+ parentNode: {
64
+ /**
65
+ * Returns the parent of the specified node in the DOM tree.
66
+ * @returns {CoraliteAnyNode | CoraliteComponentRoot}
67
+ */
68
+ get() {
69
+ return this.parent;
70
+ },
71
+ /**
72
+ * Sets the parent of the node.
73
+ * @param {CoraliteAnyNode | CoraliteComponentRoot} value - The parent node to set
74
+ */
75
+ set(value) {
76
+ this.parent = value;
77
+ }
78
+ },
79
+ parentElement: {
80
+ /**
81
+ * Returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element.
82
+ * @returns {CoraliteAnyNode | CoraliteComponentRoot}
83
+ */
84
+ get() {
85
+ return this.parent;
86
+ },
87
+ /**
88
+ * Sets the parent element of the node.
89
+ * @param {CoraliteAnyNode | CoraliteComponentRoot} value - The parent element to set
90
+ */
91
+ set(value) {
92
+ this.parent = value;
93
+ }
94
+ },
95
+ previousSibling: {
96
+ /**
97
+ * Returns the node immediately preceding the specified one in its parent's childNodes list, or null if the specified node is the first in that list.
98
+ * @returns {CoraliteAnyNode | null}
99
+ */
100
+ get() {
101
+ if (!this.parent || !this.parent.children) {
102
+ return null;
103
+ }
104
+ const index = this.parent.children.indexOf(this);
105
+ return index > 0 ? this.parent.children[index - 1] : null;
106
+ }
107
+ },
108
+ nextSibling: {
109
+ /**
110
+ * Returns the node immediately following the specified one in its parent's childNodes list, or null if the specified node is the last node in that list.
111
+ * @returns {CoraliteAnyNode | null}
112
+ */
113
+ get() {
114
+ if (!this.parent || !this.parent.children) {
115
+ return null;
116
+ }
117
+ const index = this.parent.children.indexOf(this);
118
+ return index > -1 && index < this.parent.children.length - 1 ? this.parent.children[index + 1] : null;
119
+ }
120
+ }
121
+ });
122
+ function CoraliteElementConstructor(node) {
123
+ CoraliteNodeConstructor.call(this, node);
124
+ }
125
+ CoraliteElementConstructor.prototype = Object.create(CoraliteNodeConstructor.prototype);
126
+ CoraliteElementConstructor.prototype.constructor = CoraliteElementConstructor;
127
+ Object.defineProperties(CoraliteElementConstructor.prototype, {
128
+ nodeName: {
129
+ /**
130
+ * Returns the name of the node (uppercase tag name for elements).
131
+ * @returns {string}
132
+ */
133
+ get() {
134
+ return this.name.toUpperCase();
135
+ }
136
+ },
137
+ tagName: {
138
+ /**
139
+ * Returns the tag name of the element (uppercase).
140
+ * @returns {string}
141
+ */
142
+ get() {
143
+ return this.name.toUpperCase();
144
+ },
145
+ /**
146
+ * Sets the tag name of the element (converted to lowercase).
147
+ * @param {string} value - The tag name to set
148
+ */
149
+ set(value) {
150
+ this.name = value.toLowerCase();
151
+ }
152
+ },
153
+ nodeValue: {
154
+ /**
155
+ * Returns null for elements.
156
+ * @returns {null}
157
+ */
158
+ get() {
159
+ return null;
160
+ },
161
+ /**
162
+ * Setting nodeValue on an element has no effect.
163
+ */
164
+ set(value) {
165
+ }
166
+ },
167
+ attributes: {
168
+ /**
169
+ * Returns a collection of the element's attributes.
170
+ * @returns {Object.<string, string>}
171
+ */
172
+ get() {
173
+ return this.attribs;
174
+ },
175
+ /**
176
+ * Sets the attributes of the element.
177
+ * @param {Object.<string, string>} value - The attributes object to set
178
+ */
179
+ set(value) {
180
+ this.attribs = value;
181
+ }
182
+ },
183
+ childNodes: {
184
+ /**
185
+ * Returns a live collection of child nodes of the given element.
186
+ * @returns {CoraliteAnyNode[]}
187
+ */
188
+ get() {
189
+ return this.children || [];
190
+ },
191
+ /**
192
+ * Sets the child nodes of the element.
193
+ * @param {CoraliteAnyNode[]} value - The array of child nodes to set
194
+ */
195
+ set(value) {
196
+ this.children = value;
197
+ }
198
+ },
199
+ firstChild: {
200
+ /**
201
+ * Returns the node's first child in the tree, or null if the node has no children.
202
+ * @returns {CoraliteAnyNode | null}
203
+ */
204
+ get() {
205
+ return this.children && this.children.length > 0 ? this.children[0] : null;
206
+ }
207
+ },
208
+ lastChild: {
209
+ /**
210
+ * Returns the last child of the node, or null if there are no child nodes.
211
+ * @returns {CoraliteAnyNode | null}
212
+ */
213
+ get() {
214
+ return this.children && this.children.length > 0 ? this.children[this.children.length - 1] : null;
215
+ }
216
+ },
217
+ textContent: {
218
+ /**
219
+ * Returns the text content of the node and its descendants.
220
+ * @returns {string}
221
+ */
222
+ get() {
223
+ if (this.children) {
224
+ return this.children.map((child) => child.textContent).join("");
225
+ }
226
+ return "";
227
+ },
228
+ /**
229
+ * Sets the text content of the node. Replaces all children with a single text node.
230
+ * @param {string} value - The text content to set
231
+ */
232
+ set(value) {
233
+ const textNode = createCoraliteTextNode({
234
+ type: "text",
235
+ data: value,
236
+ parent: this
237
+ });
238
+ this.children = [textNode];
239
+ }
240
+ },
241
+ id: {
242
+ /**
243
+ * Returns the element's ID attribute.
244
+ * @returns {string}
245
+ */
246
+ get() {
247
+ return this.attribs ? this.attribs.id : "";
248
+ },
249
+ /**
250
+ * Sets the element's ID attribute.
251
+ * @param {string} value - The ID to set
252
+ */
253
+ set(value) {
254
+ if (this.attribs) {
255
+ this.attribs.id = value;
256
+ }
257
+ }
258
+ },
259
+ className: {
260
+ /**
261
+ * Returns the element's class attribute.
262
+ * @returns {string}
263
+ */
264
+ get() {
265
+ return this.attribs ? this.attribs.class : "";
266
+ },
267
+ /**
268
+ * Sets the element's class attribute.
269
+ * @param {string} value - The class names to set
270
+ */
271
+ set(value) {
272
+ if (this.attribs) {
273
+ this.attribs.class = value;
274
+ }
275
+ }
276
+ }
277
+ });
278
+ function CoraliteTextNodeConstructor(node) {
279
+ CoraliteNodeConstructor.call(this, node);
280
+ }
281
+ CoraliteTextNodeConstructor.prototype = Object.create(CoraliteNodeConstructor.prototype);
282
+ CoraliteTextNodeConstructor.prototype.constructor = CoraliteTextNodeConstructor;
283
+ Object.defineProperties(CoraliteTextNodeConstructor.prototype, {
284
+ nodeName: {
285
+ /**
286
+ * Returns the name of the node (#text).
287
+ * @returns {string}
288
+ */
289
+ get() {
290
+ return "#text";
291
+ }
292
+ },
293
+ nodeValue: {
294
+ /**
295
+ * Returns the text content of the node.
296
+ * @returns {string}
297
+ */
298
+ get() {
299
+ return this.data;
300
+ },
301
+ /**
302
+ * Sets the text content of the node.
303
+ * @param {string} value - The text content to set
304
+ */
305
+ set(value) {
306
+ this.data = value;
307
+ }
308
+ },
309
+ textContent: {
310
+ /**
311
+ * Returns the text content of the node.
312
+ * @returns {string}
313
+ */
314
+ get() {
315
+ return this.data;
316
+ },
317
+ /**
318
+ * Sets the text content of the node.
319
+ * @param {string} value - The text content to set
320
+ */
321
+ set(value) {
322
+ this.data = value;
323
+ }
324
+ }
325
+ });
326
+ function createCoraliteTextNode(node) {
327
+ makeCircularPropertiesNonEnumerable(node);
328
+ Object.setPrototypeOf(node, CoraliteTextNodeConstructor.prototype);
329
+ return node;
330
+ }
331
+ function CoraliteCommentConstructor(node) {
332
+ CoraliteNodeConstructor.call(this, node);
333
+ }
334
+ CoraliteCommentConstructor.prototype = Object.create(CoraliteNodeConstructor.prototype);
335
+ CoraliteCommentConstructor.prototype.constructor = CoraliteCommentConstructor;
336
+ Object.defineProperties(CoraliteCommentConstructor.prototype, {
337
+ nodeName: {
338
+ /**
339
+ * Returns the name of the node (#comment).
340
+ * @returns {string}
341
+ */
342
+ get() {
343
+ return "#comment";
344
+ }
345
+ },
346
+ nodeValue: {
347
+ /**
348
+ * Returns the content of the comment.
349
+ * @returns {string}
350
+ */
351
+ get() {
352
+ return this.data;
353
+ },
354
+ /**
355
+ * Sets the content of the comment.
356
+ * @param {string} value - The content to set
357
+ */
358
+ set(value) {
359
+ this.data = value;
360
+ }
361
+ },
362
+ textContent: {
363
+ /**
364
+ * Returns the content of the comment.
365
+ * @returns {string}
366
+ */
367
+ get() {
368
+ return this.data;
369
+ },
370
+ /**
371
+ * Sets the content of the comment.
372
+ * @param {string} value - The content to set
373
+ */
374
+ set(value) {
375
+ this.data = value;
376
+ }
377
+ }
378
+ });
379
+ function CoraliteDirectiveConstructor(node) {
380
+ CoraliteNodeConstructor.call(this, node);
381
+ }
382
+ CoraliteDirectiveConstructor.prototype = Object.create(CoraliteNodeConstructor.prototype);
383
+ CoraliteDirectiveConstructor.prototype.constructor = CoraliteDirectiveConstructor;
384
+ Object.defineProperties(CoraliteDirectiveConstructor.prototype, {
385
+ nodeName: {
386
+ /**
387
+ * Returns the name of the directive (e.g., !DOCTYPE).
388
+ * @returns {string}
389
+ */
390
+ get() {
391
+ return this.name;
392
+ }
393
+ },
394
+ nodeValue: {
395
+ /**
396
+ * Returns the content of the directive.
397
+ * @returns {string}
398
+ */
399
+ get() {
400
+ return this.data;
401
+ },
402
+ /**
403
+ * Sets the content of the directive.
404
+ * @param {string} value - The content to set
405
+ */
406
+ set(value) {
407
+ this.data = value;
408
+ }
409
+ }
410
+ });
411
+ function CoraliteComponentConstructor(node) {
412
+ CoraliteNodeConstructor.call(this, node);
413
+ }
414
+ CoraliteComponentConstructor.prototype = Object.create(CoraliteNodeConstructor.prototype);
415
+ CoraliteComponentConstructor.prototype.constructor = CoraliteComponentConstructor;
416
+ Object.defineProperties(CoraliteComponentConstructor.prototype, {
417
+ nodeName: {
418
+ /**
419
+ * Returns the name of the node (#document).
420
+ * @returns {string}
421
+ */
422
+ get() {
423
+ return "#document";
424
+ }
425
+ },
426
+ nodeValue: {
427
+ /**
428
+ * Returns null for document nodes.
429
+ * @returns {null}
430
+ */
431
+ get() {
432
+ return null;
433
+ }
434
+ },
435
+ childNodes: {
436
+ /**
437
+ * Returns a live collection of child nodes of the document.
438
+ * @returns {CoraliteAnyNode[]}
439
+ */
440
+ get() {
441
+ return this.children || [];
442
+ },
443
+ /**
444
+ * Sets the child nodes of the document.
445
+ * @param {CoraliteAnyNode[]} value - The array of child nodes to set
446
+ */
447
+ set(value) {
448
+ this.children = value;
449
+ }
450
+ },
451
+ firstChild: {
452
+ /**
453
+ * Returns the document's first child in the tree, or null if the document has no children.
454
+ * @returns {CoraliteAnyNode | null}
455
+ */
456
+ get() {
457
+ return this.children && this.children.length > 0 ? this.children[0] : null;
458
+ }
459
+ },
460
+ lastChild: {
461
+ /**
462
+ * Returns the last child of the document, or null if there are no child nodes.
463
+ * @returns {CoraliteAnyNode | null}
464
+ */
465
+ get() {
466
+ return this.children && this.children.length > 0 ? this.children[this.children.length - 1] : null;
467
+ }
468
+ },
469
+ textContent: {
470
+ /**
471
+ * Returns null for document nodes.
472
+ * @returns {null}
473
+ */
474
+ get() {
475
+ return null;
476
+ }
477
+ }
478
+ });
479
+
480
+ // lib/utils.js
481
+ function createReadOnlyProxy(target, proxies = /* @__PURE__ */ new WeakMap()) {
482
+ if (proxies.has(target)) {
483
+ return proxies.get(target);
484
+ }
485
+ const handler = {
486
+ get(target2, property, receiver) {
487
+ const value = Reflect.get(target2, property, receiver);
488
+ if (value !== null && typeof value === "object" && !(typeof Node !== "undefined" && value instanceof Node)) {
489
+ return createReadOnlyProxy(value, proxies);
490
+ }
491
+ return value;
492
+ },
493
+ set() {
494
+ throw new Error("Coralite Error: Cannot mutate state inside a getter. State is read-only here.");
495
+ },
496
+ deleteProperty() {
497
+ throw new Error("Coralite Error: Cannot delete state inside a getter. State is read-only here.");
498
+ }
499
+ };
500
+ const proxy = new Proxy(target, handler);
501
+ proxies.set(target, proxy);
502
+ return proxy;
503
+ }
504
+
505
+ // lib/coralite-element.js
506
+ var BOOLEAN_ATTRIBUTES2 = /* @__PURE__ */ new Set([
2
507
  "allowfullscreen",
3
508
  "async",
4
509
  "autofocus",
@@ -44,30 +549,7 @@ function coerce(value, type) {
44
549
  }
45
550
  return value;
46
551
  }
47
- function createReadOnlyProxy(target, proxies = /* @__PURE__ */ new WeakMap()) {
48
- if (proxies.has(target)) {
49
- return proxies.get(target);
50
- }
51
- const handler = {
52
- get(target2, property, receiver) {
53
- const value = Reflect.get(target2, property, receiver);
54
- if (value !== null && typeof value === "object" && !(typeof Node !== "undefined" && value instanceof Node)) {
55
- return createReadOnlyProxy(value, proxies);
56
- }
57
- return value;
58
- },
59
- set() {
60
- throw new Error("Coralite Error: Cannot mutate state inside a getter. State is read-only here.");
61
- },
62
- deleteProperty() {
63
- throw new Error("Coralite Error: Cannot delete state inside a getter. State is read-only here.");
64
- }
65
- };
66
- const proxy = new Proxy(target, handler);
67
- proxies.set(target, proxy);
68
- return proxy;
69
- }
70
- class CoraliteElement extends HTMLElement {
552
+ var CoraliteElement = class extends HTMLElement {
71
553
  /**
72
554
  * Initializes a new instance of the CoraliteElement.
73
555
  * Sets up internal state trackers, binding collections, and hook registries.
@@ -375,7 +857,7 @@ class CoraliteElement extends HTMLElement {
375
857
  }
376
858
  } else if (binding.type === "attribute") {
377
859
  const element = binding.node;
378
- if (BOOLEAN_ATTRIBUTES.has(binding.name)) {
860
+ if (BOOLEAN_ATTRIBUTES2.has(binding.name)) {
379
861
  const isFalsy = hydratedValue === "" || hydratedValue === "false" || hydratedValue === "null" || hydratedValue === "0" || hydratedValue === "undefined";
380
862
  if (isFalsy) {
381
863
  element.removeAttribute(binding.name);
@@ -476,7 +958,7 @@ class CoraliteElement extends HTMLElement {
476
958
  }
477
959
  }
478
960
  }
479
- }
961
+ };
480
962
  function createCoraliteClass(options, contextGetter = null, hooks = {}) {
481
963
  return class extends CoraliteElement {
482
964
  /**
@@ -509,7 +991,6 @@ function createCoraliteClass(options, contextGetter = null, hooks = {}) {
509
991
  export {
510
992
  CoraliteElement,
511
993
  coerce,
512
- createCoraliteClass,
513
- createReadOnlyProxy
994
+ createCoraliteClass
514
995
  };
515
996
  //# sourceMappingURL=coralite-element.js.map