@shopify/ui-extensions-server-kit 5.2.0
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/CHANGELOG.md +121 -0
- package/README.md +74 -0
- package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -0
- package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +28 -0
- package/dist/ExtensionServerClient/ExtensionServerClient.es.js +133 -0
- package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +1 -0
- package/dist/ExtensionServerClient/index.d.ts +2 -0
- package/dist/ExtensionServerClient/types.cjs.js +1 -0
- package/dist/ExtensionServerClient/types.d.ts +124 -0
- package/dist/ExtensionServerClient/types.es.js +4 -0
- package/dist/context/ExtensionServerProvider.cjs.js +1 -0
- package/dist/context/ExtensionServerProvider.d.ts +2 -0
- package/dist/context/ExtensionServerProvider.es.js +29 -0
- package/dist/context/ExtensionServerProvider.test.d.ts +1 -0
- package/dist/context/constants.cjs.js +1 -0
- package/dist/context/constants.d.ts +3 -0
- package/dist/context/constants.es.js +14 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/types.d.ts +11 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useExtensionClient.cjs.js +1 -0
- package/dist/hooks/useExtensionClient.d.ts +1 -0
- package/dist/hooks/useExtensionClient.es.js +8 -0
- package/dist/hooks/useExtensionServerContext.cjs.js +1 -0
- package/dist/hooks/useExtensionServerContext.d.ts +1 -0
- package/dist/hooks/useExtensionServerContext.es.js +6 -0
- package/dist/hooks/useExtensionServerEvent.cjs.js +1 -0
- package/dist/hooks/useExtensionServerEvent.d.ts +1 -0
- package/dist/hooks/useExtensionServerEvent.es.js +9 -0
- package/dist/hooks/useExtensionServerState.cjs.js +1 -0
- package/dist/hooks/useExtensionServerState.d.ts +1 -0
- package/dist/hooks/useExtensionServerState.es.js +9 -0
- package/dist/hooks/useIsomorphicLayoutEffect.cjs.js +1 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/hooks/useIsomorphicLayoutEffect.es.js +5 -0
- package/dist/i18n.cjs.js +1 -0
- package/dist/i18n.d.ts +93 -0
- package/dist/i18n.es.js +61 -0
- package/dist/i18n.test.d.ts +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.cjs2.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +54 -0
- package/dist/index.es2.js +8 -0
- package/dist/state/actions/actions.cjs.js +1 -0
- package/dist/state/actions/actions.d.ts +6 -0
- package/dist/state/actions/actions.es.js +37 -0
- package/dist/state/actions/index.d.ts +2 -0
- package/dist/state/actions/types.d.ts +21 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/reducers/constants.cjs.js +1 -0
- package/dist/state/reducers/constants.d.ts +2 -0
- package/dist/state/reducers/constants.es.js +7 -0
- package/dist/state/reducers/extensionServerReducer.cjs.js +1 -0
- package/dist/state/reducers/extensionServerReducer.d.ts +3 -0
- package/dist/state/reducers/extensionServerReducer.es.js +57 -0
- package/dist/state/reducers/extensionServerReducer.test.d.ts +1 -0
- package/dist/state/reducers/index.d.ts +3 -0
- package/dist/state/reducers/types.d.ts +6 -0
- package/dist/testing/MockExtensionServerProvider.cjs.js +1 -0
- package/dist/testing/MockExtensionServerProvider.d.ts +7 -0
- package/dist/testing/MockExtensionServerProvider.es.js +24 -0
- package/dist/testing/app.cjs.js +1 -0
- package/dist/testing/app.d.ts +2 -0
- package/dist/testing/app.es.js +16 -0
- package/dist/testing/extensions.cjs.js +1 -0
- package/dist/testing/extensions.d.ts +6 -0
- package/dist/testing/extensions.es.js +65 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/types.cjs.js +1 -0
- package/dist/types.d.ts +169 -0
- package/dist/types.es.js +4 -0
- package/dist/utilities/assetToString.cjs.js +1 -0
- package/dist/utilities/assetToString.d.ts +2 -0
- package/dist/utilities/assetToString.es.js +7 -0
- package/dist/utilities/assetToString.test.d.ts +1 -0
- package/dist/utilities/groupByKey.cjs.js +1 -0
- package/dist/utilities/groupByKey.d.ts +3 -0
- package/dist/utilities/groupByKey.es.js +6 -0
- package/dist/utilities/index.d.ts +7 -0
- package/dist/utilities/isUIExtension.cjs.js +1 -0
- package/dist/utilities/isUIExtension.d.ts +1 -0
- package/dist/utilities/isUIExtension.es.js +6 -0
- package/dist/utilities/isValidSurface.cjs.js +1 -0
- package/dist/utilities/isValidSurface.d.ts +2 -0
- package/dist/utilities/isValidSurface.es.js +7 -0
- package/dist/utilities/noop.cjs.js +1 -0
- package/dist/utilities/noop.d.ts +1 -0
- package/dist/utilities/noop.es.js +5 -0
- package/dist/utilities/replaceUpdated.cjs.js +1 -0
- package/dist/utilities/replaceUpdated.d.ts +1 -0
- package/dist/utilities/replaceUpdated.es.js +14 -0
- package/dist/utilities/replaceUpdated.test.d.ts +1 -0
- package/dist/utilities/set.cjs.js +1 -0
- package/dist/utilities/set.d.ts +4 -0
- package/dist/utilities/set.es.js +18 -0
- package/dist/utilities/set.test.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.mjs +1 -0
- package/node_modules/@shopify/react-testing/LICENSE.md +21 -0
- package/node_modules/@shopify/react-testing/README.md +711 -0
- package/node_modules/@shopify/react-testing/build/cjs/TestWrapper.js +52 -0
- package/node_modules/@shopify/react-testing/build/cjs/_virtual/_rollupPluginBabelHelpers.js +47 -0
- package/node_modules/@shopify/react-testing/build/cjs/compat.js +14 -0
- package/node_modules/@shopify/react-testing/build/cjs/destroy.js +13 -0
- package/node_modules/@shopify/react-testing/build/cjs/element.js +225 -0
- package/node_modules/@shopify/react-testing/build/cjs/index.js +21 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/components.js +46 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/context.js +25 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/index.js +16 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/props.js +38 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/strings.js +42 -0
- package/node_modules/@shopify/react-testing/build/cjs/matchers/utilities.js +110 -0
- package/node_modules/@shopify/react-testing/build/cjs/mount.js +76 -0
- package/node_modules/@shopify/react-testing/build/cjs/root.js +284 -0
- package/node_modules/@shopify/react-testing/build/cjs/toReactString.js +86 -0
- package/node_modules/@shopify/react-testing/build/cjs/types.js +28 -0
- package/node_modules/@shopify/react-testing/build/esm/TestWrapper.mjs +44 -0
- package/node_modules/@shopify/react-testing/build/esm/_virtual/_rollupPluginBabelHelpers.mjs +42 -0
- package/node_modules/@shopify/react-testing/build/esm/compat.mjs +10 -0
- package/node_modules/@shopify/react-testing/build/esm/destroy.mjs +9 -0
- package/node_modules/@shopify/react-testing/build/esm/element.mjs +221 -0
- package/node_modules/@shopify/react-testing/build/esm/index.mjs +5 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/components.mjs +41 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/context.mjs +21 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/index.mjs +14 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/props.mjs +33 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/strings.mjs +37 -0
- package/node_modules/@shopify/react-testing/build/esm/matchers/utilities.mjs +101 -0
- package/node_modules/@shopify/react-testing/build/esm/mount.mjs +70 -0
- package/node_modules/@shopify/react-testing/build/esm/root.mjs +275 -0
- package/node_modules/@shopify/react-testing/build/esm/toReactString.mjs +80 -0
- package/node_modules/@shopify/react-testing/build/esm/types.mjs +26 -0
- package/node_modules/@shopify/react-testing/build/esnext/TestWrapper.esnext +44 -0
- package/node_modules/@shopify/react-testing/build/esnext/compat.esnext +10 -0
- package/node_modules/@shopify/react-testing/build/esnext/destroy.esnext +9 -0
- package/node_modules/@shopify/react-testing/build/esnext/element.esnext +221 -0
- package/node_modules/@shopify/react-testing/build/esnext/index.esnext +5 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/components.esnext +41 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/context.esnext +21 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/index.esnext +14 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/props.esnext +33 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/strings.esnext +37 -0
- package/node_modules/@shopify/react-testing/build/esnext/matchers/utilities.esnext +99 -0
- package/node_modules/@shopify/react-testing/build/esnext/mount.esnext +71 -0
- package/node_modules/@shopify/react-testing/build/esnext/root.esnext +275 -0
- package/node_modules/@shopify/react-testing/build/esnext/toReactString.esnext +80 -0
- package/node_modules/@shopify/react-testing/build/esnext/types.esnext +26 -0
- package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts +17 -0
- package/node_modules/@shopify/react-testing/build/ts/TestWrapper.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/compat.d.ts +3 -0
- package/node_modules/@shopify/react-testing/build/ts/compat.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts +2 -0
- package/node_modules/@shopify/react-testing/build/ts/destroy.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/element.d.ts +42 -0
- package/node_modules/@shopify/react-testing/build/ts/element.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/index.d.ts +7 -0
- package/node_modules/@shopify/react-testing/build/ts/index.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts +12 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/components.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts +8 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/context.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts +20 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/index.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts +10 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/props.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts +11 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/strings.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts +17 -0
- package/node_modules/@shopify/react-testing/build/ts/matchers/utilities.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/mount.d.ts +39 -0
- package/node_modules/@shopify/react-testing/build/ts/mount.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/root.d.ts +55 -0
- package/node_modules/@shopify/react-testing/build/ts/root.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts +5 -0
- package/node_modules/@shopify/react-testing/build/ts/toReactString.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/build/ts/types.d.ts +89 -0
- package/node_modules/@shopify/react-testing/build/ts/types.d.ts.map +1 -0
- package/node_modules/@shopify/react-testing/index.esnext +1 -0
- package/node_modules/@shopify/react-testing/index.js +1 -0
- package/node_modules/@shopify/react-testing/index.mjs +1 -0
- package/node_modules/@shopify/react-testing/matchers.esnext +1 -0
- package/node_modules/@shopify/react-testing/matchers.js +1 -0
- package/node_modules/@shopify/react-testing/matchers.mjs +1 -0
- package/node_modules/@shopify/react-testing/package.json +69 -0
- package/node_modules/@shopify/ui-extensions-test-utils/CHANGELOG.md +66 -0
- package/node_modules/@shopify/ui-extensions-test-utils/dist/index.js +3 -0
- package/node_modules/@shopify/ui-extensions-test-utils/dist/render.js +5 -0
- package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.js +20 -0
- package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +6 -0
- package/node_modules/@shopify/ui-extensions-test-utils/package.json +41 -0
- package/node_modules/@shopify/ui-extensions-test-utils/project.json +39 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +985 -0
- package/node_modules/@types/node/async_hooks.d.ts +522 -0
- package/node_modules/@types/node/buffer.d.ts +2321 -0
- package/node_modules/@types/node/child_process.d.ts +1544 -0
- package/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/node/constants.d.ts +19 -0
- package/node_modules/@types/node/crypto.d.ts +4451 -0
- package/node_modules/@types/node/dgram.d.ts +586 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +192 -0
- package/node_modules/@types/node/dns/promises.d.ts +381 -0
- package/node_modules/@types/node/dns.d.ts +809 -0
- package/node_modules/@types/node/dom-events.d.ts +122 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +803 -0
- package/node_modules/@types/node/fs/promises.d.ts +1205 -0
- package/node_modules/@types/node/fs.d.ts +4211 -0
- package/node_modules/@types/node/globals.d.ts +377 -0
- package/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/node/http.d.ts +1801 -0
- package/node_modules/@types/node/http2.d.ts +2386 -0
- package/node_modules/@types/node/https.d.ts +544 -0
- package/node_modules/@types/node/index.d.ts +88 -0
- package/node_modules/@types/node/inspector.d.ts +2739 -0
- package/node_modules/@types/node/module.d.ts +298 -0
- package/node_modules/@types/node/net.d.ts +913 -0
- package/node_modules/@types/node/os.d.ts +473 -0
- package/node_modules/@types/node/package.json +235 -0
- package/node_modules/@types/node/path.d.ts +191 -0
- package/node_modules/@types/node/perf_hooks.d.ts +626 -0
- package/node_modules/@types/node/process.d.ts +1531 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +141 -0
- package/node_modules/@types/node/readline/promises.d.ts +143 -0
- package/node_modules/@types/node/readline.d.ts +666 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/node_modules/@types/node/stream/web.d.ts +336 -0
- package/node_modules/@types/node/stream.d.ts +1731 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +1113 -0
- package/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@types/node/timers.d.ts +126 -0
- package/node_modules/@types/node/tls.d.ts +1203 -0
- package/node_modules/@types/node/trace_events.d.ts +171 -0
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/ts4.8/assert.d.ts +985 -0
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +522 -0
- package/node_modules/@types/node/ts4.8/buffer.d.ts +2321 -0
- package/node_modules/@types/node/ts4.8/child_process.d.ts +1544 -0
- package/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
- package/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
- package/node_modules/@types/node/ts4.8/crypto.d.ts +4450 -0
- package/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +192 -0
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +381 -0
- package/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
- package/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/node/ts4.8/events.d.ts +754 -0
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +1205 -0
- package/node_modules/@types/node/ts4.8/fs.d.ts +4211 -0
- package/node_modules/@types/node/ts4.8/globals.d.ts +377 -0
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/node/ts4.8/http.d.ts +1801 -0
- package/node_modules/@types/node/ts4.8/http2.d.ts +2386 -0
- package/node_modules/@types/node/ts4.8/https.d.ts +544 -0
- package/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/node/ts4.8/inspector.d.ts +2739 -0
- package/node_modules/@types/node/ts4.8/module.d.ts +298 -0
- package/node_modules/@types/node/ts4.8/net.d.ts +913 -0
- package/node_modules/@types/node/ts4.8/os.d.ts +473 -0
- package/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +626 -0
- package/node_modules/@types/node/ts4.8/process.d.ts +1531 -0
- package/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
- package/node_modules/@types/node/ts4.8/readline.d.ts +666 -0
- package/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +336 -0
- package/node_modules/@types/node/ts4.8/stream.d.ts +1731 -0
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/ts4.8/test.d.ts +1113 -0
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/node/ts4.8/timers.d.ts +126 -0
- package/node_modules/@types/node/ts4.8/tls.d.ts +1203 -0
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
- package/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
- package/node_modules/@types/node/ts4.8/url.d.ts +937 -0
- package/node_modules/@types/node/ts4.8/util.d.ts +2075 -0
- package/node_modules/@types/node/ts4.8/v8.d.ts +541 -0
- package/node_modules/@types/node/ts4.8/vm.d.ts +667 -0
- package/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +692 -0
- package/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/node/tty.d.ts +206 -0
- package/node_modules/@types/node/url.d.ts +937 -0
- package/node_modules/@types/node/util.d.ts +2075 -0
- package/node_modules/@types/node/v8.d.ts +541 -0
- package/node_modules/@types/node/vm.d.ts +667 -0
- package/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/node/worker_threads.d.ts +692 -0
- package/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/react/LICENSE +21 -0
- package/node_modules/@types/react/README.md +16 -0
- package/node_modules/@types/react/experimental.d.ts +192 -0
- package/node_modules/@types/react/global.d.ts +151 -0
- package/node_modules/@types/react/index.d.ts +3175 -0
- package/node_modules/@types/react/jsx-dev-runtime.d.ts +2 -0
- package/node_modules/@types/react/jsx-runtime.d.ts +2 -0
- package/node_modules/@types/react/package.json +149 -0
- package/node_modules/@vitejs/plugin-react-refresh/LICENSE +21 -0
- package/node_modules/@vitejs/plugin-react-refresh/README.md +73 -0
- package/node_modules/@vitejs/plugin-react-refresh/index.d.ts +14 -0
- package/node_modules/@vitejs/plugin-react-refresh/index.js +239 -0
- package/node_modules/@vitejs/plugin-react-refresh/package.json +35 -0
- package/package.json +65 -0
- package/project.json +74 -0
- package/scripts/create-entry-files.ts +44 -0
- package/src/ExtensionServerClient/ExtensionServerClient.test.ts +730 -0
- package/src/ExtensionServerClient/ExtensionServerClient.ts +310 -0
- package/src/ExtensionServerClient/index.ts +2 -0
- package/src/ExtensionServerClient/types.ts +159 -0
- package/src/context/ExtensionServerProvider.test.tsx +173 -0
- package/src/context/ExtensionServerProvider.tsx +46 -0
- package/src/context/constants.ts +15 -0
- package/src/context/index.ts +3 -0
- package/src/context/types.ts +13 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useExtensionClient.ts +6 -0
- package/src/hooks/useExtensionServerContext.ts +4 -0
- package/src/hooks/useExtensionServerEvent.ts +11 -0
- package/src/hooks/useExtensionServerState.ts +6 -0
- package/src/hooks/useIsomorphicLayoutEffect.ts +6 -0
- package/src/i18n.test.ts +417 -0
- package/src/i18n.ts +208 -0
- package/src/index.ts +7 -0
- package/src/state/actions/actions.ts +36 -0
- package/src/state/actions/index.ts +2 -0
- package/src/state/actions/types.ts +26 -0
- package/src/state/index.ts +2 -0
- package/src/state/reducers/constants.ts +6 -0
- package/src/state/reducers/extensionServerReducer.test.ts +160 -0
- package/src/state/reducers/extensionServerReducer.ts +87 -0
- package/src/state/reducers/index.ts +3 -0
- package/src/state/reducers/types.ts +7 -0
- package/src/testing/MockExtensionServerProvider.tsx +36 -0
- package/src/testing/app.ts +15 -0
- package/src/testing/extensions.ts +70 -0
- package/src/testing/index.ts +3 -0
- package/src/types.ts +172 -0
- package/src/utilities/assetToString.test.ts +16 -0
- package/src/utilities/assetToString.ts +8 -0
- package/src/utilities/groupByKey.ts +3 -0
- package/src/utilities/index.ts +7 -0
- package/src/utilities/isUIExtension.ts +7 -0
- package/src/utilities/isValidSurface.ts +7 -0
- package/src/utilities/noop.ts +1 -0
- package/src/utilities/replaceUpdated.test.ts +26 -0
- package/src/utilities/replaceUpdated.ts +16 -0
- package/src/utilities/set.test.ts +19 -0
- package/src/utilities/set.ts +29 -0
- package/testing.d.ts +1 -0
- package/testing.js +1 -0
- package/testing.mjs +1 -0
- package/tests/setup.ts +6 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are types for things that are present in the `experimental` builds of React but not yet
|
|
3
|
+
* on a stable build.
|
|
4
|
+
*
|
|
5
|
+
* Once they are promoted to stable they can just be moved to the main index file.
|
|
6
|
+
*
|
|
7
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
|
8
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
|
9
|
+
* is to add `"react/experimental"` to the `"types"` array.
|
|
10
|
+
*
|
|
11
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
|
12
|
+
* This module does not exist in reality, which is why the {} is important:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* import {} from 'react/experimental'
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* It is also possible to include it through a triple-slash reference:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* /// <reference types="react/experimental" />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
// See https://github.com/facebook/react/blob/master/packages/react/src/React.js to see how the exports are declared,
|
|
28
|
+
// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
|
|
29
|
+
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
|
|
30
|
+
//
|
|
31
|
+
// For the inputs of types exported as simply a fiber tag, the `beginWork` function of ReactFiberBeginWork.js
|
|
32
|
+
// is a good place to start looking for details; it generally calls prop validation functions or delegates
|
|
33
|
+
// all tasks done as part of the render phase (the concurrent part of the React update cycle).
|
|
34
|
+
//
|
|
35
|
+
// Suspense-related handling can be found in ReactFiberThrow.js.
|
|
36
|
+
|
|
37
|
+
import React = require('.');
|
|
38
|
+
|
|
39
|
+
export {};
|
|
40
|
+
|
|
41
|
+
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
|
42
|
+
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
|
43
|
+
|
|
44
|
+
declare module '.' {
|
|
45
|
+
export interface SuspenseProps {
|
|
46
|
+
/**
|
|
47
|
+
* The presence of this prop indicates that the content is computationally expensive to render.
|
|
48
|
+
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
|
|
49
|
+
* @see {@link https://github.com/facebook/react/pull/19936}
|
|
50
|
+
*/
|
|
51
|
+
unstable_expectedLoadTime?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
|
|
55
|
+
export type SuspenseListTailMode = 'collapsed' | 'hidden';
|
|
56
|
+
|
|
57
|
+
export interface SuspenseListCommonProps {
|
|
58
|
+
/**
|
|
59
|
+
* Note that SuspenseList require more than one child;
|
|
60
|
+
* it is a runtime warning to provide only a single child.
|
|
61
|
+
*
|
|
62
|
+
* It does, however, allow those children to be wrapped inside a single
|
|
63
|
+
* level of `<React.Fragment>`.
|
|
64
|
+
*/
|
|
65
|
+
children: ReactElement | Iterable<ReactElement>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
|
|
69
|
+
/**
|
|
70
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
|
71
|
+
*/
|
|
72
|
+
revealOrder: 'forwards' | 'backwards';
|
|
73
|
+
/**
|
|
74
|
+
* Dictates how unloaded items in a SuspenseList is shown.
|
|
75
|
+
*
|
|
76
|
+
* - By default, `SuspenseList` will show all fallbacks in the list.
|
|
77
|
+
* - `collapsed` shows only the next fallback in the list.
|
|
78
|
+
* - `hidden` doesn’t show any unloaded items.
|
|
79
|
+
*/
|
|
80
|
+
tail?: SuspenseListTailMode;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
|
|
84
|
+
/**
|
|
85
|
+
* Defines the order in which the `SuspenseList` children should be revealed.
|
|
86
|
+
*/
|
|
87
|
+
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']>;
|
|
88
|
+
/**
|
|
89
|
+
* The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
|
|
90
|
+
*/
|
|
91
|
+
tail?: never;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* `SuspenseList` helps coordinate many components that can suspend by orchestrating the order
|
|
98
|
+
* in which these components are revealed to the user.
|
|
99
|
+
*
|
|
100
|
+
* When multiple components need to fetch data, this data may arrive in an unpredictable order.
|
|
101
|
+
* However, if you wrap these items in a `SuspenseList`, React will not show an item in the list
|
|
102
|
+
* until previous items have been displayed (this behavior is adjustable).
|
|
103
|
+
*
|
|
104
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist
|
|
105
|
+
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
|
|
106
|
+
*/
|
|
107
|
+
export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
|
|
108
|
+
|
|
109
|
+
export interface SuspenseConfig {
|
|
110
|
+
busyDelayMs?: number;
|
|
111
|
+
busyMinDurationMs?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// undocumented, considered for removal
|
|
115
|
+
export function unstable_withSuspenseConfig(
|
|
116
|
+
scope: () => VoidOrUndefinedOnly,
|
|
117
|
+
config: SuspenseConfig | null | undefined,
|
|
118
|
+
): void;
|
|
119
|
+
|
|
120
|
+
// must be synchronous
|
|
121
|
+
export type TransitionFunction = () => VoidOrUndefinedOnly;
|
|
122
|
+
// strange definition to allow vscode to show documentation on the invocation
|
|
123
|
+
export interface TransitionStartFunction {
|
|
124
|
+
/**
|
|
125
|
+
* State updates caused inside the callback are allowed to be deferred.
|
|
126
|
+
*
|
|
127
|
+
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
|
|
128
|
+
*
|
|
129
|
+
* @param callback A _synchronous_ function which causes state updates that can be deferred.
|
|
130
|
+
*/
|
|
131
|
+
(callback: TransitionFunction): void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Returns a deferred version of the value that may “lag behind” it for at most `timeoutMs`.
|
|
136
|
+
*
|
|
137
|
+
* This is commonly used to keep the interface responsive when you have something that renders immediately
|
|
138
|
+
* based on user input and something that needs to wait for a data fetch.
|
|
139
|
+
*
|
|
140
|
+
* A good example of this is a text input.
|
|
141
|
+
*
|
|
142
|
+
* @param value The value that is going to be deferred
|
|
143
|
+
*
|
|
144
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#usedeferredvalue
|
|
145
|
+
*/
|
|
146
|
+
export function unstable_useDeferredValue<T>(value: T): T;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Allows components to avoid undesirable loading states by waiting for content to load
|
|
150
|
+
* before transitioning to the next screen. It also allows components to defer slower,
|
|
151
|
+
* data fetching updates until subsequent renders so that more crucial updates can be
|
|
152
|
+
* rendered immediately.
|
|
153
|
+
*
|
|
154
|
+
* The `useTransition` hook returns two values in an array.
|
|
155
|
+
*
|
|
156
|
+
* The first is a function that takes a callback. We can use it to tell React which state we want to defer.
|
|
157
|
+
* The seconda boolean. It’s React’s way of informing us whether we’re waiting for the transition to finish.
|
|
158
|
+
*
|
|
159
|
+
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
|
|
160
|
+
*
|
|
161
|
+
* @param config An optional object with `timeoutMs`
|
|
162
|
+
*
|
|
163
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition
|
|
164
|
+
*/
|
|
165
|
+
export function unstable_useTransition(config?: SuspenseConfig | null): [TransitionStartFunction, boolean];
|
|
166
|
+
|
|
167
|
+
const opaqueIdentifierBranding: unique symbol;
|
|
168
|
+
/**
|
|
169
|
+
* WARNING: Don't use this as a `string`.
|
|
170
|
+
*
|
|
171
|
+
* This is an opaque type that is not supposed to type-check structurally.
|
|
172
|
+
* It is only valid if returned from React methods and passed to React e.g. `<button aria-labelledby={opaqueIdentifier} />`
|
|
173
|
+
*/
|
|
174
|
+
// We can't create a type that would be rejected for string concatenation or `.toString()` calls.
|
|
175
|
+
// So in order to not have to add `string | OpaqueIdentifier` to every react-dom host prop we intersect it with `string`.
|
|
176
|
+
type OpaqueIdentifier = string & {
|
|
177
|
+
readonly [opaqueIdentifierBranding]: unknown;
|
|
178
|
+
// While this would cause `const stringified: string = opaqueIdentifier.toString()` to not type-check it also adds completions while typing.
|
|
179
|
+
// It would also still allow string concatenation.
|
|
180
|
+
// Unsure which is better. Not type-checking or not suggesting.
|
|
181
|
+
// toString(): void;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Similar to `useTransition` but allows uses where hooks are not available.
|
|
188
|
+
*
|
|
189
|
+
* @param callback A _synchronous_ function which causes state updates that can be deferred.
|
|
190
|
+
*/
|
|
191
|
+
export function unstable_startTransition(scope: TransitionFunction): void;
|
|
192
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
React projects that don't include the DOM library need these interfaces to compile.
|
|
3
|
+
React Native applications use React, but there is no DOM available. The JavaScript runtime
|
|
4
|
+
is ES6/ES2015 only. These definitions allow such projects to compile with only `--lib ES6`.
|
|
5
|
+
|
|
6
|
+
Warning: all of these interfaces are empty. If you want type definitions for various properties
|
|
7
|
+
(such as HTMLInputElement.prototype.value), you need to add `--lib DOM` (via command line or tsconfig.json).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface Event { }
|
|
11
|
+
interface AnimationEvent extends Event { }
|
|
12
|
+
interface ClipboardEvent extends Event { }
|
|
13
|
+
interface CompositionEvent extends Event { }
|
|
14
|
+
interface DragEvent extends Event { }
|
|
15
|
+
interface FocusEvent extends Event { }
|
|
16
|
+
interface KeyboardEvent extends Event { }
|
|
17
|
+
interface MouseEvent extends Event { }
|
|
18
|
+
interface TouchEvent extends Event { }
|
|
19
|
+
interface PointerEvent extends Event { }
|
|
20
|
+
interface TransitionEvent extends Event { }
|
|
21
|
+
interface UIEvent extends Event { }
|
|
22
|
+
interface WheelEvent extends Event { }
|
|
23
|
+
|
|
24
|
+
interface EventTarget { }
|
|
25
|
+
interface Document { }
|
|
26
|
+
interface DataTransfer { }
|
|
27
|
+
interface StyleMedia { }
|
|
28
|
+
|
|
29
|
+
interface Element { }
|
|
30
|
+
interface DocumentFragment { }
|
|
31
|
+
|
|
32
|
+
interface HTMLElement extends Element { }
|
|
33
|
+
interface HTMLAnchorElement extends HTMLElement { }
|
|
34
|
+
interface HTMLAreaElement extends HTMLElement { }
|
|
35
|
+
interface HTMLAudioElement extends HTMLElement { }
|
|
36
|
+
interface HTMLBaseElement extends HTMLElement { }
|
|
37
|
+
interface HTMLBodyElement extends HTMLElement { }
|
|
38
|
+
interface HTMLBRElement extends HTMLElement { }
|
|
39
|
+
interface HTMLButtonElement extends HTMLElement { }
|
|
40
|
+
interface HTMLCanvasElement extends HTMLElement { }
|
|
41
|
+
interface HTMLDataElement extends HTMLElement { }
|
|
42
|
+
interface HTMLDataListElement extends HTMLElement { }
|
|
43
|
+
interface HTMLDialogElement extends HTMLElement { }
|
|
44
|
+
interface HTMLDivElement extends HTMLElement { }
|
|
45
|
+
interface HTMLDListElement extends HTMLElement { }
|
|
46
|
+
interface HTMLEmbedElement extends HTMLElement { }
|
|
47
|
+
interface HTMLFieldSetElement extends HTMLElement { }
|
|
48
|
+
interface HTMLFormElement extends HTMLElement { }
|
|
49
|
+
interface HTMLHeadingElement extends HTMLElement { }
|
|
50
|
+
interface HTMLHeadElement extends HTMLElement { }
|
|
51
|
+
interface HTMLHRElement extends HTMLElement { }
|
|
52
|
+
interface HTMLHtmlElement extends HTMLElement { }
|
|
53
|
+
interface HTMLIFrameElement extends HTMLElement { }
|
|
54
|
+
interface HTMLImageElement extends HTMLElement { }
|
|
55
|
+
interface HTMLInputElement extends HTMLElement { }
|
|
56
|
+
interface HTMLModElement extends HTMLElement { }
|
|
57
|
+
interface HTMLLabelElement extends HTMLElement { }
|
|
58
|
+
interface HTMLLegendElement extends HTMLElement { }
|
|
59
|
+
interface HTMLLIElement extends HTMLElement { }
|
|
60
|
+
interface HTMLLinkElement extends HTMLElement { }
|
|
61
|
+
interface HTMLMapElement extends HTMLElement { }
|
|
62
|
+
interface HTMLMetaElement extends HTMLElement { }
|
|
63
|
+
interface HTMLObjectElement extends HTMLElement { }
|
|
64
|
+
interface HTMLOListElement extends HTMLElement { }
|
|
65
|
+
interface HTMLOptGroupElement extends HTMLElement { }
|
|
66
|
+
interface HTMLOptionElement extends HTMLElement { }
|
|
67
|
+
interface HTMLParagraphElement extends HTMLElement { }
|
|
68
|
+
interface HTMLParamElement extends HTMLElement { }
|
|
69
|
+
interface HTMLPreElement extends HTMLElement { }
|
|
70
|
+
interface HTMLProgressElement extends HTMLElement { }
|
|
71
|
+
interface HTMLQuoteElement extends HTMLElement { }
|
|
72
|
+
interface HTMLSlotElement extends HTMLElement { }
|
|
73
|
+
interface HTMLScriptElement extends HTMLElement { }
|
|
74
|
+
interface HTMLSelectElement extends HTMLElement { }
|
|
75
|
+
interface HTMLSourceElement extends HTMLElement { }
|
|
76
|
+
interface HTMLSpanElement extends HTMLElement { }
|
|
77
|
+
interface HTMLStyleElement extends HTMLElement { }
|
|
78
|
+
interface HTMLTableElement extends HTMLElement { }
|
|
79
|
+
interface HTMLTableColElement extends HTMLElement { }
|
|
80
|
+
interface HTMLTableDataCellElement extends HTMLElement { }
|
|
81
|
+
interface HTMLTableHeaderCellElement extends HTMLElement { }
|
|
82
|
+
interface HTMLTableRowElement extends HTMLElement { }
|
|
83
|
+
interface HTMLTableSectionElement extends HTMLElement { }
|
|
84
|
+
interface HTMLTemplateElement extends HTMLElement { }
|
|
85
|
+
interface HTMLTextAreaElement extends HTMLElement { }
|
|
86
|
+
interface HTMLTitleElement extends HTMLElement { }
|
|
87
|
+
interface HTMLTrackElement extends HTMLElement { }
|
|
88
|
+
interface HTMLUListElement extends HTMLElement { }
|
|
89
|
+
interface HTMLVideoElement extends HTMLElement { }
|
|
90
|
+
interface HTMLWebViewElement extends HTMLElement { }
|
|
91
|
+
|
|
92
|
+
interface SVGElement extends Element { }
|
|
93
|
+
interface SVGSVGElement extends SVGElement { }
|
|
94
|
+
interface SVGCircleElement extends SVGElement { }
|
|
95
|
+
interface SVGClipPathElement extends SVGElement { }
|
|
96
|
+
interface SVGDefsElement extends SVGElement { }
|
|
97
|
+
interface SVGDescElement extends SVGElement { }
|
|
98
|
+
interface SVGEllipseElement extends SVGElement { }
|
|
99
|
+
interface SVGFEBlendElement extends SVGElement { }
|
|
100
|
+
interface SVGFEColorMatrixElement extends SVGElement { }
|
|
101
|
+
interface SVGFEComponentTransferElement extends SVGElement { }
|
|
102
|
+
interface SVGFECompositeElement extends SVGElement { }
|
|
103
|
+
interface SVGFEConvolveMatrixElement extends SVGElement { }
|
|
104
|
+
interface SVGFEDiffuseLightingElement extends SVGElement { }
|
|
105
|
+
interface SVGFEDisplacementMapElement extends SVGElement { }
|
|
106
|
+
interface SVGFEDistantLightElement extends SVGElement { }
|
|
107
|
+
interface SVGFEDropShadowElement extends SVGElement { }
|
|
108
|
+
interface SVGFEFloodElement extends SVGElement { }
|
|
109
|
+
interface SVGFEFuncAElement extends SVGElement { }
|
|
110
|
+
interface SVGFEFuncBElement extends SVGElement { }
|
|
111
|
+
interface SVGFEFuncGElement extends SVGElement { }
|
|
112
|
+
interface SVGFEFuncRElement extends SVGElement { }
|
|
113
|
+
interface SVGFEGaussianBlurElement extends SVGElement { }
|
|
114
|
+
interface SVGFEImageElement extends SVGElement { }
|
|
115
|
+
interface SVGFEMergeElement extends SVGElement { }
|
|
116
|
+
interface SVGFEMergeNodeElement extends SVGElement { }
|
|
117
|
+
interface SVGFEMorphologyElement extends SVGElement { }
|
|
118
|
+
interface SVGFEOffsetElement extends SVGElement { }
|
|
119
|
+
interface SVGFEPointLightElement extends SVGElement { }
|
|
120
|
+
interface SVGFESpecularLightingElement extends SVGElement { }
|
|
121
|
+
interface SVGFESpotLightElement extends SVGElement { }
|
|
122
|
+
interface SVGFETileElement extends SVGElement { }
|
|
123
|
+
interface SVGFETurbulenceElement extends SVGElement { }
|
|
124
|
+
interface SVGFilterElement extends SVGElement { }
|
|
125
|
+
interface SVGForeignObjectElement extends SVGElement { }
|
|
126
|
+
interface SVGGElement extends SVGElement { }
|
|
127
|
+
interface SVGImageElement extends SVGElement { }
|
|
128
|
+
interface SVGLineElement extends SVGElement { }
|
|
129
|
+
interface SVGLinearGradientElement extends SVGElement { }
|
|
130
|
+
interface SVGMarkerElement extends SVGElement { }
|
|
131
|
+
interface SVGMaskElement extends SVGElement { }
|
|
132
|
+
interface SVGMetadataElement extends SVGElement { }
|
|
133
|
+
interface SVGPathElement extends SVGElement { }
|
|
134
|
+
interface SVGPatternElement extends SVGElement { }
|
|
135
|
+
interface SVGPolygonElement extends SVGElement { }
|
|
136
|
+
interface SVGPolylineElement extends SVGElement { }
|
|
137
|
+
interface SVGRadialGradientElement extends SVGElement { }
|
|
138
|
+
interface SVGRectElement extends SVGElement { }
|
|
139
|
+
interface SVGStopElement extends SVGElement { }
|
|
140
|
+
interface SVGSwitchElement extends SVGElement { }
|
|
141
|
+
interface SVGSymbolElement extends SVGElement { }
|
|
142
|
+
interface SVGTextElement extends SVGElement { }
|
|
143
|
+
interface SVGTextPathElement extends SVGElement { }
|
|
144
|
+
interface SVGTSpanElement extends SVGElement { }
|
|
145
|
+
interface SVGUseElement extends SVGElement { }
|
|
146
|
+
interface SVGViewElement extends SVGElement { }
|
|
147
|
+
|
|
148
|
+
interface Text { }
|
|
149
|
+
interface TouchList { }
|
|
150
|
+
interface WebGLRenderingContext { }
|
|
151
|
+
interface WebGL2RenderingContext { }
|