frosty 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_native.d.ts +10 -0
- package/dist/_native.d.ts.map +1 -0
- package/dist/_native.js +41 -0
- package/dist/_native.js.map +1 -0
- package/dist/_native.mjs +38 -0
- package/dist/_native.mjs.map +1 -0
- package/dist/dom.d.ts +14 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +51 -0
- package/dist/dom.js.map +1 -0
- package/dist/dom.mjs +49 -0
- package/dist/dom.mjs.map +1 -0
- package/dist/index.d.ts +209 -15
- package/dist/index.js +106 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -100
- package/dist/index.mjs.map +1 -1
- package/dist/internals/common-BmoFkpvW.d.ts +21 -0
- package/dist/internals/common-BmoFkpvW.d.ts.map +1 -0
- package/dist/internals/common-D2qumIG-.js +4100 -0
- package/dist/internals/common-D2qumIG-.js.map +1 -0
- package/dist/internals/common-De2Ddc8P.mjs +4098 -0
- package/dist/internals/common-De2Ddc8P.mjs.map +1 -0
- package/dist/internals/common-tTif_A6X.d.ts +3529 -0
- package/dist/internals/common-tTif_A6X.d.ts.map +1 -0
- package/dist/internals/component-BbXL632k.js +61 -0
- package/dist/internals/component-BbXL632k.js.map +1 -0
- package/dist/internals/component-DEV8vsnm.mjs +59 -0
- package/dist/internals/component-DEV8vsnm.mjs.map +1 -0
- package/dist/internals/fragment-B0rB4qEp.js +32 -0
- package/dist/internals/fragment-B0rB4qEp.js.map +1 -0
- package/dist/internals/fragment-CiP98fWd.d.ts +6 -0
- package/dist/internals/fragment-CiP98fWd.d.ts.map +1 -0
- package/dist/internals/fragment-DPs1AriN.mjs +30 -0
- package/dist/internals/fragment-DPs1AriN.mjs.map +1 -0
- package/dist/internals/renderer-B7EH7HAA.mjs +157 -0
- package/dist/internals/renderer-B7EH7HAA.mjs.map +1 -0
- package/dist/internals/renderer-CiM3ufRM.d.ts +43 -0
- package/dist/internals/renderer-CiM3ufRM.d.ts.map +1 -0
- package/dist/internals/renderer-D3zwukmJ.js +159 -0
- package/dist/internals/renderer-D3zwukmJ.js.map +1 -0
- package/dist/internals/runtime-Bc12AYVQ.mjs +34 -0
- package/dist/internals/runtime-Bc12AYVQ.mjs.map +1 -0
- package/dist/internals/runtime-X8YxT6Gi.js +37 -0
- package/dist/internals/runtime-X8YxT6Gi.js.map +1 -0
- package/dist/internals/sync-BayBMXKm.mjs +287 -0
- package/dist/internals/sync-BayBMXKm.mjs.map +1 -0
- package/dist/internals/sync-BlxufCQn.js +293 -0
- package/dist/internals/sync-BlxufCQn.js.map +1 -0
- package/dist/internals/utils-CJK72Yog.mjs +549 -0
- package/dist/internals/utils-CJK72Yog.mjs.map +1 -0
- package/dist/internals/utils-DGp0ZtFY.js +558 -0
- package/dist/internals/utils-DGp0ZtFY.js.map +1 -0
- package/dist/jsx-runtime.d.ts +7 -4
- package/dist/jsx-runtime.js +10 -3
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/jsx-runtime.mjs +8 -3
- package/dist/jsx-runtime.mjs.map +1 -1
- package/dist/server-dom.d.ts +15 -0
- package/dist/server-dom.d.ts.map +1 -0
- package/dist/server-dom.js +57 -0
- package/dist/server-dom.js.map +1 -0
- package/dist/server-dom.mjs +50 -0
- package/dist/server-dom.mjs.map +1 -0
- package/dist/web.d.ts +29 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +266 -0
- package/dist/web.js.map +1 -0
- package/dist/web.mjs +257 -0
- package/dist/web.mjs.map +1 -0
- package/package.json +37 -7
- package/dist/internals/fragment-AhsrK7tK.d.ts +0 -8857
- package/dist/internals/fragment-AhsrK7tK.d.ts.map +0 -1
- package/dist/internals/fragment-BOZTF3vt.js +0 -110
- package/dist/internals/fragment-BOZTF3vt.js.map +0 -1
- package/dist/internals/fragment-BTxSnFHG.mjs +0 -106
- package/dist/internals/fragment-BTxSnFHG.mjs.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { N as NativeElementType, c as PropsType, b as ComponentNode } from './internals/common-tTif_A6X.js';
|
|
2
|
+
export { _ as _Renderer } from './internals/renderer-CiM3ufRM.js';
|
|
3
|
+
import '@o2ter/utils-js';
|
|
4
|
+
import 'lodash';
|
|
5
|
+
import 'csstype';
|
|
6
|
+
|
|
7
|
+
declare function _createNativeElement(type: NativeElementType, props: PropsType, key?: string | number): ComponentNode;
|
|
8
|
+
|
|
9
|
+
export { _createNativeElement };
|
|
10
|
+
//# sourceMappingURL=_native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_native.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/_native.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var runtime = require('./internals/runtime-X8YxT6Gi.js');
|
|
4
|
+
var renderer = require('./internals/renderer-D3zwukmJ.js');
|
|
5
|
+
require('./internals/component-BbXL632k.js');
|
|
6
|
+
require('lodash');
|
|
7
|
+
require('./internals/utils-DGp0ZtFY.js');
|
|
8
|
+
require('myers.js');
|
|
9
|
+
require('nextick');
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
// native.ts
|
|
13
|
+
//
|
|
14
|
+
// The MIT License
|
|
15
|
+
// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
|
|
16
|
+
//
|
|
17
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
// in the Software without restriction, including without limitation the rights
|
|
20
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
// furnished to do so, subject to the following conditions:
|
|
23
|
+
//
|
|
24
|
+
// The above copyright notice and this permission notice shall be included in
|
|
25
|
+
// all copies or substantial portions of the Software.
|
|
26
|
+
//
|
|
27
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
33
|
+
// THE SOFTWARE.
|
|
34
|
+
//
|
|
35
|
+
function _createNativeElement(type, props, key) {
|
|
36
|
+
return runtime._createElement(type, { ...props, key });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports._Renderer = renderer._Renderer;
|
|
40
|
+
exports._createNativeElement = _createNativeElement;
|
|
41
|
+
//# sourceMappingURL=_native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_native.js","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\nexport { _Renderer } from '../core/renderer';\n\nexport function _createNativeElement(\n type: NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":["_createElement"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAMgB,oBAAoB,CAClC,IAAuB,EACvB,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAOA,sBAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;;"}
|
package/dist/_native.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { _ as _createElement } from './internals/runtime-Bc12AYVQ.mjs';
|
|
2
|
+
export { _ as _Renderer } from './internals/renderer-B7EH7HAA.mjs';
|
|
3
|
+
import './internals/component-DEV8vsnm.mjs';
|
|
4
|
+
import 'lodash';
|
|
5
|
+
import './internals/utils-CJK72Yog.mjs';
|
|
6
|
+
import 'myers.js';
|
|
7
|
+
import 'nextick';
|
|
8
|
+
|
|
9
|
+
//
|
|
10
|
+
// native.ts
|
|
11
|
+
//
|
|
12
|
+
// The MIT License
|
|
13
|
+
// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
|
|
14
|
+
//
|
|
15
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
// in the Software without restriction, including without limitation the rights
|
|
18
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
// furnished to do so, subject to the following conditions:
|
|
21
|
+
//
|
|
22
|
+
// The above copyright notice and this permission notice shall be included in
|
|
23
|
+
// all copies or substantial portions of the Software.
|
|
24
|
+
//
|
|
25
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
31
|
+
// THE SOFTWARE.
|
|
32
|
+
//
|
|
33
|
+
function _createNativeElement(type, props, key) {
|
|
34
|
+
return _createElement(type, { ...props, key });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { _createNativeElement };
|
|
38
|
+
//# sourceMappingURL=_native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_native.mjs","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\nexport { _Renderer } from '../core/renderer';\n\nexport function _createNativeElement(\n type: NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAMgB,oBAAoB,CAClC,IAAuB,EACvB,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;"}
|
package/dist/dom.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _ as _DOMRenderer } from './internals/common-BmoFkpvW.js';
|
|
2
|
+
import './internals/common-tTif_A6X.js';
|
|
3
|
+
import '@o2ter/utils-js';
|
|
4
|
+
import 'lodash';
|
|
5
|
+
import 'csstype';
|
|
6
|
+
import './internals/renderer-CiM3ufRM.js';
|
|
7
|
+
|
|
8
|
+
declare class DOMRenderer extends _DOMRenderer {
|
|
9
|
+
static default: DOMRenderer;
|
|
10
|
+
static createRoot(root: Element): ReturnType<typeof DOMRenderer.default.createRoot>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { DOMRenderer };
|
|
14
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/dom.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./internals/common-D2qumIG-.js');
|
|
4
|
+
require('lodash');
|
|
5
|
+
require('myers.js');
|
|
6
|
+
require('./internals/renderer-D3zwukmJ.js');
|
|
7
|
+
require('./internals/utils-DGp0ZtFY.js');
|
|
8
|
+
require('./internals/component-BbXL632k.js');
|
|
9
|
+
require('nextick');
|
|
10
|
+
require('postcss');
|
|
11
|
+
require('postcss-js');
|
|
12
|
+
require('postcss-nested');
|
|
13
|
+
require('autoprefixer');
|
|
14
|
+
|
|
15
|
+
//
|
|
16
|
+
// dom.ts
|
|
17
|
+
//
|
|
18
|
+
// The MIT License
|
|
19
|
+
// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
|
|
20
|
+
//
|
|
21
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
23
|
+
// in the Software without restriction, including without limitation the rights
|
|
24
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
26
|
+
// furnished to do so, subject to the following conditions:
|
|
27
|
+
//
|
|
28
|
+
// The above copyright notice and this permission notice shall be included in
|
|
29
|
+
// all copies or substantial portions of the Software.
|
|
30
|
+
//
|
|
31
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
37
|
+
// THE SOFTWARE.
|
|
38
|
+
//
|
|
39
|
+
class DOMRenderer extends common._DOMRenderer {
|
|
40
|
+
static default = new DOMRenderer();
|
|
41
|
+
static createRoot(root) {
|
|
42
|
+
return this.default.createRoot(root);
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
get _server() {
|
|
46
|
+
return typeof window === 'undefined';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.DOMRenderer = DOMRenderer;
|
|
51
|
+
//# sourceMappingURL=dom.js.map
|
package/dist/dom.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sources":["../../src/renderer/dom.ts"],"sourcesContent":["//\n// dom.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { _DOMRenderer } from './common';\n\nexport class DOMRenderer extends _DOMRenderer {\n\n static default = new DOMRenderer();\n\n static createRoot(root: Element): ReturnType<typeof DOMRenderer.default.createRoot> {\n return this.default.createRoot(root);\n }\n\n /** @internal */\n get _server(): boolean {\n return typeof window === 'undefined';\n }\n}\n"],"names":["_DOMRenderer"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKM,MAAO,WAAY,SAAQA,mBAAY,CAAA;AAE3C,IAAA,OAAO,OAAO,GAAG,IAAI,WAAW,EAAE;IAElC,OAAO,UAAU,CAAC,IAAa,EAAA;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;;;AAItC,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,OAAO,MAAM,KAAK,WAAW;;;;;;"}
|
package/dist/dom.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { _ as _DOMRenderer } from './internals/common-De2Ddc8P.mjs';
|
|
2
|
+
import 'lodash';
|
|
3
|
+
import 'myers.js';
|
|
4
|
+
import './internals/renderer-B7EH7HAA.mjs';
|
|
5
|
+
import './internals/utils-CJK72Yog.mjs';
|
|
6
|
+
import './internals/component-DEV8vsnm.mjs';
|
|
7
|
+
import 'nextick';
|
|
8
|
+
import 'postcss';
|
|
9
|
+
import 'postcss-js';
|
|
10
|
+
import 'postcss-nested';
|
|
11
|
+
import 'autoprefixer';
|
|
12
|
+
|
|
13
|
+
//
|
|
14
|
+
// dom.ts
|
|
15
|
+
//
|
|
16
|
+
// The MIT License
|
|
17
|
+
// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
|
|
18
|
+
//
|
|
19
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
21
|
+
// in the Software without restriction, including without limitation the rights
|
|
22
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
24
|
+
// furnished to do so, subject to the following conditions:
|
|
25
|
+
//
|
|
26
|
+
// The above copyright notice and this permission notice shall be included in
|
|
27
|
+
// all copies or substantial portions of the Software.
|
|
28
|
+
//
|
|
29
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
35
|
+
// THE SOFTWARE.
|
|
36
|
+
//
|
|
37
|
+
class DOMRenderer extends _DOMRenderer {
|
|
38
|
+
static default = new DOMRenderer();
|
|
39
|
+
static createRoot(root) {
|
|
40
|
+
return this.default.createRoot(root);
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
get _server() {
|
|
44
|
+
return typeof window === 'undefined';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { DOMRenderer };
|
|
49
|
+
//# sourceMappingURL=dom.mjs.map
|
package/dist/dom.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.mjs","sources":["../../src/renderer/dom.ts"],"sourcesContent":["//\n// dom.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { _DOMRenderer } from './common';\n\nexport class DOMRenderer extends _DOMRenderer {\n\n static default = new DOMRenderer();\n\n static createRoot(root: Element): ReturnType<typeof DOMRenderer.default.createRoot> {\n return this.default.createRoot(root);\n }\n\n /** @internal */\n get _server(): boolean {\n return typeof window === 'undefined';\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKM,MAAO,WAAY,SAAQ,YAAY,CAAA;AAE3C,IAAA,OAAO,OAAO,GAAG,IAAI,WAAW,EAAE;IAElC,OAAO,UAAU,CAAC,IAAa,EAAA;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;;;AAItC,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,OAAO,MAAM,KAAK,WAAW;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,219 @@
|
|
|
1
|
-
import { C as ComponentType, E as ElementNode, a as
|
|
2
|
-
export {
|
|
1
|
+
import { C as ComponentType, E as ElementNode, R as RefObject, a as Ref, S as SetStateAction, b as ComponentNode, P as PropsWithChildren, _ as _ElementType, N as NativeElementType, c as PropsType } from './internals/common-tTif_A6X.js';
|
|
2
|
+
export { f as ComponentProps, g as ComponentPropsWithoutRef, i as ComponentRef, e as RefAttribute, h as RefCallback, d as createElement } from './internals/common-tTif_A6X.js';
|
|
3
3
|
import { Awaitable } from '@o2ter/utils-js';
|
|
4
|
+
export { F as Fragment } from './internals/fragment-CiP98fWd.js';
|
|
4
5
|
import 'lodash';
|
|
6
|
+
import 'csstype';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A custom hook that manages side effects with support for an `AbortSignal`.
|
|
10
|
+
* It ensures proper cleanup logic and handles asynchronous operations effectively.
|
|
11
|
+
*
|
|
12
|
+
* @param effect -
|
|
13
|
+
* A function that receives an `AbortSignal` and performs side effects.
|
|
14
|
+
* It can optionally return a cleanup function or a promise that resolves to a cleanup function.
|
|
15
|
+
*
|
|
16
|
+
* @param deps -
|
|
17
|
+
* An optional array of dependencies that determines when the effect should be re-executed.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* useEffect((signal) => {
|
|
21
|
+
* fetch('/api/data', { signal })
|
|
22
|
+
* .then(response => response.json())
|
|
23
|
+
* .then(data => console.log(data))
|
|
24
|
+
* .catch(err => {
|
|
25
|
+
* if (err.name === 'AbortError') {
|
|
26
|
+
* console.log('Fetch aborted');
|
|
27
|
+
* } else {
|
|
28
|
+
* console.error(err);
|
|
29
|
+
* }
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* return () => {
|
|
33
|
+
* console.log('Cleanup logic here');
|
|
34
|
+
* };
|
|
35
|
+
* }, []);
|
|
36
|
+
*/
|
|
37
|
+
declare const useEffect: (effect: (signal: AbortSignal) => Awaitable<void | (() => Awaitable<void>)>, deps?: any) => void;
|
|
14
38
|
|
|
15
|
-
type Context<Value> = ReturnType<typeof
|
|
16
|
-
type ContextType<C extends Context<any>> =
|
|
17
|
-
declare const
|
|
39
|
+
type Context<Value> = ReturnType<typeof _createContext<Value>>;
|
|
40
|
+
type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
|
|
41
|
+
declare const _createContext: <Value extends unknown>(defaultValue: Value) => ComponentType<{
|
|
18
42
|
value: Value;
|
|
19
43
|
children?: ElementNode | ((value: Value) => ElementNode);
|
|
44
|
+
}> & {
|
|
45
|
+
Consumer: ComponentType<{
|
|
46
|
+
children: (value: Value) => ElementNode;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new context object with an optional default value.
|
|
51
|
+
*
|
|
52
|
+
* A context object allows you to share a value across a component tree
|
|
53
|
+
* without explicitly passing it as a prop to every level.
|
|
54
|
+
*
|
|
55
|
+
* @template Value - The type of the value to be stored in the context.
|
|
56
|
+
* @param - The default value for the context.
|
|
57
|
+
* @returns A context object that can be used to provide and consume the value.
|
|
58
|
+
*/
|
|
59
|
+
declare function createContext<Value>(defaultValue: Value): Context<Value>;
|
|
60
|
+
declare function createContext<Value = undefined>(): Context<Value | undefined>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A custom hook that retrieves the current value of a context and optionally applies
|
|
64
|
+
* a selector function to transform the context value. This hook ensures that the component
|
|
65
|
+
* subscribes to the context and re-renders when the context value changes.
|
|
66
|
+
*
|
|
67
|
+
* @template T - The type of the context value.
|
|
68
|
+
* @template R - The type of the transformed value returned by the selector.
|
|
69
|
+
* @param context - The context object to retrieve the value from.
|
|
70
|
+
* @param selector - An optional selector function to transform the context value.
|
|
71
|
+
* Defaults to an identity function.
|
|
72
|
+
* @returns - The current value of the context, optionally transformed by the selector.
|
|
73
|
+
*
|
|
74
|
+
* @throws - Throws an error if the provided context is invalid or if the hook
|
|
75
|
+
* is used outside of a render function.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const MyContext = createContext({ user: null });
|
|
79
|
+
*
|
|
80
|
+
* function MyComponent() {
|
|
81
|
+
* const user = useContext(MyContext, context => context.user);
|
|
82
|
+
* return <div>{user ? `Hello, ${user.name}` : 'Hello, Guest'}</div>;
|
|
83
|
+
* }
|
|
84
|
+
*/
|
|
85
|
+
declare const useContext: <T, R = T>(context: Context<T>, selector?: (state: T) => R) => R;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A utility function that memoizes the result of a factory function.
|
|
89
|
+
*
|
|
90
|
+
* @template T The type of the value returned by the factory function.
|
|
91
|
+
* @param factory A function that produces a value to be memoized.
|
|
92
|
+
* @param deps An optional dependency array. The memoized value is recalculated
|
|
93
|
+
* only when the dependencies change.
|
|
94
|
+
* @returns The memoized value produced by the factory function.
|
|
95
|
+
*/
|
|
96
|
+
declare const useMemo: <T>(factory: () => T, deps?: any) => T;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Creates a mutable reference object that persists across function calls.
|
|
100
|
+
*
|
|
101
|
+
* @template T The type of the value stored in the reference.
|
|
102
|
+
* @param initialValue The initial value to store in the reference.
|
|
103
|
+
* @returns An object with a `current` property that holds the value.
|
|
104
|
+
*/
|
|
105
|
+
declare function useRef<T>(initialValue: T): RefObject<T>;
|
|
106
|
+
declare function useRef<T = undefined>(): RefObject<T | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* Associates a reference with a value created by an initializer function.
|
|
109
|
+
*
|
|
110
|
+
* @template T The type of the reference.
|
|
111
|
+
* @template R The type of the value created by the initializer function.
|
|
112
|
+
* @param ref A reference object or a callback function to receive the value.
|
|
113
|
+
* @param init A function that initializes and returns the value to associate with the reference.
|
|
114
|
+
* @param deps An optional dependency array. The initializer function is re-executed when the dependencies change.
|
|
115
|
+
*/
|
|
116
|
+
declare const useRefHandle: <T, R extends T>(ref: Ref<T> | undefined, init: () => R, deps?: any) => void;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A custom hook that memoizes a callback function, ensuring that it only changes
|
|
120
|
+
* if its dependencies change. This is useful for optimizing performance by preventing
|
|
121
|
+
* unnecessary re-creations of functions.
|
|
122
|
+
*
|
|
123
|
+
* @template T - The type of the callback function.
|
|
124
|
+
* @param callback - The callback function to be memoized.
|
|
125
|
+
* @param deps - An optional array of dependencies. If provided, the callback
|
|
126
|
+
* will only be updated when one of these dependencies changes.
|
|
127
|
+
* If not provided, the callback will remain stable.
|
|
128
|
+
* @returns - A stable version of the callback function that will not change unless
|
|
129
|
+
* its dependencies change.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* const memoizedCallback = useCallback(() => {
|
|
133
|
+
* console.log('This function is memoized!');
|
|
134
|
+
* }, [dependency]);
|
|
135
|
+
*/
|
|
136
|
+
declare const useCallback: <T extends (...args: any) => any>(callback: T, deps?: any) => T;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A hook function for managing state within a custom framework or library.
|
|
140
|
+
*
|
|
141
|
+
* @template T - The type of the state value.
|
|
142
|
+
* @param - The initial state value or a function that returns the initial state.
|
|
143
|
+
* @returns - A tuple containing the current state value and a function to update the state.
|
|
144
|
+
*
|
|
145
|
+
* The `useState` function provides a way to manage stateful values. It returns the current state
|
|
146
|
+
* and a setter function that can update the state. The setter function accepts either a new value
|
|
147
|
+
* or a function that receives the current state and returns the updated state.
|
|
148
|
+
*
|
|
149
|
+
* Example:
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const [count, setCount] = useState(0);
|
|
152
|
+
* setCount(5); // Updates the state to 5
|
|
153
|
+
* setCount(prev => prev + 1); // Updates the state to the previous value + 1
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
declare function useState<T>(initialState: T | (() => T)): [T, (dispatch: SetStateAction<T>) => void];
|
|
157
|
+
declare function useState<T = undefined>(): [T | undefined, (dispatch: SetStateAction<T | undefined>) => void];
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Retrieves the stack of parent components from the current hook state.
|
|
161
|
+
*
|
|
162
|
+
* This function accesses the current hook state and extracts the stack of
|
|
163
|
+
* parent components. It throws an error if called outside of a valid render
|
|
164
|
+
* context.
|
|
165
|
+
*
|
|
166
|
+
* @returns An array of parent components from the current hook state.
|
|
167
|
+
* @throws Will throw an error if the function is called outside of a valid render context.
|
|
168
|
+
*/
|
|
169
|
+
declare const useStack: () => ComponentNode[];
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A utility function that manages state using a reducer pattern.
|
|
173
|
+
*
|
|
174
|
+
* @template T The type of the state.
|
|
175
|
+
* @template A The type of the action object (optional).
|
|
176
|
+
* @param reducer A function that takes the current state and an action, and returns the new state.
|
|
177
|
+
* @param initialState The initial state value or a function that returns the initial state.
|
|
178
|
+
* @returns A tuple containing the current state and a dispatch function to update the state.
|
|
179
|
+
*/
|
|
180
|
+
declare function useReducer<T>(reducer: (prevState: T) => T, initialState: T | (() => T)): [T, (dispatch: () => void) => void];
|
|
181
|
+
declare function useReducer<T, A = any>(reducer: (prevState: T, action: A) => T, initialState: T | (() => T)): [T, (dispatch: (action: A) => void) => void];
|
|
182
|
+
declare function useReducer<T = undefined>(reducer: (prevState: T | undefined) => T | undefined): [T | undefined, (dispatch: () => void) => void];
|
|
183
|
+
declare function useReducer<T = undefined, A = any>(reducer: (prevState: T | undefined, action: A) => T | undefined): [T | undefined, (dispatch: (action: A) => void) => void];
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A hook utility for synchronizing with an external store.
|
|
187
|
+
*
|
|
188
|
+
* @template Snapshot - The type of the snapshot returned by the store.
|
|
189
|
+
* @param subscribe - A function that sets up a subscription to the external store.
|
|
190
|
+
* - `onStoreChange`: A callback to invoke when the store changes.
|
|
191
|
+
* - `signal`: An `AbortSignal` to handle cleanup when the subscription is no longer needed.
|
|
192
|
+
* - Returns an optional cleanup function or a promise resolving to one.
|
|
193
|
+
* @param getSnapshot - A function that retrieves the current snapshot of the store.
|
|
194
|
+
* @param getServerSnapshot - (Optional) A function that retrieves the snapshot of the store
|
|
195
|
+
* in a server environment.
|
|
196
|
+
* @returns The current snapshot of the store.
|
|
197
|
+
*
|
|
198
|
+
* @throws Will throw an error if used outside of a valid render context.
|
|
199
|
+
*/
|
|
200
|
+
declare const useSyncExternalStore: <Snapshot>(subscribe: (onStoreChange: () => void, signal: AbortSignal) => Awaitable<void | (() => Awaitable<void>)>, getSnapshot: () => Snapshot, getServerSnapshot?: () => Snapshot) => Snapshot;
|
|
201
|
+
|
|
202
|
+
type ErrorBoundaryProps = PropsWithChildren<{
|
|
203
|
+
silent?: boolean;
|
|
204
|
+
onError?: (error: any, component: ComponentNode, stack: ComponentNode[]) => void;
|
|
205
|
+
}>;
|
|
206
|
+
declare const ErrorBoundary: ComponentType<ErrorBoundaryProps>;
|
|
207
|
+
|
|
208
|
+
type PropsProviderProps = PropsWithChildren<{
|
|
209
|
+
callback: (v: {
|
|
210
|
+
type: _ElementType | NativeElementType;
|
|
211
|
+
props: PropsType;
|
|
212
|
+
}) => PropsType | undefined | null;
|
|
20
213
|
}>;
|
|
214
|
+
declare const PropsProvider: ComponentType<PropsProviderProps>;
|
|
21
215
|
|
|
22
|
-
declare const
|
|
216
|
+
declare const mergeRefs: <T>(...refs: Ref<T>[]) => (x: T) => void;
|
|
23
217
|
|
|
24
|
-
export {
|
|
218
|
+
export { ComponentNode, ComponentType, type Context, type ContextType, ElementNode, _ElementType as ElementType, ErrorBoundary, PropsProvider, PropsWithChildren, Ref, RefObject, SetStateAction, createContext, mergeRefs, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useRefHandle, useStack, useState, useSyncExternalStore };
|
|
25
219
|
//# sourceMappingURL=index.d.ts.map
|