@ecopages/radiant 0.3.0-beta.2 → 0.3.0-beta.3
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 +11 -7
- package/client/app-bootstrap.js +2 -2
- package/client/app-bootstrap.js.map +2 -2
- package/client/hydrator.js +2 -2
- package/client/hydrator.js.map +2 -2
- package/client/install-hydrator.js +2 -2
- package/client/install-hydrator.js.map +2 -2
- package/context/context-consumer-bootstrap.js +2 -2
- package/context/context-consumer-bootstrap.js.map +4 -4
- package/context/context-consumer-runtime.js +2 -2
- package/context/context-consumer-runtime.js.map +4 -4
- package/context/context-host.js +2 -2
- package/context/context-host.js.map +2 -2
- package/context/context-provider.js +2 -2
- package/context/context-provider.js.map +2 -2
- package/context/context-ssr-bridge.d.ts +1 -1
- package/context/context-ssr-bridge.js +2 -2
- package/context/context-ssr-bridge.js.map +3 -3
- package/context/create-context.js +2 -2
- package/context/create-context.js.map +2 -2
- package/context/decorators/consume-context.js +2 -2
- package/context/decorators/consume-context.js.map +4 -4
- package/context/decorators/context-selection-delivery.js +2 -2
- package/context/decorators/context-selection-delivery.js.map +2 -2
- package/context/decorators/context-selector.js +2 -2
- package/context/decorators/context-selector.js.map +4 -4
- package/context/decorators/legacy/consume-context.js +2 -2
- package/context/decorators/legacy/consume-context.js.map +4 -4
- package/context/decorators/legacy/context-selector-field.js +2 -2
- package/context/decorators/legacy/context-selector-field.js.map +4 -4
- package/context/decorators/legacy/context-selector.js +2 -2
- package/context/decorators/legacy/context-selector.js.map +4 -4
- package/context/decorators/legacy/provide-context.js +2 -2
- package/context/decorators/legacy/provide-context.js.map +2 -2
- package/context/decorators/on-context-update.js +2 -2
- package/context/decorators/on-context-update.js.map +4 -4
- package/context/decorators/provide-context.js +2 -2
- package/context/decorators/provide-context.js.map +2 -2
- package/context/decorators/standard/consume-context.js +2 -2
- package/context/decorators/standard/consume-context.js.map +4 -4
- package/context/decorators/standard/context-selector-field.js +2 -2
- package/context/decorators/standard/context-selector-field.js.map +4 -4
- package/context/decorators/standard/context-selector.js +2 -2
- package/context/decorators/standard/context-selector.js.map +4 -4
- package/context/decorators/standard/provide-context.js +2 -2
- package/context/decorators/standard/provide-context.js.map +2 -2
- package/context/decorators/standard-legacy-dispatch.js +2 -2
- package/context/decorators/standard-legacy-dispatch.js.map +2 -2
- package/context/events.js +2 -2
- package/context/events.js.map +2 -2
- package/context/hydration-script.js +2 -2
- package/context/hydration-script.js.map +2 -2
- package/context/index.js +2 -2
- package/context/index.js.map +4 -4
- package/controller-registry.js +2 -2
- package/controller-registry.js.map +2 -2
- package/core/controller-metadata.js +2 -2
- package/core/controller-metadata.js.map +2 -2
- package/core/custom-element-metadata.js +2 -2
- package/core/custom-element-metadata.js.map +2 -2
- package/core/event-subscription-registry.js +2 -2
- package/core/event-subscription-registry.js.map +2 -2
- package/core/host-ssr-registry.js +2 -2
- package/core/host-ssr-registry.js.map +2 -2
- package/core/hydration-capable-host.js +2 -2
- package/core/hydration-capable-host.js.map +2 -2
- package/core/hydration-codec.js +2 -2
- package/core/hydration-codec.js.map +2 -2
- package/core/radiant-controller.js +2 -2
- package/core/radiant-controller.js.map +2 -2
- package/core/radiant-element-brand.d.ts +2 -0
- package/core/radiant-element-brand.js +3 -0
- package/core/radiant-element-brand.js.map +10 -0
- package/core/radiant-element-ssr-host-source.d.ts +32 -0
- package/core/radiant-element-ssr-host-source.js +3 -0
- package/core/radiant-element-ssr-host-source.js.map +11 -0
- package/core/radiant-element-ssr-host.d.ts +5 -6
- package/core/radiant-element-ssr-host.js +1 -2
- package/core/radiant-element-ssr-host.js.map +3 -4
- package/core/radiant-element-ssr-registry.d.ts +24 -11
- package/core/radiant-element-ssr-registry.js +2 -2
- package/core/radiant-element-ssr-registry.js.map +3 -3
- package/core/radiant-element.d.ts +5 -3
- package/core/radiant-element.js +2 -2
- package/core/radiant-element.js.map +6 -5
- package/core/radiant-hydrator-state.js +2 -2
- package/core/radiant-hydrator-state.js.map +2 -2
- package/core/reactive-binding-adapter.js +2 -2
- package/core/reactive-binding-adapter.js.map +2 -2
- package/core/reactive-host.js +2 -2
- package/core/reactive-host.js.map +2 -2
- package/core/reactive-jsx-value.js +2 -2
- package/core/reactive-jsx-value.js.map +2 -2
- package/core/reactive-prop-core.js +2 -2
- package/core/reactive-prop-core.js.map +2 -2
- package/core/reactive-prop-metadata.js +2 -2
- package/core/reactive-prop-metadata.js.map +2 -2
- package/core/reactive-property-state.js +2 -2
- package/core/reactive-property-state.js.map +2 -2
- package/core/reactivity-adapter.js +2 -2
- package/core/reactivity-adapter.js.map +2 -2
- package/core/reactivity-runtime.js +2 -2
- package/core/reactivity-runtime.js.map +2 -2
- package/core/reactivity-signals.js +2 -2
- package/core/reactivity-signals.js.map +2 -2
- package/core/render-runtime.js +2 -2
- package/core/render-runtime.js.map +2 -2
- package/core/render-scheduler.js +2 -2
- package/core/render-scheduler.js.map +2 -2
- package/core/slot-projection-runtime.js +2 -2
- package/core/slot-projection-runtime.js.map +2 -2
- package/core/ssr-preparation.js +2 -2
- package/core/ssr-preparation.js.map +2 -2
- package/decorators/attr.js +2 -2
- package/decorators/attr.js.map +2 -2
- package/decorators/bound.js +2 -2
- package/decorators/bound.js.map +2 -2
- package/decorators/bridge.js +2 -2
- package/decorators/bridge.js.map +2 -2
- package/decorators/controller.js +2 -2
- package/decorators/controller.js.map +2 -2
- package/decorators/custom-element.js +2 -2
- package/decorators/custom-element.js.map +2 -2
- package/decorators/debounce.js +2 -2
- package/decorators/debounce.js.map +2 -2
- package/decorators/event.js +2 -2
- package/decorators/event.js.map +2 -2
- package/decorators/legacy/attr.js +2 -2
- package/decorators/legacy/attr.js.map +2 -2
- package/decorators/legacy/bound.js +2 -2
- package/decorators/legacy/bound.js.map +2 -2
- package/decorators/legacy/custom-element.js +2 -2
- package/decorators/legacy/custom-element.js.map +2 -2
- package/decorators/legacy/debounce.js +2 -2
- package/decorators/legacy/debounce.js.map +2 -2
- package/decorators/legacy/event.js +2 -2
- package/decorators/legacy/event.js.map +2 -2
- package/decorators/legacy/host-readiness.js +2 -2
- package/decorators/legacy/host-readiness.js.map +2 -2
- package/decorators/legacy/instance-initializers.js +2 -2
- package/decorators/legacy/instance-initializers.js.map +2 -2
- package/decorators/legacy/member-bootstrap.js +2 -2
- package/decorators/legacy/member-bootstrap.js.map +2 -2
- package/decorators/legacy/on-event.js +2 -2
- package/decorators/legacy/on-event.js.map +2 -2
- package/decorators/legacy/on-updated.js +2 -2
- package/decorators/legacy/on-updated.js.map +2 -2
- package/decorators/legacy/query-slot.js +2 -2
- package/decorators/legacy/query-slot.js.map +2 -2
- package/decorators/legacy/query.js +2 -2
- package/decorators/legacy/query.js.map +2 -2
- package/decorators/legacy/reactive-field.js +2 -2
- package/decorators/legacy/reactive-field.js.map +2 -2
- package/decorators/legacy/reactive-prop.js +2 -2
- package/decorators/legacy/reactive-prop.js.map +2 -2
- package/decorators/legacy/signal.js +2 -2
- package/decorators/legacy/signal.js.map +2 -2
- package/decorators/on-event.js +2 -2
- package/decorators/on-event.js.map +2 -2
- package/decorators/on-updated.js +2 -2
- package/decorators/on-updated.js.map +2 -2
- package/decorators/prop.js +2 -2
- package/decorators/prop.js.map +2 -2
- package/decorators/query-slot.js +2 -2
- package/decorators/query-slot.js.map +2 -2
- package/decorators/query.js +2 -2
- package/decorators/query.js.map +2 -2
- package/decorators/shared/auto-bind.js +2 -2
- package/decorators/shared/auto-bind.js.map +2 -2
- package/decorators/shared/reactive-attr.js +2 -2
- package/decorators/shared/reactive-attr.js.map +2 -2
- package/decorators/signal.js +2 -2
- package/decorators/signal.js.map +2 -2
- package/decorators/standard/attr.js +2 -2
- package/decorators/standard/attr.js.map +2 -2
- package/decorators/standard/bound.js +2 -2
- package/decorators/standard/bound.js.map +2 -2
- package/decorators/standard/custom-element.js +2 -2
- package/decorators/standard/custom-element.js.map +2 -2
- package/decorators/standard/debounce.js +2 -2
- package/decorators/standard/debounce.js.map +2 -2
- package/decorators/standard/event.js +2 -2
- package/decorators/standard/event.js.map +2 -2
- package/decorators/standard/on-event.js +2 -2
- package/decorators/standard/on-event.js.map +2 -2
- package/decorators/standard/on-updated.js +2 -2
- package/decorators/standard/on-updated.js.map +2 -2
- package/decorators/standard/query-slot.js +2 -2
- package/decorators/standard/query-slot.js.map +2 -2
- package/decorators/standard/query.js +2 -2
- package/decorators/standard/query.js.map +2 -2
- package/decorators/standard/reactive-field.js +2 -2
- package/decorators/standard/reactive-field.js.map +2 -2
- package/decorators/standard/reactive-prop.js +2 -2
- package/decorators/standard/reactive-prop.js.map +2 -2
- package/decorators/standard/signal.js +2 -2
- package/decorators/standard/signal.js.map +2 -2
- package/decorators/state.js +2 -2
- package/decorators/state.js.map +2 -2
- package/helpers/create-event-listener.js +2 -2
- package/helpers/create-event-listener.js.map +2 -2
- package/helpers/create-event.js +2 -2
- package/helpers/create-event.js.map +2 -2
- package/helpers/create-query-slot.js +2 -2
- package/helpers/create-query-slot.js.map +2 -2
- package/helpers/create-query.js +2 -2
- package/helpers/create-query.js.map +2 -2
- package/helpers/debounce.js +2 -2
- package/helpers/debounce.js.map +2 -2
- package/helpers/index.js +2 -2
- package/helpers/index.js.map +2 -2
- package/index.js +2 -2
- package/index.js.map +6 -5
- package/package.json +13 -3
- package/server/assert-light-dom-ssr.d.ts +10 -0
- package/server/assert-light-dom-ssr.js +3 -0
- package/server/assert-light-dom-ssr.js.map +10 -0
- package/server/context-ssr.d.ts +8 -19
- package/server/context-ssr.js +2 -2
- package/server/context-ssr.js.map +5 -5
- package/server/host-attribute-serialization.js +2 -2
- package/server/host-attribute-serialization.js.map +4 -4
- package/server/host-script-composition.js +2 -2
- package/server/host-script-composition.js.map +2 -2
- package/server/html-parser.js +2 -2
- package/server/html-parser.js.map +2 -2
- package/server/install-light-dom-shim.d.ts +2 -1
- package/server/install-light-dom-shim.js +2 -2
- package/server/install-light-dom-shim.js.map +9 -8
- package/server/install-ssr-runtime.d.ts +8 -0
- package/server/install-ssr-runtime.js +3 -0
- package/server/install-ssr-runtime.js.map +21 -0
- package/server/install-ssr-scope-adapters.d.ts +1 -0
- package/server/install-ssr-scope-adapters.js +3 -0
- package/server/install-ssr-scope-adapters.js.map +11 -0
- package/server/light-dom-shim.js +2 -2
- package/server/light-dom-shim.js.map +8 -7
- package/server/minimal-dom/dataset.d.ts +2 -0
- package/server/minimal-dom/dataset.js +3 -0
- package/server/minimal-dom/dataset.js.map +10 -0
- package/server/minimal-dom/document.js +2 -2
- package/server/minimal-dom/document.js.map +5 -6
- package/server/minimal-dom/html.d.ts +1 -2
- package/server/minimal-dom/html.js +2 -2
- package/server/minimal-dom/html.js.map +6 -5
- package/server/minimal-dom/install.d.ts +1 -0
- package/server/minimal-dom/install.js +2 -2
- package/server/minimal-dom/install.js.map +8 -7
- package/server/minimal-dom/nodes.d.ts +9 -0
- package/server/minimal-dom/nodes.js +3 -0
- package/server/minimal-dom/nodes.js.map +12 -0
- package/server/project-root.js +2 -2
- package/server/project-root.js.map +4 -5
- package/server/radiant-element-ssr-bridge.d.ts +9 -9
- package/server/radiant-element-ssr-bridge.js +2 -2
- package/server/radiant-element-ssr-bridge.js.map +27 -14
- package/server/radiant-element-ssr-extractor.d.ts +5 -1
- package/server/radiant-element-ssr-extractor.js +2 -2
- package/server/radiant-element-ssr-extractor.js.map +6 -5
- package/server/radiant-element-ssr-service.d.ts +4 -1
- package/server/radiant-element-ssr-service.js +2 -2
- package/server/radiant-element-ssr-service.js.map +15 -12
- package/server/radiant-element-ssr.d.ts +1 -1
- package/server/radiant-element-ssr.js +2 -2
- package/server/radiant-element-ssr.js.map +27 -14
- package/server/render-component.d.ts +3 -5
- package/server/render-component.js +2 -2
- package/server/render-component.js.map +27 -20
- package/server/render-controller.d.ts +1 -0
- package/server/render-controller.js +2 -2
- package/server/render-controller.js.map +30 -23
- package/server/render-fragment.js +2 -2
- package/server/render-fragment.js.map +2 -2
- package/server/slot-projection-html.js +2 -2
- package/server/slot-projection-html.js.map +5 -6
- package/signals/host-resource.js +2 -2
- package/signals/host-resource.js.map +2 -2
- package/signals/host-signal.js +2 -2
- package/signals/host-signal.js.map +2 -2
- package/signals/hydration-script.js +2 -2
- package/signals/hydration-script.js.map +2 -2
- package/tools/escape-css-identifier.js +2 -2
- package/tools/escape-css-identifier.js.map +2 -2
- package/tools/escape-script-json.js +2 -2
- package/tools/escape-script-json.js.map +2 -2
- package/tools/event-emitter.js +2 -2
- package/tools/event-emitter.js.map +2 -2
- package/tools/index.js +2 -2
- package/tools/index.js.map +2 -2
- package/tools/render-jsx-template.js +2 -2
- package/tools/render-jsx-template.js.map +2 -2
- package/types.js +2 -2
- package/types.js.map +2 -2
- package/utils/attribute-utils.js +2 -2
- package/utils/attribute-utils.js.map +2 -2
- package/utils/escape-html-attribute.js +2 -2
- package/utils/escape-html-attribute.js.map +2 -2
- package/utils/index.js +2 -2
- package/utils/index.js.map +2 -2
- package/server/internal-radiant-host.d.ts +0 -2
- package/server/internal-radiant-host.js +0 -3
- package/server/internal-radiant-host.js.map +0 -9
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/utils/escape-html-attribute.ts", "../src/core/reactive-prop-metadata.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/decorators/legacy/host-readiness.ts", "../src/
|
|
3
|
+
"sources": ["../src/utils/attribute-utils.ts", "../src/utils/escape-html-attribute.ts", "../src/server/host-attribute-serialization.ts", "../src/server/context-ssr.ts", "../src/context/context-ssr-bridge.ts", "../src/server/host-script-composition.ts", "../src/server/assert-light-dom-ssr.ts", "../src/core/reactive-prop-metadata.ts", "../src/core/radiant-element-brand.ts", "../src/core/radiant-element-ssr-host-source.ts", "../src/server/radiant-element-ssr-extractor.ts", "../src/core/custom-element-metadata.ts", "../src/core/ssr-preparation.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/decorators/legacy/host-readiness.ts", "../src/server/radiant-element-ssr-service.ts", "../src/server/install-ssr-scope-adapters.ts", "../src/core/radiant-element-ssr-registry.ts", "../src/server/minimal-dom/dataset.ts", "../src/server/minimal-dom/nodes.ts", "../src/server/minimal-dom/document.ts", "../src/server/html-parser.ts", "../src/server/minimal-dom/html.ts", "../src/tools/escape-css-identifier.ts", "../src/server/minimal-dom/install.ts", "../src/server/install-light-dom-shim.ts", "../src/server/install-ssr-runtime.ts", "../src/server/radiant-element-ssr-bridge.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n",
|
|
5
6
|
"/** Escapes a string for safe interpolation inside a double-quoted HTML attribute value. */\nexport function escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');\n}\n",
|
|
7
|
+
"import type { ReactiveProperty } from '../core/reactive-prop-core';\nimport type { ReactivePropDefinition } from '../core/reactive-prop-metadata';\nimport { writeAttributeValue } from '../utils/attribute-utils';\nimport { escapeHtmlAttribute } from '../utils/escape-html-attribute';\n\n/**\n * Minimal host shape needed by the attribute serialization policy.\n *\n * This interface defines the narrow contract that the serialization module\n * consumes, keeping it independent of the full {@link RadiantElementSsrHost}.\n */\nexport type HostAttributeSource = {\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tgetAttributeNames: () => string[];\n\tgetAttribute: (name: string) => string | null;\n};\n\n/**\n * Resolves the final set of SSR host attributes from a Radiant Element Host.\n *\n * ## Source precedence (highest to lowest)\n *\n * 1. **Reactive properties** — legacy attribute reflection via `property.converter`.\n * These are already-registered reactive properties with established converters.\n * Falsy values (`undefined`, `null`, `false`) are omitted.\n *\n * 2. **Reactive prop definitions** — decorator-based definitions. Skipped when the\n * target attribute name was already emitted by source 1 (dedup via `seenAttributes`).\n * Uses `writeAttributeValue` for type-aware conversion.\n *\n * 3. **Authored attributes** — raw host-level attributes from the original markup.\n * These always win if present, regardless of whether sources 1 or 2 already\n * set the same name. This preserves explicit author intent in templates.\n *\n * @param host Host shape providing reactive state and attribute accessors.\n * @returns Flat record of attribute name → serialized value.\n */\nexport function resolveHostAttributes(host: HostAttributeSource): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst seenAttributes = new Set<string>();\n\n\tappendReactivePropertyAttributes(host, attributes, seenAttributes);\n\tappendReactivePropDefinitionAttributes(host, attributes, seenAttributes);\n\tappendAuthoredAttributes(host, attributes);\n\n\treturn attributes;\n}\n\n/**\n * Serializes a flat attribute record into an HTML attribute string.\n *\n * Each entry becomes ` name=\"escaped-value\"` with the leading space included.\n * The combined string is safe for direct interpolation into an opening tag.\n *\n * @param attributes Flat attribute record to serialize.\n * @returns HTML attribute string.\n */\nexport function stringifyHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join('');\n}\n\n/**\n * Source 1: Reactive properties with established converters.\n *\n * Falsy runtime values are omitted — they should not appear as attributes\n * in SSR output.\n */\nfunction appendReactivePropertyAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const property of host.getReactiveProperties()) {\n\t\tconst currentValue = host.getPropertyValue(property.name);\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\tseenAttributes.add(property.attribute);\n\t}\n}\n\n/**\n * Source 2: Decorator-based reactive prop definitions.\n *\n * Skipped when the attribute name was already emitted by source 1, preventing\n * duplicate or conflicting attribute values.\n */\nfunction appendReactivePropDefinitionAttributes(\n\thost: HostAttributeSource,\n\tattributes: Record<string, string>,\n\tseenAttributes: Set<string>,\n): void {\n\tfor (const definition of host.getReactivePropDefinitions()) {\n\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\tif (seenAttributes.has(attributeName)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst currentValue = host.getPropertyValue(definition.name);\n\n\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\tseenAttributes.add(attributeName);\n\t}\n}\n\n/**\n * Source 3: Authored attributes from the original markup.\n *\n * These always overwrite — when an author explicitly sets an attribute in\n * markup, that intent takes precedence over reactive property reflection.\n */\nfunction appendAuthoredAttributes(host: HostAttributeSource, attributes: Record<string, string>): void {\n\tfor (const attributeName of host.getAttributeNames()) {\n\t\tconst attributeValue = host.getAttribute(attributeName);\n\t\tif (attributeValue !== null) {\n\t\t\tattributes[attributeName] = attributeValue;\n\t\t}\n\t}\n}\n",
|
|
8
|
+
"import { getActiveSsrScopeValue, withActiveSsrScopeValue } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = readonly ProviderFrame[];\n\nconst SSR_PROVIDER_STACK_KEY = Symbol.for('@ecopages/radiant.ssr-provider-stack');\n\n/**\n * Ensures an SSR provider stack exists on the active JSX SSR render scope.\n * Nested calls reuse the active stack. Call at render boundaries.\n */\nexport function runWithSsrProviderStack<T>(render: () => T): T {\n\tif (getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY) !== undefined) {\n\t\treturn render();\n\t}\n\n\treturn withActiveSsrScopeValue(SSR_PROVIDER_STACK_KEY, [], render);\n}\n\n/**\n * Runs work with one additional provider frame on the active SSR context stack.\n * Requires an active {@link runWithSsrProviderStack} boundary.\n */\nexport function withSsrContextProviders<T>(providers: readonly SsrSerializableContextProvider[], render: () => T): T {\n\tif (providers.length === 0) {\n\t\treturn render();\n\t}\n\n\tconst parent = getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY);\n\n\tif (parent === undefined) {\n\t\tthrow new Error(\n\t\t\t'SSR context providers require runWithSsrProviderStack(...). Wrap the sync render snapshot at the render boundary.',\n\t\t);\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\treturn withActiveSsrScopeValue(SSR_PROVIDER_STACK_KEY, [...parent, frame], render);\n}\n\n/** Resolves the nearest SSR-visible provider for a context token (innermost first). */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getActiveSsrScopeValue<ProviderStack>(SSR_PROVIDER_STACK_KEY);\n\n\tif (!store) {\n\t\treturn undefined;\n\t}\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/** Resolves the current SSR-visible value for a context token. */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n",
|
|
9
|
+
"import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nlet ssrContextProviderResolver: SsrContextProviderResolver | undefined;\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules. Module-local: SSR bundlers must resolve one radiant instance.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tssrContextProviderResolver = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn ssrContextProviderResolver?.(context);\n}\n",
|
|
10
|
+
"/**\n * Host script composition for Radiant SSR.\n *\n * This module owns the mode-sensitive ordering and inclusion rules for the\n * script payloads that appear inside a server-rendered Element Host.\n *\n * ## Composition rules\n *\n * | Mode | Order |\n * |-----------|-----------------------------------------------------------------|\n * | `plain` | view content → authored hydration markup → slot projection |\n * | `hydrate` | view content → slot projection → hydration binding scripts |\n *\n * In **plain** mode, authored hydration markup (script tags pre-authored on the\n * host) is preserved because the component may rely on them for standalone\n * behavior. Hydration binding scripts are omitted because there is no client\n * hydrator to consume them.\n *\n * In **hydrate** mode, authored hydration markup is superseded by the formal\n * hydration binding scripts. Slot projection comes before hydration scripts so\n * the client can reconstruct projected content before binding recovery.\n */\n\n/** Individual content parts that make up a server-rendered host's inner HTML. */\nexport type HostContentParts = {\n\t/** The rendered view HTML from `renderViewToString`. */\n\thostContent: string;\n\t/** Authored hydration script markup pre-existing on the host, if any. */\n\tauthoredHydrationMarkup: string;\n\t/** Slot projection JSON payload script tag, if any. */\n\tslotProjectionScript: string;\n\t/** Hydration binding script tags for client-side recovery, if any. */\n\thydrationScripts: string;\n};\n\n/**\n * Assembles the inner HTML of a server-rendered Element Host from its\n * individual content parts, respecting the mode-sensitive ordering rules.\n *\n * @param parts Individual content parts to compose.\n * @param hydrate Whether the output targets client-side hydration.\n * @returns Assembled inner HTML string.\n */\nexport function composeHostContent(parts: HostContentParts, hydrate: boolean): string {\n\tif (!hydrate) {\n\t\treturn `${parts.hostContent}${parts.authoredHydrationMarkup}${parts.slotProjectionScript}`;\n\t}\n\n\treturn `${parts.hostContent}${parts.slotProjectionScript}${parts.hydrationScripts}`;\n}\n",
|
|
11
|
+
"export type LightDomSsrCheckable = {\n\treadonly renderRootMode: unknown;\n\treadonly constructor?: Function;\n};\n\n/**\n * Radiant host SSR is light-DOM only. Shadow-mode hosts render into an open\n * shadow root on the client; the server pipeline does not emit declarative\n * shadow roots and must not silently serialize view HTML as light-DOM children.\n */\nexport function assertLightDomSsrSupported(component: LightDomSsrCheckable): void {\n\tif (component.renderRootMode !== 'shadow') {\n\t\treturn;\n\t}\n\n\tconst name =\n\t\ttypeof component.constructor === 'function' && component.constructor.name\n\t\t\t? component.constructor.name\n\t\t\t: 'RadiantElement';\n\n\tthrow new Error(\n\t\t`${name} uses renderRootMode \"shadow\". Radiant SSR is light-DOM only; keep renderRootMode \"light\" for server rendering, or skip SSR for this host.`,\n\t);\n}\n",
|
|
6
12
|
"import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
|
|
13
|
+
"/** Cross-realm Element Host brand for SSR extraction (survives duplicate package copies). */\nexport const RADIANT_ELEMENT_BRAND = Symbol.for('@ecopages/radiant.RadiantElement');\n",
|
|
14
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { RADIANT_ELEMENT_BRAND } from './radiant-element-brand';\n\n/**\n * Branded Element Host surface read by the server SSR pipeline.\n *\n * Lives in core so client-safe registry types and server extractors share one\n * contract without importing {@link RadiantElement} (HTMLElement at init).\n */\nexport type RadiantElementSsrHostSource = {\n\tconstructor: Function;\n\treadonly renderRootMode: 'light' | 'shadow';\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup(): string | undefined;\n\tgetContextProviders(): SsrSerializableContextProvider[];\n\tgetHydrationBindings(): SsrSerializableHydrationBinding[];\n\tgetReactiveProperties(): ReactiveProperty[];\n\tgetSlotProjectionScriptTag(): string | undefined;\n\tresolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable };\n};\n\nexport type BrandedRadiantElementSsrHost = RadiantElementSsrHostSource & {\n\treadonly [RADIANT_ELEMENT_BRAND]: true;\n};\n\nexport type RadiantElementViewRenderSource = Pick<\n\tRadiantElementSsrHostSource,\n\t'resolveTrackedRenderOutput' | 'renderRootMode'\n>;\n\n/** True when the value is a branded Radiant Element Host the server can serialize. */\nexport function isRadiantElementSsrHost(component: unknown): component is BrandedRadiantElementSsrHost {\n\treturn typeof component === 'object' && component !== null && RADIANT_ELEMENT_BRAND in component;\n}\n",
|
|
15
|
+
"import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { isRadiantElementSsrHost } from '../core/radiant-element-ssr-host-source';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n/**\n * Builds the private SSR host snapshot from a Radiant Element Host.\n * Extraction stays in the server layer; detection uses {@link RADIANT_ELEMENT_BRAND}.\n */\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\tthrow new Error(\n\t\t\t'Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.',\n\t\t);\n\t}\n\n\treturn {\n\t\tconstructor: component.constructor as CustomElementConstructor,\n\t\trenderRootMode: component.renderRootMode,\n\t\tgetAttribute: (name) => component.getAttribute(name),\n\t\tgetAttributeNames: () => component.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => component.getAuthoredHydrationScriptMarkup(),\n\t\tgetContextProviders: () => component.getContextProviders(),\n\t\tgetHydrationBindings: () => component.getHydrationBindings(),\n\t\tgetReactiveProperties: () => component.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => component.getSlotProjectionScriptTag(),\n\t\tresolveTrackedRenderOutput: () => component.resolveTrackedRenderOutput(),\n\t};\n}\n",
|
|
16
|
+
"export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
|
|
17
|
+
"type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol.for('@ecopages/radiant.ssr-preparation-callbacks');\nexport const SSR_PREPARATION_RUNNING = Symbol.for('@ecopages/radiant.ssr-preparation-running');\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n",
|
|
7
18
|
"export type LegacyPostConstructionPhase = 'connect' | 'ssr';\n\ntype LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\ntype LegacyPostConstructionInitializer<T extends object = object> = (\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\nconst LEGACY_POST_CONSTRUCTION_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-post-construction-initializers');\nconst LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS = Symbol.for(\n\t'@ecopages/radiant.legacy-executed-post-construction-initializers',\n);\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_INSTANCE_INITIALIZERS, initializer);\n}\n\n/**\n * Registers post-construction work for a legacy decorator.\n *\n * This phase exists for decorators that eagerly write instance fields. With\n * legacy decorators plus `useDefineForClassFields`, subclass field definition\n * can overwrite values written during the base-class constructor.\n */\nexport function registerLegacyPostConstructionInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyPostConstructionInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_POST_CONSTRUCTION_INITIALIZERS, initializer);\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers<T extends object>(instance: T): void {\n\trunLegacyInitializers(instance, LEGACY_INSTANCE_INITIALIZERS);\n}\n\n/**\n * Runs legacy decorator setup that must happen after subclass field\n * initialization has completed.\n *\n * Each initializer runs at most once per instance even if multiple lifecycle\n * entrypoints call this helper.\n */\nexport function runLegacyPostConstructionInitializers<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyPostConstructionInitializersOnPrototypeChain(\n\t\tinstance,\n\t\tphase,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<\n\t\t\tLegacyPostConstructionInitializer<T>\n\t\t>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(\n\tproto: T,\n\tkey: symbol,\n\tinitializer: LegacyInstanceInitializer<T> | LegacyPostConstructionInitializer<T>,\n): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = Object.prototype.hasOwnProperty.call(target, key) ? target[key] : undefined;\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, key, {\n\t\tvalue: [initializer],\n\t});\n}\n\nfunction runLegacyInitializers<T extends object>(instance: T, key: symbol): void {\n\twalkPrototypeChain(instance, (prototype) => {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as\n\t\t\tLegacyInstanceInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t});\n}\n\nfunction runLegacyPostConstructionInitializersOnPrototypeChain<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n\texecutedInitializers: Set<LegacyPostConstructionInitializer<T>>,\n): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[LEGACY_POST_CONSTRUCTION_INITIALIZERS] as\n\t\t\tLegacyPostConstructionInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tif (executedInitializers.has(initializer)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinitializer(instance, phase);\n\t\t\texecutedInitializers.add(initializer);\n\t\t}\n\t}\n}\n\nfunction collectPrototypeChain<T extends object>(instance: T): object[] {\n\tconst prototypes: object[] = [];\n\tlet prototype: object | null = Object.getPrototypeOf(instance);\n\n\twhile (prototype && prototype !== Object.prototype) {\n\t\tprototypes.unshift(prototype);\n\t\tprototype = Object.getPrototypeOf(prototype);\n\t}\n\n\treturn prototypes;\n}\n\nfunction walkPrototypeChain<T extends object>(instance: T, visit: (prototype: object) => void): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tvisit(prototype);\n\t}\n}\n",
|
|
8
19
|
"import { runLegacyInstanceInitializers, runLegacyPostConstructionInitializers } from './instance-initializers';\n\nexport type LegacyHostReadinessPhase = 'construct' | 'connect' | 'ssr';\n\n/**\n * Runs legacy decorator initialization for the requested lifecycle phase.\n *\n * Post-construction work is idempotent — multiple calls with `connect` or `ssr`\n * only execute each registered initializer once per instance.\n */\nexport function ensureLegacyHostReady<T extends object>(host: T, phase: LegacyHostReadinessPhase): void {\n\tswitch (phase) {\n\t\tcase 'construct':\n\t\t\trunLegacyInstanceInitializers(host);\n\t\t\tbreak;\n\t\tcase 'connect':\n\t\t\trunLegacyPostConstructionInitializers(host, 'connect');\n\t\t\tbreak;\n\t\tcase 'ssr':\n\t\t\trunLegacyPostConstructionInitializers(host, 'ssr');\n\t\t\tbreak;\n\t}\n}\n",
|
|
9
|
-
"import type {
|
|
10
|
-
"import
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
|
|
14
|
-
"import
|
|
15
|
-
"
|
|
16
|
-
"import
|
|
17
|
-
"
|
|
18
|
-
"import
|
|
19
|
-
"import
|
|
20
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { getCustomElementTagName } from '../core/custom-element-metadata';\nimport { runSsrPreparationCallbacks } from '../core/ssr-preparation';\nimport { withSsrContextProviders } from './context-ssr';\nimport { composeHostContent } from './host-script-composition';\nimport { resolveHostAttributes, stringifyHostAttributes } from './host-attribute-serialization';\nimport { ensureLegacyHostReady } from '../decorators/legacy/host-readiness';\nimport { assertLightDomSsrSupported } from './assert-light-dom-ssr';\nimport { toInternalRadiantSsrHost } from './radiant-element-ssr-extractor';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n\nexport type RadiantElementViewRenderer = (host: InternalRadiantSsrHost, options?: RenderToStringOptions) => string;\n\nexport class RadiantElementSsrService {\n\tprivate readonly component: object;\n\tprivate readonly host: InternalRadiantSsrHost;\n\tprivate readonly renderView: RadiantElementViewRenderer;\n\n\tconstructor(component: object, renderView: RadiantElementViewRenderer) {\n\t\tthis.component = component;\n\t\tthis.host = toInternalRadiantSsrHost(component);\n\t\tthis.renderView = renderView;\n\t}\n\n\tprivate ensureReady(): void {\n\t\tassertLightDomSsrSupported(this.host);\n\t\tensureLegacyHostReady(this.component, 'ssr');\n\t\trunSsrPreparationCallbacks(this.component);\n\t}\n\n\tpublic renderHost(): JsxRenderable {\n\t\tthis.ensureReady();\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ mode: 'hydrate' }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tthis.ensureReady();\n\t\tconst tagName = this.getTagName();\n\n\t\treturn withSsrContextProviders(\n\t\t\tthis.host.getContextProviders(),\n\t\t\t() => `<${tagName}${stringifyHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`,\n\t\t);\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tthis.ensureReady();\n\t\treturn resolveHostAttributes(this.host);\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hydrate = options.mode === 'hydrate' || (options.mode === undefined && options.hydrate === true);\n\n\t\tconst hydrationScripts = hydrate\n\t\t\t? this.host\n\t\t\t\t\t.getHydrationBindings()\n\t\t\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t\t\t.join('')\n\t\t\t: '';\n\n\t\treturn composeHostContent(\n\t\t\t{\n\t\t\t\thostContent: this.renderView(this.host, options),\n\t\t\t\tauthoredHydrationMarkup: this.host.getAuthoredHydrationScriptMarkup?.() ?? '',\n\t\t\t\tslotProjectionScript: this.host.getSlotProjectionScriptTag?.() ?? '',\n\t\t\t\thydrationScripts,\n\t\t\t},\n\t\t\thydrate,\n\t\t);\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n",
|
|
21
|
+
"import { getActiveSsrScopeValue, withActiveSsrScopeValue } from '@ecopages/jsx/server';\nimport { installRadiantElementSsrScopeAdapters } from '../core/radiant-element-ssr-registry';\n\n/** Side-effect import: wires core SSR runtime lookups to the Node JSX SSR render scope. */\ninstallRadiantElementSsrScopeAdapters({\n\tget: getActiveSsrScopeValue,\n\twithValue: withActiveSsrScopeValue,\n});\n",
|
|
22
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantElementSsrHostSource, RadiantElementViewRenderSource } from './radiant-element-ssr-host-source';\n\n/** Core-local render options so client code never imports `@ecopages/jsx/server`. */\nexport type RadiantElementRenderToStringOptions = {\n\thydrate?: boolean;\n\tmode?: 'plain' | 'hydrate';\n};\n\nexport type RadiantElementRenderBridge = {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString?: (options?: RadiantElementRenderToStringOptions) => string;\n};\n\n/** Branded Element Host accepted by the server SSR pipeline. */\nexport type RadiantElementServerRenderSsrCapable = RadiantElementSsrHostSource;\n\nexport type { RadiantElementViewRenderSource };\n\nexport type RadiantElementSsrRuntime = {\n\tgetHostAttributes(component: RadiantElementServerRenderSsrCapable): Record<string, string>;\n\trenderHost(component: RadiantElementServerRenderSsrCapable): JsxRenderable;\n\trenderHostToString(\n\t\tcomponent: RadiantElementServerRenderSsrCapable,\n\t\toptions?: RadiantElementRenderToStringOptions,\n\t): string;\n\tresolveRenderBridge(component: object): RadiantElementRenderBridge | undefined;\n\trenderView(component: RadiantElementServerRenderSsrCapable, options?: RadiantElementRenderToStringOptions): string;\n};\n\n/** JSX SSR scope adapters installed by the server layer into client-safe core. */\nexport type RadiantElementSsrScopeAdapters = {\n\tget<T>(key: symbol): T | undefined;\n\twithValue<TValue, T>(key: symbol, value: TValue, render: () => T): T;\n};\n\nconst RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL = Symbol.for('@ecopages/radiant.element-ssr-runtime');\n\nlet scopeAdapters: RadiantElementSsrScopeAdapters | undefined;\n\n/**\n * Called once from Radiant server SSR modules; client bundles never install this.\n * Module-local: SSR bundlers must resolve one `@ecopages/radiant` instance (do not inline duplicates).\n */\nexport function installRadiantElementSsrScopeAdapters(adapters: RadiantElementSsrScopeAdapters): void {\n\tscopeAdapters = adapters;\n}\n\nexport function getRadiantElementSsrRuntime(): RadiantElementSsrRuntime | undefined {\n\treturn scopeAdapters?.get<RadiantElementSsrRuntime>(RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL);\n}\n\nexport function withRadiantElementSsrRuntime<T>(runtime: RadiantElementSsrRuntime, render: () => T): T {\n\tif (!scopeAdapters) {\n\t\tthrow new Error(\n\t\t\t'Radiant element SSR runtime requires the server scope adapters. Import a Radiant server SSR entrypoint before rendering.',\n\t\t);\n\t}\n\n\tif (scopeAdapters.get<RadiantElementSsrRuntime>(RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL) === runtime) {\n\t\treturn render();\n\t}\n\n\treturn scopeAdapters.withValue(RADIANT_ELEMENT_SSR_RUNTIME_SYMBOL, runtime, render);\n}\n",
|
|
23
|
+
"export function toDataAttributeName(property: string): string {\n\treturn `data-${property.replace(/([A-Z])/g, '-$1').toLowerCase()}`;\n}\n\nexport function toDatasetPropertyName(attributeName: string): string {\n\treturn attributeName.replace(/-([a-z])/g, (_match, character: string) => character.toUpperCase());\n}\n",
|
|
24
|
+
"import { escapeHtmlAttribute } from '../../utils/escape-html-attribute';\nimport { toDataAttributeName, toDatasetPropertyName } from './dataset';\n\ntype MinimalParentNode = Node & ParentNode;\n\ntype HtmlParsers = {\n\tparseHtmlToNodes: (html: string, ownerDocument: Document | null) => Node[];\n\tserializeNodeHtml: (node: Node) => string;\n};\n\nlet htmlParsers: HtmlParsers | undefined;\n\n/**\n * Registers HTML parse/serialize helpers from `./html` to break a circular import.\n * Import `./html` (or the light-DOM install entry) before using `innerHTML`.\n */\nexport function registerMinimalDomHtmlParsers(parsers: HtmlParsers): void {\n\thtmlParsers = parsers;\n}\n\nfunction ensureHtmlParsers(): HtmlParsers {\n\tif (!htmlParsers) {\n\t\tthrow new Error(\n\t\t\t'Minimal DOM HTML parsers are not registered. Import @ecopages/radiant/server/install-ssr-runtime (or ./html) before using innerHTML.',\n\t\t);\n\t}\n\n\treturn htmlParsers;\n}\n\nexport class MinimalNode extends EventTarget {\n\tstatic readonly DOCUMENT_NODE = 9;\n\tstatic readonly ELEMENT_NODE = 1;\n\tstatic readonly TEXT_NODE = 3;\n\n\tpublic childNodes: Node[] = [];\n\tpublic ownerDocument: Document | null;\n\tpublic parentNode: MinimalParentNode | null = null;\n\n\tconstructor(\n\t\tpublic readonly nodeType: number,\n\t\townerDocument: Document | null = null,\n\t) {\n\t\tsuper();\n\t\tthis.ownerDocument = ownerDocument;\n\t}\n\n\tappend(...nodes: Array<Node | string>): void {\n\t\tfor (const node of nodes) {\n\t\t\tthis.appendChild(typeof node === 'string' ? createTextNode(node) : node);\n\t\t}\n\t}\n\n\tappendChild<TNode extends Node>(node: TNode): TNode {\n\t\tif ('parentNode' in node && node.parentNode && 'removeChild' in node.parentNode) {\n\t\t\t(node.parentNode as Node & { removeChild(node: Node): Node }).removeChild(node);\n\t\t}\n\n\t\tthis.childNodes.push(node);\n\t\t(node as Node & { ownerDocument: Document | null }).ownerDocument =\n\t\t\tthis.nodeType === MinimalNode.DOCUMENT_NODE ? (this as unknown as Document) : this.ownerDocument;\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = this as unknown as MinimalParentNode;\n\t\treturn node;\n\t}\n\n\tremoveChild<TNode extends Node>(node: TNode): TNode {\n\t\tconst nodeIndex = this.childNodes.indexOf(node);\n\n\t\tif (nodeIndex === -1) {\n\t\t\treturn node;\n\t\t}\n\n\t\tthis.childNodes.splice(nodeIndex, 1);\n\t\t(node as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\treturn node;\n\t}\n\n\treplaceChildren(...nodes: Array<Node | string>): void {\n\t\tfor (const child of this.childNodes) {\n\t\t\t(child as Node & { parentNode: MinimalParentNode | null }).parentNode = null;\n\t\t}\n\n\t\tthis.childNodes = [];\n\t\tthis.append(...nodes);\n\t}\n\n\tget textContent(): string | null {\n\t\treturn this.childNodes.map((child) => child.textContent ?? '').join('');\n\t}\n\n\tset textContent(value: string | null) {\n\t\tthis.replaceChildren(value ?? '');\n\t}\n\n\tgetRootNode(): Node {\n\t\tlet current: Node = this as unknown as Node;\n\n\t\twhile ('parentNode' in current && current.parentNode) {\n\t\t\tcurrent = current.parentNode;\n\t\t}\n\n\t\treturn current;\n\t}\n}\n\nexport class MinimalTextNode extends MinimalNode {\n\tconstructor(\n\t\tprivate value: string,\n\t\townerDocument: Document | null = getInstalledDocumentLike(),\n\t) {\n\t\tsuper(MinimalNode.TEXT_NODE, ownerDocument);\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.value;\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.value = value ?? '';\n\t}\n}\n\nclass MinimalClassList {\n\tconstructor(private readonly element: MinimalElement) {}\n\n\tadd(...tokens: string[]): void {\n\t\tconst nextTokens = new Set(this.readTokens());\n\n\t\tfor (const token of tokens) {\n\t\t\tif (token !== '') {\n\t\t\t\tnextTokens.add(token);\n\t\t\t}\n\t\t}\n\n\t\tthis.writeTokens([...nextTokens]);\n\t}\n\n\tremove(...tokens: string[]): void {\n\t\tconst nextTokens = new Set(this.readTokens());\n\n\t\tfor (const token of tokens) {\n\t\t\tnextTokens.delete(token);\n\t\t}\n\n\t\tthis.writeTokens([...nextTokens]);\n\t}\n\n\ttoggle(token: string, force?: boolean): boolean {\n\t\tconst hasToken = this.contains(token);\n\t\tconst shouldAdd = force ?? !hasToken;\n\n\t\tif (shouldAdd) {\n\t\t\tthis.add(token);\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.remove(token);\n\t\treturn false;\n\t}\n\n\tcontains(token: string): boolean {\n\t\treturn this.readTokens().includes(token);\n\t}\n\n\ttoString(): string {\n\t\treturn this.value;\n\t}\n\n\tget value(): string {\n\t\treturn this.element.getAttribute('class') ?? '';\n\t}\n\n\tprivate readTokens(): string[] {\n\t\treturn this.value\n\t\t\t.split(/\\s+/)\n\t\t\t.map((token) => token.trim())\n\t\t\t.filter((token) => token.length > 0);\n\t}\n\n\tprivate writeTokens(tokens: string[]): void {\n\t\tif (tokens.length === 0) {\n\t\t\tthis.element.removeAttribute('class');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.element.setAttribute('class', tokens.join(' '));\n\t}\n}\n\nexport class MinimalElement extends MinimalNode {\n\tprivate attributes = new Map<string, string>();\n\tprivate classListValue?: MinimalClassList;\n\tprivate datasetValue?: DOMStringMap;\n\tprivate fragmentHtml?: string;\n\tprivate fragmentText?: string;\n\n\tpublic readonly localName: string;\n\tpublic readonly tagName: string;\n\n\tconstructor(tagName = 'div', ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper(MinimalNode.ELEMENT_NODE, ownerDocument);\n\t\tthis.localName = tagName.toLowerCase();\n\t\tthis.tagName = this.localName.toUpperCase();\n\t}\n\n\tget id(): string {\n\t\treturn this.getAttribute('id') ?? '';\n\t}\n\n\tset id(value: string) {\n\t\tif (value === '') {\n\t\t\tthis.removeAttribute('id');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setAttribute('id', value);\n\t}\n\n\tget classList(): DOMTokenList {\n\t\tthis.classListValue ??= new MinimalClassList(this);\n\t\treturn this.classListValue as unknown as DOMTokenList;\n\t}\n\n\tget dataset(): DOMStringMap {\n\t\tthis.datasetValue ??= new Proxy(\n\t\t\t{},\n\t\t\t{\n\t\t\t\tdeleteProperty: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.removeAttribute(toDataAttributeName(property));\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\tget: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this.getAttribute(toDataAttributeName(property)) ?? undefined;\n\t\t\t\t},\n\t\t\t\tgetOwnPropertyDescriptor: (_target, property) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: this.getAttribute(toDataAttributeName(property)) ?? undefined,\n\t\t\t\t\t\twritable: true,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\thas: (_target, property) => {\n\t\t\t\t\treturn typeof property === 'string' && this.hasAttribute(toDataAttributeName(property));\n\t\t\t\t},\n\t\t\t\townKeys: () => {\n\t\t\t\t\treturn this.getAttributeNames()\n\t\t\t\t\t\t.filter((name) => name.startsWith('data-'))\n\t\t\t\t\t\t.map((name) => toDatasetPropertyName(name.slice(5)));\n\t\t\t\t},\n\t\t\t\tset: (_target, property, value) => {\n\t\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.setAttribute(toDataAttributeName(property), String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t},\n\t\t) as DOMStringMap;\n\n\t\treturn this.datasetValue;\n\t}\n\n\thasAttribute(name: string): boolean {\n\t\treturn this.attributes.has(name);\n\t}\n\n\tgetAttribute(name: string): string | null {\n\t\treturn this.attributes.get(name) ?? null;\n\t}\n\n\tgetAttributeNames(): string[] {\n\t\treturn Array.from(this.attributes.keys());\n\t}\n\n\tsetAttribute(name: string, value: unknown): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.set(name, String(value));\n\t}\n\n\ttoggleAttribute(name: string, force?: boolean): boolean {\n\t\tconst shouldHaveAttribute = force ?? !this.hasAttribute(name);\n\n\t\tif (shouldHaveAttribute) {\n\t\t\tthis.setAttribute(name, '');\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.removeAttribute(name);\n\t\treturn false;\n\t}\n\n\tremoveAttribute(name: string): void {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.attributes.delete(name);\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n\n\tmatches(): boolean {\n\t\treturn false;\n\t}\n\n\tget outerHTML(): string {\n\t\tif (this.fragmentHtml !== undefined) {\n\t\t\treturn this.fragmentHtml;\n\t\t}\n\n\t\tconst attributes = Array.from(this.attributes.entries())\n\t\t\t.map(([name, value]) => ` ${name}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t\t.join('');\n\n\t\treturn `<${this.localName}${attributes}>${this.innerHTML}</${this.localName}>`;\n\t}\n\n\tget innerHTML(): string {\n\t\treturn this.childNodes.map((child) => ensureHtmlParsers().serializeNodeHtml(child)).join('');\n\t}\n\n\tset innerHTML(html: string) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = undefined;\n\t\tthis.replaceChildren(...ensureHtmlParsers().parseHtmlToNodes(html, this.ownerDocument));\n\t}\n\n\toverride get textContent(): string {\n\t\treturn this.fragmentText ?? super.textContent ?? '';\n\t}\n\n\toverride set textContent(value: string | null) {\n\t\tthis.fragmentHtml = undefined;\n\t\tthis.fragmentText = value ?? '';\n\t\tsuper.textContent = value;\n\t}\n\n\tsetSerializedFragment(fragmentHtml: string, fragmentText: string, attributes: Record<string, string>): void {\n\t\tthis.fragmentHtml = fragmentHtml;\n\t\tthis.fragmentText = fragmentText;\n\t\tthis.attributes = new Map(Object.entries(attributes));\n\t\tthis.replaceChildren();\n\t}\n}\n\nexport class MinimalEvent {\n\tpublic readonly bubbles: boolean;\n\tpublic readonly cancelable: boolean;\n\tpublic readonly composed: boolean;\n\tpublic readonly type: string;\n\n\tconstructor(type: string, eventInitDict: EventInit = {}) {\n\t\tthis.type = type;\n\t\tthis.bubbles = eventInitDict.bubbles ?? false;\n\t\tthis.cancelable = eventInitDict.cancelable ?? false;\n\t\tthis.composed = eventInitDict.composed ?? false;\n\t}\n}\n\nexport class MinimalCustomEvent<T = unknown> extends MinimalEvent {\n\tpublic readonly detail: T;\n\n\tconstructor(type: string, eventInitDict: CustomEventInit<T> = {}) {\n\t\tsuper(type, eventInitDict);\n\t\tthis.detail = eventInitDict.detail as T;\n\t}\n}\n\nexport class MinimalHTMLElement extends MinimalElement {\n\tpublic isConnected = false;\n\n\tconstructor(tagName = 'div', ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper(tagName, ownerDocument);\n\t}\n\n\tinsertAdjacentHTML(_position: InsertPosition, html: string): void {\n\t\tthis.append(...ensureHtmlParsers().parseHtmlToNodes(html, this.ownerDocument));\n\t}\n\n\tconnectedCallback?(): void;\n\tattributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n\tdisconnectedCallback?(): void;\n}\n\nexport class MinimalHtmlScriptElement extends MinimalHTMLElement {\n\tconstructor(ownerDocument: Document | null = getInstalledDocumentLike()) {\n\t\tsuper('script', ownerDocument);\n\t}\n}\n\nexport function createTextNode(value: string): Node {\n\treturn new MinimalTextNode(value, getInstalledDocumentLike()) as unknown as Node;\n}\n\nexport function getInstalledDocumentLike(): Document | null {\n\treturn ((globalThis as typeof globalThis & { document?: Document }).document ?? null) as Document | null;\n}\n",
|
|
25
|
+
"import { MinimalHtmlScriptElement, MinimalHTMLElement, MinimalNode, MinimalTextNode } from './nodes';\n\nexport type MinimalCustomElementRegistry = {\n\tdefine(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;\n\tget(name: string): CustomElementConstructor | undefined;\n};\n\nexport class MinimalDocument extends MinimalNode {\n\tconstructor() {\n\t\tsuper(MinimalNode.DOCUMENT_NODE);\n\t}\n\n\tcreateElement(tagName: string): HTMLElement {\n\t\treturn (tagName.toLowerCase() === 'script'\n\t\t\t? new MinimalHtmlScriptElement(this as unknown as Document)\n\t\t\t: new MinimalHTMLElement(tagName, this as unknown as Document)) as unknown as HTMLElement;\n\t}\n\n\tcreateTextNode(value: string): Text {\n\t\treturn new MinimalTextNode(value, this as unknown as Document) as unknown as Text;\n\t}\n\n\tquerySelector(): Element | null {\n\t\treturn null;\n\t}\n\n\tquerySelectorAll(): Element[] {\n\t\treturn [];\n\t}\n}\n\nexport class MinimalCustomElementsRegistry implements MinimalCustomElementRegistry {\n\tprivate definitions = new Map<string, CustomElementConstructor>();\n\n\tdefine(name: string, constructor: CustomElementConstructor): void {\n\t\tif (this.definitions.has(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.definitions.set(name, constructor);\n\t}\n\n\tget(name: string): CustomElementConstructor | undefined {\n\t\treturn this.definitions.get(name);\n\t}\n}\n",
|
|
26
|
+
"export type ParsedHtmlTag = {\n\tattributes: Record<string, string>;\n\tend: number;\n\tinnerHtml: string;\n\tselfClosing: boolean;\n\ttagName: string;\n\ttype: 'open';\n};\n\nexport type ParsedHtmlToken =\n\t| ParsedHtmlTag\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'close';\n\t }\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'comment' | 'declaration';\n\t };\n\nexport const voidElementNames = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n]);\n\nexport function collectTopLevelHtmlFragments(html: string): string[] {\n\tconst fragments: string[] = [];\n\tlet index = 0;\n\n\twhile (index < html.length) {\n\t\tconst fragmentStart = index;\n\n\t\tif (html.startsWith('<!--', index)) {\n\t\t\tconst commentEnd = html.indexOf('-->', index + 4);\n\t\t\tindex = commentEnd === -1 ? html.length : commentEnd + 3;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (html[index] !== '<') {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\t\t\tindex = nextTagIndex === -1 ? html.length : nextTagIndex;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst token = parseHtmlTagToken(html, index);\n\n\t\tif (!token) {\n\t\t\tfragments.push(html.slice(fragmentStart));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type !== 'open' || token.selfClosing || voidElementNames.has(token.tagName)) {\n\t\t\tindex = token.end;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tindex = token.end;\n\t\tlet depth = 1;\n\n\t\twhile (index < html.length && depth > 0) {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\t\tif (nextTagIndex === -1) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nestedToken = parseHtmlTagToken(html, nextTagIndex);\n\n\t\t\tif (!nestedToken) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = nestedToken.end;\n\n\t\t\tif (nestedToken.type === 'comment' || nestedToken.type === 'declaration') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'open' && !nestedToken.selfClosing && !voidElementNames.has(nestedToken.tagName)) {\n\t\t\t\tdepth += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'close') {\n\t\t\t\tdepth -= 1;\n\t\t\t}\n\t\t}\n\n\t\tfragments.push(html.slice(fragmentStart, index));\n\t}\n\n\treturn fragments.filter((fragment) => fragment !== '');\n}\n\nexport function findHtmlTagEnd(html: string, startIndex: number): number {\n\tlet quote: '\"' | \"'\" | undefined;\n\n\tfor (let index = startIndex + 1; index < html.length; index += 1) {\n\t\tconst character = html[index];\n\n\t\tif (quote) {\n\t\t\tif (character === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '\"' || character === \"'\") {\n\t\t\tquote = character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '>') {\n\t\t\treturn index + 1;\n\t\t}\n\t}\n\n\treturn html.length;\n}\n\nexport function parseAttributes(rawAttributes: string): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst attributePattern = /([:^@A-Za-z0-9_.-]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>/]+)))?/g;\n\n\tfor (const match of rawAttributes.matchAll(attributePattern)) {\n\t\tconst [, name, doubleQuoted, singleQuoted, bareValue] = match;\n\n\t\tif (!name) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[name] = doubleQuoted ?? singleQuoted ?? bareValue ?? '';\n\t}\n\n\treturn attributes;\n}\n\nexport function parseHtmlTagToken(html: string, startIndex: number): ParsedHtmlToken | undefined {\n\tif (html.startsWith('<!--', startIndex)) {\n\t\tconst endIndex = html.indexOf('-->', startIndex + 4);\n\t\treturn {\n\t\t\tend: endIndex === -1 ? html.length : endIndex + 3,\n\t\t\ttype: 'comment',\n\t\t};\n\t}\n\n\tconst endIndex = findHtmlTagEnd(html, startIndex);\n\tconst rawToken = html.slice(startIndex + 1, endIndex - 1).trim();\n\n\tif (rawToken === '') {\n\t\treturn undefined;\n\t}\n\n\tif (rawToken.startsWith('!') || rawToken.startsWith('?')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'declaration',\n\t\t};\n\t}\n\n\tif (rawToken.startsWith('/')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'close',\n\t\t};\n\t}\n\n\tconst selfClosing = /\\/\\s*$/.test(rawToken);\n\tconst tagBody = selfClosing ? rawToken.replace(/\\/\\s*$/, '').trim() : rawToken;\n\tconst tagName = tagBody.split(/[\\s/>]/, 1)[0]?.toLowerCase() ?? '';\n\tconst attributesStart = tagName.length;\n\tconst rawAttributes = tagBody.slice(attributesStart).trim();\n\tconst innerHtml =\n\t\tselfClosing || voidElementNames.has(tagName)\n\t\t\t? ''\n\t\t\t: extractInnerHtmlFragment(html, startIndex, endIndex, tagName);\n\n\treturn {\n\t\tattributes: parseAttributes(rawAttributes),\n\t\tend: endIndex,\n\t\tinnerHtml,\n\t\tselfClosing,\n\t\ttagName,\n\t\ttype: 'open',\n\t};\n}\n\nexport function extractInnerHtmlFragment(\n\thtml: string,\n\tstartIndex: number,\n\ttagEndIndex: number,\n\ttagName: string,\n): string {\n\tlet index = tagEndIndex;\n\tlet depth = 1;\n\n\twhile (index < html.length && depth > 0) {\n\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\tif (nextTagIndex === -1) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tconst nextTag = parseHtmlTagToken(html, nextTagIndex);\n\n\t\tif (!nextTag) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tif (\n\t\t\tnextTag.type === 'open' &&\n\t\t\tnextTag.tagName === tagName &&\n\t\t\t!nextTag.selfClosing &&\n\t\t\t!voidElementNames.has(tagName)\n\t\t) {\n\t\t\tdepth += 1;\n\t\t}\n\n\t\tif (nextTag.type === 'close') {\n\t\t\tconst closingName = html\n\t\t\t\t.slice(nextTagIndex + 2, nextTag.end - 1)\n\t\t\t\t.trim()\n\t\t\t\t.toLowerCase();\n\n\t\t\tif (closingName === tagName) {\n\t\t\t\tdepth -= 1;\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\treturn html.slice(tagEndIndex, nextTagIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tindex = nextTag.end;\n\t}\n\n\treturn html.slice(tagEndIndex);\n}\n",
|
|
27
|
+
"import { collectTopLevelHtmlFragments, parseHtmlTagToken, type ParsedHtmlTag } from '../html-parser';\nimport { toDataAttributeName, toDatasetPropertyName } from './dataset';\nimport {\n\tgetInstalledDocumentLike,\n\tMinimalElement,\n\tMinimalHtmlScriptElement,\n\tMinimalHTMLElement,\n\tMinimalNode,\n\tMinimalTextNode,\n\tregisterMinimalDomHtmlParsers,\n} from './nodes';\n\nexport { toDataAttributeName, toDatasetPropertyName } from './dataset';\n\nexport function createElementFromFragment(fragment: string, tag: ParsedHtmlTag, ownerDocument: Document | null): Node {\n\tconst element =\n\t\ttag.tagName === 'script'\n\t\t\t? (new MinimalHtmlScriptElement(ownerDocument) as MinimalElement)\n\t\t\t: new MinimalHTMLElement(tag.tagName, ownerDocument);\n\n\telement.setSerializedFragment(fragment, extractTextContent(tag.innerHtml), tag.attributes);\n\treturn element as unknown as Node;\n}\n\nexport function extractTextContent(html: string): string {\n\treturn html.replace(/<!--.*?-->/gs, '').replace(/<[^>]+>/g, '');\n}\n\nexport function parseHtmlToNodes(html: string, ownerDocument: Document | null = getInstalledDocumentLike()): Node[] {\n\treturn collectTopLevelHtmlFragments(html).map((fragment) => {\n\t\tif (!fragment.startsWith('<')) {\n\t\t\treturn new MinimalTextNode(fragment, ownerDocument) as unknown as Node;\n\t\t}\n\n\t\tconst tag = parseHtmlTagToken(fragment, 0);\n\n\t\tif (!tag || tag.type !== 'open') {\n\t\t\treturn new MinimalTextNode(fragment, ownerDocument) as unknown as Node;\n\t\t}\n\n\t\treturn createElementFromFragment(fragment, tag, ownerDocument);\n\t});\n}\n\nexport function serializeNodeHtml(node: Node): string {\n\tif (node.nodeType === MinimalNode.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\n\treturn 'outerHTML' in node && typeof node.outerHTML === 'string' ? node.outerHTML : (node.textContent ?? '');\n}\n\nregisterMinimalDomHtmlParsers({\n\tparseHtmlToNodes,\n\tserializeNodeHtml,\n});\n",
|
|
28
|
+
"export function escapeCssIdentifier(value: string): string {\n\tconst cssNamespace = globalThis.CSS as { escape?: (value: string) => string } | undefined;\n\n\tif (typeof cssNamespace?.escape === 'function') {\n\t\treturn cssNamespace.escape(value);\n\t}\n\n\tlet escaped = '';\n\n\tfor (let index = 0; index < value.length; index += 1) {\n\t\tconst character = value[index] ?? '';\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\n\t\tif (codePoint === 0) {\n\t\t\tescaped += '\\uFFFD';\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isControlCharacter = (codePoint >= 0x0001 && codePoint <= 0x001f) || codePoint === 0x007f;\n\t\tconst startsWithDigit = index === 0 && codePoint >= 0x0030 && codePoint <= 0x0039;\n\t\tconst startsWithHyphenDigit =\n\t\t\tindex === 1 && codePoint >= 0x0030 && codePoint <= 0x0039 && (value[0] ?? '') === '-';\n\t\tconst isSingleHyphen = index === 0 && character === '-' && value.length === 1;\n\n\t\tif (isControlCharacter || startsWithDigit || startsWithHyphenDigit) {\n\t\t\tescaped += `\\\\${codePoint.toString(16)} `;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tcodePoint >= 0x0080 ||\n\t\t\tcharacter === '-' ||\n\t\t\tcharacter === '_' ||\n\t\t\t(codePoint >= 0x0030 && codePoint <= 0x0039) ||\n\t\t\t(codePoint >= 0x0041 && codePoint <= 0x005a) ||\n\t\t\t(codePoint >= 0x0061 && codePoint <= 0x007a)\n\t\t) {\n\t\t\tescaped += isSingleHyphen ? `\\\\${character}` : character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tescaped += `\\\\${character}`;\n\t}\n\n\treturn escaped;\n}\n",
|
|
29
|
+
"import { escapeCssIdentifier } from '../../tools/escape-css-identifier';\nimport { MinimalCustomElementsRegistry, MinimalDocument, type MinimalCustomElementRegistry } from './document';\nimport './html';\nimport {\n\tMinimalCustomEvent,\n\tMinimalElement,\n\tMinimalEvent,\n\tMinimalHtmlScriptElement,\n\tMinimalHTMLElement,\n\tMinimalNode,\n} from './nodes';\n\ntype MinimalCssNamespace = {\n\tescape(value: string): string;\n};\n\n/**\n * Minimal window-like runtime surface exposed by the SSR light-DOM shim.\n *\n * This is intentionally much smaller than a browser `window`; it only includes\n * the constructors and registry access that Radiant SSR currently needs.\n */\nexport type LightDomShimWindow = {\n\t/** Event constructor exposed to SSR-created components. */\n\tCustomEvent: typeof CustomEvent;\n\t/** Document constructor exposed to SSR-created components. */\n\tDocument: typeof Document;\n\t/** Element constructor exposed to SSR-created components. */\n\tElement: typeof Element;\n\t/** Event constructor exposed to SSR-created components. */\n\tEvent: typeof Event;\n\t/** EventTarget constructor exposed to SSR-created components. */\n\tEventTarget: typeof EventTarget;\n\t/** HTMLScriptElement constructor used by slot projection payload parsing. */\n\tHTMLScriptElement: typeof HTMLScriptElement;\n\t/** HTMLElement constructor exposed to SSR-created components. */\n\tHTMLElement: typeof HTMLElement;\n\t/** Node constructor exposed to SSR-created components. */\n\tNode: typeof Node;\n\t/** Minimal document instance exposed to SSR-created components. */\n\tdocument: Document;\n\t/** Minimal CSS namespace exposed to SSR-created components. */\n\tCSS: MinimalCssNamespace;\n\t/** Custom element registry used while rendering in SSR. */\n\tcustomElements: MinimalCustomElementRegistry;\n};\n\n/** Host preparation options accepted by the server render environment. */\nexport type PrepareServerRenderHostOptions = {\n\t/** Serialized light-DOM content to attach to the host before SSR. */\n\tauthoredContent?: string;\n};\n\n/** Reusable SSR environment used to prepare component hosts before rendering. */\nexport type ServerRenderEnvironment = {\n\t/** Prepares the host instance for rendering, including authored light-DOM content. */\n\tprepareHost(host: HTMLElement, options?: PrepareServerRenderHostOptions): void;\n};\n\nlet installedWindow: LightDomShimWindow | undefined;\n\nconst minimalCssNamespace: MinimalCssNamespace = {\n\tescape(value: string): string {\n\t\treturn escapeCssIdentifier(String(value));\n\t},\n};\n\nfunction getExistingWindowLike(): LightDomShimWindow | undefined {\n\tconst globalScope = globalThis as typeof globalThis & {\n\t\tCSS?: MinimalCssNamespace;\n\t\tCustomEvent?: typeof CustomEvent;\n\t\tDocument?: typeof Document;\n\t\tElement?: typeof Element;\n\t\tEvent?: typeof Event;\n\t\tEventTarget?: typeof EventTarget;\n\t\tHTMLScriptElement?: typeof HTMLScriptElement;\n\t\tHTMLElement?: typeof HTMLElement;\n\t\tNode?: typeof Node;\n\t\tdocument?: Document;\n\t\tcustomElements?: MinimalCustomElementRegistry;\n\t\twindow?: LightDomShimWindow;\n\t};\n\tconst existingCustomElements = globalScope.customElements;\n\n\tif (\n\t\ttypeof globalScope.Node === 'undefined' ||\n\t\ttypeof globalScope.Document === 'undefined' ||\n\t\ttypeof globalScope.Element === 'undefined' ||\n\t\ttypeof globalScope.HTMLElement === 'undefined' ||\n\t\ttypeof globalScope.document === 'undefined' ||\n\t\t!existingCustomElements ||\n\t\ttypeof existingCustomElements.define !== 'function' ||\n\t\ttypeof existingCustomElements.get !== 'function'\n\t) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\tglobalScope.window ?? {\n\t\t\tCSS: globalScope.CSS ?? minimalCssNamespace,\n\t\t\tCustomEvent: (globalScope.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent,\n\t\t\tDocument: globalScope.Document,\n\t\t\tElement: globalScope.Element,\n\t\t\tEvent: (globalScope.Event ?? MinimalEvent) as typeof Event,\n\t\t\tEventTarget: (globalScope.EventTarget ?? EventTarget) as typeof EventTarget,\n\t\t\tHTMLScriptElement: (globalScope.HTMLScriptElement ?? globalScope.HTMLElement) as typeof HTMLScriptElement,\n\t\t\tHTMLElement: globalScope.HTMLElement,\n\t\t\tNode: globalScope.Node,\n\t\t\tdocument: globalScope.document,\n\t\t\tcustomElements: existingCustomElements,\n\t\t}\n\t);\n}\n\n/** Ensures that a minimal window-like SSR runtime is available and returns it. */\nexport function ensureLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\treturn installLightDomShim();\n}\n\n/**\n * Creates a reusable SSR environment that can prepare a component host with\n * authored light-DOM content before rendering.\n *\n * Adapters can reuse a single environment across multiple render calls when\n * they want a single host-preparation entrypoint backed by the installed shim.\n */\nexport function createServerRenderEnvironment(): ServerRenderEnvironment {\n\tensureLightDomShim();\n\n\treturn {\n\t\tprepareHost(host: HTMLElement, options: PrepareServerRenderHostOptions = {}): void {\n\t\t\tif (options.authoredContent !== undefined) {\n\t\t\t\thost.innerHTML = options.authoredContent;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Installs the smallest global surface needed to instantiate Radiant custom elements during SSR.\n */\nexport function installLightDomShim(): LightDomShimWindow {\n\tconst existingWindow = getExistingWindowLike();\n\n\tif (existingWindow) {\n\t\treturn existingWindow;\n\t}\n\n\tif (installedWindow) {\n\t\treturn installedWindow;\n\t}\n\n\tconst customElements = new MinimalCustomElementsRegistry();\n\tconst document = new MinimalDocument() as unknown as Document;\n\tconst EventConstructor = (globalThis.Event ?? MinimalEvent) as typeof Event;\n\tconst CustomEventConstructor = (globalThis.CustomEvent ?? MinimalCustomEvent) as typeof CustomEvent;\n\tconst DocumentConstructor = MinimalDocument as unknown as typeof Document;\n\tconst EventTargetConstructor = (globalThis.EventTarget ?? EventTarget) as typeof EventTarget;\n\tinstalledWindow = {\n\t\tCSS: (globalThis.CSS as MinimalCssNamespace | undefined) ?? minimalCssNamespace,\n\t\tCustomEvent: CustomEventConstructor,\n\t\tDocument: DocumentConstructor,\n\t\tElement: MinimalElement as unknown as typeof Element,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement as unknown as typeof HTMLScriptElement,\n\t\tHTMLElement: MinimalHTMLElement as unknown as typeof HTMLElement,\n\t\tNode: MinimalNode as unknown as typeof Node,\n\t\tdocument,\n\t\tcustomElements,\n\t};\n\n\tObject.assign(globalThis, {\n\t\tCSS: (globalThis.CSS as MinimalCssNamespace | undefined) ?? minimalCssNamespace,\n\t\tCustomEvent: CustomEventConstructor,\n\t\tDocument: DocumentConstructor,\n\t\tElement: MinimalElement,\n\t\tEvent: EventConstructor,\n\t\tEventTarget: EventTargetConstructor,\n\t\tHTMLScriptElement: MinimalHtmlScriptElement,\n\t\tHTMLElement: MinimalHTMLElement,\n\t\tNode: MinimalNode,\n\t\tdocument,\n\t\tcustomElements,\n\t\twindow: installedWindow,\n\t});\n\n\treturn installedWindow;\n}\n",
|
|
30
|
+
"import { installLightDomShim } from './light-dom-shim';\n\n/** Side-effect install for SSR. Import this module before any `@ecopages/radiant` value import. */\ninstallLightDomShim();\n\n/** Non-undefined export so bundlers keep this side-effect module when externalized. */\nexport const radiantLightDomShimInstalled = true;\n",
|
|
31
|
+
"import './install-light-dom-shim';\nimport './install-ssr-scope-adapters';\n\n/**\n * Non-undefined export so bundlers keep this side-effect module when externalized.\n * Defined locally (do not re-export from install-light-dom-shim) so the radiant\n * package build does not emit a broken renamed re-export after inlining.\n */\nexport const radiantSsrRuntimeInstalled = true;\n",
|
|
32
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { renderToString as renderJsxToString } from '@ecopages/jsx/server';\nimport {\n\tcreateServerHydrationBindingState,\n\tisServerRenderHydrationActive,\n\twithServerCustomElementRenderHook,\n\twithServerHydrationBindingState,\n} from '@ecopages/jsx/server';\nimport { assertLightDomSsrSupported } from './assert-light-dom-ssr';\nimport { RadiantElementSsrService } from './radiant-element-ssr-service';\nimport { runWithSsrProviderStack } from './context-ssr';\nimport './install-ssr-runtime';\nimport { isRadiantElementSsrHost } from '../core/radiant-element-ssr-host-source';\nimport type {\n\tRadiantElementRenderBridge,\n\tRadiantElementServerRenderSsrCapable,\n\tRadiantElementSsrRuntime,\n\tRadiantElementViewRenderSource,\n} from '../core/radiant-element-ssr-registry';\nimport { withRadiantElementSsrRuntime } from '../core/radiant-element-ssr-registry';\n\nlet radiantElementSsrRuntime: RadiantElementSsrRuntime | undefined;\n\nexport function createRadiantElementSsrService(component: object): RadiantElementSsrService {\n\treturn new RadiantElementSsrService(component, renderRadiantElementViewToString);\n}\n\n/** One host-serialization entry used by adapters and nested JSX custom-element SSR. */\nexport function renderRadiantElementHostToString(\n\tcomponent: RadiantElementServerRenderSsrCapable,\n\toptions: RenderToStringOptions = {},\n): string {\n\treturn withServerRadiantElementSsrRuntime(() => {\n\t\tconst service = createRadiantElementSsrService(component);\n\t\treturn service.renderHostToString(options, service.getHostAttributes());\n\t});\n}\n\nexport function renderRadiantElementHost(component: RadiantElementServerRenderSsrCapable): JsxRenderable {\n\treturn {\n\t\tnodeType: 1,\n\t\touterHTML: renderRadiantElementHostToString(component, { mode: 'hydrate' }),\n\t};\n}\n\nexport function renderRegisteredRadiantElementHost(component: unknown): JsxRenderable | undefined {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn renderRadiantElementHost(component);\n}\n\nexport function renderRegisteredRadiantElementHostToString(\n\tcomponent: unknown,\n\toptions: RenderToStringOptions = {},\n): string | undefined {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn renderRadiantElementHostToString(component, options);\n}\n\nexport function renderRadiantElementViewToString(\n\tcomponent: RadiantElementViewRenderSource,\n\toptions: RenderToStringOptions = {},\n): string {\n\tassertLightDomSsrSupported(component);\n\n\treturn withServerRadiantElementSsrRuntime(() =>\n\t\twithRadiantServerCustomElementRenderBridge(() =>\n\t\t\trenderJsxToString(component.resolveTrackedRenderOutput().value, options),\n\t\t),\n\t);\n}\n\nexport function getRadiantElementHostSsrAttributes(\n\tcomponent: RadiantElementServerRenderSsrCapable,\n): Record<string, string> {\n\treturn createRadiantElementSsrService(component).getHostAttributes();\n}\n\nexport function resolveRadiantElementRenderBridge(component: object): RadiantElementRenderBridge | undefined {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\trenderHost: () => renderRadiantElementHost(component),\n\t\trenderHostToString: (options) => renderRadiantElementHostToString(component, options),\n\t};\n}\n\n/**\n * Installs the JSX custom-element render hook so nested CEs serialize through\n * {@link renderRadiantElementHostToString} (same path as `renderComponent`).\n */\nexport function withRadiantServerCustomElementRenderBridge<T>(render: () => T): T {\n\treturn withServerCustomElementRenderHook(({ instance }) => {\n\t\tif (!isRadiantElementSsrHost(instance)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\tget outerHTML() {\n\t\t\t\treturn serializeNestedCustomElementHost(instance);\n\t\t\t},\n\t\t};\n\t}, render);\n}\n\nfunction serializeNestedCustomElementHost(instance: RadiantElementServerRenderSsrCapable): string {\n\tconst hydrate = isServerRenderHydrationActive();\n\tconst options: RenderToStringOptions = { hydrate, mode: hydrate ? 'hydrate' : 'plain' };\n\n\tif (!hydrate) {\n\t\treturn renderRadiantElementHostToString(instance, options);\n\t}\n\n\treturn withServerHydrationBindingState(createServerHydrationBindingState(), () =>\n\t\trenderRadiantElementHostToString(instance, options),\n\t);\n}\n\nexport function getOrCreateRadiantElementSsrRuntime(): RadiantElementSsrRuntime {\n\tif (radiantElementSsrRuntime) {\n\t\treturn radiantElementSsrRuntime;\n\t}\n\n\tradiantElementSsrRuntime = {\n\t\tgetHostAttributes: getRadiantElementHostSsrAttributes,\n\t\trenderHost: renderRadiantElementHost,\n\t\trenderHostToString: renderRadiantElementHostToString,\n\t\tresolveRenderBridge: resolveRadiantElementRenderBridge,\n\t\trenderView: renderRadiantElementViewToString,\n\t};\n\n\treturn radiantElementSsrRuntime;\n}\n\nexport function withServerRadiantElementSsrRuntime<T>(render: () => T): T {\n\treturn withRadiantElementSsrRuntime(getOrCreateRadiantElementSsrRuntime(), () => runWithSsrProviderStack(render));\n}\n"
|
|
20
33
|
],
|
|
21
|
-
"mappings": "i1BACO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,OAAO,EAAM,QAAQ,KAAM,OAAO,EAAE,QAAQ,KAAM,QAAQ,EAAE,QAAQ,KAAM,MAAM,EAAE,QAAQ,KAAM,MAAM,ECAvG,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,EAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,ECtB7G,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAC1F,EAAwC,OAAO,IAAI,yDAAyD,EAC5G,GAAiD,OAAO,IAC7D,kEACD,EAQO,SAAS,EAAmD,CAClE,EACA,EACO,CACP,EAAoB,EAAO,EAA8B,CAAW,EAU9D,SAAS,EAA2D,CAC1E,EACA,EACO,CACP,EA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ACN,SAAU,KACN,UAAS,EAAG,CACf,OAAO,GAAiC,CAAQ,EAElD,GACE,CAAM,EAGV,SAAS,EAAgC,CAAC,EAAwD,CACjG,IAAM,EAAU,GAA8B,EACxC,EAAiC,CAAE,UAAS,KAAM,EAAU,UAAY,OAAQ,EAEtF,GAAI,CAAC,EACJ,OAAO,EAAiC,EAAU,CAAO,EAG1D,OAAO,GAAgC,GAAkC,EAAG,IAC3E,EAAiC,EAAU,CAAO,CACnD,EAGM,SAAS,EAAmC,EAA6B,CAC/E,GAAI,EACH,OAAO,EAWR,OARA,EAA2B,CAC1B,kBAAmB,GACnB,WAAY,EACZ,mBAAoB,EACpB,oBAAqB,GACrB,WAAY,EACb,EAEO,EAGD,SAAS,EAAqC,CAAC,EAAoB,CACzE,OAAO,GAA6B,GAAoC,EAAG,IAAM,EAAwB,CAAM,CAAC",
|
|
35
|
+
"debugId": "34EE8AD97CB89E1964756E2164756E21",
|
|
23
36
|
"names": []
|
|
24
37
|
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import type { InternalRadiantSsrHost } from '
|
|
1
|
+
import type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the private SSR host snapshot from a Radiant Element Host.
|
|
4
|
+
* Extraction stays in the server layer; detection uses {@link RADIANT_ELEMENT_BRAND}.
|
|
5
|
+
*/
|
|
2
6
|
export declare function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var R=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function t(i){return(i.constructor[R]??[]).slice()}var s=Symbol.for("@ecopages/radiant.RadiantElement");function a(i){return typeof i==="object"&&i!==null&&s in i}function I(i){if(!a(i))throw Error("Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.");return{constructor:i.constructor,renderRootMode:i.renderRootMode,getAttribute:(r)=>i.getAttribute(r),getAttributeNames:()=>i.getAttributeNames(),getAuthoredHydrationScriptMarkup:()=>i.getAuthoredHydrationScriptMarkup(),getContextProviders:()=>i.getContextProviders(),getHydrationBindings:()=>i.getHydrationBindings(),getReactiveProperties:()=>i.getReactiveProperties(),getReactivePropDefinitions:()=>t(i),getPropertyValue:(r)=>Reflect.get(i,r),getSlotProjectionScriptTag:()=>i.getSlotProjectionScriptTag(),resolveTrackedRenderOutput:()=>i.resolveTrackedRenderOutput()}}export{I as toInternalRadiantSsrHost};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=628637024C616DEC64756E2164756E21
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/core/reactive-prop-metadata.ts", "../src/core/radiant-element-ssr-host.ts", "../src/server/radiant-element-ssr-extractor.ts"],
|
|
3
|
+
"sources": ["../src/core/reactive-prop-metadata.ts", "../src/core/radiant-element-brand.ts", "../src/core/radiant-element-ssr-host-source.ts", "../src/server/radiant-element-ssr-extractor.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
|
|
6
|
-
"
|
|
7
|
-
"import {
|
|
6
|
+
"/** Cross-realm Element Host brand for SSR extraction (survives duplicate package copies). */\nexport const RADIANT_ELEMENT_BRAND = Symbol.for('@ecopages/radiant.RadiantElement');\n",
|
|
7
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from './reactive-prop-core';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { RADIANT_ELEMENT_BRAND } from './radiant-element-brand';\n\n/**\n * Branded Element Host surface read by the server SSR pipeline.\n *\n * Lives in core so client-safe registry types and server extractors share one\n * contract without importing {@link RadiantElement} (HTMLElement at init).\n */\nexport type RadiantElementSsrHostSource = {\n\tconstructor: Function;\n\treadonly renderRootMode: 'light' | 'shadow';\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames(): string[];\n\tgetAuthoredHydrationScriptMarkup(): string | undefined;\n\tgetContextProviders(): SsrSerializableContextProvider[];\n\tgetHydrationBindings(): SsrSerializableHydrationBinding[];\n\tgetReactiveProperties(): ReactiveProperty[];\n\tgetSlotProjectionScriptTag(): string | undefined;\n\tresolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable };\n};\n\nexport type BrandedRadiantElementSsrHost = RadiantElementSsrHostSource & {\n\treadonly [RADIANT_ELEMENT_BRAND]: true;\n};\n\nexport type RadiantElementViewRenderSource = Pick<\n\tRadiantElementSsrHostSource,\n\t'resolveTrackedRenderOutput' | 'renderRootMode'\n>;\n\n/** True when the value is a branded Radiant Element Host the server can serialize. */\nexport function isRadiantElementSsrHost(component: unknown): component is BrandedRadiantElementSsrHost {\n\treturn typeof component === 'object' && component !== null && RADIANT_ELEMENT_BRAND in component;\n}\n",
|
|
8
|
+
"import { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { isRadiantElementSsrHost } from '../core/radiant-element-ssr-host-source';\nimport type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';\n/**\n * Builds the private SSR host snapshot from a Radiant Element Host.\n * Extraction stays in the server layer; detection uses {@link RADIANT_ELEMENT_BRAND}.\n */\nexport function toInternalRadiantSsrHost(component: object): InternalRadiantSsrHost {\n\tif (!isRadiantElementSsrHost(component)) {\n\t\tthrow new Error(\n\t\t\t'Radiant SSR runtime requires a RadiantElement host. Import a Radiant server SSR entrypoint and pass a RadiantElement instance.',\n\t\t);\n\t}\n\n\treturn {\n\t\tconstructor: component.constructor as CustomElementConstructor,\n\t\trenderRootMode: component.renderRootMode,\n\t\tgetAttribute: (name) => component.getAttribute(name),\n\t\tgetAttributeNames: () => component.getAttributeNames(),\n\t\tgetAuthoredHydrationScriptMarkup: () => component.getAuthoredHydrationScriptMarkup(),\n\t\tgetContextProviders: () => component.getContextProviders(),\n\t\tgetHydrationBindings: () => component.getHydrationBindings(),\n\t\tgetReactiveProperties: () => component.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => Reflect.get(component, name),\n\t\tgetSlotProjectionScriptTag: () => component.getSlotProjectionScriptTag(),\n\t\tresolveTrackedRenderOutput: () => component.resolveTrackedRenderOutput(),\n\t};\n}\n"
|
|
8
9
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
10
|
+
"mappings": "AAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EA2BjF,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,EC7BtG,IAAM,EAAwB,OAAO,IAAI,kCAAkC,ECkC3E,SAAS,CAAuB,CAAC,EAA+D,CACtG,OAAO,OAAO,IAAc,UAAY,IAAc,MAAQ,KAAyB,EC7BjF,SAAS,CAAwB,CAAC,EAA2C,CACnF,GAAI,CAAC,EAAwB,CAAS,EACrC,MAAU,MACT,gIACD,EAGD,MAAO,CACN,YAAa,EAAU,YACvB,eAAgB,EAAU,eAC1B,aAAc,CAAC,IAAS,EAAU,aAAa,CAAI,EACnD,kBAAmB,IAAM,EAAU,kBAAkB,EACrD,iCAAkC,IAAM,EAAU,iCAAiC,EACnF,oBAAqB,IAAM,EAAU,oBAAoB,EACzD,qBAAsB,IAAM,EAAU,qBAAqB,EAC3D,sBAAuB,IAAM,EAAU,sBAAsB,EAC7D,2BAA4B,IAAM,EAA2B,CAAS,EACtE,iBAAkB,CAAC,IAAS,QAAQ,IAAI,EAAW,CAAI,EACvD,2BAA4B,IAAM,EAAU,2BAA2B,EACvE,2BAA4B,IAAM,EAAU,2BAA2B,CACxE",
|
|
11
|
+
"debugId": "628637024C616DEC64756E2164756E21",
|
|
11
12
|
"names": []
|
|
12
13
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
2
|
import type { RenderToStringOptions } from '@ecopages/jsx/server';
|
|
3
|
+
import type { InternalRadiantSsrHost } from '../core/radiant-element-ssr-host';
|
|
4
|
+
export type RadiantElementViewRenderer = (host: InternalRadiantSsrHost, options?: RenderToStringOptions) => string;
|
|
3
5
|
export declare class RadiantElementSsrService {
|
|
4
6
|
private readonly component;
|
|
5
7
|
private readonly host;
|
|
6
|
-
|
|
8
|
+
private readonly renderView;
|
|
9
|
+
constructor(component: object, renderView: RadiantElementViewRenderer);
|
|
7
10
|
private ensureReady;
|
|
8
11
|
renderHost(): JsxRenderable;
|
|
9
12
|
renderHostToString(options?: RenderToStringOptions, attributes?: Record<string, string>): string;
|