acrylblends 0.6.2 → 0.6.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 +4 -1
- package/docs/framework/README.md +3 -2
- package/docs/framework/UPSTREAM.md +1 -1
- package/docs/framework/cordis/acryl-in-a-cordis-app.md +6 -0
- package/docs/framework/getting-started/basic.md +1 -0
- package/docs/framework/getting-started/desktop.md +41 -0
- package/docs/framework/guides/jsx-dom.md +0 -3
- package/docs/framework/guides/jsx.md +0 -3
- package/docs/framework/helpers/css.md +0 -3
- package/docs/framework/upstream.json +3 -3
- package/lib/accepts.d.ts +1 -1
- package/lib/acryl-base.d.ts +1 -1
- package/lib/adapter.d.ts +1 -1
- package/lib/{app-BdrVHBlJ.d.ts → app-wFwpg-bt.d.ts} +1 -1
- package/lib/base-BpQy2Rk7.d.ts +783 -0
- package/lib/base-ddiVmiE7.js +721 -0
- package/lib/basic-auth.d.ts +1 -1
- package/lib/bearer-auth.d.ts +1 -1
- package/lib/body-limit.d.ts +1 -1
- package/lib/cache.d.ts +1 -1
- package/lib/client.d.ts +2 -2
- package/lib/combine.d.ts +1 -1
- package/lib/common-D8Z4JRCw.d.ts +46 -0
- package/lib/components-Ce5FRyHU.js +268 -0
- package/lib/components-DYZdxJIJ.js +24 -0
- package/lib/compress.d.ts +1 -1
- package/lib/conninfo.d.ts +2 -2
- package/lib/constants-BR9jM9BC.js +9 -0
- package/lib/{context-B5Y1lLha.d.ts → context-DVQBjuns.d.ts} +1 -1
- package/lib/context-DxFdY_un.d.ts +250 -0
- package/lib/context-storage.d.ts +1 -1
- package/lib/{cookie-D9_nQbsM.d.ts → cookie-CCelEqky.d.ts} +1 -1
- package/lib/cookie.d.ts +3 -3
- package/lib/cors.d.ts +1 -1
- package/lib/csrf.d.ts +1 -1
- package/lib/css-D2jb7X8b.js +320 -0
- package/lib/css.d.ts +82 -0
- package/lib/css.js +134 -0
- package/lib/dev.d.ts +2 -2
- package/lib/etag.d.ts +1 -1
- package/lib/factory.d.ts +2 -2
- package/lib/hooks-Bq5q9IMl.js +762 -0
- package/lib/html-SllAe0YT.d.ts +46 -0
- package/lib/html.d.ts +1 -1
- package/lib/index-C850MeBA.d.ts +94 -0
- package/lib/{index-m12zcmph.d.ts → index-CUTfU69R.d.ts} +3 -3
- package/lib/{index-DtEoak1i.d.ts → index-Cqcdluyn.d.ts} +2 -2
- package/lib/{index-Kqou8Fjh.d.ts → index-CsvB-F9j.d.ts} +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/ip-restriction.d.ts +2 -2
- package/lib/jsx/dom/client.d.ts +30 -0
- package/lib/jsx/dom/client.js +49 -0
- package/lib/jsx/dom/css.d.ts +84 -0
- package/lib/jsx/dom/css.js +2 -0
- package/lib/jsx/dom/jsx-dev-runtime.d.ts +3 -0
- package/lib/jsx/dom/jsx-dev-runtime.js +2 -0
- package/lib/jsx/dom/jsx-runtime.d.ts +3 -0
- package/lib/jsx/dom/jsx-runtime.js +2 -0
- package/lib/jsx/dom/server.d.ts +105 -0
- package/lib/jsx/dom/server.js +37 -0
- package/lib/jsx/dom.d.ts +5 -0
- package/lib/jsx/dom.js +74 -0
- package/lib/jsx/jsx-dev-runtime.d.ts +6 -0
- package/lib/jsx/jsx-dev-runtime.js +14 -0
- package/lib/jsx/jsx-runtime.d.ts +10 -0
- package/lib/jsx/jsx-runtime.js +30 -0
- package/lib/jsx/streaming.d.ts +2 -0
- package/lib/jsx/streaming.js +2 -0
- package/lib/jsx-dev-runtime-B22O-Npk.d.ts +7 -0
- package/lib/jsx-dev-runtime-kAhR_4C7.js +354 -0
- package/lib/jsx-runtime-BVVgDSdq.d.ts +1 -0
- package/lib/jsx.d.ts +3 -0
- package/lib/jsx.js +47 -0
- package/lib/jwk.d.ts +4 -4
- package/lib/{jwt-BA65QhnJ.d.ts → jwt-BARhotDz.d.ts} +1 -1
- package/lib/jwt.d.ts +4 -4
- package/lib/language.d.ts +1 -1
- package/lib/logger.d.ts +1 -1
- package/lib/loopback-only.d.ts +1 -1
- package/lib/method-not-allowed.d.ts +2 -2
- package/lib/method-override.d.ts +2 -2
- package/lib/mount.d.ts +1 -1
- package/lib/node-server/conninfo.d.ts +1 -1
- package/lib/node-server/serve-static.d.ts +1 -1
- package/lib/node-server/serve-static.js +1 -1
- package/lib/node-server.d.ts +1 -1
- package/lib/node-server.js +1 -1
- package/lib/powered-by.d.ts +1 -1
- package/lib/pretty-json.d.ts +1 -1
- package/lib/proxy.d.ts +1 -1
- package/lib/quick.d.ts +1 -1
- package/lib/request-id.d.ts +1 -1
- package/lib/request.d.ts +1 -1
- package/lib/route.d.ts +1 -1
- package/lib/schema-validator.d.ts +1 -1
- package/lib/secure-headers.d.ts +1 -1
- package/lib/{serve-static-Dw_m6KxR.js → serve-static-Cw23shXv.js} +1 -0
- package/lib/serve-static.d.ts +1 -1
- package/lib/streaming.d.ts +1 -1
- package/lib/testing.d.ts +4 -4
- package/lib/timeout.d.ts +1 -1
- package/lib/timing.d.ts +1 -1
- package/lib/tiny.d.ts +1 -1
- package/lib/trailing-slash.d.ts +1 -1
- package/lib/{types-Bd29gh2o.d.ts → types-CQiGmsWW.d.ts} +3 -3
- package/lib/{types-D9DEXMjE.d.ts → types-Lqx5BxQF.d.ts} +8 -1
- package/lib/{types-ZM9gIiKh.d.ts → types-nEL8VPDC.d.ts} +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/utils/body.d.ts +1 -1
- package/lib/utils/cookie.d.ts +1 -1
- package/lib/utils/crypto.d.ts +1 -1
- package/lib/utils/html.d.ts +1 -45
- package/lib/utils/ipaddr.d.ts +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/types.d.ts +2 -2
- package/lib/validator.d.ts +2 -2
- package/lib/ws.d.ts +1 -1
- package/package.json +45 -1
- package/plugins/acryl-inspect/upstream.json +1 -1
- package/plugins/acryl-node-server/upstream.json +1 -1
- package/plugins/acryl-router/src/core/helper/css/common.case.test.tsx +506 -0
- package/plugins/acryl-router/src/core/helper/css/common.ts +337 -0
- package/plugins/acryl-router/src/core/helper/css/index.test.tsx +678 -0
- package/plugins/acryl-router/src/core/helper/css/index.ts +262 -0
- package/plugins/acryl-router/src/core/helper/streaming/sse.test.tsx +557 -0
- package/plugins/acryl-router/src/core/jsx/base.test.tsx +97 -0
- package/plugins/acryl-router/src/core/jsx/base.ts +490 -0
- package/plugins/acryl-router/src/core/jsx/children.test.ts +52 -0
- package/plugins/acryl-router/src/core/jsx/children.ts +20 -0
- package/plugins/acryl-router/src/core/jsx/components.test.tsx +936 -0
- package/plugins/acryl-router/src/core/jsx/components.ts +257 -0
- package/plugins/acryl-router/src/core/jsx/constants.ts +6 -0
- package/plugins/acryl-router/src/core/jsx/context-isolation.test.ts +655 -0
- package/plugins/acryl-router/src/core/jsx/context.ts +266 -0
- package/plugins/acryl-router/src/core/jsx/dom/client.test.tsx +128 -0
- package/plugins/acryl-router/src/core/jsx/dom/client.ts +89 -0
- package/plugins/acryl-router/src/core/jsx/dom/components.test.tsx +330 -0
- package/plugins/acryl-router/src/core/jsx/dom/components.ts +39 -0
- package/plugins/acryl-router/src/core/jsx/dom/context.test.tsx +184 -0
- package/plugins/acryl-router/src/core/jsx/dom/context.ts +52 -0
- package/plugins/acryl-router/src/core/jsx/dom/css.test.tsx +149 -0
- package/plugins/acryl-router/src/core/jsx/dom/css.ts +263 -0
- package/plugins/acryl-router/src/core/jsx/dom/hooks/index.test.tsx +172 -0
- package/plugins/acryl-router/src/core/jsx/dom/hooks/index.ts +91 -0
- package/plugins/acryl-router/src/core/jsx/dom/index.test.tsx +3681 -0
- package/plugins/acryl-router/src/core/jsx/dom/index.ts +170 -0
- package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.test.tsx +1344 -0
- package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.ts +438 -0
- package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.ts +23 -0
- package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.ts +8 -0
- package/plugins/acryl-router/src/core/jsx/dom/render.ts +879 -0
- package/plugins/acryl-router/src/core/jsx/dom/server.test.tsx +199 -0
- package/plugins/acryl-router/src/core/jsx/dom/server.ts +76 -0
- package/plugins/acryl-router/src/core/jsx/dom/utils.ts +7 -0
- package/plugins/acryl-router/src/core/jsx/hooks/dom.test.tsx +859 -0
- package/plugins/acryl-router/src/core/jsx/hooks/index.ts +437 -0
- package/plugins/acryl-router/src/core/jsx/hooks/string.test.tsx +40 -0
- package/plugins/acryl-router/src/core/jsx/index.test.tsx +1744 -0
- package/plugins/acryl-router/src/core/jsx/index.ts +115 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.ts +23 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.test.tsx +666 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.ts +210 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-elements.ts +938 -0
- package/plugins/acryl-router/src/core/jsx/jsx-dev-runtime.ts +26 -0
- package/plugins/acryl-router/src/core/jsx/jsx-runtime.test.tsx +85 -0
- package/plugins/acryl-router/src/core/jsx/jsx-runtime.ts +51 -0
- package/plugins/acryl-router/src/core/jsx/streaming.test.tsx +1281 -0
- package/plugins/acryl-router/src/core/jsx/streaming.ts +231 -0
- package/plugins/acryl-router/src/core/jsx/types.ts +41 -0
- package/plugins/acryl-router/src/core/jsx/utils.test.ts +366 -0
- package/plugins/acryl-router/src/core/jsx/utils.ts +202 -0
- package/plugins/acryl-router/src/core/utils/types.ts +6 -0
- package/plugins/acryl-router/src/helpers/index.ts +1 -0
- package/plugins/acryl-router/tests/jsx.spec.tsx +63 -0
- package/plugins/acryl-router/upstream.json +3 -3
- package/plugins/acryl-router-http/upstream.json +1 -1
- package/plugins/acryl-state/upstream.json +1 -1
- package/plugins/desktop/upstream.json +1 -1
- package/plugins/desktop-web/upstream.json +1 -1
- package/plugins/save/plugin.json +1 -1
- package/templates/todo/upstream.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* This module provides APIs for `acryl-router/jsx/dom`.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { isValidElement, reactAPICompatVersion, shallowEqual } from '../base.ts'
|
|
7
|
+
import type { Child, DOMAttributes, JSX, JSXNode, Props, FC, MemorableFC } from '../base.ts'
|
|
8
|
+
import { Children } from '../children.ts'
|
|
9
|
+
import { DOM_MEMO } from '../constants.ts'
|
|
10
|
+
import { useContext } from '../context.ts'
|
|
11
|
+
import {
|
|
12
|
+
createRef,
|
|
13
|
+
forwardRef,
|
|
14
|
+
startTransition,
|
|
15
|
+
startViewTransition,
|
|
16
|
+
use,
|
|
17
|
+
useCallback,
|
|
18
|
+
useDebugValue,
|
|
19
|
+
useDeferredValue,
|
|
20
|
+
useEffect,
|
|
21
|
+
useId,
|
|
22
|
+
useImperativeHandle,
|
|
23
|
+
useInsertionEffect,
|
|
24
|
+
useLayoutEffect,
|
|
25
|
+
useMemo,
|
|
26
|
+
useReducer,
|
|
27
|
+
useRef,
|
|
28
|
+
useState,
|
|
29
|
+
useSyncExternalStore,
|
|
30
|
+
useTransition,
|
|
31
|
+
useViewTransition,
|
|
32
|
+
} from '../hooks/index.ts'
|
|
33
|
+
import { ErrorBoundary, Suspense } from './components.ts'
|
|
34
|
+
import { createContext } from './context.ts'
|
|
35
|
+
import { useActionState, useFormStatus, useOptimistic } from './hooks/index.ts'
|
|
36
|
+
import { Fragment, jsx } from './jsx-runtime.ts'
|
|
37
|
+
import { createPortal, flushSync } from './render.ts'
|
|
38
|
+
|
|
39
|
+
export { render } from './render.ts'
|
|
40
|
+
|
|
41
|
+
const createElement = (
|
|
42
|
+
tag: string | ((props: Props) => JSXNode),
|
|
43
|
+
props: Props | null,
|
|
44
|
+
...children: Child[]
|
|
45
|
+
): JSXNode => {
|
|
46
|
+
const jsxProps: Props = props ? { ...props } : {}
|
|
47
|
+
if (children.length) {
|
|
48
|
+
jsxProps.children = children.length === 1 ? children[0] : children
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let key = undefined
|
|
52
|
+
if ('key' in jsxProps) {
|
|
53
|
+
key = jsxProps.key
|
|
54
|
+
delete jsxProps.key
|
|
55
|
+
}
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
return jsx(tag, jsxProps, key) as any
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const cloneElement = <T extends JSXNode | JSX.Element>(
|
|
61
|
+
element: T,
|
|
62
|
+
props: Props,
|
|
63
|
+
...children: Child[]
|
|
64
|
+
): T => {
|
|
65
|
+
return jsx(
|
|
66
|
+
(element as JSXNode).tag,
|
|
67
|
+
{
|
|
68
|
+
...(element as JSXNode).props,
|
|
69
|
+
...props,
|
|
70
|
+
children: children.length ? children : (element as JSXNode).props.children,
|
|
71
|
+
},
|
|
72
|
+
(element as JSXNode).key
|
|
73
|
+
) as T
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const memo = <T>(
|
|
77
|
+
component: FC<T>,
|
|
78
|
+
propsAreEqual: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean = shallowEqual
|
|
79
|
+
): FC<T> => {
|
|
80
|
+
const wrapper = ((props: T) => component(props)) as MemorableFC<T>
|
|
81
|
+
wrapper[DOM_MEMO] = propsAreEqual
|
|
82
|
+
return wrapper as FC<T>
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
reactAPICompatVersion as version,
|
|
87
|
+
createElement as jsx,
|
|
88
|
+
useState,
|
|
89
|
+
useEffect,
|
|
90
|
+
useRef,
|
|
91
|
+
useCallback,
|
|
92
|
+
use,
|
|
93
|
+
startTransition,
|
|
94
|
+
useTransition,
|
|
95
|
+
useDeferredValue,
|
|
96
|
+
startViewTransition,
|
|
97
|
+
useViewTransition,
|
|
98
|
+
useMemo,
|
|
99
|
+
useLayoutEffect,
|
|
100
|
+
useInsertionEffect,
|
|
101
|
+
useReducer,
|
|
102
|
+
useId,
|
|
103
|
+
useDebugValue,
|
|
104
|
+
createRef,
|
|
105
|
+
forwardRef,
|
|
106
|
+
useImperativeHandle,
|
|
107
|
+
useSyncExternalStore,
|
|
108
|
+
useFormStatus,
|
|
109
|
+
useActionState,
|
|
110
|
+
useOptimistic,
|
|
111
|
+
Suspense,
|
|
112
|
+
ErrorBoundary,
|
|
113
|
+
createContext,
|
|
114
|
+
useContext,
|
|
115
|
+
memo,
|
|
116
|
+
isValidElement,
|
|
117
|
+
createElement,
|
|
118
|
+
cloneElement,
|
|
119
|
+
Children,
|
|
120
|
+
Fragment,
|
|
121
|
+
Fragment as StrictMode,
|
|
122
|
+
flushSync,
|
|
123
|
+
createPortal,
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type { DOMAttributes }
|
|
127
|
+
|
|
128
|
+
export default {
|
|
129
|
+
version: reactAPICompatVersion,
|
|
130
|
+
useState,
|
|
131
|
+
useEffect,
|
|
132
|
+
useRef,
|
|
133
|
+
useCallback,
|
|
134
|
+
use,
|
|
135
|
+
startTransition,
|
|
136
|
+
useTransition,
|
|
137
|
+
useDeferredValue,
|
|
138
|
+
startViewTransition,
|
|
139
|
+
useViewTransition,
|
|
140
|
+
useMemo,
|
|
141
|
+
useLayoutEffect,
|
|
142
|
+
useInsertionEffect,
|
|
143
|
+
useReducer,
|
|
144
|
+
useId,
|
|
145
|
+
useDebugValue,
|
|
146
|
+
createRef,
|
|
147
|
+
forwardRef,
|
|
148
|
+
useImperativeHandle,
|
|
149
|
+
useSyncExternalStore,
|
|
150
|
+
useFormStatus,
|
|
151
|
+
useActionState,
|
|
152
|
+
useOptimistic,
|
|
153
|
+
Suspense,
|
|
154
|
+
ErrorBoundary,
|
|
155
|
+
createContext,
|
|
156
|
+
useContext,
|
|
157
|
+
memo,
|
|
158
|
+
isValidElement,
|
|
159
|
+
createElement,
|
|
160
|
+
cloneElement,
|
|
161
|
+
Children,
|
|
162
|
+
Fragment,
|
|
163
|
+
StrictMode: Fragment,
|
|
164
|
+
flushSync,
|
|
165
|
+
createPortal,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export type { Context } from '../context.ts'
|
|
169
|
+
|
|
170
|
+
export type * from '../types.ts'
|