@raphy-js/dom 0.0.0-stage → 1.0.0-dev.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +187 -2
- package/dist/DOMBlueprintMaterializer-C-icNhvm.cjs +1 -0
- package/dist/DOMBlueprintMaterializer-CxzM_TX5.js +201 -0
- package/dist/FullDOMOperations-BOlf0_0L.js +2781 -0
- package/dist/FullDOMOperations-Dschwj33.cjs +1 -0
- package/dist/api/renderer.d.ts +12 -0
- package/dist/applicationIdentity-CHbuUlsE.cjs +1 -0
- package/dist/applicationIdentity-DjVgpsQq.js +11 -0
- package/dist/bind-BEmkQdaL.cjs +1 -0
- package/dist/bind-OakIMWpC.js +52 -0
- package/dist/binding/DOMValueWriter.d.ts +59 -0
- package/dist/binding/materializeComponentProps.d.ts +38 -0
- package/dist/binding/mountDOMBinding.d.ts +9 -0
- package/dist/binding/mountDOMProps.d.ts +22 -0
- package/dist/capture.cjs +1 -0
- package/dist/capture.d.ts +7 -0
- package/dist/capture.js +166 -0
- package/dist/channels-Bs8GHVWn.cjs +1 -0
- package/dist/channels-DqAQt-NH.js +33 -0
- package/dist/compact/hydration.cjs +1 -0
- package/dist/compact/hydration.d.ts +9 -0
- package/dist/compact/hydration.js +12 -0
- package/dist/compact/index.d.ts +19 -0
- package/dist/compact/targetRuntime.d.ts +1 -0
- package/dist/compact.cjs +1 -0
- package/dist/compact.js +34 -0
- package/dist/contracts/freezeGeneratedContract.d.ts +5 -0
- package/dist/contracts/manifest.json +25 -0
- package/dist/contracts/node.cjs +1 -0
- package/dist/contracts/node.contract.json +36889 -0
- package/dist/contracts/node.d.ts +6 -0
- package/dist/contracts/node.js +19 -0
- package/dist/contracts/stylesheet.cjs +1 -0
- package/dist/contracts/stylesheet.contract.json +11887 -0
- package/dist/contracts/stylesheet.d.ts +6 -0
- package/dist/contracts/stylesheet.js +22 -0
- package/dist/createDOMDataEventInput-B82pnIav.cjs +1 -0
- package/dist/createDOMDataEventInput-BDX50jhu.js +3010 -0
- package/dist/createDOMNodeRuntime-BHcsbeO1.cjs +1 -0
- package/dist/createDOMNodeRuntime-DIKOUQP7.js +3006 -0
- package/dist/createHydrationRenderer-C7srF-66.js +289 -0
- package/dist/createHydrationRenderer-DKybWTj4.cjs +1 -0
- package/dist/elementRef-D8Ir8tXA.cjs +1 -0
- package/dist/elementRef-YPBBElV9.js +32 -0
- package/dist/event/DOMEventHub.d.ts +303 -0
- package/dist/freezeGeneratedContract-0EZt85o4.js +10 -0
- package/dist/freezeGeneratedContract-g_Op1hGY.cjs +1 -0
- package/dist/hydration/HydrationEvents.d.ts +20 -0
- package/dist/hydration/HydrationSession.d.ts +107 -0
- package/dist/hydration/HydrationStream.d.ts +30 -0
- package/dist/hydration/activateHydration.d.ts +2 -0
- package/dist/hydration/createHydrationRenderer.d.ts +25 -0
- package/dist/hydration/index.d.ts +8 -0
- package/dist/hydration.cjs +1 -0
- package/dist/hydration.js +12 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +24 -0
- package/dist/interaction/clipboard.d.ts +2 -0
- package/dist/interaction/contextAction.d.ts +3 -0
- package/dist/interaction/contracts/node.cjs +1 -0
- package/dist/interaction/contracts/node.d.ts +15 -0
- package/dist/interaction/contracts/node.js +60 -0
- package/dist/interaction/dragDrop.d.ts +13 -0
- package/dist/interaction/focus.d.ts +4 -0
- package/dist/interaction/geometry.d.ts +39 -0
- package/dist/interaction/hover.d.ts +4 -0
- package/dist/interaction/index.d.ts +2 -0
- package/dist/interaction/interaction.d.ts +4 -0
- package/dist/interaction/internal/DOMInputModality.d.ts +20 -0
- package/dist/interaction/internal/DOMInteraction.types.d.ts +29 -0
- package/dist/interaction/internal/applicationIdentity.d.ts +3 -0
- package/dist/interaction/internal/dragDataTransfer.d.ts +4 -0
- package/dist/interaction/internal/solvePosition.d.ts +5 -0
- package/dist/interaction/keyboard.d.ts +3 -0
- package/dist/interaction/move.d.ts +3 -0
- package/dist/interaction/nativeDragDrop.d.ts +18 -0
- package/dist/interaction/outside.d.ts +3 -0
- package/dist/interaction/press.d.ts +3 -0
- package/dist/interaction/profile.cjs +1 -0
- package/dist/interaction/profile.d.ts +2 -0
- package/dist/interaction/profile.js +48 -0
- package/dist/interaction/rovingFocus.d.ts +4 -0
- package/dist/interaction/runtime.d.ts +7 -0
- package/dist/interaction/textEditing.d.ts +4 -0
- package/dist/interaction.cjs +1 -0
- package/dist/interaction.js +1603 -0
- package/dist/internal/dev.d.ts +20 -0
- package/dist/motion/channels.d.ts +5 -0
- package/dist/motion/index.d.ts +8 -0
- package/dist/motion-scroll/index.d.ts +19 -0
- package/dist/motion-scroll.cjs +1 -0
- package/dist/motion-scroll.js +169 -0
- package/dist/motion.cjs +1 -0
- package/dist/motion.js +187 -0
- package/dist/operations.cjs +1 -0
- package/dist/operations.d.ts +3 -0
- package/dist/operations.js +10 -0
- package/dist/profile/DOMProfile.d.ts +4 -0
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile.cjs +1 -0
- package/dist/profile.js +23 -0
- package/dist/renderer/DOMEffectScope.d.ts +13 -0
- package/dist/renderer/DOMPresentation.d.ts +8 -0
- package/dist/renderer/DOMRenderer.d.ts +35 -0
- package/dist/renderer/DOMRenderer.types.d.ts +12 -0
- package/dist/renderer/DOMRendererExtension.types.d.ts +33 -0
- package/dist/renderer/DOMRuntimeProfile.d.ts +15 -0
- package/dist/renderer/DOMTargetRuntime.d.ts +1 -0
- package/dist/renderer/createDOMTargetRuntime.d.ts +3 -0
- package/dist/renderer/installAuxiliaryViews.d.ts +8 -0
- package/dist/renderer/installDOMRendererExtensions.d.ts +10 -0
- package/dist/renderer/resolveDOMMountTarget.d.ts +7 -0
- package/dist/renderer-4Wbid5nE.js +30 -0
- package/dist/renderer-DHK3lLG-.cjs +1 -0
- package/dist/resolveDOMMountTarget-C75JWc5x.cjs +1 -0
- package/dist/resolveDOMMountTarget-D944H05N.js +19 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +21 -0
- package/dist/runtime.js +25 -0
- package/dist/serialization.cjs +1 -0
- package/dist/serialization.d.ts +4 -0
- package/dist/serialization.js +118 -0
- package/dist/stylesheet/DOMStyleManager.d.ts +95 -0
- package/dist/stylesheet/DOMStyleReferenceName.d.ts +2 -0
- package/dist/stylesheet/DOMStylesheetRuntime.d.ts +25 -0
- package/dist/stylesheet/acquireInstanceStylesheets.d.ts +4 -0
- package/dist/stylesheet/scopeDOMSelector.d.ts +2 -0
- package/dist/stylesheet/serializeDOMStyleValue.d.ts +3 -0
- package/dist/targetRuntime-C67QmOgE.cjs +1 -0
- package/dist/targetRuntime-C_OdmS5w.js +5 -0
- package/dist/template/AdvancedDOMMaterializer.d.ts +14 -0
- package/dist/template/AsyncDOMMaterializer.d.ts +4 -0
- package/dist/template/BoundaryDOMMaterializer.d.ts +10 -0
- package/dist/template/DOMHostPlan.d.ts +4 -0
- package/dist/template/DOMNode.types.d.ts +192 -0
- package/dist/template/DOMNodeRuntime.d.ts +1 -0
- package/dist/template/binding/DOMBinding.types.d.ts +44 -0
- package/dist/template/binding/bind.d.ts +16 -0
- package/dist/template/blueprint/DOMBlueprintAddressing.d.ts +23 -0
- package/dist/template/blueprint/DOMBlueprintMaterializer.d.ts +3 -0
- package/dist/template/blueprint/DOMBlueprintMaterializer.types.d.ts +15 -0
- package/dist/template/blueprint/DOMHostBlueprint.d.ts +102 -0
- package/dist/template/blueprint/DOMHostBlueprintCache.d.ts +86 -0
- package/dist/template/blueprint/createDOMDataEventInput.d.ts +5 -0
- package/dist/template/blueprint/mountDOMHostBlueprint.d.ts +45 -0
- package/dist/template/createDOMNodeRuntime.d.ts +3 -0
- package/dist/template/each/mountEach.d.ts +5 -0
- package/dist/template/each/mountPureEach.d.ts +22 -0
- package/dist/template/error/DOMInvocation.d.ts +58 -0
- package/dist/template/error/DOMOperationError.d.ts +25 -0
- package/dist/template/html/DOMRawHtmlNode.types.d.ts +21 -0
- package/dist/template/html/rawHtml.d.ts +5 -0
- package/dist/template/keep-alive/DOMKeepAliveNode.types.d.ts +10 -0
- package/dist/template/keep-alive/keepAlive.d.ts +4 -0
- package/dist/template/mount/DOMMountTransaction.d.ts +63 -0
- package/dist/template/mountNode.d.ts +173 -0
- package/dist/template/normalizeChildren.d.ts +5 -0
- package/dist/template/operations/DOMOperations.d.ts +56 -0
- package/dist/template/operations/FullDOMOperations.d.ts +6 -0
- package/dist/template/page/DOMHead.d.ts +7 -0
- package/dist/template/page/PageNodePlan.d.ts +31 -0
- package/dist/template/ref/DOMElementRef.types.d.ts +7 -0
- package/dist/template/ref/componentRefGuard.d.ts +6 -0
- package/dist/template/ref/elementRef.d.ts +9 -0
- package/dist/template/structural/range/DOMRange.d.ts +145 -0
- package/dist/template/teleport/DOMTeleportNode.types.d.ts +8 -0
- package/dist/template/teleport/teleport.d.ts +4 -0
- package/dist/template/transition/DOMTransitionCoordinator.d.ts +32 -0
- package/dist/template/transition/DOMTransitionNode.types.d.ts +30 -0
- package/dist/template/transition/transition.d.ts +4 -0
- package/dist/template/value/DOMValueDescriptor.types.d.ts +34 -0
- package/dist/template/value/valueDescriptors.d.ts +13 -0
- package/package.json +157 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** DOM mount target accepted by the existing adapter. */
|
|
2
|
+
export type DOMMountTarget = Element | ShadowRoot | string;
|
|
3
|
+
/**
|
|
4
|
+
* Разрешает удобный selector и не принимает произвольный DocumentFragment как ShadowRoot.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveDOMMountTarget(target: DOMMountTarget): Element | ShadowRoot;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { d as f, e as m, c } from "./createDOMNodeRuntime-DIKOUQP7.js";
|
|
2
|
+
import { d as l } from "./createDOMDataEventInput-BDX50jhu.js";
|
|
3
|
+
import { D as d, a as O } from "./DOMBlueprintMaterializer-CxzM_TX5.js";
|
|
4
|
+
import { F as R, c as u } from "./FullDOMOperations-BOlf0_0L.js";
|
|
5
|
+
function E(r) {
|
|
6
|
+
let t = d;
|
|
7
|
+
const n = r.extensions?.filter((e) => e.resolveTarget) ?? [];
|
|
8
|
+
n.length > 0 && (t = f(m(u, (e) => {
|
|
9
|
+
let o;
|
|
10
|
+
for (const a of n) {
|
|
11
|
+
const i = a.resolveTarget(e, t);
|
|
12
|
+
if (i !== void 0) {
|
|
13
|
+
if (o !== void 0)
|
|
14
|
+
throw new Error(`[RaphyDOM] Multiple extensions resolve target "${e}".`);
|
|
15
|
+
o = i;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return o;
|
|
19
|
+
})));
|
|
20
|
+
const s = {
|
|
21
|
+
domOptions: r,
|
|
22
|
+
create: (e) => new c(e, r, R, O),
|
|
23
|
+
runtimeProfile: l(),
|
|
24
|
+
targetRuntime: t
|
|
25
|
+
};
|
|
26
|
+
return Object.freeze(s);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
E as r
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./createDOMNodeRuntime-BHcsbeO1.cjs"),O=require("./createDOMDataEventInput-B82pnIav.cjs"),u=require("./DOMBlueprintMaterializer-C-icNhvm.cjs"),a=require("./FullDOMOperations-Dschwj33.cjs");function M(r){let t=u.DOM_TARGET_RUNTIME;const o=r.extensions?.filter(e=>e.resolveTarget)??[];o.length>0&&(t=i.createDOMTargetRuntime(i.createDOMNodeRuntime(a.createDOMBlueprintInstance,e=>{let n;for(const l of o){const s=l.resolveTarget(e,t);if(s!==void 0){if(n!==void 0)throw new Error(`[RaphyDOM] Multiple extensions resolve target "${e}".`);n=s}}return n})));const c={domOptions:r,create:e=>new i.DOMRenderer(e,r,a.FULL_DOM_OPERATIONS,u.DOM_BLUEPRINT_MATERIALIZER),runtimeProfile:O.domRuntimeProfile(),targetRuntime:t};return Object.freeze(c)}exports.renderer=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(e){if(typeof e=="string"){const o=e.trim();if(o.length===0)throw new TypeError("[RaphyDOM] Mount selector must not be empty.");if(typeof document>"u")throw new Error("[RaphyDOM] A selector mount target requires a browser Document.");const n=document.querySelector(o);if(n===null)throw new Error(`[RaphyDOM] Mount target ${JSON.stringify(o)} was not found.`);return n}if(e!==null&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11&&"host"in e&&e.host?.nodeType===1))return e;throw new TypeError("[RaphyDOM] Mount target must be a selector, Element or ShadowRoot.")}exports.resolveDOMMountTarget=r;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function r(e) {
|
|
2
|
+
if (typeof e == "string") {
|
|
3
|
+
const o = e.trim();
|
|
4
|
+
if (o.length === 0)
|
|
5
|
+
throw new TypeError("[RaphyDOM] Mount selector must not be empty.");
|
|
6
|
+
if (typeof document > "u")
|
|
7
|
+
throw new Error("[RaphyDOM] A selector mount target requires a browser Document.");
|
|
8
|
+
const n = document.querySelector(o);
|
|
9
|
+
if (n === null)
|
|
10
|
+
throw new Error(`[RaphyDOM] Mount target ${JSON.stringify(o)} was not found.`);
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
if (e !== null && typeof e == "object" && (e.nodeType === 1 || e.nodeType === 11 && "host" in e && e.host?.nodeType === 1))
|
|
14
|
+
return e;
|
|
15
|
+
throw new TypeError("[RaphyDOM] Mount target must be a selector, Element or ShadowRoot.");
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
r
|
|
19
|
+
};
|
package/dist/runtime.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./renderer-DHK3lLG-.cjs"),r=require("./resolveDOMMountTarget-C75JWc5x.cjs"),n=Object.freeze({createDeferredRenderer:()=>{let e;return{renderer:t.renderer({get target(){if(e===void 0)throw new Error("[RaphyDOM] Set a mount target before materialization.");return e}}),setTarget(o){e=r.resolveDOMMountTarget(o)}}},createRenderer:e=>t.renderer({target:r.resolveDOMMountTarget(e)}),id:"@raphy-js/dom"});exports.resolveDOMMountTarget=r.resolveDOMMountTarget;exports.RAPHY_DOM_RUNTIME_ADAPTER=n;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentEmits } from '@raphy-js/core';
|
|
2
|
+
import { RaphExecution } from '@raphy-js/raph/execution';
|
|
3
|
+
import { RaphRuntime } from '@raphy-js/raph/runtime';
|
|
4
|
+
import { DOMMountTarget } from './renderer/resolveDOMMountTarget.js';
|
|
5
|
+
/** DOM boundary, которую пользователь может передать в `app.mount(...)`. */
|
|
6
|
+
export type { DOMMountTarget } from './renderer/resolveDOMMountTarget.js';
|
|
7
|
+
export { resolveDOMMountTarget } from './renderer/resolveDOMMountTarget.js';
|
|
8
|
+
/**
|
|
9
|
+
* Runtime adapter корневого DOM Target.
|
|
10
|
+
*
|
|
11
|
+
* Profile хранит только module reference на этот export. Живой Element либо
|
|
12
|
+
* ShadowRoot появляется исключительно при вызове `mount()` в browser runtime.
|
|
13
|
+
*/
|
|
14
|
+
export declare const RAPHY_DOM_RUNTIME_ADAPTER: Readonly<{
|
|
15
|
+
createDeferredRenderer: <Props = unknown, State = unknown, Emits extends ComponentEmits = Readonly<Record<never, never>>>() => {
|
|
16
|
+
renderer: import('./index.js').DOMRendererDefinition<Props, State, Emits, RaphRuntime>;
|
|
17
|
+
setTarget(value: DOMMountTarget): void;
|
|
18
|
+
};
|
|
19
|
+
createRenderer: <Props = unknown, State = unknown, Emits extends ComponentEmits = Readonly<Record<never, never>>, Runtime extends RaphExecution<Runtime> = RaphRuntime>(target: DOMMountTarget) => import('./index.js').DOMRendererDefinition<Props, State, Emits, Runtime>;
|
|
20
|
+
id: "@raphy-js/dom";
|
|
21
|
+
}>;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { r } from "./renderer-4Wbid5nE.js";
|
|
2
|
+
import { r as t } from "./resolveDOMMountTarget-D944H05N.js";
|
|
3
|
+
const d = /* @__PURE__ */ Object.freeze({
|
|
4
|
+
createDeferredRenderer: () => {
|
|
5
|
+
let e;
|
|
6
|
+
return {
|
|
7
|
+
renderer: r({
|
|
8
|
+
get target() {
|
|
9
|
+
if (e === void 0)
|
|
10
|
+
throw new Error("[RaphyDOM] Set a mount target before materialization.");
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
}),
|
|
14
|
+
setTarget(a) {
|
|
15
|
+
e = t(a);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
createRenderer: (e) => r({ target: t(e) }),
|
|
20
|
+
id: "@raphy-js/dom"
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
d as RAPHY_DOM_RUNTIME_ADAPTER,
|
|
24
|
+
t as resolveDOMMountTarget
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./bind-BEmkQdaL.cjs"),p=new Set(["cursive","emoji","fangsong","fantasy","math","monospace","sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif"]);function d(n){switch(n.kind){case"border":return m(n.value);case"color":return s(n.value);case"cubicBezier":return u(n.value);case"dimension":return i(n.value);case"duration":return`${r(n.value.value)}${n.value.unit}`;case"fontFamily":return f(n.value);case"fontWeight":return typeof n.value=="number"?r(n.value):n.value;case"gradient":return y(n.value);case"number":return r(n.value);case"shadow":return h(n.value);case"strokeStyle":return $(n.value);case"transition":return l(n.value);case"typography":return b(n.value)}}function m(n){return`${i(n.width)} ${$(n.style)} ${s(n.color)}`}function s(n){const t=n.components.map(c=>c==="none"?c:r(c)),e=n.alpha===void 0?"":` / ${r(n.alpha)}`;switch(n.colorSpace){case"hsl":return`hsl(${t[0]} ${o(n.components[1])} ${o(n.components[2])}${e})`;case"hwb":return`hwb(${t[0]} ${o(n.components[1])} ${o(n.components[2])}${e})`;case"lab":case"lch":case"oklab":case"oklch":return`${n.colorSpace}(${t.join(" ")}${e})`;default:return`color(${n.colorSpace} ${t.join(" ")}${e})`}}function o(n){return n===void 0||n==="none"?n??"none":`${r(n)}%`}function u(n){return`cubic-bezier(${n.map(r).join(", ")})`}function i(n){return`${r(n.value)}${n.unit}`}function f(n){return(typeof n=="string"?[n]:n).map(e=>p.has(e)||/^[-_a-z][\w-]*$/i.test(e)?e:JSON.stringify(e)).join(", ")}function y(n){return`linear-gradient(${n.map(e=>`${s(e.color)} ${r(e.position*100)}%`).join(", ")})`}function h(n){return(Array.isArray(n)?n:[n]).map(g).join(", ")}function g(n){return[n.inset===!0?"inset":"",i(n.offsetX),i(n.offsetY),i(n.blur),i(n.spread),s(n.color)].filter(Boolean).join(" ")}function $(n){return typeof n=="string"?n:n.dashArray.map(i).join(" ")}function l(n){return[`${r(n.duration.value)}${n.duration.unit}`,u(n.timingFunction),`${r(n.delay.value)}${n.delay.unit}`].join(" ")}function b(n){return[typeof n.fontWeight=="number"?r(n.fontWeight):n.fontWeight,`${i(n.fontSize)}/${r(n.lineHeight)}`,f(n.fontFamily)].join(" ")}function r(n){return Object.is(n,-0)?"0":String(n)}exports.createNativeBinding=a.bind;exports.isNativeBinding=a.isDOMBinding;exports.serializeStyleValue=d;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Pure CSS value formatting shared by browser and server HTML targets. */
|
|
2
|
+
export { serializeDOMStyleValue as serializeStyleValue } from './stylesheet/serializeDOMStyleValue.js';
|
|
3
|
+
/** Descriptors are platform-free; adapters share native binding validation. */
|
|
4
|
+
export { bind as createNativeBinding, isDOMBinding as isNativeBinding, } from './template/binding/bind.js';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { b as S, i as j } from "./bind-OakIMWpC.js";
|
|
2
|
+
const $ = /* @__PURE__ */ new Set([
|
|
3
|
+
"cursive",
|
|
4
|
+
"emoji",
|
|
5
|
+
"fangsong",
|
|
6
|
+
"fantasy",
|
|
7
|
+
"math",
|
|
8
|
+
"monospace",
|
|
9
|
+
"sans-serif",
|
|
10
|
+
"serif",
|
|
11
|
+
"system-ui",
|
|
12
|
+
"ui-monospace",
|
|
13
|
+
"ui-rounded",
|
|
14
|
+
"ui-sans-serif",
|
|
15
|
+
"ui-serif"
|
|
16
|
+
]);
|
|
17
|
+
function l(n) {
|
|
18
|
+
switch (n.kind) {
|
|
19
|
+
case "border":
|
|
20
|
+
return p(n.value);
|
|
21
|
+
case "color":
|
|
22
|
+
return s(n.value);
|
|
23
|
+
case "cubicBezier":
|
|
24
|
+
return a(n.value);
|
|
25
|
+
case "dimension":
|
|
26
|
+
return i(n.value);
|
|
27
|
+
case "duration":
|
|
28
|
+
return `${r(n.value.value)}${n.value.unit}`;
|
|
29
|
+
case "fontFamily":
|
|
30
|
+
return f(n.value);
|
|
31
|
+
case "fontWeight":
|
|
32
|
+
return typeof n.value == "number" ? r(n.value) : n.value;
|
|
33
|
+
case "gradient":
|
|
34
|
+
return m(n.value);
|
|
35
|
+
case "number":
|
|
36
|
+
return r(n.value);
|
|
37
|
+
case "shadow":
|
|
38
|
+
return d(n.value);
|
|
39
|
+
case "strokeStyle":
|
|
40
|
+
return u(n.value);
|
|
41
|
+
case "transition":
|
|
42
|
+
return y(n.value);
|
|
43
|
+
case "typography":
|
|
44
|
+
return g(n.value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function p(n) {
|
|
48
|
+
return `${i(n.width)} ${u(n.style)} ${s(n.color)}`;
|
|
49
|
+
}
|
|
50
|
+
function s(n) {
|
|
51
|
+
const t = n.components.map((c) => c === "none" ? c : r(c)), e = n.alpha === void 0 ? "" : ` / ${r(n.alpha)}`;
|
|
52
|
+
switch (n.colorSpace) {
|
|
53
|
+
case "hsl":
|
|
54
|
+
return `hsl(${t[0]} ${o(n.components[1])} ${o(n.components[2])}${e})`;
|
|
55
|
+
case "hwb":
|
|
56
|
+
return `hwb(${t[0]} ${o(n.components[1])} ${o(n.components[2])}${e})`;
|
|
57
|
+
case "lab":
|
|
58
|
+
case "lch":
|
|
59
|
+
case "oklab":
|
|
60
|
+
case "oklch":
|
|
61
|
+
return `${n.colorSpace}(${t.join(" ")}${e})`;
|
|
62
|
+
default:
|
|
63
|
+
return `color(${n.colorSpace} ${t.join(" ")}${e})`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function o(n) {
|
|
67
|
+
return n === void 0 || n === "none" ? n ?? "none" : `${r(n)}%`;
|
|
68
|
+
}
|
|
69
|
+
function a(n) {
|
|
70
|
+
return `cubic-bezier(${n.map(r).join(", ")})`;
|
|
71
|
+
}
|
|
72
|
+
function i(n) {
|
|
73
|
+
return `${r(n.value)}${n.unit}`;
|
|
74
|
+
}
|
|
75
|
+
function f(n) {
|
|
76
|
+
return (typeof n == "string" ? [n] : n).map((e) => $.has(e) || /^[-_a-z][\w-]*$/i.test(e) ? e : JSON.stringify(e)).join(", ");
|
|
77
|
+
}
|
|
78
|
+
function m(n) {
|
|
79
|
+
return `linear-gradient(${n.map((e) => `${s(e.color)} ${r(e.position * 100)}%`).join(", ")})`;
|
|
80
|
+
}
|
|
81
|
+
function d(n) {
|
|
82
|
+
return (Array.isArray(n) ? n : [n]).map(h).join(", ");
|
|
83
|
+
}
|
|
84
|
+
function h(n) {
|
|
85
|
+
return [
|
|
86
|
+
n.inset === !0 ? "inset" : "",
|
|
87
|
+
i(n.offsetX),
|
|
88
|
+
i(n.offsetY),
|
|
89
|
+
i(n.blur),
|
|
90
|
+
i(n.spread),
|
|
91
|
+
s(n.color)
|
|
92
|
+
].filter(Boolean).join(" ");
|
|
93
|
+
}
|
|
94
|
+
function u(n) {
|
|
95
|
+
return typeof n == "string" ? n : n.dashArray.map(i).join(" ");
|
|
96
|
+
}
|
|
97
|
+
function y(n) {
|
|
98
|
+
return [
|
|
99
|
+
`${r(n.duration.value)}${n.duration.unit}`,
|
|
100
|
+
a(n.timingFunction),
|
|
101
|
+
`${r(n.delay.value)}${n.delay.unit}`
|
|
102
|
+
].join(" ");
|
|
103
|
+
}
|
|
104
|
+
function g(n) {
|
|
105
|
+
return [
|
|
106
|
+
typeof n.fontWeight == "number" ? r(n.fontWeight) : n.fontWeight,
|
|
107
|
+
`${i(n.fontSize)}/${r(n.lineHeight)}`,
|
|
108
|
+
f(n.fontFamily)
|
|
109
|
+
].join(" ");
|
|
110
|
+
}
|
|
111
|
+
function r(n) {
|
|
112
|
+
return Object.is(n, -0) ? "0" : String(n);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
S as createNativeBinding,
|
|
116
|
+
j as isNativeBinding,
|
|
117
|
+
l as serializeStyleValue
|
|
118
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { RaphyRendererContext, StylesheetDefinition, StyleValueProvider, StyleValueScope } from '@raphy-js/core';
|
|
2
|
+
import { DOMRendererOptions } from '../renderer/DOMRenderer.types.js';
|
|
3
|
+
type DOMStyleRoot = Document | ShadowRoot;
|
|
4
|
+
interface DOMStyleCheckpoint {
|
|
5
|
+
readonly definitionCount: number;
|
|
6
|
+
readonly markerLeases: ReadonlyMap<Element, ReadonlySet<symbol>>;
|
|
7
|
+
readonly roots: ReadonlySet<DOMStyleRoot>;
|
|
8
|
+
}
|
|
9
|
+
interface DOMScopedProviderLease {
|
|
10
|
+
readonly provider: StyleValueProvider;
|
|
11
|
+
readonly release: () => void;
|
|
12
|
+
readonly token: string;
|
|
13
|
+
}
|
|
14
|
+
/** Owns generated CSS, theme variables and application markers for one DOM renderer. */
|
|
15
|
+
export declare class DOMStyleManager {
|
|
16
|
+
get applicationId(): string;
|
|
17
|
+
readonly applicationScopeId: string;
|
|
18
|
+
private readonly _hasApplicationLayer;
|
|
19
|
+
private readonly _applicationMarker;
|
|
20
|
+
private readonly _compiled;
|
|
21
|
+
private readonly _context;
|
|
22
|
+
private readonly _definitions;
|
|
23
|
+
private readonly _definitionSet;
|
|
24
|
+
private readonly _markerLeases;
|
|
25
|
+
private readonly _nonce;
|
|
26
|
+
private readonly _providerBindings;
|
|
27
|
+
private readonly _providerStops;
|
|
28
|
+
private readonly _roots;
|
|
29
|
+
private readonly _scopedProviders;
|
|
30
|
+
private readonly _scopedProviderStates;
|
|
31
|
+
private _scopedProviderCounter;
|
|
32
|
+
private _disposed;
|
|
33
|
+
/** Creates the primary style root and starts one application-owned provider projection. */
|
|
34
|
+
constructor(context: RaphyRendererContext<any>, options: Pick<DOMRendererOptions, 'target' | 'styleNonce' | 'applicationMarker'>);
|
|
35
|
+
/** Captures stylesheet and tree-root state for synchronous mount rollback. */
|
|
36
|
+
checkpoint(): DOMStyleCheckpoint;
|
|
37
|
+
/** Materializes new definitions once and installs them in every retained tree root. */
|
|
38
|
+
acquire(definitions: readonly StylesheetDefinition<unknown>[] | undefined): void;
|
|
39
|
+
/** Creates one marker controller for a logical wrapperless style-value scope. */
|
|
40
|
+
createValueBoundary(scope: StyleValueScope, includeApplicationProviders?: boolean): DOMStyleValueBoundary;
|
|
41
|
+
/** Removes every artifact created after a failed synchronous mount checkpoint. */
|
|
42
|
+
rollback(checkpoint: DOMStyleCheckpoint): void;
|
|
43
|
+
/** Retains CSS-variable inheritance and stylesheet delivery for a DOM boundary. */
|
|
44
|
+
retainBoundary(target: Element | ShadowRoot): () => void;
|
|
45
|
+
/** Reinstalls manager-owned nodes after renderer replacement of a ShadowRoot target. */
|
|
46
|
+
restoreRoot(target: Element | ShadowRoot): void;
|
|
47
|
+
/** Stops subscriptions and removes all styles and marker tokens exactly once. */
|
|
48
|
+
dispose(): void;
|
|
49
|
+
/** Rejects calls that would recreate renderer-owned resources after disposal. */
|
|
50
|
+
private _assertActive;
|
|
51
|
+
/** Creates the application-owned style nodes for one Document or ShadowRoot. */
|
|
52
|
+
private _ensureRoot;
|
|
53
|
+
/** Retains one rule/subscription set per distinct provider identity and namespace. */
|
|
54
|
+
_retainScopedProvider(namespace: string, provider: StyleValueProvider): DOMScopedProviderLease;
|
|
55
|
+
/** Physical portals also project root providers onto their own logical roots. */
|
|
56
|
+
_resolveScopedProviders(scope: StyleValueScope, includeApplicationProviders: boolean): readonly (readonly [string, StyleValueProvider])[];
|
|
57
|
+
/** Installs one provider rule into one retained Document or ShadowRoot. */
|
|
58
|
+
private _installScopedProvider;
|
|
59
|
+
/** Projects one scoped binding into all roots retaining its provider. */
|
|
60
|
+
private _updateScopedProviderValue;
|
|
61
|
+
private _writeScopedProviderValue;
|
|
62
|
+
/** Releases subscriptions, rules and cache identity for one unused provider. */
|
|
63
|
+
private _removeScopedProvider;
|
|
64
|
+
/** Appends one compiled definition to one retained tree root. */
|
|
65
|
+
private _installDefinition;
|
|
66
|
+
/** Compiles a definition once through the renderer-declared Core runtime. */
|
|
67
|
+
private _materialize;
|
|
68
|
+
/** Creates the immutable DOM projection for every Core style binding. */
|
|
69
|
+
private _readProviderBindings;
|
|
70
|
+
/** Projects one changed semantic value into every retained DOM root. */
|
|
71
|
+
private _updateProviderValue;
|
|
72
|
+
/** Writes one application-scoped CSS custom property when its value changed. */
|
|
73
|
+
private _writeProviderValue;
|
|
74
|
+
/** Removes every style node owned by this manager from one root. */
|
|
75
|
+
private _removeRoot;
|
|
76
|
+
}
|
|
77
|
+
/** Owns marker elements and atomically swaps provider leases for one scope. */
|
|
78
|
+
export declare class DOMStyleValueBoundary {
|
|
79
|
+
private readonly _elements;
|
|
80
|
+
private readonly _manager;
|
|
81
|
+
private readonly _scope;
|
|
82
|
+
private readonly _includeApplicationProviders;
|
|
83
|
+
private readonly _leases;
|
|
84
|
+
private _disposed;
|
|
85
|
+
constructor(manager: DOMStyleManager, scope: StyleValueScope, includeApplicationProviders: boolean);
|
|
86
|
+
/** Validates and stages every provider before publishing new marker tokens. */
|
|
87
|
+
refresh(): void;
|
|
88
|
+
/** Marks one first materialized element of a logical root branch. */
|
|
89
|
+
attach(element: Element): void;
|
|
90
|
+
/** Forgets a replaced raw-HTML root without touching markers owned by others. */
|
|
91
|
+
detach(element: Element): void;
|
|
92
|
+
/** Releases markers and provider rules after physical DOM range removal. */
|
|
93
|
+
dispose(): void;
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StylesheetAdapter } from '@raphy-js/core';
|
|
2
|
+
/** DOM сохраняет enclosing at-rule до финальной сериализации, не затрагивая keyframe selectors. */
|
|
3
|
+
export type DOMStyleRule = string | Readonly<{
|
|
4
|
+
kind: 'qualified';
|
|
5
|
+
selector: string;
|
|
6
|
+
block: readonly DOMStyleRule[];
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
kind: 'at-rule';
|
|
9
|
+
name: string;
|
|
10
|
+
prelude: string;
|
|
11
|
+
block: readonly DOMStyleRule[] | null;
|
|
12
|
+
}>;
|
|
13
|
+
declare module '@raphy-js/core' {
|
|
14
|
+
interface StylesheetRendererTypeRegistry {
|
|
15
|
+
'@raphy-js/dom': {
|
|
16
|
+
readonly rule: DOMStyleRule;
|
|
17
|
+
readonly stylesheet: string;
|
|
18
|
+
readonly value: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** DOM-owned serializer for the renderer-neutral Core StyleSheet call language. */
|
|
23
|
+
export declare const DOM_STYLESHEET_ADAPTER: StylesheetAdapter;
|
|
24
|
+
/** Application-local DOM stylesheet runtime used by each renderer definition. */
|
|
25
|
+
export declare const DOM_STYLESHEET_RUNTIME: import('@raphy-js/core').StylesheetRuntime;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { StylesheetDefinition } from '@raphy-js/core';
|
|
2
|
+
import { DOMStyleManager } from './DOMStyleManager.js';
|
|
3
|
+
/** Atomically adds resolved definitions; lifetime and deduplication stay application-owned. */
|
|
4
|
+
export declare function acquireInstanceStylesheets(manager: DOMStyleManager, resolve: () => readonly StylesheetDefinition[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./createDOMNodeRuntime-BHcsbeO1.cjs"),t=e.createDOMTargetRuntime(e.createDOMNodeRuntime());exports.COMPACT_DOM_TARGET_RUNTIME=t;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContributionNodePlan as DOMContributionNodePlan, RegionNodePlan as DOMRegionNodePlan } from '@raphy-js/core';
|
|
2
|
+
import { DOMKeepAliveNodePlan } from './keep-alive/DOMKeepAliveNode.types.js';
|
|
3
|
+
import { ADVANCED_DOM_MOUNT_HOST, MountContext } from './mountNode.js';
|
|
4
|
+
import { DOMTeleportNodePlan } from './teleport/DOMTeleportNode.types.js';
|
|
5
|
+
import { DOMTransitionNodePlan } from './transition/DOMTransitionNode.types.js';
|
|
6
|
+
import { DOMRange } from './structural/range/DOMRange.js';
|
|
7
|
+
/** Private size probe: one factory and the existing DOM/Core ownership. */
|
|
8
|
+
export declare function createAdvancedDOMMaterializer(host: typeof ADVANCED_DOM_MOUNT_HOST): Readonly<{
|
|
9
|
+
teleport: <Props, State, Slots extends object>(plan: DOMTeleportNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
10
|
+
transition: <Props, State, Slots extends object>(plan: DOMTransitionNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
11
|
+
keepAlive: <Props, State, Slots extends object>(plan: DOMKeepAliveNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
12
|
+
contribution: <Props, State, Slots extends object>(plan: DOMContributionNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
13
|
+
region: <Props, State, Slots extends object>(plan: DOMRegionNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AsyncBoundaryNodePlan as DOMAsyncBoundaryNodePlan } from '@raphy-js/core';
|
|
2
|
+
import { BOUNDARY_DOM_MOUNT_HOST, MountContext } from './mountNode.js';
|
|
3
|
+
import { DOMRange } from './structural/range/DOMRange.js';
|
|
4
|
+
export declare function createAsyncDOMMaterializer(host: typeof BOUNDARY_DOM_MOUNT_HOST): <Props, State, Slots extends object>(plan: DOMAsyncBoundaryNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ErrorBoundaryNodePlan as DOMErrorBoundaryNodePlan } from '@raphy-js/core';
|
|
2
|
+
import { BOUNDARY_DOM_MOUNT_HOST, MountContext } from './mountNode.js';
|
|
3
|
+
import { DOMClientOnlyPlan, DOMHydrationBoundaryPlan } from './page/PageNodePlan.js';
|
|
4
|
+
import { DOMRange } from './structural/range/DOMRange.js';
|
|
5
|
+
/** Единственная реализация optional page/async/error materializers. */
|
|
6
|
+
export declare function createBoundaryDOMMaterializer(host: typeof BOUNDARY_DOM_MOUNT_HOST): Readonly<{
|
|
7
|
+
mountClientOnly: <Props, State, Slots extends object>(plan: DOMClientOnlyPlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
8
|
+
mountHydrationBoundary: <Props, State, Slots extends object>(plan: DOMHydrationBoundaryPlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
9
|
+
mountErrorBoundary: <Props, State, Slots extends object>(plan: DOMErrorBoundaryNodePlan, context: MountContext<Props, State, Slots>) => DOMRange;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DOMNormalizedChild } from './DOMNode.types.js';
|
|
2
|
+
/** Общие immutable snapshots host nodes без props или normalized children. */
|
|
3
|
+
export declare const EMPTY_DOM_ELEMENT_PROPS: Readonly<Record<string, unknown>>;
|
|
4
|
+
export declare const EMPTY_DOM_NORMALIZED_CHILDREN: readonly DOMNormalizedChild[];
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { ComponentEmits, ComponentEventListeners, ComponentNodePlan, ComponentNodeProps, ComponentNodePropsPlan, ComponentNodePropsSource, ComponentNodeSlots, ComponentNodeSlotsArgument, ComponentTemplate, CoreNodePlan, NoComponentEmits, NoComponentSlots, NodeDynamicValue, TargetRef, TextNodePlan } from '@raphy-js/core';
|
|
2
|
+
import { DOMBinding } from './binding/DOMBinding.types.js';
|
|
3
|
+
import { DOMHostBlueprintNodePlan } from './blueprint/DOMHostBlueprint.js';
|
|
4
|
+
import { DOMRawHtmlNodePlan } from './html/DOMRawHtmlNode.types.js';
|
|
5
|
+
import { DOMKeepAliveNodePlan } from './keep-alive/DOMKeepAliveNode.types.js';
|
|
6
|
+
import { DOMElementRef } from './ref/DOMElementRef.types.js';
|
|
7
|
+
import { DOMTeleportNodePlan } from './teleport/DOMTeleportNode.types.js';
|
|
8
|
+
import { DOMTransitionNodePlan } from './transition/DOMTransitionNode.types.js';
|
|
9
|
+
import { DOMListenerDescriptor, DOMValueDescriptor } from './value/DOMValueDescriptor.types.js';
|
|
10
|
+
/** Стандартный HTML tag, известный browser DOM typings. */
|
|
11
|
+
export type HTMLTag = keyof HTMLElementTagNameMap;
|
|
12
|
+
/** Стандартный SVG tag, известный browser DOM typings. */
|
|
13
|
+
export type SVGTag = keyof SVGElementTagNameMap;
|
|
14
|
+
/** Стандартный MathML tag, известный browser DOM typings. */
|
|
15
|
+
export type MathMLTag = keyof MathMLElementTagNameMap;
|
|
16
|
+
/** Расширяемый registry typed custom elements приложения. */
|
|
17
|
+
export interface RaphyCustomElementRegistry {
|
|
18
|
+
}
|
|
19
|
+
/** Имя пользовательского browser custom element. */
|
|
20
|
+
export type CustomElementTag = Extract<keyof RaphyCustomElementRegistry, string> | `${string}-${string}`;
|
|
21
|
+
/** Tag, который может материализовать DOM renderer. */
|
|
22
|
+
export type DOMTag = HTMLTag | SVGTag | MathMLTag | CustomElementTag;
|
|
23
|
+
/** Статическое значение HTML/SVG attribute. */
|
|
24
|
+
export type DOMAttributeValue = string | number | boolean | null | undefined;
|
|
25
|
+
/** Объект либо строка inline style. */
|
|
26
|
+
export type DOMClass = string | Readonly<Record<string, boolean>> | readonly DOMClass[];
|
|
27
|
+
/** Объект, строка либо массив объединяемых inline style значений. */
|
|
28
|
+
export type DOMStyle = string | Readonly<Partial<CSSStyleDeclaration>> | readonly DOMStyle[];
|
|
29
|
+
/** Обработчик browser event с типизированным current target. */
|
|
30
|
+
export type DOMEventHandler<EventType extends Event, CurrentTarget extends Element> = (event: EventType & {
|
|
31
|
+
readonly currentTarget: CurrentTarget;
|
|
32
|
+
}) => void;
|
|
33
|
+
type DOMEventHandlers<ElementType extends Element> = {
|
|
34
|
+
readonly [EventName in keyof GlobalEventHandlersEventMap as `on${Capitalize<EventName>}`]?: DOMEventHandler<GlobalEventHandlersEventMap[EventName], ElementType>;
|
|
35
|
+
};
|
|
36
|
+
type DOMElementPropertyKeys<ElementType extends Element> = {
|
|
37
|
+
[Property in keyof ElementType]: Property extends string ? ElementType[Property] extends (...arguments_: never[]) => unknown ? never : Property : never;
|
|
38
|
+
}[keyof ElementType];
|
|
39
|
+
type UnsafeDOMProperty = 'children' | 'childNodes' | 'innerHTML' | 'outerHTML' | 'parentElement' | 'parentNode' | 'style' | 'textContent';
|
|
40
|
+
type DOMElementProperties<ElementType extends Element> = Partial<Pick<ElementType, Exclude<DOMElementPropertyKeys<ElementType>, UnsafeDOMProperty>>>;
|
|
41
|
+
type DOMDataAttributes = {
|
|
42
|
+
readonly [Attribute in `data-${string}`]?: DOMAttributeValue;
|
|
43
|
+
};
|
|
44
|
+
type DOMAriaAttributes = {
|
|
45
|
+
readonly [Attribute in `aria-${string}`]?: DOMAttributeValue;
|
|
46
|
+
};
|
|
47
|
+
/** Атрибуты SVG, которые являются serialized attributes, а не JS properties. */
|
|
48
|
+
interface DOMSVGAttributes {
|
|
49
|
+
readonly 'gradientUnits'?: DOMAttributeValue;
|
|
50
|
+
readonly 'offset'?: DOMAttributeValue;
|
|
51
|
+
readonly 'stop-color'?: DOMAttributeValue;
|
|
52
|
+
readonly 'clipPathUnits'?: DOMAttributeValue;
|
|
53
|
+
readonly 'filterUnits'?: DOMAttributeValue;
|
|
54
|
+
readonly 'maskUnits'?: DOMAttributeValue;
|
|
55
|
+
readonly 'maskContentUnits'?: DOMAttributeValue;
|
|
56
|
+
readonly 'clip-path'?: DOMAttributeValue;
|
|
57
|
+
readonly 'mask'?: DOMAttributeValue;
|
|
58
|
+
readonly 'filter'?: DOMAttributeValue;
|
|
59
|
+
readonly 'stroke-dasharray'?: DOMAttributeValue;
|
|
60
|
+
readonly 'stroke-dashoffset'?: DOMAttributeValue;
|
|
61
|
+
readonly 'pathLength'?: DOMAttributeValue;
|
|
62
|
+
readonly 'opacity'?: DOMAttributeValue;
|
|
63
|
+
readonly 'marker-end'?: DOMAttributeValue;
|
|
64
|
+
readonly 'marker-start'?: DOMAttributeValue;
|
|
65
|
+
readonly 'markerUnits'?: DOMAttributeValue;
|
|
66
|
+
readonly 'markerWidth'?: DOMAttributeValue;
|
|
67
|
+
readonly 'markerHeight'?: DOMAttributeValue;
|
|
68
|
+
readonly 'refX'?: DOMAttributeValue;
|
|
69
|
+
readonly 'refY'?: DOMAttributeValue;
|
|
70
|
+
readonly 'orient'?: DOMAttributeValue;
|
|
71
|
+
readonly 'stdDeviation'?: DOMAttributeValue;
|
|
72
|
+
readonly 'in'?: DOMAttributeValue;
|
|
73
|
+
readonly 'result'?: DOMAttributeValue;
|
|
74
|
+
readonly 'mask-type'?: DOMAttributeValue;
|
|
75
|
+
readonly 'fill-rule'?: DOMAttributeValue;
|
|
76
|
+
readonly 'clip-rule'?: DOMAttributeValue;
|
|
77
|
+
readonly 'color-interpolation-filters'?: DOMAttributeValue;
|
|
78
|
+
readonly 'cx'?: DOMAttributeValue;
|
|
79
|
+
readonly 'cy'?: DOMAttributeValue;
|
|
80
|
+
readonly 'd'?: DOMAttributeValue;
|
|
81
|
+
readonly 'fill'?: DOMAttributeValue;
|
|
82
|
+
readonly 'focusable'?: DOMAttributeValue;
|
|
83
|
+
readonly 'height'?: DOMAttributeValue;
|
|
84
|
+
readonly 'href'?: DOMAttributeValue;
|
|
85
|
+
readonly 'points'?: DOMAttributeValue;
|
|
86
|
+
readonly 'preserveAspectRatio'?: DOMAttributeValue;
|
|
87
|
+
readonly 'r'?: DOMAttributeValue;
|
|
88
|
+
readonly 'rx'?: DOMAttributeValue;
|
|
89
|
+
readonly 'ry'?: DOMAttributeValue;
|
|
90
|
+
readonly 'stroke'?: DOMAttributeValue;
|
|
91
|
+
readonly 'stroke-linecap'?: DOMAttributeValue;
|
|
92
|
+
readonly 'stroke-linejoin'?: DOMAttributeValue;
|
|
93
|
+
readonly 'stroke-width'?: DOMAttributeValue;
|
|
94
|
+
readonly 'transform'?: DOMAttributeValue;
|
|
95
|
+
readonly 'viewBox'?: DOMAttributeValue;
|
|
96
|
+
readonly 'width'?: DOMAttributeValue;
|
|
97
|
+
readonly 'x'?: DOMAttributeValue;
|
|
98
|
+
readonly 'xlink:href'?: DOMAttributeValue;
|
|
99
|
+
readonly 'xmlns'?: DOMAttributeValue;
|
|
100
|
+
readonly 'x1'?: DOMAttributeValue;
|
|
101
|
+
readonly 'x2'?: DOMAttributeValue;
|
|
102
|
+
readonly 'y'?: DOMAttributeValue;
|
|
103
|
+
readonly 'y1'?: DOMAttributeValue;
|
|
104
|
+
readonly 'y2'?: DOMAttributeValue;
|
|
105
|
+
}
|
|
106
|
+
/** Атрибуты MathML, сериализуемые renderer через setAttribute. */
|
|
107
|
+
interface DOMMathMLAttributes {
|
|
108
|
+
readonly display?: DOMAttributeValue;
|
|
109
|
+
readonly displaystyle?: DOMAttributeValue;
|
|
110
|
+
readonly mathcolor?: DOMAttributeValue;
|
|
111
|
+
readonly mathsize?: DOMAttributeValue;
|
|
112
|
+
readonly mathvariant?: DOMAttributeValue;
|
|
113
|
+
readonly scriptlevel?: DOMAttributeValue;
|
|
114
|
+
}
|
|
115
|
+
type DOMNamespaceAttributes<ElementType extends Element> = ElementType extends SVGElement ? DOMSVGAttributes : ElementType extends MathMLElement ? DOMMathMLAttributes : object;
|
|
116
|
+
type DOMElementPropsSnapshot<ElementType extends Element> = Readonly<Omit<DOMElementProperties<ElementType>, keyof DOMNamespaceAttributes<ElementType>> & DOMEventHandlers<ElementType> & DOMDataAttributes & DOMAriaAttributes & DOMNamespaceAttributes<ElementType> & {
|
|
117
|
+
readonly class?: DOMClass;
|
|
118
|
+
readonly style?: DOMStyle;
|
|
119
|
+
}>;
|
|
120
|
+
type DOMElementBinding<ElementType extends Element, Property> = Property extends 'value' ? ElementType extends HTMLInputElement ? DOMBinding<string, 'auto'> | DOMBinding<number | null, 'number'> : ElementType extends HTMLTextAreaElement ? DOMBinding<string, 'auto'> : ElementType extends HTMLSelectElement ? DOMBinding<string, 'auto'> | DOMBinding<readonly string[], 'multiple'> : never : Property extends 'checked' ? ElementType extends HTMLInputElement ? DOMBinding<boolean, 'auto'> | DOMBinding<unknown, 'option'> : never : never;
|
|
121
|
+
type DOMElementDynamicFields<ElementType extends Element, Props> = {
|
|
122
|
+
readonly [Property in keyof Props]: Props[Property] | NodeDynamicValue<Props[Property]> | DOMElementBinding<ElementType, Property> | DOMValueDescriptor;
|
|
123
|
+
};
|
|
124
|
+
/** Типизирует статические и точечные динамические свойства конкретного DOM element. */
|
|
125
|
+
export type DOMElementProps<ElementType extends Element> = Readonly<DOMElementDynamicFields<ElementType, DOMElementPropsSnapshot<ElementType>> & {
|
|
126
|
+
readonly ref?: DOMElementRef<ElementType> | TargetRef | null;
|
|
127
|
+
}>;
|
|
128
|
+
/** Разрешает обычный props object либо один динамический snapshot всех props. */
|
|
129
|
+
export type DOMElementPropsSource<ElementType extends Element> = DOMElementProps<ElementType> | (NodeDynamicValue<DOMElementPropsSnapshot<ElementType> | null | undefined> & {
|
|
130
|
+
/** Static metadata outside read(); a ref inside the snapshot remains invalid. */
|
|
131
|
+
readonly ref?: DOMElementRef<ElementType> | TargetRef | null;
|
|
132
|
+
});
|
|
133
|
+
/** Свойства custom element до появления пользовательского registry augmentation. */
|
|
134
|
+
type CustomElementInstance<Tag extends CustomElementTag> = Tag extends keyof RaphyCustomElementRegistry ? RaphyCustomElementRegistry[Tag] extends Element ? RaphyCustomElementRegistry[Tag] : HTMLElement : HTMLElement;
|
|
135
|
+
export type CustomElementProps<Tag extends CustomElementTag = CustomElementTag> = DOMElementProps<CustomElementInstance<Tag>> & Readonly<Record<string, unknown | NodeDynamicValue<unknown>>>;
|
|
136
|
+
/** Разрешает обычный либо групповой динамический props source custom element. */
|
|
137
|
+
export type CustomElementPropsSource<Tag extends CustomElementTag = CustomElementTag> = CustomElementProps<Tag> | (NodeDynamicValue<Readonly<Record<string, unknown>> | null | undefined> & {
|
|
138
|
+
readonly ref?: DOMElementRef<CustomElementInstance<Tag>> | TargetRef | null;
|
|
139
|
+
});
|
|
140
|
+
/** Хранит renderer-ready props snapshot либо ленивый grouped source. */
|
|
141
|
+
export type DOMElementPropsPlan = Readonly<Record<string, unknown>> | NodeDynamicValue<Readonly<Record<string, unknown>> | null | undefined>;
|
|
142
|
+
/** Полный public input component: обычные props и объявленные `on<Event>` listeners. */
|
|
143
|
+
export type DOMComponentInputSnapshot<Props extends object, Emits extends ComponentEmits = NoComponentEmits> = Readonly<Props & ComponentEventListeners<Emits>>;
|
|
144
|
+
/** Типизирует статические и точечные dynamic inputs дочернего component. */
|
|
145
|
+
export type DOMComponentProps<Props extends object, Emits extends ComponentEmits = NoComponentEmits> = ComponentNodeProps<DOMComponentInputSnapshot<Props, Emits>>;
|
|
146
|
+
/** Разрешает props object либо один динамический snapshot всех component props. */
|
|
147
|
+
export type DOMComponentPropsSource<Props extends object, Emits extends ComponentEmits = NoComponentEmits> = ComponentNodePropsSource<DOMComponentInputSnapshot<Props, Emits>>;
|
|
148
|
+
/** Хранит renderer-ready component props snapshot либо grouped source. */
|
|
149
|
+
export type DOMComponentPropsPlan = ComponentNodePropsPlan;
|
|
150
|
+
/** Типизирует renderer-specific factories component slots. */
|
|
151
|
+
export type DOMComponentSlots<Slots extends object> = ComponentNodeSlots<Slots>;
|
|
152
|
+
/** Делает slot registry обязательным только при наличии required slot keys. */
|
|
153
|
+
export type DOMComponentSlotsArgument<Slots extends object> = ComponentNodeSlotsArgument<Slots>;
|
|
154
|
+
/** Одноразовый DOM construction plan стандартного или custom element. */
|
|
155
|
+
export interface DOMElementNodePlan {
|
|
156
|
+
readonly kind: 'element';
|
|
157
|
+
readonly tag: DOMTag;
|
|
158
|
+
readonly ref: DOMElementRef<Element> | TargetRef | null;
|
|
159
|
+
readonly props: DOMElementPropsPlan;
|
|
160
|
+
readonly children: readonly DOMNormalizedChild[];
|
|
161
|
+
}
|
|
162
|
+
/** Одноразовый DOM construction plan пользовательского Raphy component. */
|
|
163
|
+
export type DOMComponentNodePlan = ComponentNodePlan;
|
|
164
|
+
/** Fine-grained binding одного стабильного browser Text node. */
|
|
165
|
+
export type DOMTextNodePlan = TextNodePlan;
|
|
166
|
+
/** Узел DOM template, создаваемый `node()` либо `text()`. */
|
|
167
|
+
export type DOMNodePlan = CoreNodePlan | import('./page/PageNodePlan.js').DOMPagePlan | DOMElementNodePlan | DOMHostBlueprintNodePlan | DOMRawHtmlNodePlan | DOMTeleportNodePlan | DOMTransitionNodePlan | DOMKeepAliveNodePlan;
|
|
168
|
+
/** Допустимый child ручного `node()` API. */
|
|
169
|
+
export type DOMChild = DOMNodePlan | string | number | boolean | null | undefined | readonly DOMChild[];
|
|
170
|
+
/** Нормализованный child без пустых значений и вложенных arrays. */
|
|
171
|
+
export type DOMNormalizedChild = DOMNodePlan | string;
|
|
172
|
+
/** DOM-specific template, совместимый с renderer-neutral contract Core. */
|
|
173
|
+
export interface DOMTemplate<Props = unknown, State = unknown, Slots extends object = NoComponentSlots> extends ComponentTemplate<Props, State, DOMChild, Slots> {
|
|
174
|
+
}
|
|
175
|
+
type DOMHostNodes = {
|
|
176
|
+
readonly [Tag in DOMTag]: {
|
|
177
|
+
readonly inputs: Tag extends HTMLTag ? DOMElementPropsSource<HTMLElementTagNameMap[Tag]> : Tag extends SVGTag ? DOMElementPropsSource<SVGElementTagNameMap[Tag]> : Tag extends MathMLTag ? DOMElementPropsSource<MathMLElementTagNameMap[Tag]> : Tag extends CustomElementTag ? CustomElementPropsSource<Tag> : never;
|
|
178
|
+
readonly node: DOMElementNodePlan;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
declare module '@raphy-js/core' {
|
|
182
|
+
interface NodeRendererTypeRegistry {
|
|
183
|
+
readonly '@raphy-js/dom': {
|
|
184
|
+
readonly child: DOMChild;
|
|
185
|
+
readonly hostNodes: DOMHostNodes;
|
|
186
|
+
readonly inputDescriptors: {
|
|
187
|
+
readonly event: DOMListenerDescriptor;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DOM_NODE_RUNTIME: import('@raphy-js/core').NodeRuntime;
|