@dxos/web-context-react 0.0.0 → 0.8.4-main.05e74ebcff
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 +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/index.mjs +191 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +193 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/types/src/consumer.d.ts +31 -0
- package/dist/types/src/consumer.d.ts.map +1 -0
- package/dist/types/src/consumer.test.d.ts +2 -0
- package/dist/types/src/consumer.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/internal.d.ts +6 -0
- package/dist/types/src/internal.d.ts.map +1 -0
- package/dist/types/src/provider.d.ts +36 -0
- package/dist/types/src/provider.d.ts.map +1 -0
- package/dist/types/src/provider.test.d.ts +2 -0
- package/dist/types/src/provider.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +8 -7
- package/src/consumer.test.tsx +5 -5
- package/src/provider.tsx +19 -9
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2025 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ import { useWebComponentContext } from '@dxos/web-context-react';
|
|
|
40
40
|
|
|
41
41
|
const MyComponent = () => {
|
|
42
42
|
const theme = useWebComponentContext(ThemeContext, { subscribe: true });
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
return <div style={{ color: theme?.color }}>Hello World</div>;
|
|
45
45
|
};
|
|
46
46
|
```
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@dxos/web-context";
|
|
3
|
+
|
|
4
|
+
// src/consumer.ts
|
|
5
|
+
import { useContext as useContext2, useEffect as useEffect2, useState } from "react";
|
|
6
|
+
import { ContextRequestEvent as ContextRequestEvent2 } from "@dxos/web-context";
|
|
7
|
+
|
|
8
|
+
// src/internal.ts
|
|
9
|
+
import { createContext } from "react";
|
|
10
|
+
var HostElementContext = createContext(void 0);
|
|
11
|
+
|
|
12
|
+
// src/provider.tsx
|
|
13
|
+
import React, { createContext as createContext2, useCallback, useContext, useEffect, useRef } from "react";
|
|
14
|
+
import { CONTEXT_PROVIDER_EVENT, CONTEXT_REQUEST_EVENT, ContextProviderEvent, ContextRequestEvent } from "@dxos/web-context";
|
|
15
|
+
var ContextRequestHandlerContext = /* @__PURE__ */ createContext2(void 0);
|
|
16
|
+
function tryHandleContextRequest(event) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
function useContextRequestHandler() {
|
|
20
|
+
return useContext(ContextRequestHandlerContext);
|
|
21
|
+
}
|
|
22
|
+
var ContextProtocolProvider = ({ context, value, children }) => {
|
|
23
|
+
const parentHandler = useContext(ContextRequestHandlerContext);
|
|
24
|
+
const subscriptions = useRef(/* @__PURE__ */ new WeakMap()).current;
|
|
25
|
+
const subscriptionRefs = useRef(/* @__PURE__ */ new Set()).current;
|
|
26
|
+
const valueRef = useRef(value);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
valueRef.current = value;
|
|
29
|
+
}, [
|
|
30
|
+
value
|
|
31
|
+
]);
|
|
32
|
+
const handleRequest = useCallback((event) => {
|
|
33
|
+
if (event.context !== context) {
|
|
34
|
+
if (parentHandler) {
|
|
35
|
+
return parentHandler(event);
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const currentValue = valueRef.current;
|
|
40
|
+
if (event.subscribe) {
|
|
41
|
+
const callback = event.callback;
|
|
42
|
+
const consumerHost = event.contextTarget || event.composedPath()[0];
|
|
43
|
+
const unsubscribe = () => {
|
|
44
|
+
const info = subscriptions.get(callback);
|
|
45
|
+
if (info) {
|
|
46
|
+
subscriptionRefs.delete(info.ref);
|
|
47
|
+
subscriptions.delete(callback);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const ref = new WeakRef(callback);
|
|
51
|
+
subscriptions.set(callback, {
|
|
52
|
+
unsubscribe,
|
|
53
|
+
consumerHost,
|
|
54
|
+
ref
|
|
55
|
+
});
|
|
56
|
+
subscriptionRefs.add(ref);
|
|
57
|
+
event.callback(currentValue, unsubscribe);
|
|
58
|
+
} else {
|
|
59
|
+
event.callback(currentValue);
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}, [
|
|
63
|
+
context,
|
|
64
|
+
parentHandler
|
|
65
|
+
]);
|
|
66
|
+
const handleContextRequestEvent = useCallback((e) => {
|
|
67
|
+
const event = e;
|
|
68
|
+
if (handleRequest(event)) {
|
|
69
|
+
event.stopImmediatePropagation();
|
|
70
|
+
}
|
|
71
|
+
}, [
|
|
72
|
+
handleRequest
|
|
73
|
+
]);
|
|
74
|
+
const handleContextProviderEvent = useCallback((e) => {
|
|
75
|
+
const event = e;
|
|
76
|
+
if (event.context !== context) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (containerRef.current && event.contextTarget === containerRef.current) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const seen = /* @__PURE__ */ new Set();
|
|
83
|
+
for (const ref of subscriptionRefs) {
|
|
84
|
+
const callback = ref.deref();
|
|
85
|
+
if (!callback) {
|
|
86
|
+
subscriptionRefs.delete(ref);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const info = subscriptions.get(callback);
|
|
90
|
+
if (!info) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (seen.has(callback)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
seen.add(callback);
|
|
97
|
+
info.consumerHost.dispatchEvent(new ContextRequestEvent(context, callback, {
|
|
98
|
+
subscribe: true,
|
|
99
|
+
target: info.consumerHost
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
event.stopPropagation();
|
|
103
|
+
}, [
|
|
104
|
+
context
|
|
105
|
+
]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
for (const ref of subscriptionRefs) {
|
|
108
|
+
const callback = ref.deref();
|
|
109
|
+
if (!callback) {
|
|
110
|
+
subscriptionRefs.delete(ref);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const info = subscriptions.get(callback);
|
|
114
|
+
if (info) {
|
|
115
|
+
callback(value, info.unsubscribe);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, [
|
|
119
|
+
value
|
|
120
|
+
]);
|
|
121
|
+
const containerRef = useRef(null);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
const el = containerRef.current;
|
|
124
|
+
if (!el) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
el.addEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);
|
|
128
|
+
el.addEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);
|
|
129
|
+
el.dispatchEvent(new ContextProviderEvent(context, el));
|
|
130
|
+
return () => {
|
|
131
|
+
el.removeEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);
|
|
132
|
+
el.removeEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);
|
|
133
|
+
subscriptionRefs.clear();
|
|
134
|
+
};
|
|
135
|
+
}, [
|
|
136
|
+
handleContextRequestEvent,
|
|
137
|
+
handleContextProviderEvent,
|
|
138
|
+
context
|
|
139
|
+
]);
|
|
140
|
+
return /* @__PURE__ */ React.createElement(ContextRequestHandlerContext.Provider, {
|
|
141
|
+
value: handleRequest
|
|
142
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
143
|
+
className: "contents",
|
|
144
|
+
ref: containerRef
|
|
145
|
+
}, children));
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/consumer.ts
|
|
149
|
+
function useWebComponentContext(context, options) {
|
|
150
|
+
const [value, setValue] = useState(void 0);
|
|
151
|
+
const handler = useContextRequestHandler();
|
|
152
|
+
const hostElement = useContext2(HostElementContext);
|
|
153
|
+
useEffect2(() => {
|
|
154
|
+
let unsubscribeFn;
|
|
155
|
+
const callback = (newValue, unsubscribe) => {
|
|
156
|
+
setValue(newValue);
|
|
157
|
+
if (unsubscribe) {
|
|
158
|
+
unsubscribeFn = unsubscribe;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const targetElement = options?.element ?? hostElement ?? document.body;
|
|
162
|
+
const event = new ContextRequestEvent2(context, callback, {
|
|
163
|
+
subscribe: options?.subscribe,
|
|
164
|
+
target: targetElement
|
|
165
|
+
});
|
|
166
|
+
let handled = false;
|
|
167
|
+
if (handler) {
|
|
168
|
+
handled = handler(event);
|
|
169
|
+
}
|
|
170
|
+
if (!handled) {
|
|
171
|
+
targetElement.dispatchEvent(event);
|
|
172
|
+
}
|
|
173
|
+
return () => {
|
|
174
|
+
unsubscribeFn?.();
|
|
175
|
+
};
|
|
176
|
+
}, [
|
|
177
|
+
context,
|
|
178
|
+
options?.subscribe,
|
|
179
|
+
options?.element,
|
|
180
|
+
handler,
|
|
181
|
+
hostElement
|
|
182
|
+
]);
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
ContextProtocolProvider,
|
|
187
|
+
tryHandleContextRequest,
|
|
188
|
+
useContextRequestHandler,
|
|
189
|
+
useWebComponentContext
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/consumer.ts", "../../../src/internal.ts", "../../../src/provider.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport * from '@dxos/web-context';\n\nexport * from './consumer';\nexport * from './provider';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useContext, useEffect, useState } from 'react';\n\nimport { ContextRequestEvent, type ContextType, type UnknownContext } from '@dxos/web-context';\n\nimport { HostElementContext } from './internal';\nimport { useContextRequestHandler } from './provider';\n\n/**\n * Options for useWebComponentContext hook\n */\nexport interface UseWebComponentContextOptions {\n /**\n * Whether to subscribe to context updates.\n * If true, the returned value will update when the provider's value changes.\n * Default: false\n */\n subscribe?: boolean;\n\n /**\n * The element to dispatch the context-request event from.\n * This is only used when there's no React provider in the tree.\n * Default: document.body\n */\n element?: HTMLElement;\n}\n\n/**\n * A React hook that requests context using the Web Component Context Protocol.\n *\n * This first tries to use the React context chain (for providers in the same\n * React tree), then falls back to dispatching a DOM event (for web component\n * providers).\n *\n * @param context - The context key to request\n * @param options - Optional configuration\n * @returns The context value or undefined\n */\nexport function useWebComponentContext<T extends UnknownContext>(\n context: T,\n options?: UseWebComponentContextOptions,\n): ContextType<T> | undefined {\n const [value, setValue] = useState<ContextType<T> | undefined>(undefined);\n\n const handler = useContextRequestHandler();\n const hostElement = useContext(HostElementContext);\n\n useEffect(() => {\n let unsubscribeFn: (() => void) | undefined;\n\n const callback = (newValue: ContextType<T>, unsubscribe?: () => void) => {\n setValue(newValue);\n if (unsubscribe) {\n unsubscribeFn = unsubscribe;\n }\n };\n\n const targetElement = options?.element ?? hostElement ?? document.body;\n\n const event = new ContextRequestEvent(context, callback, {\n subscribe: options?.subscribe,\n target: targetElement,\n });\n\n let handled = false;\n if (handler) {\n handled = handler(event);\n }\n\n if (!handled) {\n targetElement.dispatchEvent(event);\n }\n\n return () => {\n unsubscribeFn?.();\n };\n }, [context, options?.subscribe, options?.element, handler, hostElement]);\n\n return value;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from 'react';\n\n/**\n * Internal React context for passing the host element to nested components.\n * This allows useWebComponentContext to dispatch events from the custom element.\n */\nexport const HostElementContext = createContext<HTMLElement | undefined>(undefined);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n type JSX,\n type PropsWithChildren,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n} from 'react';\n\nimport {\n CONTEXT_PROVIDER_EVENT,\n CONTEXT_REQUEST_EVENT,\n type ContextCallback,\n ContextProviderEvent,\n ContextRequestEvent,\n type ContextType,\n type UnknownContext,\n} from '@dxos/web-context';\n\n/**\n * Handler function type for context requests passed via React context\n */\ntype ContextRequestHandler = (event: ContextRequestEvent<UnknownContext>) => boolean;\n\n/**\n * Internal React context for passing context request handlers down the tree.\n * This allows useWebComponentContext to work synchronously in React.\n */\nconst ContextRequestHandlerContext = createContext<ContextRequestHandler | undefined>(undefined);\n\n/**\n * Try to handle a context request using the React context chain.\n * Returns true if handled, false otherwise.\n * Used internally by useWebComponentContext.\n */\nexport function tryHandleContextRequest(event: ContextRequestEvent<UnknownContext>): boolean {\n // This function is intended to be used where useContext is invalid (outside component),\n // but context handling in React MUST happen inside components.\n // So this helper might be less useful in React than in Solid if not used inside a hook/component.\n // However, we can export the context itself for consumers to use `useContext`.\n return false;\n}\n\n/**\n * Get the context request handler from React context.\n * Used internally by useWebComponentContext.\n */\nexport function useContextRequestHandler(): ContextRequestHandler | undefined {\n return useContext(ContextRequestHandlerContext);\n}\n\n/**\n * Props for the ContextProtocolProvider component\n */\nexport interface ContextProtocolProviderProps<T extends UnknownContext> {\n /** The context key to provide */\n context: T;\n /** The value to provide */\n value: ContextType<T>;\n}\n\n/**\n * A provider component that:\n * 1. Handles context-request events from web components (via DOM events)\n * 2. Handles context requests from React consumers (via React context)\n * 3. Supports subscriptions for reactive updates\n * 4. Uses WeakRef for subscriptions to prevent memory leaks\n */\nexport const ContextProtocolProvider = <T extends UnknownContext>({\n context,\n value,\n children,\n}: PropsWithChildren<ContextProtocolProviderProps<T>>): JSX.Element => {\n // Get parent handler if one exists (for nested providers)\n const parentHandler = useContext(ContextRequestHandlerContext);\n\n // Track subscriptions with their stable unsubscribe functions and consumer host elements\n interface SubscriptionInfo {\n unsubscribe: () => void;\n consumerHost: Element;\n ref: WeakRef<ContextCallback<ContextType<T>>>;\n }\n\n // We use refs for mutable state that doesn't trigger re-renders\n const subscriptions = useRef(new WeakMap<ContextCallback<ContextType<T>>, SubscriptionInfo>()).current;\n const subscriptionRefs = useRef(new Set<WeakRef<ContextCallback<ContextType<T>>>>()).current;\n const valueRef = useRef(value);\n\n // Update value ref when prop changes\n useEffect(() => {\n valueRef.current = value;\n }, [value]);\n\n // Core handler logic\n const handleRequest = useCallback(\n (event: ContextRequestEvent<UnknownContext>): boolean => {\n if (event.context !== context) {\n if (parentHandler) {\n return parentHandler(event);\n }\n return false;\n }\n\n const currentValue = valueRef.current; // Use latest value\n\n if (event.subscribe) {\n const callback = event.callback as ContextCallback<ContextType<T>>;\n const consumerHost = event.contextTarget || (event.composedPath()[0] as Element);\n\n const unsubscribe = () => {\n const info = subscriptions.get(callback);\n if (info) {\n subscriptionRefs.delete(info.ref);\n subscriptions.delete(callback);\n }\n };\n\n const ref = new WeakRef(callback);\n subscriptions.set(callback, { unsubscribe, consumerHost, ref });\n subscriptionRefs.add(ref);\n\n event.callback(currentValue, unsubscribe);\n } else {\n event.callback(currentValue);\n }\n\n return true;\n },\n [context, parentHandler], // Dependencies\n );\n\n // Handle DOM context-request events\n const handleContextRequestEvent = useCallback(\n (e: Event) => {\n const event = e as ContextRequestEvent<UnknownContext>;\n if (handleRequest(event)) {\n event.stopImmediatePropagation();\n }\n },\n [handleRequest],\n );\n\n // Handle context-provider events\n const handleContextProviderEvent = useCallback(\n (e: Event) => {\n const event = e as ContextProviderEvent<UnknownContext>;\n if (event.context !== context) {\n return;\n }\n if (containerRef.current && event.contextTarget === containerRef.current) {\n return;\n }\n\n const seen = new Set<ContextCallback<ContextType<T>>>();\n for (const ref of subscriptionRefs) {\n const callback = ref.deref();\n if (!callback) {\n subscriptionRefs.delete(ref);\n continue;\n }\n\n const info = subscriptions.get(callback);\n if (!info) {\n continue;\n }\n\n if (seen.has(callback)) {\n continue;\n }\n seen.add(callback);\n\n info.consumerHost.dispatchEvent(\n new ContextRequestEvent(context, callback, { subscribe: true, target: info.consumerHost }),\n );\n }\n event.stopPropagation();\n },\n [context],\n );\n\n // Notify subscribers when value changes.\n useEffect(() => {\n // Skip notification if value hasn't changed? React does this for us if we use dependencies correctly?\n // No, we need to imperatively call callbacks.\n // value constraint is in the dependency array.\n\n for (const ref of subscriptionRefs) {\n const callback = ref.deref();\n if (!callback) {\n subscriptionRefs.delete(ref);\n continue;\n }\n const info = subscriptions.get(callback);\n if (info) {\n callback(value, info.unsubscribe);\n }\n }\n }, [value]);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) {\n return;\n }\n\n el.addEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);\n el.addEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);\n\n // Announce provider.\n el.dispatchEvent(new ContextProviderEvent(context, el));\n\n return () => {\n el.removeEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);\n el.removeEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);\n subscriptionRefs.clear();\n };\n }, [handleContextRequestEvent, handleContextProviderEvent, context]);\n\n return (\n <ContextRequestHandlerContext.Provider value={handleRequest}>\n <div className='contents' ref={containerRef}>\n {children}\n </div>\n </ContextRequestHandlerContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,cAAc;;;ACAd,SAASA,cAAAA,aAAYC,aAAAA,YAAWC,gBAAgB;AAEhD,SAASC,uBAAAA,4BAAkE;;;ACF3E,SAASC,qBAAqB;AAMvB,IAAMC,qBAAqBD,cAAuCE,MAAAA;;;ACNzE,OAAOC,SAGLC,iBAAAA,gBACAC,aACAC,YACAC,WACAC,cACK;AAEP,SACEC,wBACAC,uBAEAC,sBACAC,2BAGK;AAWP,IAAMC,+BAA+BT,gBAAAA,eAAiDU,MAAAA;AAO/E,SAASC,wBAAwBC,OAA0C;AAKhF,SAAO;AACT;AAMO,SAASC,2BAAAA;AACd,SAAOX,WAAWO,4BAAAA;AACpB;AAmBO,IAAMK,0BAA0B,CAA2B,EAChEC,SACAC,OACAC,SAAQ,MAC2C;AAEnD,QAAMC,gBAAgBhB,WAAWO,4BAAAA;AAUjC,QAAMU,gBAAgBf,OAAO,oBAAIgB,QAAAA,CAAAA,EAA8DC;AAC/F,QAAMC,mBAAmBlB,OAAO,oBAAImB,IAAAA,CAAAA,EAAiDF;AACrF,QAAMG,WAAWpB,OAAOY,KAAAA;AAGxBb,YAAU,MAAA;AACRqB,aAASH,UAAUL;EACrB,GAAG;IAACA;GAAM;AAGV,QAAMS,gBAAgBxB,YACpB,CAACW,UAAAA;AACC,QAAIA,MAAMG,YAAYA,SAAS;AAC7B,UAAIG,eAAe;AACjB,eAAOA,cAAcN,KAAAA;MACvB;AACA,aAAO;IACT;AAEA,UAAMc,eAAeF,SAASH;AAE9B,QAAIT,MAAMe,WAAW;AACnB,YAAMC,WAAWhB,MAAMgB;AACvB,YAAMC,eAAejB,MAAMkB,iBAAkBlB,MAAMmB,aAAY,EAAG,CAAA;AAElE,YAAMC,cAAc,MAAA;AAClB,cAAMC,OAAOd,cAAce,IAAIN,QAAAA;AAC/B,YAAIK,MAAM;AACRX,2BAAiBa,OAAOF,KAAKG,GAAG;AAChCjB,wBAAcgB,OAAOP,QAAAA;QACvB;MACF;AAEA,YAAMQ,MAAM,IAAIC,QAAQT,QAAAA;AACxBT,oBAAcmB,IAAIV,UAAU;QAAEI;QAAaH;QAAcO;MAAI,CAAA;AAC7Dd,uBAAiBiB,IAAIH,GAAAA;AAErBxB,YAAMgB,SAASF,cAAcM,WAAAA;IAC/B,OAAO;AACLpB,YAAMgB,SAASF,YAAAA;IACjB;AAEA,WAAO;EACT,GACA;IAACX;IAASG;GAAc;AAI1B,QAAMsB,4BAA4BvC,YAChC,CAACwC,MAAAA;AACC,UAAM7B,QAAQ6B;AACd,QAAIhB,cAAcb,KAAAA,GAAQ;AACxBA,YAAM8B,yBAAwB;IAChC;EACF,GACA;IAACjB;GAAc;AAIjB,QAAMkB,6BAA6B1C,YACjC,CAACwC,MAAAA;AACC,UAAM7B,QAAQ6B;AACd,QAAI7B,MAAMG,YAAYA,SAAS;AAC7B;IACF;AACA,QAAI6B,aAAavB,WAAWT,MAAMkB,kBAAkBc,aAAavB,SAAS;AACxE;IACF;AAEA,UAAMwB,OAAO,oBAAItB,IAAAA;AACjB,eAAWa,OAAOd,kBAAkB;AAClC,YAAMM,WAAWQ,IAAIU,MAAK;AAC1B,UAAI,CAAClB,UAAU;AACbN,yBAAiBa,OAAOC,GAAAA;AACxB;MACF;AAEA,YAAMH,OAAOd,cAAce,IAAIN,QAAAA;AAC/B,UAAI,CAACK,MAAM;AACT;MACF;AAEA,UAAIY,KAAKE,IAAInB,QAAAA,GAAW;AACtB;MACF;AACAiB,WAAKN,IAAIX,QAAAA;AAETK,WAAKJ,aAAamB,cAChB,IAAIxC,oBAAoBO,SAASa,UAAU;QAAED,WAAW;QAAMsB,QAAQhB,KAAKJ;MAAa,CAAA,CAAA;IAE5F;AACAjB,UAAMsC,gBAAe;EACvB,GACA;IAACnC;GAAQ;AAIXZ,YAAU,MAAA;AAKR,eAAWiC,OAAOd,kBAAkB;AAClC,YAAMM,WAAWQ,IAAIU,MAAK;AAC1B,UAAI,CAAClB,UAAU;AACbN,yBAAiBa,OAAOC,GAAAA;AACxB;MACF;AACA,YAAMH,OAAOd,cAAce,IAAIN,QAAAA;AAC/B,UAAIK,MAAM;AACRL,iBAASZ,OAAOiB,KAAKD,WAAW;MAClC;IACF;EACF,GAAG;IAAChB;GAAM;AAEV,QAAM4B,eAAexC,OAAuB,IAAA;AAE5CD,YAAU,MAAA;AACR,UAAMgD,KAAKP,aAAavB;AACxB,QAAI,CAAC8B,IAAI;AACP;IACF;AAEAA,OAAGC,iBAAiB9C,uBAAuBkC,yBAAAA;AAC3CW,OAAGC,iBAAiB/C,wBAAwBsC,0BAAAA;AAG5CQ,OAAGH,cAAc,IAAIzC,qBAAqBQ,SAASoC,EAAAA,CAAAA;AAEnD,WAAO,MAAA;AACLA,SAAGE,oBAAoB/C,uBAAuBkC,yBAAAA;AAC9CW,SAAGE,oBAAoBhD,wBAAwBsC,0BAAAA;AAC/CrB,uBAAiBgC,MAAK;IACxB;EACF,GAAG;IAACd;IAA2BG;IAA4B5B;GAAQ;AAEnE,SACE,sBAAA,cAACN,6BAA6B8C,UAAQ;IAACvC,OAAOS;KAC5C,sBAAA,cAAC+B,OAAAA;IAAIC,WAAU;IAAWrB,KAAKQ;KAC5B3B,QAAAA,CAAAA;AAIT;;;AF/LO,SAASyC,uBACdC,SACAC,SAAuC;AAEvC,QAAM,CAACC,OAAOC,QAAAA,IAAYC,SAAqCC,MAAAA;AAE/D,QAAMC,UAAUC,yBAAAA;AAChB,QAAMC,cAAcC,YAAWC,kBAAAA;AAE/BC,EAAAA,WAAU,MAAA;AACR,QAAIC;AAEJ,UAAMC,WAAW,CAACC,UAA0BC,gBAAAA;AAC1CZ,eAASW,QAAAA;AACT,UAAIC,aAAa;AACfH,wBAAgBG;MAClB;IACF;AAEA,UAAMC,gBAAgBf,SAASgB,WAAWT,eAAeU,SAASC;AAElE,UAAMC,QAAQ,IAAIC,qBAAoBrB,SAASa,UAAU;MACvDS,WAAWrB,SAASqB;MACpBC,QAAQP;IACV,CAAA;AAEA,QAAIQ,UAAU;AACd,QAAIlB,SAAS;AACXkB,gBAAUlB,QAAQc,KAAAA;IACpB;AAEA,QAAI,CAACI,SAAS;AACZR,oBAAcS,cAAcL,KAAAA;IAC9B;AAEA,WAAO,MAAA;AACLR,sBAAAA;IACF;EACF,GAAG;IAACZ;IAASC,SAASqB;IAAWrB,SAASgB;IAASX;IAASE;GAAY;AAExE,SAAON;AACT;",
|
|
6
|
+
"names": ["useContext", "useEffect", "useState", "ContextRequestEvent", "createContext", "HostElementContext", "undefined", "React", "createContext", "useCallback", "useContext", "useEffect", "useRef", "CONTEXT_PROVIDER_EVENT", "CONTEXT_REQUEST_EVENT", "ContextProviderEvent", "ContextRequestEvent", "ContextRequestHandlerContext", "undefined", "tryHandleContextRequest", "event", "useContextRequestHandler", "ContextProtocolProvider", "context", "value", "children", "parentHandler", "subscriptions", "WeakMap", "current", "subscriptionRefs", "Set", "valueRef", "handleRequest", "currentValue", "subscribe", "callback", "consumerHost", "contextTarget", "composedPath", "unsubscribe", "info", "get", "delete", "ref", "WeakRef", "set", "add", "handleContextRequestEvent", "e", "stopImmediatePropagation", "handleContextProviderEvent", "containerRef", "seen", "deref", "has", "dispatchEvent", "target", "stopPropagation", "el", "addEventListener", "removeEventListener", "clear", "Provider", "div", "className", "useWebComponentContext", "context", "options", "value", "setValue", "useState", "undefined", "handler", "useContextRequestHandler", "hostElement", "useContext", "HostElementContext", "useEffect", "unsubscribeFn", "callback", "newValue", "unsubscribe", "targetElement", "element", "document", "body", "event", "ContextRequestEvent", "subscribe", "target", "handled", "dispatchEvent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/internal.ts":{"bytes":1122,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/provider.tsx":{"bytes":21018,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true}],"format":"esm"},"src/consumer.ts":{"bytes":6500,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"src/internal.ts","kind":"import-statement","original":"./internal"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider"}],"format":"esm"},"src/index.ts":{"bytes":575,"imports":[{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"src/consumer.ts","kind":"import-statement","original":"./consumer"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15044},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true}],"exports":["ContextProtocolProvider","tryHandleContextRequest","useContextRequestHandler","useWebComponentContext"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":35},"src/consumer.ts":{"bytesInOutput":1096},"src/internal.ts":{"bytesInOutput":87},"src/provider.tsx":{"bytesInOutput":3991}},"bytes":5460}}}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
export * from "@dxos/web-context";
|
|
5
|
+
|
|
6
|
+
// src/consumer.ts
|
|
7
|
+
import { useContext as useContext2, useEffect as useEffect2, useState } from "react";
|
|
8
|
+
import { ContextRequestEvent as ContextRequestEvent2 } from "@dxos/web-context";
|
|
9
|
+
|
|
10
|
+
// src/internal.ts
|
|
11
|
+
import { createContext } from "react";
|
|
12
|
+
var HostElementContext = createContext(void 0);
|
|
13
|
+
|
|
14
|
+
// src/provider.tsx
|
|
15
|
+
import React, { createContext as createContext2, useCallback, useContext, useEffect, useRef } from "react";
|
|
16
|
+
import { CONTEXT_PROVIDER_EVENT, CONTEXT_REQUEST_EVENT, ContextProviderEvent, ContextRequestEvent } from "@dxos/web-context";
|
|
17
|
+
var ContextRequestHandlerContext = /* @__PURE__ */ createContext2(void 0);
|
|
18
|
+
function tryHandleContextRequest(event) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function useContextRequestHandler() {
|
|
22
|
+
return useContext(ContextRequestHandlerContext);
|
|
23
|
+
}
|
|
24
|
+
var ContextProtocolProvider = ({ context, value, children }) => {
|
|
25
|
+
const parentHandler = useContext(ContextRequestHandlerContext);
|
|
26
|
+
const subscriptions = useRef(/* @__PURE__ */ new WeakMap()).current;
|
|
27
|
+
const subscriptionRefs = useRef(/* @__PURE__ */ new Set()).current;
|
|
28
|
+
const valueRef = useRef(value);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
valueRef.current = value;
|
|
31
|
+
}, [
|
|
32
|
+
value
|
|
33
|
+
]);
|
|
34
|
+
const handleRequest = useCallback((event) => {
|
|
35
|
+
if (event.context !== context) {
|
|
36
|
+
if (parentHandler) {
|
|
37
|
+
return parentHandler(event);
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const currentValue = valueRef.current;
|
|
42
|
+
if (event.subscribe) {
|
|
43
|
+
const callback = event.callback;
|
|
44
|
+
const consumerHost = event.contextTarget || event.composedPath()[0];
|
|
45
|
+
const unsubscribe = () => {
|
|
46
|
+
const info = subscriptions.get(callback);
|
|
47
|
+
if (info) {
|
|
48
|
+
subscriptionRefs.delete(info.ref);
|
|
49
|
+
subscriptions.delete(callback);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const ref = new WeakRef(callback);
|
|
53
|
+
subscriptions.set(callback, {
|
|
54
|
+
unsubscribe,
|
|
55
|
+
consumerHost,
|
|
56
|
+
ref
|
|
57
|
+
});
|
|
58
|
+
subscriptionRefs.add(ref);
|
|
59
|
+
event.callback(currentValue, unsubscribe);
|
|
60
|
+
} else {
|
|
61
|
+
event.callback(currentValue);
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}, [
|
|
65
|
+
context,
|
|
66
|
+
parentHandler
|
|
67
|
+
]);
|
|
68
|
+
const handleContextRequestEvent = useCallback((e) => {
|
|
69
|
+
const event = e;
|
|
70
|
+
if (handleRequest(event)) {
|
|
71
|
+
event.stopImmediatePropagation();
|
|
72
|
+
}
|
|
73
|
+
}, [
|
|
74
|
+
handleRequest
|
|
75
|
+
]);
|
|
76
|
+
const handleContextProviderEvent = useCallback((e) => {
|
|
77
|
+
const event = e;
|
|
78
|
+
if (event.context !== context) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (containerRef.current && event.contextTarget === containerRef.current) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const seen = /* @__PURE__ */ new Set();
|
|
85
|
+
for (const ref of subscriptionRefs) {
|
|
86
|
+
const callback = ref.deref();
|
|
87
|
+
if (!callback) {
|
|
88
|
+
subscriptionRefs.delete(ref);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const info = subscriptions.get(callback);
|
|
92
|
+
if (!info) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (seen.has(callback)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
seen.add(callback);
|
|
99
|
+
info.consumerHost.dispatchEvent(new ContextRequestEvent(context, callback, {
|
|
100
|
+
subscribe: true,
|
|
101
|
+
target: info.consumerHost
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
}, [
|
|
106
|
+
context
|
|
107
|
+
]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
for (const ref of subscriptionRefs) {
|
|
110
|
+
const callback = ref.deref();
|
|
111
|
+
if (!callback) {
|
|
112
|
+
subscriptionRefs.delete(ref);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const info = subscriptions.get(callback);
|
|
116
|
+
if (info) {
|
|
117
|
+
callback(value, info.unsubscribe);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [
|
|
121
|
+
value
|
|
122
|
+
]);
|
|
123
|
+
const containerRef = useRef(null);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
const el = containerRef.current;
|
|
126
|
+
if (!el) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
el.addEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);
|
|
130
|
+
el.addEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);
|
|
131
|
+
el.dispatchEvent(new ContextProviderEvent(context, el));
|
|
132
|
+
return () => {
|
|
133
|
+
el.removeEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);
|
|
134
|
+
el.removeEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);
|
|
135
|
+
subscriptionRefs.clear();
|
|
136
|
+
};
|
|
137
|
+
}, [
|
|
138
|
+
handleContextRequestEvent,
|
|
139
|
+
handleContextProviderEvent,
|
|
140
|
+
context
|
|
141
|
+
]);
|
|
142
|
+
return /* @__PURE__ */ React.createElement(ContextRequestHandlerContext.Provider, {
|
|
143
|
+
value: handleRequest
|
|
144
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
145
|
+
className: "contents",
|
|
146
|
+
ref: containerRef
|
|
147
|
+
}, children));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/consumer.ts
|
|
151
|
+
function useWebComponentContext(context, options) {
|
|
152
|
+
const [value, setValue] = useState(void 0);
|
|
153
|
+
const handler = useContextRequestHandler();
|
|
154
|
+
const hostElement = useContext2(HostElementContext);
|
|
155
|
+
useEffect2(() => {
|
|
156
|
+
let unsubscribeFn;
|
|
157
|
+
const callback = (newValue, unsubscribe) => {
|
|
158
|
+
setValue(newValue);
|
|
159
|
+
if (unsubscribe) {
|
|
160
|
+
unsubscribeFn = unsubscribe;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const targetElement = options?.element ?? hostElement ?? document.body;
|
|
164
|
+
const event = new ContextRequestEvent2(context, callback, {
|
|
165
|
+
subscribe: options?.subscribe,
|
|
166
|
+
target: targetElement
|
|
167
|
+
});
|
|
168
|
+
let handled = false;
|
|
169
|
+
if (handler) {
|
|
170
|
+
handled = handler(event);
|
|
171
|
+
}
|
|
172
|
+
if (!handled) {
|
|
173
|
+
targetElement.dispatchEvent(event);
|
|
174
|
+
}
|
|
175
|
+
return () => {
|
|
176
|
+
unsubscribeFn?.();
|
|
177
|
+
};
|
|
178
|
+
}, [
|
|
179
|
+
context,
|
|
180
|
+
options?.subscribe,
|
|
181
|
+
options?.element,
|
|
182
|
+
handler,
|
|
183
|
+
hostElement
|
|
184
|
+
]);
|
|
185
|
+
return value;
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
ContextProtocolProvider,
|
|
189
|
+
tryHandleContextRequest,
|
|
190
|
+
useContextRequestHandler,
|
|
191
|
+
useWebComponentContext
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/consumer.ts", "../../../src/internal.ts", "../../../src/provider.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport * from '@dxos/web-context';\n\nexport * from './consumer';\nexport * from './provider';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useContext, useEffect, useState } from 'react';\n\nimport { ContextRequestEvent, type ContextType, type UnknownContext } from '@dxos/web-context';\n\nimport { HostElementContext } from './internal';\nimport { useContextRequestHandler } from './provider';\n\n/**\n * Options for useWebComponentContext hook\n */\nexport interface UseWebComponentContextOptions {\n /**\n * Whether to subscribe to context updates.\n * If true, the returned value will update when the provider's value changes.\n * Default: false\n */\n subscribe?: boolean;\n\n /**\n * The element to dispatch the context-request event from.\n * This is only used when there's no React provider in the tree.\n * Default: document.body\n */\n element?: HTMLElement;\n}\n\n/**\n * A React hook that requests context using the Web Component Context Protocol.\n *\n * This first tries to use the React context chain (for providers in the same\n * React tree), then falls back to dispatching a DOM event (for web component\n * providers).\n *\n * @param context - The context key to request\n * @param options - Optional configuration\n * @returns The context value or undefined\n */\nexport function useWebComponentContext<T extends UnknownContext>(\n context: T,\n options?: UseWebComponentContextOptions,\n): ContextType<T> | undefined {\n const [value, setValue] = useState<ContextType<T> | undefined>(undefined);\n\n const handler = useContextRequestHandler();\n const hostElement = useContext(HostElementContext);\n\n useEffect(() => {\n let unsubscribeFn: (() => void) | undefined;\n\n const callback = (newValue: ContextType<T>, unsubscribe?: () => void) => {\n setValue(newValue);\n if (unsubscribe) {\n unsubscribeFn = unsubscribe;\n }\n };\n\n const targetElement = options?.element ?? hostElement ?? document.body;\n\n const event = new ContextRequestEvent(context, callback, {\n subscribe: options?.subscribe,\n target: targetElement,\n });\n\n let handled = false;\n if (handler) {\n handled = handler(event);\n }\n\n if (!handled) {\n targetElement.dispatchEvent(event);\n }\n\n return () => {\n unsubscribeFn?.();\n };\n }, [context, options?.subscribe, options?.element, handler, hostElement]);\n\n return value;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from 'react';\n\n/**\n * Internal React context for passing the host element to nested components.\n * This allows useWebComponentContext to dispatch events from the custom element.\n */\nexport const HostElementContext = createContext<HTMLElement | undefined>(undefined);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, {\n type JSX,\n type PropsWithChildren,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n} from 'react';\n\nimport {\n CONTEXT_PROVIDER_EVENT,\n CONTEXT_REQUEST_EVENT,\n type ContextCallback,\n ContextProviderEvent,\n ContextRequestEvent,\n type ContextType,\n type UnknownContext,\n} from '@dxos/web-context';\n\n/**\n * Handler function type for context requests passed via React context\n */\ntype ContextRequestHandler = (event: ContextRequestEvent<UnknownContext>) => boolean;\n\n/**\n * Internal React context for passing context request handlers down the tree.\n * This allows useWebComponentContext to work synchronously in React.\n */\nconst ContextRequestHandlerContext = createContext<ContextRequestHandler | undefined>(undefined);\n\n/**\n * Try to handle a context request using the React context chain.\n * Returns true if handled, false otherwise.\n * Used internally by useWebComponentContext.\n */\nexport function tryHandleContextRequest(event: ContextRequestEvent<UnknownContext>): boolean {\n // This function is intended to be used where useContext is invalid (outside component),\n // but context handling in React MUST happen inside components.\n // So this helper might be less useful in React than in Solid if not used inside a hook/component.\n // However, we can export the context itself for consumers to use `useContext`.\n return false;\n}\n\n/**\n * Get the context request handler from React context.\n * Used internally by useWebComponentContext.\n */\nexport function useContextRequestHandler(): ContextRequestHandler | undefined {\n return useContext(ContextRequestHandlerContext);\n}\n\n/**\n * Props for the ContextProtocolProvider component\n */\nexport interface ContextProtocolProviderProps<T extends UnknownContext> {\n /** The context key to provide */\n context: T;\n /** The value to provide */\n value: ContextType<T>;\n}\n\n/**\n * A provider component that:\n * 1. Handles context-request events from web components (via DOM events)\n * 2. Handles context requests from React consumers (via React context)\n * 3. Supports subscriptions for reactive updates\n * 4. Uses WeakRef for subscriptions to prevent memory leaks\n */\nexport const ContextProtocolProvider = <T extends UnknownContext>({\n context,\n value,\n children,\n}: PropsWithChildren<ContextProtocolProviderProps<T>>): JSX.Element => {\n // Get parent handler if one exists (for nested providers)\n const parentHandler = useContext(ContextRequestHandlerContext);\n\n // Track subscriptions with their stable unsubscribe functions and consumer host elements\n interface SubscriptionInfo {\n unsubscribe: () => void;\n consumerHost: Element;\n ref: WeakRef<ContextCallback<ContextType<T>>>;\n }\n\n // We use refs for mutable state that doesn't trigger re-renders\n const subscriptions = useRef(new WeakMap<ContextCallback<ContextType<T>>, SubscriptionInfo>()).current;\n const subscriptionRefs = useRef(new Set<WeakRef<ContextCallback<ContextType<T>>>>()).current;\n const valueRef = useRef(value);\n\n // Update value ref when prop changes\n useEffect(() => {\n valueRef.current = value;\n }, [value]);\n\n // Core handler logic\n const handleRequest = useCallback(\n (event: ContextRequestEvent<UnknownContext>): boolean => {\n if (event.context !== context) {\n if (parentHandler) {\n return parentHandler(event);\n }\n return false;\n }\n\n const currentValue = valueRef.current; // Use latest value\n\n if (event.subscribe) {\n const callback = event.callback as ContextCallback<ContextType<T>>;\n const consumerHost = event.contextTarget || (event.composedPath()[0] as Element);\n\n const unsubscribe = () => {\n const info = subscriptions.get(callback);\n if (info) {\n subscriptionRefs.delete(info.ref);\n subscriptions.delete(callback);\n }\n };\n\n const ref = new WeakRef(callback);\n subscriptions.set(callback, { unsubscribe, consumerHost, ref });\n subscriptionRefs.add(ref);\n\n event.callback(currentValue, unsubscribe);\n } else {\n event.callback(currentValue);\n }\n\n return true;\n },\n [context, parentHandler], // Dependencies\n );\n\n // Handle DOM context-request events\n const handleContextRequestEvent = useCallback(\n (e: Event) => {\n const event = e as ContextRequestEvent<UnknownContext>;\n if (handleRequest(event)) {\n event.stopImmediatePropagation();\n }\n },\n [handleRequest],\n );\n\n // Handle context-provider events\n const handleContextProviderEvent = useCallback(\n (e: Event) => {\n const event = e as ContextProviderEvent<UnknownContext>;\n if (event.context !== context) {\n return;\n }\n if (containerRef.current && event.contextTarget === containerRef.current) {\n return;\n }\n\n const seen = new Set<ContextCallback<ContextType<T>>>();\n for (const ref of subscriptionRefs) {\n const callback = ref.deref();\n if (!callback) {\n subscriptionRefs.delete(ref);\n continue;\n }\n\n const info = subscriptions.get(callback);\n if (!info) {\n continue;\n }\n\n if (seen.has(callback)) {\n continue;\n }\n seen.add(callback);\n\n info.consumerHost.dispatchEvent(\n new ContextRequestEvent(context, callback, { subscribe: true, target: info.consumerHost }),\n );\n }\n event.stopPropagation();\n },\n [context],\n );\n\n // Notify subscribers when value changes.\n useEffect(() => {\n // Skip notification if value hasn't changed? React does this for us if we use dependencies correctly?\n // No, we need to imperatively call callbacks.\n // value constraint is in the dependency array.\n\n for (const ref of subscriptionRefs) {\n const callback = ref.deref();\n if (!callback) {\n subscriptionRefs.delete(ref);\n continue;\n }\n const info = subscriptions.get(callback);\n if (info) {\n callback(value, info.unsubscribe);\n }\n }\n }, [value]);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const el = containerRef.current;\n if (!el) {\n return;\n }\n\n el.addEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);\n el.addEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);\n\n // Announce provider.\n el.dispatchEvent(new ContextProviderEvent(context, el));\n\n return () => {\n el.removeEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);\n el.removeEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);\n subscriptionRefs.clear();\n };\n }, [handleContextRequestEvent, handleContextProviderEvent, context]);\n\n return (\n <ContextRequestHandlerContext.Provider value={handleRequest}>\n <div className='contents' ref={containerRef}>\n {children}\n </div>\n </ContextRequestHandlerContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useContext", "useEffect", "useState", "ContextRequestEvent", "createContext", "HostElementContext", "undefined", "React", "createContext", "useCallback", "useContext", "useEffect", "useRef", "CONTEXT_PROVIDER_EVENT", "CONTEXT_REQUEST_EVENT", "ContextProviderEvent", "ContextRequestEvent", "ContextRequestHandlerContext", "undefined", "tryHandleContextRequest", "event", "useContextRequestHandler", "ContextProtocolProvider", "context", "value", "children", "parentHandler", "subscriptions", "WeakMap", "current", "subscriptionRefs", "Set", "valueRef", "handleRequest", "currentValue", "subscribe", "callback", "consumerHost", "contextTarget", "composedPath", "unsubscribe", "info", "get", "delete", "ref", "WeakRef", "set", "add", "handleContextRequestEvent", "e", "stopImmediatePropagation", "handleContextProviderEvent", "containerRef", "seen", "deref", "has", "dispatchEvent", "target", "stopPropagation", "el", "addEventListener", "removeEventListener", "clear", "Provider", "div", "className", "useWebComponentContext", "context", "options", "value", "setValue", "useState", "undefined", "handler", "useContextRequestHandler", "hostElement", "useContext", "HostElementContext", "useEffect", "unsubscribeFn", "callback", "newValue", "unsubscribe", "targetElement", "element", "document", "body", "event", "ContextRequestEvent", "subscribe", "target", "handled", "dispatchEvent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/internal.ts":{"bytes":1122,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/provider.tsx":{"bytes":21018,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true}],"format":"esm"},"src/consumer.ts":{"bytes":6500,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"src/internal.ts","kind":"import-statement","original":"./internal"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider"}],"format":"esm"},"src/index.ts":{"bytes":575,"imports":[{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"src/consumer.ts","kind":"import-statement","original":"./consumer"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15046},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/web-context","kind":"import-statement","external":true}],"exports":["ContextProtocolProvider","tryHandleContextRequest","useContextRequestHandler","useWebComponentContext"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":35},"src/consumer.ts":{"bytesInOutput":1096},"src/internal.ts":{"bytesInOutput":87},"src/provider.tsx":{"bytesInOutput":3991}},"bytes":5553}}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ContextType, type UnknownContext } from '@dxos/web-context';
|
|
2
|
+
/**
|
|
3
|
+
* Options for useWebComponentContext hook
|
|
4
|
+
*/
|
|
5
|
+
export interface UseWebComponentContextOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to subscribe to context updates.
|
|
8
|
+
* If true, the returned value will update when the provider's value changes.
|
|
9
|
+
* Default: false
|
|
10
|
+
*/
|
|
11
|
+
subscribe?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The element to dispatch the context-request event from.
|
|
14
|
+
* This is only used when there's no React provider in the tree.
|
|
15
|
+
* Default: document.body
|
|
16
|
+
*/
|
|
17
|
+
element?: HTMLElement;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A React hook that requests context using the Web Component Context Protocol.
|
|
21
|
+
*
|
|
22
|
+
* This first tries to use the React context chain (for providers in the same
|
|
23
|
+
* React tree), then falls back to dispatching a DOM event (for web component
|
|
24
|
+
* providers).
|
|
25
|
+
*
|
|
26
|
+
* @param context - The context key to request
|
|
27
|
+
* @param options - Optional configuration
|
|
28
|
+
* @returns The context value or undefined
|
|
29
|
+
*/
|
|
30
|
+
export declare function useWebComponentContext<T extends UnknownContext>(context: T, options?: UseWebComponentContextOptions): ContextType<T> | undefined;
|
|
31
|
+
//# sourceMappingURL=consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer.d.ts","sourceRoot":"","sources":["../../../src/consumer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAK/F;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,cAAc,EAC7D,OAAO,EAAE,CAAC,EACV,OAAO,CAAC,EAAE,6BAA6B,GACtC,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAsC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer.test.d.ts","sourceRoot":"","sources":["../../../src/consumer.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAElC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal React context for passing the host element to nested components.
|
|
3
|
+
* This allows useWebComponentContext to dispatch events from the custom element.
|
|
4
|
+
*/
|
|
5
|
+
export declare const HostElementContext: import("react").Context<HTMLElement | undefined>;
|
|
6
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/internal.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,kDAAoD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type JSX, type PropsWithChildren } from 'react';
|
|
2
|
+
import { ContextRequestEvent, type ContextType, type UnknownContext } from '@dxos/web-context';
|
|
3
|
+
/**
|
|
4
|
+
* Handler function type for context requests passed via React context
|
|
5
|
+
*/
|
|
6
|
+
type ContextRequestHandler = (event: ContextRequestEvent<UnknownContext>) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Try to handle a context request using the React context chain.
|
|
9
|
+
* Returns true if handled, false otherwise.
|
|
10
|
+
* Used internally by useWebComponentContext.
|
|
11
|
+
*/
|
|
12
|
+
export declare function tryHandleContextRequest(event: ContextRequestEvent<UnknownContext>): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get the context request handler from React context.
|
|
15
|
+
* Used internally by useWebComponentContext.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useContextRequestHandler(): ContextRequestHandler | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Props for the ContextProtocolProvider component
|
|
20
|
+
*/
|
|
21
|
+
export interface ContextProtocolProviderProps<T extends UnknownContext> {
|
|
22
|
+
/** The context key to provide */
|
|
23
|
+
context: T;
|
|
24
|
+
/** The value to provide */
|
|
25
|
+
value: ContextType<T>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A provider component that:
|
|
29
|
+
* 1. Handles context-request events from web components (via DOM events)
|
|
30
|
+
* 2. Handles context requests from React consumers (via React context)
|
|
31
|
+
* 3. Supports subscriptions for reactive updates
|
|
32
|
+
* 4. Uses WeakRef for subscriptions to prevent memory leaks
|
|
33
|
+
*/
|
|
34
|
+
export declare const ContextProtocolProvider: <T extends UnknownContext>({ context, value, children, }: PropsWithChildren<ContextProtocolProviderProps<T>>) => JSX.Element;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/provider.tsx"],"names":[],"mappings":"AAIA,OAAc,EACZ,KAAK,GAAG,EACR,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAKL,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,KAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,mBAAmB,CAAC,cAAc,CAAC,KAAK,OAAO,CAAC;AAQrF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,OAAO,CAM3F;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,qBAAqB,GAAG,SAAS,CAE5E;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,cAAc;IACpE,iCAAiC;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,2BAA2B;IAC3B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,cAAc,iCAI7D,iBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,KAAG,GAAG,CAAC,OA2J3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.test.d.ts","sourceRoot":"","sources":["../../../src/provider.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"7.0.0-dev.20260421.2","root":[[125,130]],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.dom.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../../../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/global.d.ts","../../../../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../../../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/index.d.ts","../../../../../node_modules/.pnpm/@types+react-dom@19.2.3_@types+react@19.2.14/node_modules/@types/react-dom/client.d.ts","../../../../../node_modules/.pnpm/@types+aria-query@5.0.4/node_modules/@types/aria-query/index.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/matches.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/wait-for.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/query-helpers.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/queries.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/get-queries-for-element.d.ts","../../../../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/types.d.ts","../../../../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/index.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/screen.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/wait-for-element-to-be-removed.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/get-node-text.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/events.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/pretty-dom.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/role-helpers.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/config.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/suggestions.d.ts","../../../../../node_modules/.pnpm/@testing-library+dom@10.4.1/node_modules/@testing-library/dom/types/index.d.ts","../../../../../node_modules/.pnpm/@types+react-dom@19.2.3_@types+react@19.2.14/node_modules/@types/react-dom/test-utils/index.d.ts","../../../../../node_modules/.pnpm/@testing-library+react@16.3.2_@testing-library+dom@10.4.1_@types+react-dom@19.2.3_@type_01f2c7bab43719bd0469ec1c0554baf5/node_modules/@testing-library/react/types/index.d.ts","../../../../../node_modules/.pnpm/@vitest+pretty-format@4.1.6/node_modules/@vitest/pretty-format/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/display.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/types.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/helpers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/timers.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts","../../../../../node_modules/.pnpm/@vitest+utils@4.1.6/node_modules/@vitest/utils/dist/diff.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.6/node_modules/@vitest/runner/dist/tasks.d-DEYaIMIu.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.6/node_modules/@vitest/runner/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/traces.d.D2T_R8rx.d.ts","../../../../../node_modules/.pnpm/vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2/node_modules/vite/types/hmrPayload.d.ts","../../../../../node_modules/.pnpm/vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts","../../../../../node_modules/.pnpm/vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2/node_modules/vite/types/customEvent.d.ts","../../../../../node_modules/.pnpm/vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2/node_modules/vite/types/hot.d.ts","../../../../../node_modules/.pnpm/vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2/node_modules/vite/dist/node/module-runner.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.6/node_modules/@vitest/snapshot/dist/environment.d-DOJxxZV9.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.6/node_modules/@vitest/snapshot/dist/rawSnapshot.d-D_X3-62x.d.ts","../../../../../node_modules/.pnpm/@vitest+snapshot@4.1.6/node_modules/@vitest/snapshot/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/config.d.A1h_Y6Jt.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/environment.d.CrsxCzP1.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/rpc.d.B_8sPU0w.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/worker.d.ZpHpO4yb.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/browser.d.BcoexmFG.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.6/node_modules/@vitest/spy/optional-types.d.ts","../../../../../node_modules/.pnpm/@vitest+spy@4.1.6/node_modules/@vitest/spy/dist/index.d.ts","../../../../../node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.d.ts","../../../../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts","../../../../../node_modules/.pnpm/@types+deep-eql@4.0.2/node_modules/@types/deep-eql/index.d.ts","../../../../../node_modules/.pnpm/@types+chai@5.2.2/node_modules/@types/chai/index.d.ts","../../../../../node_modules/.pnpm/@vitest+expect@4.1.6/node_modules/@vitest/expect/dist/index.d.ts","../../../../../node_modules/.pnpm/@vitest+runner@4.1.6/node_modules/@vitest/runner/dist/utils.d.ts","../../../../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/benchmark.d.DAaHLpsq.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/global.d.DVsSRdQ5.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/optional-runtime-types.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.6_vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2_/node_modules/@vitest/mocker/dist/types.d-BjI5eAwu.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.6_vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2_/node_modules/@vitest/mocker/dist/index.d-B41z0AuW.d.ts","../../../../../node_modules/.pnpm/@vitest+mocker@4.1.6_vite@8.0.10_@types+node@22.10.2_esbuild@0.28.0_jiti@2.6.1_terser@5.46.0_tsx@4.21.0_yaml@2.8.2_/node_modules/@vitest/mocker/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/suite.d.udJtyAgw.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/chunks/evaluatedModules.d.BxJ5omdx.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/runners.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.d.ts","../../../../../node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.d.ts","../../../../../node_modules/.pnpm/vitest@4.1.6_patch_hash=a7bf6a3d21c2bc782d60d0f0f916d76f304c0eb6fbf2827e8d981408c7b5120_6da06b8fd5851d8f9190287aca0d9733/node_modules/vitest/dist/index.d.ts","../../../web-context/dist/types/src/protocol.d.ts","../../../web-context/dist/types/src/index.d.ts","../../src/internal.ts","../../src/provider.tsx","../../src/consumer.ts","../../src/consumer.test.tsx","../../src/index.ts","../../src/provider.test.tsx","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/disposable.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/indexable.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/iterators.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/index.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/globals.typedarray.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/buffer.buffer.d.ts","../../../../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/header.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/readable.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/file.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/fetch.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/formdata.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/connector.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/client.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/errors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/dispatcher.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-dispatcher.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-origin.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool-stats.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/handlers.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/balanced-pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-interceptor.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-client.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-errors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/proxy-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-handler.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/api.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/interceptors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/util.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cookies.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/patch.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/websocket.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/eventsource.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/filereader.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/content-type.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cache.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/index.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/globals.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/assert.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/assert/strict.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/async_hooks.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/buffer.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/child_process.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/cluster.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/console.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/constants.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/crypto.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dgram.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/diagnostics_channel.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dns.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dns/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/domain.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dom-events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/fs.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/fs/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/http.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/http2.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/https.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/inspector.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/module.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/net.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/os.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/path.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/perf_hooks.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/process.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/punycode.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/querystring.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/readline.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/readline/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/repl.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/sea.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/sqlite.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/consumers.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/web.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/string_decoder.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/test.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/timers.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/timers/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/tls.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/trace_events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/tty.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/url.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/util.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/v8.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/vm.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/wasi.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/worker_threads.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/zlib.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"a1aa1a5e065d48ef5c7bb99e38412f96","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f",{"version":"aae8996e8b5684814785a42cbbefcd79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"01ac052ec4a79e87229f90466a9645f8","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"edba5df642941aa062a62f6328c6df3d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bb3a710cbcda0533bb127712927cbe37","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7a42de379b489e8f7b647455bebfc576","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"692bcd75364db0f65d428801c7884466","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"086b8ccc1aa2a8df8144951e6a412a39","affectsGlobalScope":true,"impliedNodeFormat":1},"8244c8f803a86fcac606483469eb85c3","efe6aa145e7328bfc4dd54be3ebcf52e","28d5a5718a71d0113016569329319e79","56d080dfccb3c53a2d6c74c4f24252e3","3fcb673f9582e954b88e5301cea2e116","b70a23ee97272dcedf89a59eb13dce09","6294201618a7ac0b0aca11519e05beca","5404d75b707f770973bbfef8d6435b0b","66d6d2eeab2fe724d820ec343699b384","637ab145289a60542ee70edb98701030","de33595bdcb1218563e354efc70822bd","cb26617fcf48e41362825205d749886d","acfbf135a9ab3e0f7da298da54518715","e8ad67e7491d8f1f9a93b33b7415868c","77a3ee497da0d9f6f0b7977c6114cb3c","e1c7093ed7cf79a829f3949f0eea4d21","164404971a17bc3ec6026e1b1e1048cc","6085bc7c76200dfd2cb23e5b4209aca4","1aaec34fdd055abfa1bd0a4fafa64af7","756c116cd2a8fdfa70fd27becfe948b8","f9faf828914bf27566a22c68abd9e088","697add4dd61f8612afaf78e17faa2ca0",{"version":"ed63d99e1e5c371dc120bef1b84057fc","impliedNodeFormat":99},{"version":"4d3fb552bfc7fb53c9195b2fafb512c0","impliedNodeFormat":99},{"version":"fbf7ba69043f86dc506ba28263e2e783","impliedNodeFormat":99},{"version":"a611eb6935df7737a77b34b01c631a4a","impliedNodeFormat":99},{"version":"6d08f6f1d0ee294c119d0e66f826331a","impliedNodeFormat":99},{"version":"d0abb8fa314728650d85450ff59db909","impliedNodeFormat":99},{"version":"abe007be89c2ad52c4d67fc2b0f6da6b","impliedNodeFormat":99},{"version":"ae1fe3925f3a2c8dfbb269ac2a50f5a6","impliedNodeFormat":99},{"version":"ee8ce731ff781ae7011350481a1af176","impliedNodeFormat":99},{"version":"08dcd98985ae16732a9be03d2b56aea6","impliedNodeFormat":99},{"version":"47f7401876f3c0a5b80bd01fbdfaed2b","impliedNodeFormat":99},{"version":"c5156ca866ebe97e9684210705e65b18","impliedNodeFormat":99},{"version":"cf03c427cb6cbebe8bd7cbad8932b8e3","impliedNodeFormat":99},{"version":"421606974dd976bfc5ae48946dc1afac","impliedNodeFormat":99},{"version":"4aeb817c2b1122f77bdaeb4e884e9479","impliedNodeFormat":99},{"version":"c52142a849d48e8e4286c2eec06173ff","impliedNodeFormat":99},{"version":"0221e2868d1f0d6df8321d945764aadb","impliedNodeFormat":99},{"version":"d2f6ad6f161f0a522886f64842c96a0e","impliedNodeFormat":99},{"version":"618ace1500cc84e42bc2e47c64f8c407","impliedNodeFormat":99},{"version":"9dd3c481cc870c4bf19e59d34f030a27","impliedNodeFormat":99},{"version":"b5c81396e966d59acab5a45f66b70866","impliedNodeFormat":99},{"version":"f94aa434ddb9e71f6e80395de85f6850","impliedNodeFormat":99},{"version":"3486e8f7f01b9874a793ddd451eb62a5","impliedNodeFormat":99},{"version":"cb0e7222aae349c2fb4f89b26efa81bd","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"0d7bbad7f82c886c5f36730065aec119","impliedNodeFormat":99},{"version":"369460c2755240ac2d3d006f09adb5ca","impliedNodeFormat":99},{"version":"4509fca76e721cdf9edb2d028395a117","impliedNodeFormat":99},"548472bfd4ebe2f1c8f494b960a27836",{"version":"31d11e53cef40d113a56c173ad0ac9f4","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"2c51637edf65b89d39356deff680ed36","affectsGlobalScope":true,"impliedNodeFormat":99},{"version":"0bf0efdacfd4bfadb631a4376097e382","impliedNodeFormat":99},{"version":"bd01f3bcdc72c9256e5cd5093d132df3","impliedNodeFormat":99},{"version":"b01bdc9acbaf3eb24eef464959e8e627","impliedNodeFormat":99},{"version":"2a75a1a065e5d0439fa1514d9c89b0eb","impliedNodeFormat":99},{"version":"b9129d694ae6cf810850117dda49d045","impliedNodeFormat":99},{"version":"c01d22bc96b89eedc0ed1f11d8c270ab","impliedNodeFormat":99},{"version":"c15bc5b81c64386efb6f85fb596c4349","impliedNodeFormat":99},{"version":"5794a694c1f75a9cc38cb5e9c757224e","impliedNodeFormat":99},{"version":"4040d5640775a803b2ca1aa914f7a1d4","impliedNodeFormat":99},{"version":"5ed96746ee2e7eb084ad54f0e0e518bc","impliedNodeFormat":99},{"version":"eba7786b00a4e551c36bafa71bfb1876","impliedNodeFormat":99},"8d8a98bf45979ce5401d9ca4027940cd","7d98e95d38525423bbe0f05e0a508a41","96920299d013de56061cbc74a1d658b2","439adabdf29be1212ec7acc292679f21","3eb46d20ed056dcbfa5e75bad9014661",{"version":"b46aa1886055db890de9be52a97b301e","impliedNodeFormat":99},"40f6d98a59ec5443585abf12e266651f","3b710df51e0ca8f28252f9e605f0d93e",{"version":"1968bda63ffcb2728a389189f8853248","signature":"560b3312beb0858b471bc26c3eb5e0f2","impliedNodeFormat":1},{"version":"ad9dc7e9139016a8d1ce85e8b0e79862","signature":"da7049a1adda9e80babe2d105994ca59","impliedNodeFormat":1},{"version":"c84305c10accd50dbae44516133d026c","signature":"86507752dad3e95f044a03b5baf1fa8e","impliedNodeFormat":1},{"version":"4eb4a3a4adc502425d4eacffb76a14fc","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"b26484dd6b6695c93a395fdfaefa5258","signature":"64a2134e58153e5651284a37e0438cbd","impliedNodeFormat":1},{"version":"6d4aa254a80ad37aee0ce894c71740d1","signature":"abe7d9981d6018efb6b2b794f40a1607","impliedNodeFormat":1},{"version":"90630acdc4134173bcf216f187bd3010","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5a82824905a90c7452696b157ccbf8e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2514e9a2749c0fc18d2f478e9e1e641e","affectsGlobalScope":true,"impliedNodeFormat":1},"fe51d7a9bcdbcce1e65bbcf39b212298",{"version":"60edda1b5f28f8e7d7a6fae700faef3c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d81e6947fba1bc10b8eec34069255664","affectsGlobalScope":true,"impliedNodeFormat":1},"8e91e7228778516936913f666d057c19","628b774b54637325e286752c79c12432","597e516ba8427cccc7f3fe944da2f942","514fd35e5eb35bb2e5cbb908af0a0aa2","ed57ae88565308729f2327f26d684976","dcd932d6b0038f2e250e30dc10125b22","9508c917bd7e458745e222a82dd24ef0","fabf86f455f96b90538cc26320ab2765","14550b4cd9f433e0addd8b6d67614d23","3658d7d7a61e0ebff921a3292f22e90b","35fef7bac8048f583e4ce6eaa0c2a4c0","6752dc653fc7a333027249fd851fdb62","b9ad7e689b46dfba362c1bf174e69018","8b0a2930dfabdf27c69c6bb1eeabcdc8","4513b1ed15523d247040689f37fa9db2","5c0c499eed773a750903d9497beafacd","2377da227d1bac82ff7b3f2081ddf8d3","beef985b474fefeb80d27fb2c8778371","c79fc9d9f09ae598a374ae7c0b5284a4","f2caa3cebb1e6be855519004830a6be0","8ebc9f2a77c900e710801214c5cb994c","ec617a0e0577dd6a3210c3b067ecb325","1db5d06e485bd82d6d5f6e36925a8714","24b864518967840216c779b5e5f00975","8719cd8047700bfb6046798390053823","f2840afb502c94db92dab0fb8d27812f","a7e7d08b372210c203745d3eac61a411","531183cc80535e0e94226d720e5eb038","f627eb958ca52c85e42f04dce4661f86","9a43fc665bce9012a3d5fe1b574ff4dc","13f4b4da6546a34719fd6bde15fb63dd","a589216508844bfc00e62fc2d97fda45","865aea1c3209e31b076cb6fe780e769e","12e64aaf26af0f5c8f1b263dd66e3feb","928971ebbcdf5b093ef37669b33bddf6","b744265d8ad12b7d4d5c5dc35d18d44e","eff32168b8348b822afeed9cbf61afa7","9aafd1f29b4d8861c1c6c34bf83c0721",{"version":"00164cbcc1c01daff01c48524e115ebe","affectsGlobalScope":true,"impliedNodeFormat":1},"75c35382241d634380073a71ae31bc9a","7deced3ef46e082f97d49bb71622526a","71574c6791f69b167ce1ab489b2b61b2",{"version":"6df4dcd8b41052cc26a6af73c6937f86","affectsGlobalScope":true,"impliedNodeFormat":1},"cbae34574fe31d4a5ef3adee146fb6f5","4a7b1858837296766fd68ce1378e74eb",{"version":"9fc8636e70e507ea8d98a7aabd265ee5","affectsGlobalScope":true,"impliedNodeFormat":1},"c57682233d627206c477b36c1c175b7c",{"version":"5cecadfdb3e00997c9616c1d5ce6b8f4","affectsGlobalScope":true,"impliedNodeFormat":1},"c328f7ad3324dad3b014a361b567a205","12c7178deaecc79c215849791e088b34","fb3449da0f8a0403fcb36d2470b68886","57c04b416fb330a87d0a4705e6e37c2f","958d9865bfe33c94973e3d58ac66b1d0",{"version":"7ed47a7721271e796e9756b45734feaf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8bc6a5a95cd2df9f0392da0fa4cb03e3","affectsGlobalScope":true,"impliedNodeFormat":1},"775e118d246ffda9283d94772389bc3c","523e9bbd311f55326ac83a7c40fc29bd","fdd14f5f74212b0d9bd023f9f4f61e62","21baad704fab1c96b85de59aa92438b0","4a0ef467ec8fa0206d0e58fed7c6955d","41a388d3894be87ff371e130db43c3e4",{"version":"3f609011f15f3445c65cc543549895cc","affectsGlobalScope":true,"impliedNodeFormat":1},"dceaed506efef02de8922a129914605d","2500b39777a662899066e61fcf737a52","bdbbfddd2833453519a4c6864652469e",{"version":"311fbe00bc63e7cf2dab9d48d54d5e1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e6616c1a81dff896f04c18da7cf5e8a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d1dfd59bf8b7e71f40ee1d3a2f1b5fcf","53c41ffbbc4356e365d72a537ffb9289","e15247d10b79191ac297212d1183ed03","dd0c03e63afe38f86d61b2d54a9ad760","20049c404ad43da435aac0c69c179cc4","9c44db35c5ff2a61538ae34208bbe504","2c7e200709d82fec821e0154eb745d9e","c626f8a955ddf43bfe6785adb1c3ca4d","c8206d568b54e5ea06131963eecd576a","cf3b2ff720e926f366519cc83c99018a",{"version":"776ec94e2f1f2ebbc5b231103a647984","affectsGlobalScope":true,"impliedNodeFormat":1},"c2e6363d164e809228f71291dcc83add",{"version":"0042ce968ec6274197843485333d3134","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf9362f571b6cc12cc5a25da6b9a8675","affectsGlobalScope":true,"impliedNodeFormat":1},"9473140d6a11c5887d169fbdfcd0cb41","e5d364c503b63abd949a746cdc6a4066","d63b35c1a5097295f0659f5583c8fb83","3509aa3de97926c2922f378a248ddb48",{"version":"e6099c385b8384a91dc4f1e601769a6f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1413cfdb74da5bf264ec30490f261de1","affectsGlobalScope":true,"impliedNodeFormat":1},"e5c06dabd06c35e42950e36d082ba24f","ac26345510b3b253794221bf8c7d7a1d","eb4ea93209a96f6f1a9c85b8d43816fb",{"version":"a0d07c37a8456336ed8d7dfd9522ea99","affectsGlobalScope":true,"impliedNodeFormat":1},"194b317939f5bde463fc9c0f8d27a314","a7106559a4309e79d396f27199eda706"],"fileIdsList":[[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[60,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[57,58,59,60,61,64,65,66,67,68,69,70,71,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[56,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[63,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[57,58,59,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[57,58,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[60,61,63,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[58,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[54,55,72,73,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[103,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[131,132,133,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,174,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,174,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[134,135,136,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227],[54,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[52,53,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[76,82,100,101,102,104,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[111,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[111,112,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[80,82,83,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[80,82,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[80,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,80,91,92,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,80,91,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[99,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,81,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[77,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,76,77,78,79,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[117,118,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[117,118,119,120,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[117,119,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[117,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[62,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,150,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,141,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,143,146,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[136,141,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[136,138,139,142,145,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,153,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,138,144,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,167,168,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,142,146,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[136,167,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[136,140,141,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[136,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,168,169,170,171,172,173,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,161,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,153,154,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,144,146,154,155,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,145,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,138,141,146,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,146,150,154,155,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,150,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,144,146,149,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,138,143,146,153,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[136,141,146,167,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229],[86,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[86,87,88,89,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[88,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[84,106,107,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[84,85,97,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,82,84,85,93,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[90,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,84,85,93,105,108,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[84,85,90,93,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[84,106,107,108,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[84,90,94,95,96,109,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,80,82,84,85,90,93,94,95,96,97,98,100,105,106,107,108,109,110,113,114,115,116,121,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[75,82,84,85,93,94,106,107,108,109,114,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[54,74,122,124,126,127,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[54,124,125,126,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[124,126,127,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[54,74,122,124,126,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[54,124,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228],[123,136,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228]],"options":{"allowJs":false,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"jsx":3,"module":200,"noImplicitOverride":true,"noUncheckedSideEffectImports":false,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"strict":true,"stripInternal":true,"sourceMap":true,"target":99,"esModuleInterop":true},"referencedMap":[[102,1],[70,1],[67,1],[66,1],[61,2],[72,3],[57,4],[68,5],[60,6],[59,7],[69,1],[64,8],[71,1],[65,9],[58,1],[74,10],[56,1],[104,11],[103,1],[176,12],[177,13],[178,14],[136,15],[179,16],[180,17],[181,18],[131,1],[134,19],[132,1],[133,1],[182,20],[183,21],[184,22],[185,23],[186,24],[187,25],[188,26],[190,1],[189,27],[191,28],[192,29],[193,30],[175,31],[135,1],[194,32],[195,33],[196,34],[229,35],[197,36],[198,37],[199,38],[200,39],[201,40],[202,41],[203,42],[204,43],[205,44],[206,45],[207,46],[208,47],[209,48],[210,49],[211,50],[213,51],[212,52],[214,53],[215,54],[216,55],[217,56],[218,57],[219,58],[220,59],[221,60],[222,61],[223,62],[224,63],[225,64],[226,65],[227,66],[228,67],[55,68],[73,68],[52,1],[54,69],[50,1],[51,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[20,1],[21,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[1,1],[105,70],[112,71],[113,72],[111,1],[75,1],[84,73],[83,74],[106,73],[91,75],[93,76],[92,77],[100,78],[99,1],[82,79],[76,80],[78,81],[80,82],[79,1],[81,80],[77,1],[137,1],[53,1],[119,83],[121,84],[120,85],[118,86],[117,1],[63,87],[62,1],[107,1],[101,1],[153,88],[163,89],[152,88],[173,90],[144,91],[143,1],[172,92],[166,93],[171,91],[146,94],[160,95],[145,96],[169,97],[141,98],[140,92],[170,99],[142,100],[147,89],[148,1],[151,89],[138,1],[174,101],[164,102],[155,103],[156,104],[158,105],[154,106],[157,107],[167,92],[149,108],[150,109],[159,110],[139,1],[162,102],[161,89],[165,1],[168,111],[87,112],[90,113],[88,112],[86,1],[89,114],[108,115],[98,116],[94,117],[95,75],[115,118],[109,119],[96,120],[114,121],[85,1],[97,122],[122,123],[116,124],[110,1],[128,125],[127,126],[129,127],[125,68],[130,128],[126,129],[124,130],[123,1]],"latestChangedDtsFile":"./src/provider.test.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/web-context-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.4-main.05e74ebcff",
|
|
4
4
|
"description": "React integration with web context protocol",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
@@ -17,15 +21,12 @@
|
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
"types": "dist/types/src/index.d.ts",
|
|
20
|
-
"typesVersions": {
|
|
21
|
-
"*": {}
|
|
22
|
-
},
|
|
23
24
|
"files": [
|
|
24
25
|
"dist",
|
|
25
26
|
"src"
|
|
26
27
|
],
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@dxos/web-context": "0.
|
|
29
|
+
"@dxos/web-context": "0.8.4-main.05e74ebcff"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@testing-library/react": "^16.3.0",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"@types/react-dom": "~19.2.3",
|
|
34
35
|
"react": "~19.2.3",
|
|
35
36
|
"react-dom": "~19.2.3",
|
|
36
|
-
"vitest": "
|
|
37
|
+
"vitest": "4.1.6"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": "~19.2.3"
|
package/src/consumer.test.tsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// @vitest-environment jsdom
|
|
6
6
|
|
|
7
7
|
import { act, cleanup, render, screen } from '@testing-library/react';
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, { ReactNode, useEffect, useRef, useState } from 'react';
|
|
9
9
|
import { afterEach, describe, expect, test } from 'vitest';
|
|
10
10
|
|
|
11
11
|
import { CONTEXT_REQUEST_EVENT, createContext } from '@dxos/web-context';
|
|
@@ -37,7 +37,7 @@ describe('useWebComponentContext', () => {
|
|
|
37
37
|
|
|
38
38
|
test('consumes context from updates (subscription)', async () => {
|
|
39
39
|
const Container = () => {
|
|
40
|
-
const [val, setVal] =
|
|
40
|
+
const [val, setVal] = useState('initial');
|
|
41
41
|
return (
|
|
42
42
|
<>
|
|
43
43
|
<button onClick={() => setVal('updated')}>Update</button>
|
|
@@ -59,9 +59,9 @@ describe('useWebComponentContext', () => {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
test('consumes context from DOM parent (outside React tree)', () => {
|
|
62
|
-
const Wrapper = ({ children }: { children:
|
|
63
|
-
const ref =
|
|
64
|
-
|
|
62
|
+
const Wrapper = ({ children }: { children: ReactNode }) => {
|
|
63
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
64
|
+
useEffect(() => {
|
|
65
65
|
const handler = (e: Event) => {
|
|
66
66
|
const event = e as any;
|
|
67
67
|
if (event.context === ctx) {
|
package/src/provider.tsx
CHANGED
|
@@ -149,8 +149,12 @@ export const ContextProtocolProvider = <T extends UnknownContext>({
|
|
|
149
149
|
const handleContextProviderEvent = useCallback(
|
|
150
150
|
(e: Event) => {
|
|
151
151
|
const event = e as ContextProviderEvent<UnknownContext>;
|
|
152
|
-
if (event.context !== context)
|
|
153
|
-
|
|
152
|
+
if (event.context !== context) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (containerRef.current && event.contextTarget === containerRef.current) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
154
158
|
|
|
155
159
|
const seen = new Set<ContextCallback<ContextType<T>>>();
|
|
156
160
|
for (const ref of subscriptionRefs) {
|
|
@@ -161,9 +165,13 @@ export const ContextProtocolProvider = <T extends UnknownContext>({
|
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
const info = subscriptions.get(callback);
|
|
164
|
-
if (!info)
|
|
168
|
+
if (!info) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
165
171
|
|
|
166
|
-
if (seen.has(callback))
|
|
172
|
+
if (seen.has(callback)) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
167
175
|
seen.add(callback);
|
|
168
176
|
|
|
169
177
|
info.consumerHost.dispatchEvent(
|
|
@@ -175,11 +183,11 @@ export const ContextProtocolProvider = <T extends UnknownContext>({
|
|
|
175
183
|
[context],
|
|
176
184
|
);
|
|
177
185
|
|
|
178
|
-
// Notify subscribers when value changes
|
|
186
|
+
// Notify subscribers when value changes.
|
|
179
187
|
useEffect(() => {
|
|
180
188
|
// Skip notification if value hasn't changed? React does this for us if we use dependencies correctly?
|
|
181
189
|
// No, we need to imperatively call callbacks.
|
|
182
|
-
// value constraint is in the dependency array
|
|
190
|
+
// value constraint is in the dependency array.
|
|
183
191
|
|
|
184
192
|
for (const ref of subscriptionRefs) {
|
|
185
193
|
const callback = ref.deref();
|
|
@@ -198,12 +206,14 @@ export const ContextProtocolProvider = <T extends UnknownContext>({
|
|
|
198
206
|
|
|
199
207
|
useEffect(() => {
|
|
200
208
|
const el = containerRef.current;
|
|
201
|
-
if (!el)
|
|
209
|
+
if (!el) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
202
212
|
|
|
203
213
|
el.addEventListener(CONTEXT_REQUEST_EVENT, handleContextRequestEvent);
|
|
204
214
|
el.addEventListener(CONTEXT_PROVIDER_EVENT, handleContextProviderEvent);
|
|
205
215
|
|
|
206
|
-
// Announce provider
|
|
216
|
+
// Announce provider.
|
|
207
217
|
el.dispatchEvent(new ContextProviderEvent(context, el));
|
|
208
218
|
|
|
209
219
|
return () => {
|
|
@@ -215,7 +225,7 @@ export const ContextProtocolProvider = <T extends UnknownContext>({
|
|
|
215
225
|
|
|
216
226
|
return (
|
|
217
227
|
<ContextRequestHandlerContext.Provider value={handleRequest}>
|
|
218
|
-
<div
|
|
228
|
+
<div className='contents' ref={containerRef}>
|
|
219
229
|
{children}
|
|
220
230
|
</div>
|
|
221
231
|
</ContextRequestHandlerContext.Provider>
|