@alchemy.run/sigil 0.0.0-alpha.10 → 0.0.0-alpha.11
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/THIRD_PARTY_NOTICES.md +28 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +181 -179
- package/dist/jsx-dev-runtime.d.ts +2 -0
- package/dist/jsx-dev-runtime.js +227 -0
- package/dist/jsx-runtime-XtwIVFsg.js +255 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.js +8 -0
- package/dist/react-CTZ_8dwh.js +1197 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +49 -0
- package/dist/router.js +44 -42
- package/dist/use-focus-B5npZrJU.js +18736 -0
- package/package.json +22 -8
- package/src/ansi/strip.ts +2 -2
- package/src/jsx-dev-runtime.ts +3 -0
- package/src/jsx-runtime.ts +6 -0
- package/src/react.ts +53 -0
- package/src/reconciler.ts +51 -0
- package/dist/use-focus-CcCIdCWA.js +0 -1337
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alchemy.run/sigil",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.11",
|
|
4
4
|
"description": "React for CLIs. A self-contained fork of Ink with an integrated TypeScript Yoga layout engine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -75,21 +75,37 @@
|
|
|
75
75
|
"import": "./dist/terminal.js",
|
|
76
76
|
"types": "./dist/terminal.d.ts",
|
|
77
77
|
"default": "./dist/terminal.js"
|
|
78
|
+
},
|
|
79
|
+
"./react": {
|
|
80
|
+
"import": "./dist/react.js",
|
|
81
|
+
"types": "./dist/react.d.ts",
|
|
82
|
+
"default": "./dist/react.js"
|
|
83
|
+
},
|
|
84
|
+
"./jsx-runtime": {
|
|
85
|
+
"import": "./dist/jsx-runtime.js",
|
|
86
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
87
|
+
"default": "./dist/jsx-runtime.js"
|
|
88
|
+
},
|
|
89
|
+
"./jsx-dev-runtime": {
|
|
90
|
+
"import": "./dist/jsx-dev-runtime.js",
|
|
91
|
+
"types": "./dist/jsx-dev-runtime.d.ts",
|
|
92
|
+
"default": "./dist/jsx-dev-runtime.js"
|
|
78
93
|
}
|
|
79
94
|
},
|
|
80
95
|
"publishConfig": {
|
|
81
96
|
"access": "public"
|
|
82
97
|
},
|
|
83
98
|
"dependencies": {
|
|
84
|
-
"react
|
|
85
|
-
"
|
|
99
|
+
"react": "^19.3.0",
|
|
100
|
+
"react-reconciler": "^0.34.0",
|
|
101
|
+
"scheduler": "^0.28.0"
|
|
86
102
|
},
|
|
87
103
|
"devDependencies": {
|
|
88
104
|
"@slopus/ghostty-wasm": "^1.3.6",
|
|
89
105
|
"@types/node": "^25.5.2",
|
|
90
|
-
"@types/react": "^19.
|
|
106
|
+
"@types/react": "^19.3.0",
|
|
91
107
|
"@types/react-reconciler": "^0.33.0",
|
|
92
|
-
"@types/scheduler": "^0.
|
|
108
|
+
"@types/scheduler": "^0.28.0",
|
|
93
109
|
"@vitest/ui": "^4.1.11",
|
|
94
110
|
"@xterm/addon-clipboard": "^0.2.0",
|
|
95
111
|
"@xterm/addon-fit": "^0.11.0",
|
|
@@ -99,8 +115,7 @@
|
|
|
99
115
|
"@xterm/addon-webgl": "^0.19.0",
|
|
100
116
|
"@xterm/headless": "^6.0.0",
|
|
101
117
|
"@xterm/xterm": "^6.0.0",
|
|
102
|
-
"react": "^
|
|
103
|
-
"react-devtools-core": "^7.0.1",
|
|
118
|
+
"react-devtools-core": "^8.0.0",
|
|
104
119
|
"tsx": "^4.21.0",
|
|
105
120
|
"typescript": "^7.0.2",
|
|
106
121
|
"vite": "npm:@voidzero-dev/vite-plus-core@^0.2.9",
|
|
@@ -110,7 +125,6 @@
|
|
|
110
125
|
},
|
|
111
126
|
"peerDependencies": {
|
|
112
127
|
"@types/react": ">=19.2.0",
|
|
113
|
-
"react": ">=19.2.0",
|
|
114
128
|
"react-devtools-core": ">=6.1.2"
|
|
115
129
|
},
|
|
116
130
|
"peerDependenciesMeta": {
|
package/src/ansi/strip.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { stripVTControlCharacters } from "node:util";
|
|
|
5
5
|
// `\u001B[38:2::255:100:0m` — which Sigil deliberately preserves in output
|
|
6
6
|
// (see sanitize-ansi.ts) — would leave `:2::255:100:0m` behind. Remove those
|
|
7
7
|
// first, then let Node handle everything else.
|
|
8
|
-
// https://github.com/nodejs/node/pull/65379
|
|
9
|
-
// can go once the minimum supported Node version ships it.
|
|
8
|
+
// https://github.com/nodejs/node/pull/65379 fixed this upstream (Node 24.21+);
|
|
9
|
+
// this wrapper can go once the minimum supported Node version ships it.
|
|
10
10
|
const colonSgrRegex = /(?:\u001B\[|\u009B)[\d;]*:[\d;:]*m/g;
|
|
11
11
|
|
|
12
12
|
export const stripAnsi = (input: string): string =>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// `react/jsx-runtime` is CommonJS; a star re-export carries no static names
|
|
2
|
+
// through the bundler, so the automatic-runtime surface is spelled out.
|
|
3
|
+
export { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// `jsxImportSource` looks up the `JSX` namespace on this module to type
|
|
5
|
+
// elements and props. Type-only, so the bundle is unaffected.
|
|
6
|
+
export type { JSX } from "react/jsx-runtime";
|
package/src/react.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Sigil ships its own React. Consumers reach React's runtime through this
|
|
2
|
+
// entry (and `jsxImportSource: "@alchemy.run/sigil"`) so the hooks a component
|
|
3
|
+
// calls and the dispatcher the reconciler installs share one module identity.
|
|
4
|
+
//
|
|
5
|
+
// `@types/react` is an `export =` module, so `export *` is rejected at the type
|
|
6
|
+
// level; the runtime surface is enumerated instead. Types stay type-only
|
|
7
|
+
// imports from `react` (erased at runtime, so no identity concern).
|
|
8
|
+
export {
|
|
9
|
+
Activity,
|
|
10
|
+
Children,
|
|
11
|
+
Component,
|
|
12
|
+
Fragment,
|
|
13
|
+
Profiler,
|
|
14
|
+
PureComponent,
|
|
15
|
+
StrictMode,
|
|
16
|
+
Suspense,
|
|
17
|
+
ViewTransition,
|
|
18
|
+
act,
|
|
19
|
+
addTransitionType,
|
|
20
|
+
cache,
|
|
21
|
+
cacheSignal,
|
|
22
|
+
captureOwnerStack,
|
|
23
|
+
cloneElement,
|
|
24
|
+
createContext,
|
|
25
|
+
createElement,
|
|
26
|
+
createRef,
|
|
27
|
+
forwardRef,
|
|
28
|
+
isValidElement,
|
|
29
|
+
lazy,
|
|
30
|
+
memo,
|
|
31
|
+
startTransition,
|
|
32
|
+
use,
|
|
33
|
+
useActionState,
|
|
34
|
+
useCallback,
|
|
35
|
+
useContext,
|
|
36
|
+
useDebugValue,
|
|
37
|
+
useDeferredValue,
|
|
38
|
+
useEffect,
|
|
39
|
+
useEffectEvent,
|
|
40
|
+
useId,
|
|
41
|
+
useImperativeHandle,
|
|
42
|
+
useInsertionEffect,
|
|
43
|
+
useLayoutEffect,
|
|
44
|
+
useMemo,
|
|
45
|
+
useOptimistic,
|
|
46
|
+
useReducer,
|
|
47
|
+
useRef,
|
|
48
|
+
useState,
|
|
49
|
+
useSyncExternalStore,
|
|
50
|
+
useTransition,
|
|
51
|
+
version,
|
|
52
|
+
} from "react";
|
|
53
|
+
export { default } from "react";
|
package/src/reconciler.ts
CHANGED
|
@@ -132,6 +132,56 @@ type HostContext = {
|
|
|
132
132
|
|
|
133
133
|
let currentUpdatePriority = NoEventPriority;
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Host hooks react-reconciler 0.34 (React 19.3) added for View Transitions
|
|
137
|
+
* and Fragment refs. `@types/react-reconciler` (0.33) does not declare them
|
|
138
|
+
* yet, so they are spread in rather than written inline (excess-property
|
|
139
|
+
* checks would reject them on the literal).
|
|
140
|
+
*
|
|
141
|
+
* A terminal has no view transitions, so a `<ViewTransition>` commits like
|
|
142
|
+
* any other update: `startViewTransition` mirrors react-dom's fallback when
|
|
143
|
+
* the document can't animate — run the commit phases synchronously and
|
|
144
|
+
* return no transition handle. `suspendOnActiveViewTransition` is on the
|
|
145
|
+
* hot path: the reconciler calls it for every transition-lane commit, so
|
|
146
|
+
* without it `startTransition` / `useTransition` updates never land.
|
|
147
|
+
*/
|
|
148
|
+
const viewTransitionHostConfig = {
|
|
149
|
+
suspendOnActiveViewTransition() {},
|
|
150
|
+
startViewTransition(
|
|
151
|
+
_suspendedState: unknown,
|
|
152
|
+
_rootContainer: DOMElement,
|
|
153
|
+
_transitionTypes: unknown,
|
|
154
|
+
mutationCallback: () => void,
|
|
155
|
+
layoutCallback: () => void,
|
|
156
|
+
_afterMutationCallback: () => void,
|
|
157
|
+
spawnedWorkCallback: () => void,
|
|
158
|
+
_passiveCallback: () => void,
|
|
159
|
+
_errorCallback: (error: unknown) => void,
|
|
160
|
+
_blockedCallback: (reason: string) => void,
|
|
161
|
+
finishedAnimation: () => void,
|
|
162
|
+
): null {
|
|
163
|
+
mutationCallback();
|
|
164
|
+
layoutCallback();
|
|
165
|
+
finishedAnimation();
|
|
166
|
+
spawnedWorkCallback();
|
|
167
|
+
return null;
|
|
168
|
+
},
|
|
169
|
+
stopViewTransition() {},
|
|
170
|
+
createViewTransitionInstance: (name: string) => ({ name }),
|
|
171
|
+
measureInstance: () => null,
|
|
172
|
+
measureClonedInstance: () => null,
|
|
173
|
+
wasInstanceInViewport: () => false,
|
|
174
|
+
hasInstanceChanged: () => false,
|
|
175
|
+
hasInstanceAffectedParent: () => false,
|
|
176
|
+
applyViewTransitionName() {},
|
|
177
|
+
restoreViewTransitionName() {},
|
|
178
|
+
cancelViewTransitionName() {},
|
|
179
|
+
cancelRootViewTransitionName() {},
|
|
180
|
+
restoreRootViewTransitionName() {},
|
|
181
|
+
createFragmentInstance: (fiber: unknown) => ({ fiber }),
|
|
182
|
+
updateFragmentInstanceFiber() {},
|
|
183
|
+
};
|
|
184
|
+
|
|
135
185
|
export const reconciler = createReconciler<
|
|
136
186
|
ElementNames,
|
|
137
187
|
Props,
|
|
@@ -422,4 +472,5 @@ export const reconciler = createReconciler<
|
|
|
422
472
|
},
|
|
423
473
|
rendererPackageName: pkg.name,
|
|
424
474
|
rendererVersion: pkg.version,
|
|
475
|
+
...viewTransitionHostConfig,
|
|
425
476
|
});
|