adnbn 0.10.0 → 0.12.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/README.md +3 -0
- package/dist/cli/builders/locale/LocaleBuilder.js +2 -11
- package/dist/cli/builders/locale/LocaleBuilder.js.map +1 -1
- package/dist/cli/builders/locale/index.js +1 -1
- package/dist/cli/builders/locale/index.js.map +1 -1
- package/dist/cli/builders/manifest/ManifestBase.js +17 -7
- package/dist/cli/builders/manifest/ManifestBase.js.map +1 -1
- package/dist/cli/builders/manifest/ManifestV2.js +1 -1
- package/dist/cli/builders/manifest/ManifestV3.js +12 -5
- package/dist/cli/builders/manifest/ManifestV3.js.map +1 -1
- package/dist/cli/builders/manifest/utils/data-collection-permissions.d.ts +15 -0
- package/dist/cli/builders/manifest/utils/data-collection-permissions.js +26 -0
- package/dist/cli/builders/manifest/utils/data-collection-permissions.js.map +1 -0
- package/dist/cli/builders/manifest/utils/host-patterns.d.ts +1 -0
- package/dist/cli/builders/manifest/utils/host-patterns.js +40 -0
- package/dist/cli/builders/manifest/utils/host-patterns.js.map +1 -0
- package/dist/cli/builders/manifest/utils/index.d.ts +4 -0
- package/dist/cli/builders/manifest/utils/index.js +19 -0
- package/dist/cli/builders/manifest/utils/index.js.map +1 -0
- package/dist/cli/builders/manifest/utils/permissions.d.ts +14 -0
- package/dist/cli/builders/manifest/utils/permissions.js +34 -0
- package/dist/cli/builders/manifest/utils/permissions.js.map +1 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.d.ts +2 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.js +92 -0
- package/dist/cli/builders/manifest/utils/web-accessible-resources.js.map +1 -0
- package/dist/cli/bundler/index.d.ts +1 -0
- package/dist/cli/bundler/index.js +1 -0
- package/dist/cli/bundler/index.js.map +1 -1
- package/dist/cli/bundler/layers.d.ts +5 -0
- package/dist/cli/bundler/layers.js +12 -0
- package/dist/cli/bundler/layers.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.d.ts +14 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +524 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +2 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.js +5 -0
- package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +9 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.js +31 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.d.ts +9 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js +43 -0
- package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.js +5 -0
- package/dist/cli/bundler/plugins/chunk-loader/index.js.map +1 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates/runtime.template.d.ts +2 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates.d.ts +7 -0
- package/dist/cli/bundler/plugins/chunk-loader/templates.js +30 -0
- package/dist/cli/bundler/plugins/{EntrypointPlugin.d.ts → entrypoint/EntrypointPlugin.d.ts} +7 -2
- package/dist/cli/bundler/plugins/{EntrypointPlugin.js → entrypoint/EntrypointPlugin.js} +46 -26
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/entrypoint/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/entrypoint/index.js +7 -0
- package/dist/cli/bundler/plugins/entrypoint/index.js.map +1 -0
- package/dist/cli/bundler/plugins/{GenerateJsonPlugin.d.ts → generate-json/GenerateJsonPlugin.d.ts} +1 -0
- package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js +73 -0
- package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-json/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/generate-json/index.js +5 -0
- package/dist/cli/bundler/plugins/generate-json/index.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.d.ts +23 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js +88 -0
- package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/generate-module/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/generate-module/index.js +7 -0
- package/dist/cli/bundler/plugins/generate-module/index.js.map +1 -0
- package/dist/cli/bundler/plugins/index.d.ts +11 -5
- package/dist/cli/bundler/plugins/index.js +28 -10
- package/dist/cli/bundler/plugins/index.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +21 -0
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +174 -0
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +3 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js +32 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.js +5 -0
- package/dist/cli/bundler/plugins/isolated-styles/index.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates/css-loader.template.d.ts +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates/runtime.template.d.ts +7 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.d.ts +18 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.js +174 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.d.ts +10 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +54 -0
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/manifest/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/manifest/index.js +6 -0
- package/dist/cli/bundler/plugins/manifest/index.js.map +1 -0
- package/dist/cli/bundler/plugins/replace/ReplacePlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/replace/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/replace/index.js +5 -0
- package/dist/cli/bundler/plugins/replace/index.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.d.ts +19 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js +20 -0
- package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/resource-access/index.js +5 -0
- package/dist/cli/bundler/plugins/resource-access/index.js.map +1 -0
- package/dist/cli/bundler/plugins/resource-access/utils.d.ts +8 -0
- package/dist/cli/bundler/plugins/resource-access/utils.js +42 -0
- package/dist/cli/bundler/plugins/resource-access/utils.js.map +1 -0
- package/dist/cli/bundler/plugins/types.d.ts +8 -0
- package/dist/cli/bundler/plugins/types.js +1 -0
- package/dist/cli/bundler/plugins/types.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.d.ts +4 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.js +12 -0
- package/dist/cli/bundler/plugins/utils/compilation-assets.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/index.d.ts +5 -0
- package/dist/cli/bundler/plugins/utils/index.js +14 -0
- package/dist/cli/bundler/plugins/utils/index.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.d.ts +13 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.js +17 -0
- package/dist/cli/bundler/plugins/utils/manifest-hooks.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/runtime-module.d.ts +3 -0
- package/dist/cli/bundler/plugins/utils/runtime-module.js +11 -0
- package/dist/cli/bundler/plugins/utils/runtime-module.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/runtime-template.d.ts +1 -0
- package/dist/cli/bundler/plugins/utils/runtime-template.js +18 -0
- package/dist/cli/bundler/plugins/utils/runtime-template.js.map +1 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.d.ts +3 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.js +18 -0
- package/dist/cli/bundler/plugins/utils/watch-compilation.js.map +1 -0
- package/dist/cli/bundler/plugins/watch/WatchPlugin.js +16 -0
- package/dist/cli/bundler/plugins/watch/WatchPlugin.js.map +1 -0
- package/dist/cli/bundler/plugins/watch/index.d.ts +1 -0
- package/dist/cli/bundler/plugins/watch/index.js +5 -0
- package/dist/cli/bundler/plugins/watch/index.js.map +1 -0
- package/dist/cli/bundler/utils/app-filename.d.ts +2 -0
- package/dist/cli/bundler/utils/app-filename.js +19 -0
- package/dist/cli/bundler/utils/app-filename.js.map +1 -0
- package/dist/cli/bundler/utils/assets.d.ts +3 -0
- package/dist/cli/bundler/utils/assets.js +162 -0
- package/dist/cli/bundler/utils/assets.js.map +1 -0
- package/dist/cli/bundler/utils/chunk-filename.d.ts +6 -0
- package/dist/cli/bundler/utils/chunk-filename.js +93 -0
- package/dist/cli/bundler/utils/chunk-filename.js.map +1 -0
- package/dist/cli/bundler/utils/index.d.ts +2 -1
- package/dist/cli/bundler/utils/index.js +2 -1
- package/dist/cli/bundler/utils/index.js.map +1 -1
- package/dist/cli/entrypoint/file/ExpressionFile.d.ts +4 -1
- package/dist/cli/entrypoint/file/ExpressionFile.js +11 -0
- package/dist/cli/entrypoint/file/ExpressionFile.js.map +1 -1
- package/dist/cli/entrypoint/file/OptionFile.d.ts +4 -2
- package/dist/cli/entrypoint/file/OptionFile.js +35 -31
- package/dist/cli/entrypoint/file/OptionFile.js.map +1 -1
- package/dist/cli/entrypoint/file/SourceFile.d.ts +18 -7
- package/dist/cli/entrypoint/file/SourceFile.js +260 -156
- package/dist/cli/entrypoint/file/SourceFile.js.map +1 -1
- package/dist/cli/entrypoint/file/index.d.ts +2 -0
- package/dist/cli/entrypoint/file/index.js +2 -0
- package/dist/cli/entrypoint/file/index.js.map +1 -1
- package/dist/cli/entrypoint/file/injectors/core.js +22 -1
- package/dist/cli/entrypoint/file/injectors/core.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/ExportParser.d.ts +14 -0
- package/dist/cli/entrypoint/file/parsers/ExportParser.js +71 -0
- package/dist/cli/entrypoint/file/parsers/ExportParser.js.map +1 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.d.ts +2 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.js +9 -0
- package/dist/cli/entrypoint/file/parsers/NodeFinder.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/ObjectParser.js +5 -1
- package/dist/cli/entrypoint/file/parsers/ObjectParser.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/index.d.ts +1 -0
- package/dist/cli/entrypoint/file/parsers/index.js +2 -0
- package/dist/cli/entrypoint/file/parsers/index.js.map +1 -1
- package/dist/cli/entrypoint/file/parsers/types.d.ts +16 -0
- package/dist/cli/entrypoint/file/parsers/types.js +13 -0
- package/dist/cli/entrypoint/file/parsers/types.js.map +1 -1
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.d.ts +1 -0
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.js +3 -0
- package/dist/cli/entrypoint/file/resolvers/ImportResolver.js.map +1 -1
- package/dist/cli/entrypoint/file/types.d.ts +26 -1
- package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js.map +1 -1
- package/dist/cli/entrypoint/finder/ContentFinder.d.ts +1 -1
- package/dist/cli/entrypoint/parser/AbstractParser.d.ts +3 -2
- package/dist/cli/entrypoint/parser/AbstractParser.js +6 -3
- package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/CommandParser.js +1 -1
- package/dist/cli/entrypoint/parser/CommandParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/ContentParser.d.ts +7 -3
- package/dist/cli/entrypoint/parser/ContentParser.js +42 -6
- package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/RelayParser.d.ts +21 -2
- package/dist/cli/entrypoint/parser/RelayParser.js +5 -1
- package/dist/cli/entrypoint/parser/RelayParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/utils/content/default-render.d.ts +3 -0
- package/dist/cli/entrypoint/parser/utils/content/default-render.js +21 -0
- package/dist/cli/entrypoint/parser/utils/content/default-render.js.map +1 -0
- package/dist/cli/plugins/asset.js +9 -4
- package/dist/cli/plugins/asset.js.map +1 -1
- package/dist/cli/plugins/background/index.js +1 -1
- package/dist/cli/plugins/background/index.js.map +1 -1
- package/dist/cli/plugins/content/Content.d.ts +2 -2
- package/dist/cli/plugins/content/Content.js +3 -2
- package/dist/cli/plugins/content/Content.js.map +1 -1
- package/dist/cli/plugins/content/ContentDriver.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.d.ts +8 -5
- package/dist/cli/plugins/content/ContentManager.js +79 -28
- package/dist/cli/plugins/content/ContentManager.js.map +1 -1
- package/dist/cli/plugins/content/ContentName.d.ts +2 -2
- package/dist/cli/plugins/content/ContentName.js +8 -7
- package/dist/cli/plugins/content/ContentName.js.map +1 -1
- package/dist/cli/plugins/content/Relay.d.ts +2 -2
- package/dist/cli/plugins/content/Relay.js +3 -2
- package/dist/cli/plugins/content/Relay.js.map +1 -1
- package/dist/cli/plugins/content/RelayDriver.d.ts +1 -1
- package/dist/cli/plugins/content/RelayDriver.js +1 -1
- package/dist/cli/plugins/content/bundler.d.ts +7 -0
- package/dist/cli/plugins/content/bundler.js +47 -0
- package/dist/cli/plugins/content/bundler.js.map +1 -0
- package/dist/cli/plugins/content/index.js +121 -62
- package/dist/cli/plugins/content/index.js.map +1 -1
- package/dist/cli/plugins/content/relay-module.d.ts +3 -0
- package/dist/cli/plugins/content/relay-module.js +11 -0
- package/dist/cli/plugins/content/relay-module.js.map +1 -0
- package/dist/cli/plugins/content/types.d.ts +2 -2
- package/dist/cli/plugins/content/utils.d.ts +3 -1
- package/dist/cli/plugins/content/utils.js +8 -1
- package/dist/cli/plugins/content/utils.js.map +1 -1
- package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +1 -1
- package/dist/cli/plugins/icon/declaration/IconDeclaration.js +6 -6
- package/dist/cli/plugins/icon/declaration/IconDeclaration.js.map +1 -1
- package/dist/cli/plugins/icon/declaration/icon.d.ts +3 -5
- package/dist/cli/plugins/icon/icon-module.d.ts +2 -0
- package/dist/cli/plugins/icon/icon-module.js +11 -0
- package/dist/cli/plugins/icon/icon-module.js.map +1 -0
- package/dist/cli/plugins/icon/index.js +5 -3
- package/dist/cli/plugins/icon/index.js.map +1 -1
- package/dist/cli/plugins/index.d.ts +1 -1
- package/dist/cli/plugins/index.js +1 -1
- package/dist/cli/plugins/locale/Locale.d.ts +9 -2
- package/dist/cli/plugins/locale/Locale.js +37 -5
- package/dist/cli/plugins/locale/Locale.js.map +1 -1
- package/dist/cli/plugins/locale/declaration/locale.d.ts +1 -1
- package/dist/cli/plugins/locale/index.js +57 -22
- package/dist/cli/plugins/locale/index.js.map +1 -1
- package/dist/cli/plugins/locale/locale-module.d.ts +4 -0
- package/dist/cli/plugins/locale/locale-module.js +16 -0
- package/dist/cli/plugins/locale/locale-module.js.map +1 -0
- package/dist/cli/plugins/offscreen/Offscreen.d.ts +2 -3
- package/dist/cli/plugins/offscreen/Offscreen.js.map +1 -1
- package/dist/cli/plugins/offscreen/index.js +5 -4
- package/dist/cli/plugins/offscreen/index.js.map +1 -1
- package/dist/cli/plugins/offscreen/offscreen-module.d.ts +3 -0
- package/dist/cli/plugins/offscreen/offscreen-module.js +11 -0
- package/dist/cli/plugins/offscreen/offscreen-module.js.map +1 -0
- package/dist/cli/plugins/output/index.d.ts +2 -0
- package/dist/cli/plugins/output/index.js +60 -0
- package/dist/cli/plugins/output/index.js.map +1 -0
- package/dist/cli/plugins/output/runtime.d.ts +26 -0
- package/dist/cli/plugins/output/runtime.js +19 -0
- package/dist/cli/plugins/output/runtime.js.map +1 -0
- package/dist/cli/plugins/page/declaration/PageDeclaration.js +4 -4
- package/dist/cli/plugins/page/declaration/PageDeclaration.js.map +1 -1
- package/dist/cli/plugins/page/declaration/page.d.ts +3 -3
- package/dist/cli/plugins/page/index.js +14 -10
- package/dist/cli/plugins/page/index.js.map +1 -1
- package/dist/cli/plugins/page/page-module.d.ts +2 -0
- package/dist/cli/plugins/page/page-module.js +11 -0
- package/dist/cli/plugins/page/page-module.js.map +1 -0
- package/dist/cli/plugins/popup/Popup.d.ts +1 -1
- package/dist/cli/plugins/popup/Popup.js +2 -2
- package/dist/cli/plugins/popup/Popup.js.map +1 -1
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +1 -1
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.js +6 -6
- package/dist/cli/plugins/popup/declaration/PopupDeclaration.js.map +1 -1
- package/dist/cli/plugins/popup/declaration/popup.d.ts +3 -3
- package/dist/cli/plugins/popup/index.js +6 -5
- package/dist/cli/plugins/popup/index.js.map +1 -1
- package/dist/cli/plugins/popup/popup-module.d.ts +3 -0
- package/dist/cli/plugins/popup/popup-module.js +11 -0
- package/dist/cli/plugins/popup/popup-module.js.map +1 -0
- package/dist/cli/plugins/sandbox/Sandbox.d.ts +1 -2
- package/dist/cli/plugins/sandbox/Sandbox.js.map +1 -1
- package/dist/cli/plugins/sandbox/index.js +5 -4
- package/dist/cli/plugins/sandbox/index.js.map +1 -1
- package/dist/cli/plugins/sandbox/sandbox-module.d.ts +3 -0
- package/dist/cli/plugins/sandbox/sandbox-module.js +11 -0
- package/dist/cli/plugins/sandbox/sandbox-module.js.map +1 -0
- package/dist/cli/plugins/sidebar/Sidebar.d.ts +1 -1
- package/dist/cli/plugins/sidebar/Sidebar.js +2 -2
- package/dist/cli/plugins/sidebar/Sidebar.js.map +1 -1
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +1 -1
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js +6 -6
- package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js.map +1 -1
- package/dist/cli/plugins/sidebar/declaration/sidebar.d.ts +3 -3
- package/dist/cli/plugins/sidebar/index.js +6 -5
- package/dist/cli/plugins/sidebar/index.js.map +1 -1
- package/dist/cli/plugins/sidebar/sidebar-module.d.ts +3 -0
- package/dist/cli/plugins/sidebar/sidebar-module.js +11 -0
- package/dist/cli/plugins/sidebar/sidebar-module.js.map +1 -0
- package/dist/cli/plugins/style/index.d.ts +2 -1
- package/dist/cli/plugins/style/index.js +52 -25
- package/dist/cli/plugins/style/index.js.map +1 -1
- package/dist/cli/plugins/style/types.d.ts +5 -0
- package/dist/cli/plugins/style/types.js +1 -0
- package/dist/cli/plugins/style/types.js.map +1 -0
- package/dist/cli/raw.d.ts +4 -0
- package/dist/cli/resolvers/bundler.js +9 -7
- package/dist/cli/resolvers/bundler.js.map +1 -1
- package/dist/cli/resolvers/config.js +2 -1
- package/dist/cli/resolvers/config.js.map +1 -1
- package/dist/cli/virtual/index.d.ts +2 -2
- package/dist/cli/virtual/index.js +11 -8
- package/dist/cli/virtual/virtual.d.ts +14 -11
- package/dist/content/index.d.ts +3 -0
- package/dist/content/index.js +8 -0
- package/dist/content/index.js.map +1 -0
- package/dist/entry/content/adapters/react/Builder.d.ts +5 -6
- package/dist/entry/content/adapters/react/Builder.js +8 -21
- package/dist/entry/content/adapters/react/Builder.js.map +1 -1
- package/dist/entry/content/adapters/react/Node.d.ts +6 -12
- package/dist/entry/content/adapters/react/Node.js +9 -25
- package/dist/entry/content/adapters/react/Node.js.map +1 -1
- package/dist/entry/content/adapters/react/index.d.ts +2 -1
- package/dist/entry/content/adapters/react/index.js +3 -1
- package/dist/entry/content/adapters/react/index.js.map +1 -1
- package/dist/entry/content/adapters/react/resolvers/definition.d.ts +2 -0
- package/dist/entry/content/adapters/react/resolvers/definition.js +12 -0
- package/dist/entry/content/adapters/react/resolvers/definition.js.map +1 -0
- package/dist/entry/content/adapters/react/resolvers/render.d.ts +2 -2
- package/dist/entry/content/adapters/react/resolvers/render.js +4 -6
- package/dist/entry/content/adapters/react/resolvers/render.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Builder.d.ts +5 -5
- package/dist/entry/content/adapters/vanilla/Builder.js +9 -15
- package/dist/entry/content/adapters/vanilla/Builder.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Node.d.ts +5 -10
- package/dist/entry/content/adapters/vanilla/Node.js +11 -34
- package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/index.d.ts +2 -1
- package/dist/entry/content/adapters/vanilla/index.js +3 -1
- package/dist/entry/content/adapters/vanilla/index.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/resolvers/definition.d.ts +2 -0
- package/dist/entry/content/adapters/vanilla/resolvers/definition.js +9 -0
- package/dist/entry/content/adapters/vanilla/resolvers/definition.js.map +1 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.d.ts +3 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.js +15 -0
- package/dist/entry/content/adapters/vanilla/resolvers/render.js.map +1 -0
- package/dist/entry/content/index.d.ts +5 -1
- package/dist/entry/content/index.js +8 -1
- package/dist/entry/content/index.js.map +1 -1
- package/dist/entry/content/lifecycle/Builder.d.ts +26 -0
- package/dist/entry/content/lifecycle/Builder.js +212 -0
- package/dist/entry/content/lifecycle/Builder.js.map +1 -0
- package/dist/entry/content/lifecycle/IsolationSetup.d.ts +16 -0
- package/dist/entry/content/lifecycle/IsolationSetup.js +37 -0
- package/dist/entry/content/lifecycle/IsolationSetup.js.map +1 -0
- package/dist/entry/content/lifecycle/MountBuilder.d.ts +8 -0
- package/dist/entry/content/lifecycle/MountBuilder.js +57 -0
- package/dist/entry/content/lifecycle/MountBuilder.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/context}/Context.d.ts +5 -2
- package/dist/entry/content/lifecycle/context/Context.js +73 -0
- package/dist/entry/content/lifecycle/context/Context.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/context}/EventEmitter.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle/context}/EventEmitter.js +3 -3
- package/dist/entry/content/lifecycle/context/EventEmitter.js.map +1 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.d.ts +5 -0
- package/dist/entry/content/{core → lifecycle/context}/ManagedContext.js +2 -2
- package/dist/entry/content/lifecycle/context/ManagedContext.js.map +1 -0
- package/dist/entry/content/lifecycle/context/index.d.ts +3 -0
- package/dist/entry/content/lifecycle/context/index.js +9 -0
- package/dist/entry/content/lifecycle/context/index.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/markers}/AbstractMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle/markers}/AbstractMarker.js +3 -3
- package/dist/entry/content/lifecycle/markers/AbstractMarker.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/markers}/AttributeMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle/markers}/AttributeMarker.js +2 -2
- package/dist/entry/content/lifecycle/markers/AttributeMarker.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/markers}/WeakMarker.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle/markers}/WeakMarker.js +2 -2
- package/dist/entry/content/lifecycle/markers/WeakMarker.js.map +1 -0
- package/dist/entry/content/lifecycle/markers/index.d.ts +3 -0
- package/dist/entry/content/lifecycle/markers/index.js +9 -0
- package/dist/entry/content/lifecycle/markers/index.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/EventNode.d.ts +5 -2
- package/dist/entry/content/{core → lifecycle/nodes}/EventNode.js +14 -2
- package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.d.ts +29 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js +187 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/MarkerNode.d.ts +4 -2
- package/dist/entry/content/{core → lifecycle/nodes}/MarkerNode.js +8 -2
- package/dist/entry/content/lifecycle/nodes/MarkerNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/MountNode.d.ts +4 -2
- package/dist/entry/content/{core → lifecycle/nodes}/MountNode.js +8 -2
- package/dist/entry/content/lifecycle/nodes/MountNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle/nodes}/Node.d.ts +3 -2
- package/dist/entry/content/{core → lifecycle/nodes}/Node.js +5 -2
- package/dist/entry/content/lifecycle/nodes/Node.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.d.ts +19 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js +75 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.d.ts +21 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js +121 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/index.d.ts +7 -0
- package/dist/entry/content/lifecycle/nodes/index.js +17 -0
- package/dist/entry/content/lifecycle/nodes/index.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/isolated-styles.d.ts +2 -0
- package/dist/entry/content/lifecycle/nodes/isolated-styles.js +14 -0
- package/dist/entry/content/lifecycle/nodes/isolated-styles.js.map +1 -0
- package/dist/entry/content/resolvers/anchor.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/anchor.js +2 -2
- package/dist/entry/content/resolvers/anchor.js.map +1 -0
- package/dist/entry/content/resolvers/container.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/container.js +2 -2
- package/dist/entry/content/resolvers/container.js.map +1 -0
- package/dist/entry/content/resolvers/definition.d.ts +5 -0
- package/dist/entry/content/resolvers/definition.js +24 -0
- package/dist/entry/content/resolvers/definition.js.map +1 -0
- package/dist/entry/content/{core/resolvers → resolvers}/index.d.ts +1 -1
- package/dist/entry/content/{core/resolvers → resolvers}/index.js +1 -1
- package/dist/entry/content/resolvers/index.js.map +1 -0
- package/dist/entry/content/resolvers/mount.d.ts +2 -0
- package/dist/entry/content/{core/resolvers → resolvers}/mount.js +3 -3
- package/dist/entry/content/resolvers/mount.js.map +1 -0
- package/dist/entry/content/resolvers/target.d.ts +3 -0
- package/dist/entry/content/resolvers/target.js +34 -0
- package/dist/entry/content/resolvers/target.js.map +1 -0
- package/dist/entry/content/resolvers/watch.d.ts +6 -0
- package/dist/entry/content/{core/resolvers → resolvers}/watch.js +15 -11
- package/dist/entry/content/resolvers/watch.js.map +1 -0
- package/dist/entry/relay/Builder.d.ts +8 -8
- package/dist/entry/relay/Builder.js +32 -19
- package/dist/entry/relay/Builder.js.map +1 -1
- package/dist/entry/relay/TransportBuilder.d.ts +3 -2
- package/dist/entry/relay/TransportBuilder.js +3 -3
- package/dist/entry/relay/TransportBuilder.js.map +1 -1
- package/dist/entry/relay/index.d.ts +5 -2
- package/dist/entry/relay/index.js +8 -2
- package/dist/entry/relay/index.js.map +1 -1
- package/dist/entry/relay/resolvers/definition.d.ts +4 -0
- package/dist/entry/relay/resolvers/definition.js +16 -0
- package/dist/entry/relay/resolvers/definition.js.map +1 -0
- package/dist/locale/adapters/react/ReactLocale.d.ts +18 -0
- package/dist/locale/adapters/react/ReactLocale.js +41 -0
- package/dist/locale/adapters/react/ReactLocale.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.d.ts +7 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.js +30 -0
- package/dist/locale/adapters/react/hooks/use-locale-attributes.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-locale.d.ts +3 -0
- package/dist/locale/adapters/react/hooks/use-locale.js +17 -0
- package/dist/locale/adapters/react/hooks/use-locale.js.map +1 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.d.ts +3 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.js +10 -0
- package/dist/locale/adapters/react/hooks/use-native-locale.js.map +1 -0
- package/dist/locale/adapters/react/index.d.ts +4 -2
- package/dist/locale/adapters/react/index.js +6 -4
- package/dist/locale/adapters/react/index.js.map +1 -1
- package/dist/locale/adapters/react/types.d.ts +22 -0
- package/dist/locale/adapters/react/types.js +1 -0
- package/dist/locale/adapters/react/types.js.map +1 -0
- package/dist/locale/helpers.d.ts +4 -5
- package/dist/locale/helpers.js +1 -1
- package/dist/locale/helpers.js.map +1 -1
- package/dist/locale/index.d.ts +2 -1
- package/dist/locale/index.js +1 -0
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/providers/AbstractLocale.d.ts +4 -4
- package/dist/locale/providers/AbstractLocale.js +13 -94
- package/dist/locale/providers/AbstractLocale.js.map +1 -1
- package/dist/locale/providers/CustomLocale.d.ts +3 -3
- package/dist/locale/providers/CustomLocale.js +6 -5
- package/dist/locale/providers/CustomLocale.js.map +1 -1
- package/dist/locale/providers/DynamicLocale.d.ts +18 -11
- package/dist/locale/providers/DynamicLocale.js +60 -47
- package/dist/locale/providers/DynamicLocale.js.map +1 -1
- package/dist/locale/providers/NativeLocale.d.ts +4 -7
- package/dist/locale/providers/NativeLocale.js +5 -14
- package/dist/locale/providers/NativeLocale.js.map +1 -1
- package/dist/locale/providers/ObservableLocale.d.ts +35 -0
- package/dist/locale/providers/ObservableLocale.js +179 -0
- package/dist/locale/providers/ObservableLocale.js.map +1 -0
- package/dist/locale/providers/index.d.ts +2 -1
- package/dist/locale/providers/index.js +3 -1
- package/dist/locale/providers/index.js.map +1 -1
- package/dist/locale/storage/LocaleStorage.d.ts +11 -0
- package/dist/locale/storage/LocaleStorage.js +40 -0
- package/dist/locale/storage/LocaleStorage.js.map +1 -0
- package/dist/locale/storage/index.d.ts +1 -0
- package/dist/locale/storage/index.js +5 -0
- package/dist/locale/storage/index.js.map +1 -0
- package/dist/main/content.d.ts +4 -6
- package/dist/main/content.js +3 -16
- package/dist/main/content.js.map +1 -1
- package/dist/main/entrypoint.d.ts +4 -0
- package/dist/main/entrypoint.js +20 -0
- package/dist/main/entrypoint.js.map +1 -0
- package/dist/main/icon.d.ts +2 -3
- package/dist/main/icon.js +2 -1
- package/dist/main/icon.js.map +1 -1
- package/dist/main/index.d.ts +1 -0
- package/dist/main/index.js +1 -0
- package/dist/main/index.js.map +1 -1
- package/dist/main/offscreen.d.ts +2 -5
- package/dist/main/offscreen.js +5 -2
- package/dist/main/offscreen.js.map +1 -1
- package/dist/main/page.d.ts +2 -4
- package/dist/main/page.js +2 -1
- package/dist/main/page.js.map +1 -1
- package/dist/main/popup.d.ts +2 -5
- package/dist/main/popup.js +3 -3
- package/dist/main/popup.js.map +1 -1
- package/dist/main/relay.d.ts +3 -3
- package/dist/main/relay.js +2 -1
- package/dist/main/relay.js.map +1 -1
- package/dist/main/sandbox.d.ts +1 -4
- package/dist/main/sandbox.js +2 -1
- package/dist/main/sandbox.js.map +1 -1
- package/dist/main/service.d.ts +1 -2
- package/dist/main/service.js.map +1 -1
- package/dist/main/sidebar.d.ts +2 -5
- package/dist/main/sidebar.js +3 -3
- package/dist/main/sidebar.js.map +1 -1
- package/dist/message/index.d.ts +2 -4
- package/dist/message/index.js.map +1 -1
- package/dist/offscreen/index.d.ts +2 -6
- package/dist/offscreen/index.js.map +1 -1
- package/dist/relay/RelayPermission.js +1 -1
- package/dist/relay/index.d.ts +2 -5
- package/dist/relay/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +1 -5
- package/dist/sandbox/index.js.map +1 -1
- package/dist/service/index.d.ts +2 -6
- package/dist/service/index.js.map +1 -1
- package/dist/shared/content/index.d.ts +1 -0
- package/dist/shared/content/index.js +6 -0
- package/dist/shared/content/index.js.map +1 -0
- package/dist/shared/content/isolation.d.ts +4 -0
- package/dist/shared/content/isolation.js +63 -0
- package/dist/shared/content/isolation.js.map +1 -0
- package/dist/shared/locale/index.d.ts +5 -0
- package/dist/shared/locale/index.js +21 -0
- package/dist/shared/locale/index.js.map +1 -0
- package/dist/shared/locale/keys.d.ts +5 -0
- package/dist/shared/locale/keys.js +33 -0
- package/dist/shared/locale/keys.js.map +1 -0
- package/dist/shared/locale/language.d.ts +4 -0
- package/dist/shared/locale/language.js +23 -0
- package/dist/shared/locale/language.js.map +1 -0
- package/dist/shared/locale/messages.d.ts +3 -0
- package/dist/shared/locale/messages.js +9 -0
- package/dist/shared/locale/messages.js.map +1 -0
- package/dist/shared/locale/plural.d.ts +2 -0
- package/dist/shared/locale/plural.js +81 -0
- package/dist/shared/locale/plural.js.map +1 -0
- package/dist/shared/locale/substitutions.d.ts +10 -0
- package/dist/shared/locale/substitutions.js +32 -0
- package/dist/shared/locale/substitutions.js.map +1 -0
- package/dist/types/background.d.ts +1 -1
- package/dist/types/background.js.map +1 -1
- package/dist/types/command.d.ts +1 -1
- package/dist/types/command.js.map +1 -1
- package/dist/types/content/adapters/index.d.ts +2 -0
- package/dist/types/content/adapters/index.js +1 -0
- package/dist/types/content/adapters/index.js.map +1 -0
- package/dist/types/content/adapters/react.d.ts +4 -0
- package/dist/types/content/adapters/react.js +1 -0
- package/dist/types/content/adapters/react.js.map +1 -0
- package/dist/types/content/adapters/vanilla.d.ts +1 -0
- package/dist/types/content/adapters/vanilla.js +1 -0
- package/dist/types/content/adapters/vanilla.js.map +1 -0
- package/dist/types/content/boundary.d.ts +17 -0
- package/dist/types/content/boundary.js +1 -0
- package/dist/types/content/boundary.js.map +1 -0
- package/dist/types/{content.d.ts → content/common.d.ts} +119 -59
- package/dist/types/{content.js → content/common.js} +23 -2
- package/dist/types/content/common.js.map +1 -0
- package/dist/types/content/definition.d.ts +61 -0
- package/dist/types/content/definition.js +1 -0
- package/dist/types/content/definition.js.map +1 -0
- package/dist/types/content/index.d.ts +7 -0
- package/dist/types/content/index.js +2 -0
- package/dist/types/content/index.js.map +1 -0
- package/dist/types/content/prepare.d.ts +9 -0
- package/dist/types/content/prepare.js +1 -0
- package/dist/types/content/prepare.js.map +1 -0
- package/dist/types/content/render.d.ts +6 -0
- package/dist/types/content/render.js +1 -0
- package/dist/types/content/render.js.map +1 -0
- package/dist/types/content/target.d.ts +13 -0
- package/dist/types/content/target.js +1 -0
- package/dist/types/content/target.js.map +1 -0
- package/dist/types/entrypoint.d.ts +20 -0
- package/dist/types/entrypoint.js +4 -0
- package/dist/types/entrypoint.js.map +1 -1
- package/dist/types/icon.d.ts +8 -0
- package/dist/types/icon.js.map +1 -1
- package/dist/types/language.d.ts +57 -0
- package/dist/types/language.js +62 -0
- package/dist/types/language.js.map +1 -0
- package/dist/types/locale.d.ts +34 -63
- package/dist/types/locale.js +62 -119
- package/dist/types/locale.js.map +1 -1
- package/dist/types/manifest.d.ts +11 -8
- package/dist/types/manifest.js.map +1 -1
- package/dist/types/message.d.ts +7 -0
- package/dist/types/message.js.map +1 -1
- package/dist/types/offscreen.d.ts +14 -1
- package/dist/types/offscreen.js.map +1 -1
- package/dist/types/page.d.ts +8 -0
- package/dist/types/popup.d.ts +9 -0
- package/dist/types/relay.d.ts +15 -7
- package/dist/types/relay.js.map +1 -1
- package/dist/types/sandbox.d.ts +12 -0
- package/dist/types/sandbox.js.map +1 -1
- package/dist/types/service.d.ts +10 -1
- package/dist/types/service.js.map +1 -1
- package/dist/types/sidebar.d.ts +9 -0
- package/dist/types/sidebar.js.map +1 -1
- package/dist/types/transport.d.ts +4 -0
- package/dist/virtual/icon.d.ts +2 -0
- package/dist/virtual/icon.js +5 -0
- package/dist/virtual/icon.js.map +1 -0
- package/dist/virtual/locale.d.ts +7 -0
- package/dist/virtual/locale.js +13 -0
- package/dist/virtual/locale.js.map +1 -0
- package/dist/virtual/modules.d.ts +41 -0
- package/dist/virtual/offscreen.d.ts +3 -0
- package/dist/virtual/offscreen.js +5 -0
- package/dist/virtual/offscreen.js.map +1 -0
- package/dist/virtual/page.d.ts +2 -0
- package/dist/virtual/page.js +5 -0
- package/dist/virtual/page.js.map +1 -0
- package/dist/virtual/popup.d.ts +3 -0
- package/dist/virtual/popup.js +5 -0
- package/dist/virtual/popup.js.map +1 -0
- package/dist/virtual/relay.d.ts +3 -0
- package/dist/virtual/relay.js +5 -0
- package/dist/virtual/relay.js.map +1 -0
- package/dist/virtual/runtime.d.ts +8 -0
- package/dist/virtual/runtime.js +9 -0
- package/dist/virtual/runtime.js.map +1 -0
- package/dist/virtual/sandbox.d.ts +3 -0
- package/dist/virtual/sandbox.js +5 -0
- package/dist/virtual/sandbox.js.map +1 -0
- package/dist/virtual/sidebar.d.ts +3 -0
- package/dist/virtual/sidebar.js +5 -0
- package/dist/virtual/sidebar.js.map +1 -0
- package/package.json +53 -23
- package/scripts/clean-dist.js +7 -0
- package/scripts/copy-dts.js +11 -1
- package/scripts/merge-coverage.mjs +12 -0
- package/scripts/pre-commit.mjs +22 -0
- package/scripts/test-inventory.mjs +38 -0
- package/scripts/test-run.mjs +25 -0
- package/types/client.d.ts +15 -0
- package/dist/cli/builders/manifest/utils.d.ts +0 -32
- package/dist/cli/builders/manifest/utils.js +0 -209
- package/dist/cli/builders/manifest/utils.js.map +0 -1
- package/dist/cli/bundler/plugins/EntrypointPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/GenerateJsonPlugin.js +0 -40
- package/dist/cli/bundler/plugins/GenerateJsonPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/ManifestPlugin.d.ts +0 -10
- package/dist/cli/bundler/plugins/ManifestPlugin.js +0 -78
- package/dist/cli/bundler/plugins/ManifestPlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/ReplacePlugin.js.map +0 -1
- package/dist/cli/bundler/plugins/WatchPlugin.js +0 -21
- package/dist/cli/bundler/plugins/WatchPlugin.js.map +0 -1
- package/dist/cli/bundler/utils/output.d.ts +0 -2
- package/dist/cli/bundler/utils/output.js +0 -15
- package/dist/cli/bundler/utils/output.js.map +0 -1
- package/dist/cli/entrypoint/finder/tests/fixtures/options/discovery/account.options.d.ts +0 -1
- package/dist/cli/entrypoint/finder/tests/fixtures/options/discovery/advanced.options/index.d.ts +0 -1
- package/dist/cli/plugins/output.d.ts +0 -2
- package/dist/cli/plugins/output.js +0 -32
- package/dist/cli/plugins/output.js.map +0 -1
- package/dist/entry/content/adapters/react/resolvers/index.d.ts +0 -1
- package/dist/entry/content/adapters/react/resolvers/index.js +0 -2
- package/dist/entry/content/adapters/react/resolvers/index.js.map +0 -1
- package/dist/entry/content/core/AbstractMarker.js.map +0 -1
- package/dist/entry/content/core/AttributeMarker.js.map +0 -1
- package/dist/entry/content/core/Builder.d.ts +0 -27
- package/dist/entry/content/core/Builder.js +0 -124
- package/dist/entry/content/core/Builder.js.map +0 -1
- package/dist/entry/content/core/Context.js +0 -43
- package/dist/entry/content/core/Context.js.map +0 -1
- package/dist/entry/content/core/EventEmitter.js.map +0 -1
- package/dist/entry/content/core/EventNode.js.map +0 -1
- package/dist/entry/content/core/ManagedContext.d.ts +0 -5
- package/dist/entry/content/core/ManagedContext.js.map +0 -1
- package/dist/entry/content/core/MarkerNode.js.map +0 -1
- package/dist/entry/content/core/MountBuilder.d.ts +0 -10
- package/dist/entry/content/core/MountBuilder.js +0 -40
- package/dist/entry/content/core/MountBuilder.js.map +0 -1
- package/dist/entry/content/core/MountNode.js.map +0 -1
- package/dist/entry/content/core/Node.js.map +0 -1
- package/dist/entry/content/core/WeakMarker.js.map +0 -1
- package/dist/entry/content/core/resolvers/anchor.d.ts +0 -2
- package/dist/entry/content/core/resolvers/anchor.js.map +0 -1
- package/dist/entry/content/core/resolvers/container.d.ts +0 -2
- package/dist/entry/content/core/resolvers/container.js.map +0 -1
- package/dist/entry/content/core/resolvers/definition.d.ts +0 -3
- package/dist/entry/content/core/resolvers/definition.js +0 -12
- package/dist/entry/content/core/resolvers/definition.js.map +0 -1
- package/dist/entry/content/core/resolvers/index.js.map +0 -1
- package/dist/entry/content/core/resolvers/mount.d.ts +0 -2
- package/dist/entry/content/core/resolvers/mount.js.map +0 -1
- package/dist/entry/content/core/resolvers/render.d.ts +0 -3
- package/dist/entry/content/core/resolvers/render.js +0 -18
- package/dist/entry/content/core/resolvers/render.js.map +0 -1
- package/dist/entry/content/core/resolvers/watch.d.ts +0 -4
- package/dist/entry/content/core/resolvers/watch.js.map +0 -1
- package/dist/locale/adapters/react/LocaleProvider.d.ts +0 -7
- package/dist/locale/adapters/react/LocaleProvider.js +0 -58
- package/dist/locale/adapters/react/LocaleProvider.js.map +0 -1
- package/dist/locale/adapters/react/context.d.ts +0 -14
- package/dist/locale/adapters/react/context.js +0 -25
- package/dist/locale/adapters/react/context.js.map +0 -1
- package/dist/locale/utils.d.ts +0 -11
- package/dist/locale/utils.js +0 -67
- package/dist/locale/utils.js.map +0 -1
- package/dist/types/content.js.map +0 -1
- /package/dist/cli/bundler/plugins/{ReplacePlugin.d.ts → replace/ReplacePlugin.d.ts} +0 -0
- /package/dist/cli/bundler/plugins/{ReplacePlugin.js → replace/ReplacePlugin.js} +0 -0
- /package/dist/cli/bundler/plugins/{WatchPlugin.d.ts → watch/WatchPlugin.d.ts} +0 -0
|
@@ -1,15 +1,33 @@
|
|
|
1
|
+
import { isContentScriptFrameNavigation, resolveContentScriptIsolation } from "./../../../shared/content/index.js";
|
|
1
2
|
import z from "zod";
|
|
2
3
|
import AbstractParser from "./AbstractParser.js";
|
|
4
|
+
import { hasContentScriptDefaultRender } from "./utils/content/default-render.js";
|
|
3
5
|
import {
|
|
4
6
|
ContentScriptDeclarative,
|
|
5
7
|
ContentScriptMarker,
|
|
6
|
-
ContentScriptMatches
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
ContentScriptMatches,
|
|
9
|
+
ContentScriptWorld,
|
|
10
|
+
ContentScriptIsolation,
|
|
11
|
+
ContentScriptShadowMode
|
|
12
|
+
} from "./../../../types/content/index.js";
|
|
13
|
+
class ContentParser extends AbstractParser {
|
|
9
14
|
definition() {
|
|
10
15
|
return ["defineContentScript", "defineContentScriptAppend"];
|
|
11
16
|
}
|
|
12
17
|
schema() {
|
|
18
|
+
const frameSchema = z.object({
|
|
19
|
+
type: z.literal(ContentScriptIsolation.Iframe)
|
|
20
|
+
}).strict();
|
|
21
|
+
const isolationSchema = z.union([
|
|
22
|
+
z.object({ type: z.literal(ContentScriptIsolation.None) }).strict(),
|
|
23
|
+
z.object({
|
|
24
|
+
type: z.literal(ContentScriptIsolation.Shadow),
|
|
25
|
+
mode: z.nativeEnum(ContentScriptShadowMode)
|
|
26
|
+
}).strict(),
|
|
27
|
+
frameSchema,
|
|
28
|
+
frameSchema.extend({ page: z.string() }),
|
|
29
|
+
frameSchema.extend({ src: z.string() })
|
|
30
|
+
]);
|
|
13
31
|
return this.CommonPropertiesSchema.extend({
|
|
14
32
|
matches: z.array(z.string()).optional(),
|
|
15
33
|
excludeMatches: z.array(z.string()).optional(),
|
|
@@ -17,13 +35,27 @@ class ContentParser_default extends AbstractParser {
|
|
|
17
35
|
includeGlobs: z.array(z.string()).optional(),
|
|
18
36
|
excludeGlobs: z.array(z.string()).optional(),
|
|
19
37
|
allFrames: z.boolean().optional(),
|
|
20
|
-
world: z.
|
|
38
|
+
world: z.nativeEnum(ContentScriptWorld).optional(),
|
|
21
39
|
runAt: z.enum(["document_start", "document_end", "document_idle"]).optional(),
|
|
22
40
|
matchOriginAsFallback: z.boolean().optional(),
|
|
23
41
|
declarative: z.union([z.nativeEnum(ContentScriptDeclarative), z.boolean()]).optional(),
|
|
24
|
-
marker: z.union([z.nativeEnum(ContentScriptMarker), z.boolean()]).optional()
|
|
42
|
+
marker: z.union([z.nativeEnum(ContentScriptMarker), z.boolean()]).optional(),
|
|
43
|
+
isolation: isolationSchema
|
|
25
44
|
});
|
|
26
45
|
}
|
|
46
|
+
getOptions(file) {
|
|
47
|
+
const optionFile = this.optionFile(file);
|
|
48
|
+
const declared = optionFile.getDeclaredProperties();
|
|
49
|
+
const values = optionFile.getOptions();
|
|
50
|
+
try {
|
|
51
|
+
const hasRender = declared.has("render") || isContentScriptFrameNavigation(values.isolation) && !optionFile.getDefinition() && this.hasDefaultRender(file);
|
|
52
|
+
return { ...values, isolation: resolveContentScriptIsolation(values.isolation, hasRender) };
|
|
53
|
+
} catch (error) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Invalid content isolation in "${file.file}": ${error instanceof Error ? error.message : String(error)}`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
27
59
|
options(file) {
|
|
28
60
|
const options = super.options(file);
|
|
29
61
|
return {
|
|
@@ -32,8 +64,12 @@ class ContentParser_default extends AbstractParser {
|
|
|
32
64
|
...options
|
|
33
65
|
};
|
|
34
66
|
}
|
|
67
|
+
/** Interprets generic export metadata using content render rules; Relay overrides this policy. */
|
|
68
|
+
hasDefaultRender(file) {
|
|
69
|
+
return hasContentScriptDefaultRender(this.expressionFile(file).getDefaultExport());
|
|
70
|
+
}
|
|
35
71
|
}
|
|
36
72
|
export {
|
|
37
|
-
|
|
73
|
+
ContentParser as default
|
|
38
74
|
};
|
|
39
75
|
//# sourceMappingURL=ContentParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/entrypoint/parser/ContentParser.ts"],"sourcesContent":["import z from \"zod\";\n\nimport AbstractParser from \"./AbstractParser\";\n\nimport {\n ContentScriptDeclarative,\n ContentScriptEntrypointOptions,\n ContentScriptMarker,\n ContentScriptMatches,\n} from \"@typing/content\";\nimport {EntrypointFile, EntrypointOptions} from \"@typing/entrypoint\";\n\nexport default class
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/entrypoint/parser/ContentParser.ts"],"sourcesContent":["import {isContentScriptFrameNavigation, resolveContentScriptIsolation} from \"@shared/content\";\nimport z from \"zod\";\n\nimport AbstractParser from \"./AbstractParser\";\nimport {hasContentScriptDefaultRender} from \"./utils/content/default-render\";\n\nimport {\n ContentScriptDeclarative,\n ContentScriptEntrypointOptions,\n ContentScriptMarker,\n ContentScriptMatches,\n ContentScriptWorld,\n ContentScriptIsolation,\n ContentScriptIsolationOptions,\n ContentScriptShadowMode,\n} from \"@typing/content\";\nimport {EntrypointFile, EntrypointOptions} from \"@typing/entrypoint\";\n\nexport default class ContentParser<\n O extends EntrypointOptions = ContentScriptEntrypointOptions,\n> extends AbstractParser<O> {\n protected definition(): string | string[] {\n return [\"defineContentScript\", \"defineContentScriptAppend\"];\n }\n\n protected schema(): z.AnyZodObject {\n const frameSchema = z\n .object({\n type: z.literal(ContentScriptIsolation.Iframe),\n })\n .strict();\n\n // getOptions normalizes shorthand and defaults before validating this object contract.\n const isolationSchema = z.union([\n z.object({type: z.literal(ContentScriptIsolation.None)}).strict(),\n z\n .object({\n type: z.literal(ContentScriptIsolation.Shadow),\n mode: z.nativeEnum(ContentScriptShadowMode),\n })\n .strict(),\n frameSchema,\n frameSchema.extend({page: z.string()}),\n frameSchema.extend({src: z.string()}),\n ]) satisfies z.ZodType<ContentScriptIsolationOptions>;\n\n return this.CommonPropertiesSchema.extend({\n matches: z.array(z.string()).optional(),\n excludeMatches: z.array(z.string()).optional(),\n matchAboutBlank: z.boolean().optional(),\n includeGlobs: z.array(z.string()).optional(),\n excludeGlobs: z.array(z.string()).optional(),\n allFrames: z.boolean().optional(),\n world: z.nativeEnum(ContentScriptWorld).optional(),\n runAt: z.enum([\"document_start\", \"document_end\", \"document_idle\"]).optional(),\n matchOriginAsFallback: z.boolean().optional(),\n declarative: z.union([z.nativeEnum(ContentScriptDeclarative), z.boolean()]).optional(),\n marker: z.union([z.nativeEnum(ContentScriptMarker), z.boolean()]).optional(),\n isolation: isolationSchema,\n });\n }\n\n protected getOptions(file: EntrypointFile): Record<string, any> {\n const optionFile = this.optionFile(file);\n const declared = optionFile.getDeclaredProperties();\n const values = optionFile.getOptions();\n\n try {\n const hasRender =\n declared.has(\"render\") ||\n (isContentScriptFrameNavigation(values.isolation) &&\n !optionFile.getDefinition() &&\n this.hasDefaultRender(file));\n\n return {...values, isolation: resolveContentScriptIsolation(values.isolation, hasRender)};\n } catch (error) {\n throw new Error(\n `Invalid content isolation in \"${file.file}\": ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n\n public options(file: EntrypointFile): O {\n const options = super.options(file);\n\n return {\n matches: ContentScriptMatches,\n runAt: \"document_idle\",\n ...options,\n };\n }\n\n /** Interprets generic export metadata using content render rules; Relay overrides this policy. */\n protected hasDefaultRender(file: EntrypointFile): boolean {\n return hasContentScriptDefaultRender(this.expressionFile(file).getDefaultExport());\n }\n}\n"],"mappings":"AAAA,SAAQ,gCAAgC,qCAAoC;AAC5E,OAAO,OAAO;AAEd,OAAO,oBAAoB;AAC3B,SAAQ,qCAAoC;AAE5C;AAAA,EACI;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACG;AAGP,MAAO,sBAEG,eAAkB;AAAA,EACd,aAAgC;AACtC,WAAO,CAAC,uBAAuB,2BAA2B;AAAA,EAC9D;AAAA,EAEU,SAAyB;AAC/B,UAAM,cAAc,EACf,OAAO;AAAA,MACJ,MAAM,EAAE,QAAQ,uBAAuB,MAAM;AAAA,IACjD,CAAC,EACA,OAAO;AAGZ,UAAM,kBAAkB,EAAE,MAAM;AAAA,MAC5B,EAAE,OAAO,EAAC,MAAM,EAAE,QAAQ,uBAAuB,IAAI,EAAC,CAAC,EAAE,OAAO;AAAA,MAChE,EACK,OAAO;AAAA,QACJ,MAAM,EAAE,QAAQ,uBAAuB,MAAM;AAAA,QAC7C,MAAM,EAAE,WAAW,uBAAuB;AAAA,MAC9C,CAAC,EACA,OAAO;AAAA,MACZ;AAAA,MACA,YAAY,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;AAAA,MACrC,YAAY,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC;AAAA,IACxC,CAAC;AAED,WAAO,KAAK,uBAAuB,OAAO;AAAA,MACtC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,MACtC,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,MAC7C,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,MACtC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,MAC3C,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,MAC3C,WAAW,EAAE,QAAQ,EAAE,SAAS;AAAA,MAChC,OAAO,EAAE,WAAW,kBAAkB,EAAE,SAAS;AAAA,MACjD,OAAO,EAAE,KAAK,CAAC,kBAAkB,gBAAgB,eAAe,CAAC,EAAE,SAAS;AAAA,MAC5E,uBAAuB,EAAE,QAAQ,EAAE,SAAS;AAAA,MAC5C,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,wBAAwB,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS;AAAA,MACrF,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,mBAAmB,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS;AAAA,MAC3E,WAAW;AAAA,IACf,CAAC;AAAA,EACL;AAAA,EAEU,WAAW,MAA2C;AAC5D,UAAM,aAAa,KAAK,WAAW,IAAI;AACvC,UAAM,WAAW,WAAW,sBAAsB;AAClD,UAAM,SAAS,WAAW,WAAW;AAErC,QAAI;AACA,YAAM,YACF,SAAS,IAAI,QAAQ,KACpB,+BAA+B,OAAO,SAAS,KAC5C,CAAC,WAAW,cAAc,KAC1B,KAAK,iBAAiB,IAAI;AAElC,aAAO,EAAC,GAAG,QAAQ,WAAW,8BAA8B,OAAO,WAAW,SAAS,EAAC;AAAA,IAC5F,SAAS,OAAO;AACZ,YAAM,IAAI;AAAA,QACN,iCAAiC,KAAK,IAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,MAC1G;AAAA,IACJ;AAAA,EACJ;AAAA,EAEO,QAAQ,MAAyB;AACpC,UAAM,UAAU,MAAM,QAAQ,IAAI;AAElC,WAAO;AAAA,MACH,SAAS;AAAA,MACT,OAAO;AAAA,MACP,GAAG;AAAA,IACP;AAAA,EACJ;AAAA;AAAA,EAGU,iBAAiB,MAA+B;AACtD,WAAO,8BAA8B,KAAK,eAAe,IAAI,EAAE,iBAAiB,CAAC;AAAA,EACrF;AACJ;","names":[]}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import z from "zod";
|
|
1
2
|
import ContentParser from "./ContentParser.js";
|
|
2
|
-
import { RelayEntrypointOptions } from "../../../types/relay.js";
|
|
3
|
+
import { RelayAllFrames, RelayEntrypointOptions, RelayMethod } from "../../../types/relay.js";
|
|
3
4
|
import { EntrypointFile } from "../../../types/entrypoint.js";
|
|
4
5
|
export default class extends ContentParser<RelayEntrypointOptions> {
|
|
5
6
|
protected definition(): string;
|
|
6
7
|
protected agreement(): string;
|
|
7
|
-
|
|
8
|
+
/** A Relay's default function initializes its transport; it is never an implicit content renderer. */
|
|
9
|
+
protected hasDefaultRender(): boolean;
|
|
10
|
+
protected schema(): z.ZodObject<{
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
} & {
|
|
13
|
+
allFrames: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNativeEnum<typeof RelayAllFrames>]>>;
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
method: z.ZodOptional<z.ZodNativeEnum<typeof RelayMethod>>;
|
|
16
|
+
}, any, any, {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
allFrames?: unknown;
|
|
19
|
+
name?: unknown;
|
|
20
|
+
method?: unknown;
|
|
21
|
+
}, {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
allFrames?: unknown;
|
|
24
|
+
name?: unknown;
|
|
25
|
+
method?: unknown;
|
|
26
|
+
}>;
|
|
8
27
|
options(file: EntrypointFile): RelayEntrypointOptions;
|
|
9
28
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import ContentParser from "./ContentParser.js";
|
|
3
3
|
import { RelayAllFrames, RelayMethod } from "./../../../types/relay.js";
|
|
4
|
-
import { ContentScriptDeclarative } from "./../../../types/content.js";
|
|
4
|
+
import { ContentScriptDeclarative } from "./../../../types/content/index.js";
|
|
5
5
|
class RelayParser_default extends ContentParser {
|
|
6
6
|
definition() {
|
|
7
7
|
return "defineRelay";
|
|
@@ -9,6 +9,10 @@ class RelayParser_default extends ContentParser {
|
|
|
9
9
|
agreement() {
|
|
10
10
|
return "init";
|
|
11
11
|
}
|
|
12
|
+
/** A Relay's default function initializes its transport; it is never an implicit content renderer. */
|
|
13
|
+
hasDefaultRender() {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
12
16
|
schema() {
|
|
13
17
|
return super.schema().extend({
|
|
14
18
|
allFrames: z.union([z.boolean(), z.nativeEnum(RelayAllFrames)]).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/entrypoint/parser/RelayParser.ts"],"sourcesContent":["import z from \"zod\";\n\nimport ContentParser from \"./ContentParser\";\n\nimport {RelayAllFrames, RelayEntrypointOptions, RelayMethod} from \"@typing/relay\";\nimport {EntrypointFile} from \"@typing/entrypoint\";\nimport {ContentScriptDeclarative} from \"@typing/content\";\n\nexport default class extends ContentParser<RelayEntrypointOptions> {\n protected definition(): string {\n return \"defineRelay\";\n }\n\n protected agreement(): string {\n return \"init\";\n }\n\n protected
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/entrypoint/parser/RelayParser.ts"],"sourcesContent":["import z from \"zod\";\n\nimport ContentParser from \"./ContentParser\";\n\nimport {RelayAllFrames, RelayEntrypointOptions, RelayMethod} from \"@typing/relay\";\nimport {EntrypointFile} from \"@typing/entrypoint\";\nimport {ContentScriptDeclarative} from \"@typing/content\";\n\nexport default class extends ContentParser<RelayEntrypointOptions> {\n protected definition(): string {\n return \"defineRelay\";\n }\n\n protected agreement(): string {\n return \"init\";\n }\n\n /** A Relay's default function initializes its transport; it is never an implicit content renderer. */\n protected hasDefaultRender(): boolean {\n return false;\n }\n\n protected schema() {\n return super.schema().extend({\n allFrames: z.union([z.boolean(), z.nativeEnum(RelayAllFrames)]).optional(),\n name: z\n .string()\n .trim()\n .min(1)\n .max(100)\n .regex(/^[\\p{L}_$][\\p{L}\\p{N}_$]*$/u, {\n message:\n \"Key must start with a Unicode letter, `$` or `_`, and may only contain letters, digits, `$` or `_`\",\n })\n .optional(),\n method: z.nativeEnum(RelayMethod).optional(),\n });\n }\n\n public options(file: EntrypointFile): RelayEntrypointOptions {\n const {declarative, method, ...options} = super.options(file);\n\n return {\n ...options,\n method,\n declarative:\n declarative === undefined\n ? method === RelayMethod.Scripting\n ? ContentScriptDeclarative.Optional\n : undefined\n : declarative,\n };\n }\n}\n"],"mappings":"AAAA,OAAO,OAAO;AAEd,OAAO,mBAAmB;AAE1B,SAAQ,gBAAwC,mBAAkB;AAElE,SAAQ,gCAA+B;AAEvC,MAAO,4BAAsB,cAAsC;AAAA,EACrD,aAAqB;AAC3B,WAAO;AAAA,EACX;AAAA,EAEU,YAAoB;AAC1B,WAAO;AAAA,EACX;AAAA;AAAA,EAGU,mBAA4B;AAClC,WAAO;AAAA,EACX;AAAA,EAEU,SAAS;AACf,WAAO,MAAM,OAAO,EAAE,OAAO;AAAA,MACzB,WAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,EAAE,WAAW,cAAc,CAAC,CAAC,EAAE,SAAS;AAAA,MACzE,MAAM,EACD,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,IAAI,GAAG,EACP,MAAM,+BAA+B;AAAA,QAClC,SACI;AAAA,MACR,CAAC,EACA,SAAS;AAAA,MACd,QAAQ,EAAE,WAAW,WAAW,EAAE,SAAS;AAAA,IAC/C,CAAC;AAAA,EACL;AAAA,EAEO,QAAQ,MAA8C;AACzD,UAAM,EAAC,aAAa,QAAQ,GAAG,QAAO,IAAI,MAAM,QAAQ,IAAI;AAE5D,WAAO;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MACA,aACI,gBAAgB,SACV,WAAW,YAAY,YACnB,yBAAyB,WACzB,SACJ;AAAA,IACd;AAAA,EACJ;AACJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExportValueKind } from "../../../file/index.js";
|
|
2
|
+
const hasContentScriptDefaultRender = (exported) => {
|
|
3
|
+
if (!exported) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
switch (exported.kind) {
|
|
7
|
+
case ExportValueKind.Function:
|
|
8
|
+
case ExportValueKind.Class:
|
|
9
|
+
case ExportValueKind.Jsx:
|
|
10
|
+
case ExportValueKind.Number:
|
|
11
|
+
return true;
|
|
12
|
+
case ExportValueKind.String:
|
|
13
|
+
return exported.value !== "";
|
|
14
|
+
default:
|
|
15
|
+
return exported.properties.includes("$$typeof") || ["type", "props", "key"].every((property) => exported.properties.includes(property));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
hasContentScriptDefaultRender
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=default-render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/cli/entrypoint/parser/utils/content/default-render.ts"],"sourcesContent":["import {ExportValueKind, type ExportValue} from \"../../../file\";\n\n/** Source metadata only: the CLI never loads a UI runtime to validate frame navigation. */\nexport const hasContentScriptDefaultRender = (exported?: ExportValue): boolean => {\n if (!exported) {\n return false;\n }\n\n switch (exported.kind) {\n case ExportValueKind.Function:\n case ExportValueKind.Class:\n case ExportValueKind.Jsx:\n case ExportValueKind.Number:\n return true;\n case ExportValueKind.String:\n return exported.value !== \"\";\n default:\n // Literal elements expose their runtime tag; inferred ReactElement/JSX.Element types\n // expose the public type/props/key fields instead (including imported element values).\n return (\n exported.properties.includes(\"$$typeof\") ||\n [\"type\", \"props\", \"key\"].every(property => exported.properties.includes(property))\n );\n }\n};\n"],"mappings":"AAAA,SAAQ,uBAAwC;AAGzC,MAAM,gCAAgC,CAAC,aAAoC;AAC9E,MAAI,CAAC,UAAU;AACX,WAAO;AAAA,EACX;AAEA,UAAQ,SAAS,MAAM;AAAA,IACnB,KAAK,gBAAgB;AAAA,IACrB,KAAK,gBAAgB;AAAA,IACrB,KAAK,gBAAgB;AAAA,IACrB,KAAK,gBAAgB;AACjB,aAAO;AAAA,IACX,KAAK,gBAAgB;AACjB,aAAO,SAAS,UAAU;AAAA,IAC9B;AAGI,aACI,SAAS,WAAW,SAAS,UAAU,KACvC,CAAC,QAAQ,SAAS,KAAK,EAAE,MAAM,cAAY,SAAS,WAAW,SAAS,QAAQ,CAAC;AAAA,EAE7F;AACJ;","names":[]}
|
|
@@ -13,23 +13,28 @@ var asset_default = definePlugin(() => {
|
|
|
13
13
|
module: {
|
|
14
14
|
rules: [
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
// Common binary resources work without a query. An explicit asset
|
|
17
|
+
// query also supports less common file formats, without hijacking code.
|
|
18
|
+
test: (file) => !/\.(?:[cm]?[jt]sx?|json|css|s[ac]ss|less|styl|vue|svelte)$/i.test(file),
|
|
17
19
|
resourceQuery: {
|
|
18
|
-
not: [/react/]
|
|
20
|
+
not: [/[?&]react(?:[=&]|$)/, /[?&]raw(?:[=&]|$)/]
|
|
19
21
|
},
|
|
20
22
|
oneOf: [
|
|
21
23
|
{
|
|
22
|
-
resourceQuery: /(chrome|browser)/,
|
|
24
|
+
resourceQuery: /[?&](chrome|browser)(?:[=&]|$)/,
|
|
23
25
|
type: "asset/resource",
|
|
26
|
+
// Both queries explicitly opt into an extension URL. Native CSS
|
|
27
|
+
// localization substitutes the installed extension ID/UUID on load.
|
|
24
28
|
generator: {
|
|
25
29
|
publicPath: `${browser === Browser.Firefox ? "moz" : "chrome"}-extension://__MSG_@@extension_id__/`
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
|
-
resourceQuery: /base64/,
|
|
33
|
+
resourceQuery: /[?&]base64(?:[=&]|$)/,
|
|
30
34
|
type: "asset/inline"
|
|
31
35
|
},
|
|
32
36
|
{
|
|
37
|
+
test: /\.(png|apng|jpe?g|gif|webp|svg|avif|tiff|bmp|ico|woff2?|eot|ttf|otf|mp3|wav|ogg|oga|opus|flac|aac|m4a|mp4|webm|ogv|mov|pdf|zip|gz|wasm)$/i,
|
|
33
38
|
type: "asset/resource"
|
|
34
39
|
}
|
|
35
40
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/plugins/asset.ts"],"sourcesContent":["import {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {appFilenameResolver, ReplacePlugin} from \"@cli/bundler\";\n\nimport {Browser} from \"@typing/browser\";\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:asset\",\n bundler: ({config}) => {\n const {app, browser, assetsDir, assetsFilename} = config;\n\n return {\n output: {\n assetModuleFilename: appFilenameResolver(app, assetsFilename, assetsDir),\n },\n module: {\n rules: [\n {\n test:
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/plugins/asset.ts"],"sourcesContent":["import {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {appFilenameResolver, ReplacePlugin} from \"@cli/bundler\";\n\nimport {Browser} from \"@typing/browser\";\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:asset\",\n bundler: ({config}) => {\n const {app, browser, assetsDir, assetsFilename} = config;\n\n return {\n output: {\n assetModuleFilename: appFilenameResolver(app, assetsFilename, assetsDir),\n },\n module: {\n rules: [\n {\n // Common binary resources work without a query. An explicit asset\n // query also supports less common file formats, without hijacking code.\n test: (file: string) =>\n !/\\.(?:[cm]?[jt]sx?|json|css|s[ac]ss|less|styl|vue|svelte)$/i.test(file),\n resourceQuery: {\n not: [/[?&]react(?:[=&]|$)/, /[?&]raw(?:[=&]|$)/],\n },\n oneOf: [\n {\n resourceQuery: /[?&](chrome|browser)(?:[=&]|$)/,\n type: \"asset/resource\",\n // Both queries explicitly opt into an extension URL. Native CSS\n // localization substitutes the installed extension ID/UUID on load.\n generator: {\n publicPath: `${browser === Browser.Firefox ? \"moz\" : \"chrome\"}-extension://__MSG_@@extension_id__/`,\n },\n },\n {\n resourceQuery: /[?&]base64(?:[=&]|$)/,\n type: \"asset/inline\",\n },\n {\n test: /\\.(png|apng|jpe?g|gif|webp|svg|avif|tiff|bmp|ico|woff2?|eot|ttf|otf|mp3|wav|ogg|oga|opus|flac|aac|m4a|mp4|webm|ogv|mov|pdf|zip|gz|wasm)$/i,\n type: \"asset/resource\",\n },\n ],\n },\n ],\n },\n plugins: [\n new ReplacePlugin({\n // Fix for asset/resource publicPath\n values: {\n \"__MSG_%40@extension_id__\": \"__MSG_@@extension_id__\",\n },\n }),\n ],\n } satisfies RspackConfig;\n },\n };\n});\n"],"mappings":"AAEA,SAAQ,oBAAmB;AAE3B,SAAQ,qBAAqB,qBAAoB;AAEjD,SAAQ,eAAc;AAEtB,IAAO,gBAAQ,aAAa,MAAM;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,YAAM,EAAC,KAAK,SAAS,WAAW,eAAc,IAAI;AAElD,aAAO;AAAA,QACH,QAAQ;AAAA,UACJ,qBAAqB,oBAAoB,KAAK,gBAAgB,SAAS;AAAA,QAC3E;AAAA,QACA,QAAQ;AAAA,UACJ,OAAO;AAAA,YACH;AAAA;AAAA;AAAA,cAGI,MAAM,CAAC,SACH,CAAC,6DAA6D,KAAK,IAAI;AAAA,cAC3E,eAAe;AAAA,gBACX,KAAK,CAAC,uBAAuB,mBAAmB;AAAA,cACpD;AAAA,cACA,OAAO;AAAA,gBACH;AAAA,kBACI,eAAe;AAAA,kBACf,MAAM;AAAA;AAAA;AAAA,kBAGN,WAAW;AAAA,oBACP,YAAY,GAAG,YAAY,QAAQ,UAAU,QAAQ,QAAQ;AAAA,kBACjE;AAAA,gBACJ;AAAA,gBACA;AAAA,kBACI,eAAe;AAAA,kBACf,MAAM;AAAA,gBACV;AAAA,gBACA;AAAA,kBACI,MAAM;AAAA,kBACN,MAAM;AAAA,gBACV;AAAA,cACJ;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,QACA,SAAS;AAAA,UACL,IAAI,cAAc;AAAA;AAAA,YAEd,QAAQ;AAAA,cACJ,4BAA4B;AAAA,YAChC;AAAA,UACJ,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
|
|
@@ -32,7 +32,7 @@ var background_default = definePlugin(() => {
|
|
|
32
32
|
}
|
|
33
33
|
return {};
|
|
34
34
|
}
|
|
35
|
-
const backgroundPlugin = EntrypointPlugin.from(await background.entry().entries()).virtual((file) => virtualBackgroundModule(file));
|
|
35
|
+
const backgroundPlugin = EntrypointPlugin.from(await background.entry().entries()).entryOptions({ asyncChunks: false, runtime: false }).virtual((file) => virtualBackgroundModule(file));
|
|
36
36
|
const commandPlugin = EntrypointPlugin.from(await command.entry().entries()).virtual((file) => command.virtual(file));
|
|
37
37
|
const servicePlugin = EntrypointPlugin.from(await service.entry().entries()).virtual((file) => service.virtual(file));
|
|
38
38
|
if (config.command === AppCommand.Watch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/plugins/background/index.ts"],"sourcesContent":["import {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\nimport {virtualBackgroundModule} from \"@cli/virtual/index.js\";\n\nimport {EntrypointPlugin} from \"@cli/bundler\";\n\nimport Background from \"./Background\";\nimport BackgroundEntry from \"./BackgroundEntry\";\nimport BackgroundManifest from \"./BackgroundManifest\";\nimport Command from \"./Command\";\nimport Service from \"./Service\";\nimport ServiceDeclaration from \"./ServiceDeclaration\";\n\nimport {Command as AppCommand} from \"@typing/app\";\n\nexport default definePlugin(() => {\n let background: Background;\n let command: Command;\n let service: Service;\n let serviceDeclaration: ServiceDeclaration;\n\n return {\n name: \"adnbn:background\",\n startup: async ({config}) => {\n background = new Background(config);\n command = new Command(config);\n service = new Service(config);\n serviceDeclaration = new ServiceDeclaration(config);\n },\n background: () => background.files(),\n command: () => command.files(),\n service: () => service.files(),\n bundler: async ({config}) => {\n serviceDeclaration.dictionary(await service.dictionary()).build();\n\n if ((await background.empty()) && (await command.empty()) && (await service.empty())) {\n if (config.debug) {\n console.warn(\"Background, command or service entries not found\");\n }\n\n return {};\n }\n\n // prettier-ignore\n const backgroundPlugin = EntrypointPlugin.from(await background.entry().entries())\n .virtual(file => virtualBackgroundModule(file));\n\n // prettier-ignore\n const commandPlugin = EntrypointPlugin.from(await command.entry().entries())\n .virtual(file => command.virtual(file));\n\n // prettier-ignore\n const servicePlugin = EntrypointPlugin.from(await service.entry().entries())\n .virtual(file => service.virtual(file));\n\n if (config.command === AppCommand.Watch) {\n backgroundPlugin.watch(() => background.clear().entry().entries());\n\n commandPlugin.watch(async () => {\n // Clear the command cache\n await command.clear().commands();\n\n return command.entry().entries();\n });\n\n servicePlugin.watch(async () => {\n serviceDeclaration.dictionary(await service.clear().dictionary()).build();\n\n return service.entry().entries();\n });\n }\n\n return {\n plugins: [servicePlugin, commandPlugin, backgroundPlugin],\n optimization: {\n splitChunks: {\n chunks(chunk) {\n return chunk.name !== BackgroundEntry.name;\n },\n },\n },\n } satisfies RspackConfig;\n },\n manifest: async ({manifest}) => {\n // prettier-ignore\n const mft = new BackgroundManifest()\n .add(background.entry())\n .add(command.entry())\n .add(service.entry());\n\n manifest\n .setBackground(\n (await mft.hasBackground())\n ? {\n entry: BackgroundEntry.name,\n persistent: await mft.isPersistent(),\n }\n : undefined\n )\n .setCommands(await command.manifest());\n\n const permissions = await mft.getPermissions();\n const optionalPermissions = await mft.getOptionalPermissions();\n const hostPermissions = await mft.getHostPermissions();\n const optionalHostPermissions = await mft.getOptionalHostPermissions();\n\n if (permissions.size > 0) {\n manifest.appendPermissions(permissions);\n }\n\n if (optionalPermissions.size > 0) {\n manifest.appendOptionalPermissions(optionalPermissions);\n }\n\n if (hostPermissions.size > 0) {\n manifest.appendHostPermissions(hostPermissions);\n }\n\n if (optionalHostPermissions.size > 0) {\n manifest.appendOptionalHostPermissions(optionalHostPermissions);\n }\n },\n };\n});\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/plugins/background/index.ts"],"sourcesContent":["import {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\nimport {virtualBackgroundModule} from \"@cli/virtual/index.js\";\n\nimport {EntrypointPlugin} from \"@cli/bundler\";\n\nimport Background from \"./Background\";\nimport BackgroundEntry from \"./BackgroundEntry\";\nimport BackgroundManifest from \"./BackgroundManifest\";\nimport Command from \"./Command\";\nimport Service from \"./Service\";\nimport ServiceDeclaration from \"./ServiceDeclaration\";\n\nimport {Command as AppCommand} from \"@typing/app\";\n\nexport default definePlugin(() => {\n let background: Background;\n let command: Command;\n let service: Service;\n let serviceDeclaration: ServiceDeclaration;\n\n return {\n name: \"adnbn:background\",\n startup: async ({config}) => {\n background = new Background(config);\n command = new Command(config);\n service = new Service(config);\n serviceDeclaration = new ServiceDeclaration(config);\n },\n background: () => background.files(),\n command: () => command.files(),\n service: () => service.files(),\n bundler: async ({config}) => {\n serviceDeclaration.dictionary(await service.dictionary()).build();\n\n if ((await background.empty()) && (await command.empty()) && (await service.empty())) {\n if (config.debug) {\n console.warn(\"Background, command or service entries not found\");\n }\n\n return {};\n }\n\n // prettier-ignore\n const backgroundPlugin = EntrypointPlugin.from(await background.entry().entries())\n .entryOptions({asyncChunks: false, runtime: false})\n .virtual(file => virtualBackgroundModule(file));\n\n // prettier-ignore\n const commandPlugin = EntrypointPlugin.from(await command.entry().entries())\n .virtual(file => command.virtual(file));\n\n // prettier-ignore\n const servicePlugin = EntrypointPlugin.from(await service.entry().entries())\n .virtual(file => service.virtual(file));\n\n if (config.command === AppCommand.Watch) {\n backgroundPlugin.watch(() => background.clear().entry().entries());\n\n commandPlugin.watch(async () => {\n // Clear the command cache\n await command.clear().commands();\n\n return command.entry().entries();\n });\n\n servicePlugin.watch(async () => {\n serviceDeclaration.dictionary(await service.clear().dictionary()).build();\n\n return service.entry().entries();\n });\n }\n\n return {\n plugins: [servicePlugin, commandPlugin, backgroundPlugin],\n optimization: {\n splitChunks: {\n chunks(chunk) {\n return chunk.name !== BackgroundEntry.name;\n },\n },\n },\n } satisfies RspackConfig;\n },\n manifest: async ({manifest}) => {\n // prettier-ignore\n const mft = new BackgroundManifest()\n .add(background.entry())\n .add(command.entry())\n .add(service.entry());\n\n manifest\n .setBackground(\n (await mft.hasBackground())\n ? {\n entry: BackgroundEntry.name,\n persistent: await mft.isPersistent(),\n }\n : undefined\n )\n .setCommands(await command.manifest());\n\n const permissions = await mft.getPermissions();\n const optionalPermissions = await mft.getOptionalPermissions();\n const hostPermissions = await mft.getHostPermissions();\n const optionalHostPermissions = await mft.getOptionalHostPermissions();\n\n if (permissions.size > 0) {\n manifest.appendPermissions(permissions);\n }\n\n if (optionalPermissions.size > 0) {\n manifest.appendOptionalPermissions(optionalPermissions);\n }\n\n if (hostPermissions.size > 0) {\n manifest.appendHostPermissions(hostPermissions);\n }\n\n if (optionalHostPermissions.size > 0) {\n manifest.appendOptionalHostPermissions(optionalHostPermissions);\n }\n },\n };\n});\n"],"mappings":"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","names":[]}
|
|
@@ -2,12 +2,12 @@ import ContentDriver from "./ContentDriver.js";
|
|
|
2
2
|
import { ContentProvider } from "./types.js";
|
|
3
3
|
import { ContentFinder } from "../../entrypoint/index.js";
|
|
4
4
|
import { ReadonlyConfig } from "../../../types/config.js";
|
|
5
|
-
import { ContentScriptEntrypointOptions } from "../../../types/content.js";
|
|
5
|
+
import { ContentScriptEntrypointOptions } from "../../../types/content/index.js";
|
|
6
6
|
import { EntrypointFile } from "../../../types/entrypoint.js";
|
|
7
7
|
export default class extends ContentFinder implements ContentProvider<ContentScriptEntrypointOptions> {
|
|
8
8
|
protected _driver?: ContentDriver<ContentScriptEntrypointOptions>;
|
|
9
9
|
constructor(config: ReadonlyConfig);
|
|
10
10
|
driver(): ContentDriver<ContentScriptEntrypointOptions>;
|
|
11
|
-
virtual(file: EntrypointFile): string;
|
|
11
|
+
virtual(file: EntrypointFile, options?: ContentScriptEntrypointOptions): string;
|
|
12
12
|
clear(): this;
|
|
13
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ContentDriver from "./ContentDriver.js";
|
|
2
2
|
import { ContentFinder } from "./../../../cli/entrypoint/index.js";
|
|
3
3
|
import { virtualContentScriptModule } from "./../../../cli/virtual/index.js";
|
|
4
|
+
import { isContentScriptFrameNavigation } from "./../../../shared/content/index.js";
|
|
4
5
|
class Content_default extends ContentFinder {
|
|
5
6
|
_driver;
|
|
6
7
|
constructor(config) {
|
|
@@ -9,11 +10,11 @@ class Content_default extends ContentFinder {
|
|
|
9
10
|
driver() {
|
|
10
11
|
return this._driver ?? (this._driver = new ContentDriver(this));
|
|
11
12
|
}
|
|
12
|
-
virtual(file) {
|
|
13
|
+
virtual(file, options) {
|
|
13
14
|
if (!this.holds(file)) {
|
|
14
15
|
throw new Error(`File ${file} not found for content script`);
|
|
15
16
|
}
|
|
16
|
-
return virtualContentScriptModule(file);
|
|
17
|
+
return virtualContentScriptModule(file, isContentScriptFrameNavigation(options == null ? void 0 : options.isolation));
|
|
17
18
|
}
|
|
18
19
|
clear() {
|
|
19
20
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/plugins/content/Content.ts"],"sourcesContent":["import ContentDriver from \"./ContentDriver\";\n\nimport {ContentProvider} from \"./types\";\n\nimport {ContentFinder} from \"@cli/entrypoint/index.js\";\nimport {virtualContentScriptModule} from \"@cli/virtual/index.js\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {ContentScriptEntrypointOptions} from \"@typing/content\";\nimport {EntrypointFile} from \"@typing/entrypoint\";\n\nexport default class extends ContentFinder implements ContentProvider<ContentScriptEntrypointOptions> {\n protected _driver?: ContentDriver<ContentScriptEntrypointOptions>;\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public driver(): ContentDriver<ContentScriptEntrypointOptions> {\n return (this._driver ??= new ContentDriver(this));\n }\n\n public virtual(file: EntrypointFile): string {\n if (!this.holds(file)) {\n throw new Error(`File ${file} not found for content script`);\n }\n\n return virtualContentScriptModule(file);\n }\n\n public clear(): this {\n this._driver?.clear();\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,OAAO,mBAAmB;AAI1B,SAAQ,qBAAoB;AAC5B,SAAQ,kCAAiC;
|
|
1
|
+
{"version":3,"sources":["../../../../src/cli/plugins/content/Content.ts"],"sourcesContent":["import ContentDriver from \"./ContentDriver\";\n\nimport {ContentProvider} from \"./types\";\n\nimport {ContentFinder} from \"@cli/entrypoint/index.js\";\nimport {virtualContentScriptModule} from \"@cli/virtual/index.js\";\nimport {isContentScriptFrameNavigation} from \"@shared/content\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {ContentScriptEntrypointOptions} from \"@typing/content\";\nimport {EntrypointFile} from \"@typing/entrypoint\";\n\nexport default class extends ContentFinder implements ContentProvider<ContentScriptEntrypointOptions> {\n protected _driver?: ContentDriver<ContentScriptEntrypointOptions>;\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public driver(): ContentDriver<ContentScriptEntrypointOptions> {\n return (this._driver ??= new ContentDriver(this));\n }\n\n public virtual(file: EntrypointFile, options?: ContentScriptEntrypointOptions): string {\n if (!this.holds(file)) {\n throw new Error(`File ${file} not found for content script`);\n }\n\n return virtualContentScriptModule(file, isContentScriptFrameNavigation(options?.isolation));\n }\n\n public clear(): this {\n this._driver?.clear();\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,OAAO,mBAAmB;AAI1B,SAAQ,qBAAoB;AAC5B,SAAQ,kCAAiC;AACzC,SAAQ,sCAAqC;AAM7C,MAAO,wBAAsB,cAAyE;AAAA,EACxF;AAAA,EAEV,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,SAAwD;AAC3D,WAAQ,KAAK,YAAL,KAAK,UAAY,IAAI,cAAc,IAAI;AAAA,EACnD;AAAA,EAEO,QAAQ,MAAsB,SAAkD;AACnF,QAAI,CAAC,KAAK,MAAM,IAAI,GAAG;AACnB,YAAM,IAAI,MAAM,QAAQ,IAAI,+BAA+B;AAAA,IAC/D;AAEA,WAAO,2BAA2B,MAAM,+BAA+B,mCAAS,SAAS,CAAC;AAAA,EAC9F;AAAA,EAEO,QAAc;AA/BzB;AAgCQ,eAAK,YAAL,mBAAc;AAEd,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContentDriver as ContentDriverContract, ContentItems } from "./types.js";
|
|
2
2
|
import { AbstractPluginFinder } from "../../entrypoint/index.js";
|
|
3
|
-
import { ContentScriptEntrypointOptions } from "../../../types/content.js";
|
|
3
|
+
import { ContentScriptEntrypointOptions } from "../../../types/content/index.js";
|
|
4
4
|
import { EntrypointFile, EntrypointNameGenerator, EntrypointOptions } from "../../../types/entrypoint.js";
|
|
5
5
|
import { ManifestOptionalPermissions, ManifestPermissions } from "../../../types/manifest.js";
|
|
6
6
|
/**
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import ContentName from "./ContentName.js";
|
|
2
2
|
import { ContentGroupItems, ContentProvider } from "./types.js";
|
|
3
3
|
import { ReadonlyConfig } from "../../../types/config.js";
|
|
4
|
-
import { ContentScriptEntrypointOptions } from "../../../types/content.js";
|
|
4
|
+
import { ContentScriptEntrypointOptions, ContentScriptWorld, type ContentScriptWorldValue } from "../../../types/content/index.js";
|
|
5
5
|
import { EntrypointEntries, EntrypointFile } from "../../../types/entrypoint.js";
|
|
6
6
|
import { ManifestContentScripts, ManifestHostPermissions, ManifestOptionalPermissions, ManifestPermissions } from "../../../types/manifest.js";
|
|
7
|
-
export default class {
|
|
8
|
-
protected readonly
|
|
7
|
+
export default class ContentManager {
|
|
8
|
+
protected readonly config: ReadonlyConfig;
|
|
9
|
+
protected readonly providers: Set<ContentProvider<ContentScriptEntrypointOptions>>;
|
|
9
10
|
protected readonly names: ContentName;
|
|
10
11
|
protected _group?: ContentGroupItems<ContentScriptEntrypointOptions>;
|
|
11
12
|
protected _hostPermissions?: [ManifestHostPermissions, ManifestHostPermissions];
|
|
@@ -13,8 +14,11 @@ export default class {
|
|
|
13
14
|
constructor(config: ReadonlyConfig);
|
|
14
15
|
provider(provider: ContentProvider<ContentScriptEntrypointOptions>): this;
|
|
15
16
|
protected getGroup(): Promise<ContentGroupItems<ContentScriptEntrypointOptions>>;
|
|
17
|
+
protected normalizeOptions(file: EntrypointFile, options: ContentScriptEntrypointOptions): ContentScriptEntrypointOptions;
|
|
16
18
|
group(): Promise<ContentGroupItems<ContentScriptEntrypointOptions>>;
|
|
17
19
|
entries(): Promise<EntrypointEntries>;
|
|
20
|
+
/** Settings are keyed by the final grouped entrypoint name, not the original source files. */
|
|
21
|
+
entryOptions(): Promise<ReadonlyMap<string, ContentScriptEntrypointOptions>>;
|
|
18
22
|
manifest(): Promise<ManifestContentScripts>;
|
|
19
23
|
hostPermissions(): Promise<ManifestHostPermissions>;
|
|
20
24
|
optionalHostPermissions(): Promise<ManifestHostPermissions>;
|
|
@@ -25,7 +29,6 @@ export default class {
|
|
|
25
29
|
protected calculatePermissions(): Promise<[ManifestPermissions, ManifestOptionalPermissions]>;
|
|
26
30
|
virtual(file: EntrypointFile): string;
|
|
27
31
|
empty(): Promise<boolean>;
|
|
28
|
-
|
|
29
|
-
likely(name?: string): boolean;
|
|
32
|
+
protected resolveWorld(world?: ContentScriptWorldValue): ContentScriptWorld;
|
|
30
33
|
clear(): this;
|
|
31
34
|
}
|
|
@@ -1,31 +1,59 @@
|
|
|
1
1
|
import ContentName from "./ContentName.js";
|
|
2
|
-
import { getContentScriptConfigFromOptions } from "./utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { getContentScriptConfigFromOptions, hasIsolatedTarget } from "./utils.js";
|
|
3
|
+
import { getContentChunkName } from "./bundler.js";
|
|
4
|
+
import {
|
|
5
|
+
ContentScriptDeclarative,
|
|
6
|
+
ContentScriptIsolation,
|
|
7
|
+
ContentScriptWorld
|
|
8
|
+
} from "./../../../types/content/index.js";
|
|
9
|
+
class ContentManager {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
this.config = config;
|
|
12
|
+
this.names = new ContentName(config);
|
|
13
|
+
Object.values(ContentScriptWorld).forEach((world) => this.names.reserve(getContentChunkName(world)));
|
|
14
|
+
}
|
|
15
|
+
config;
|
|
6
16
|
providers = /* @__PURE__ */ new Set();
|
|
7
17
|
names;
|
|
8
18
|
_group;
|
|
9
19
|
_hostPermissions;
|
|
10
20
|
_permissions;
|
|
11
|
-
constructor(config) {
|
|
12
|
-
this.names = new ContentName(config);
|
|
13
|
-
}
|
|
14
21
|
provider(provider) {
|
|
15
22
|
this.providers.add(provider);
|
|
16
23
|
return this;
|
|
17
24
|
}
|
|
18
25
|
async getGroup() {
|
|
19
|
-
const content = await Promise.all(
|
|
26
|
+
const content = await Promise.all(
|
|
27
|
+
Array.from(this.providers, (provider) => provider.driver().items())
|
|
28
|
+
);
|
|
20
29
|
const group = /* @__PURE__ */ new Map();
|
|
21
30
|
for (const items of content) {
|
|
22
31
|
for (const [name, item] of items) {
|
|
23
|
-
const
|
|
24
|
-
|
|
32
|
+
const options = this.normalizeOptions(item.file, item.options);
|
|
33
|
+
const entry = this.names.create(name, options);
|
|
34
|
+
group.set(entry, /* @__PURE__ */ new Set([...group.get(entry) || [], { ...item, options }]));
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
return group;
|
|
28
38
|
}
|
|
39
|
+
normalizeOptions(file, options) {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const world = this.resolveWorld(options.world);
|
|
42
|
+
if (this.config.manifestVersion !== 2) {
|
|
43
|
+
if (world === ContentScriptWorld.Main && (((_a = options.isolation) == null ? void 0 : _a.type) === ContentScriptIsolation.Shadow || ((_b = options.isolation) == null ? void 0 : _b.type) === ContentScriptIsolation.Iframe && !(((_c = options.isolation) == null ? void 0 : _c.src) && /^https?:\/\//.test(options.isolation.src)))) {
|
|
44
|
+
throw new Error(
|
|
45
|
+
`Content script "${file.file}" cannot use this isolation in the MAIN execution world; only external HTTP(S) isolation.src is supported`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return options;
|
|
49
|
+
}
|
|
50
|
+
if (world === ContentScriptWorld.Main) {
|
|
51
|
+
console.warn(
|
|
52
|
+
`Content script "${file.file}" requests world "MAIN", but Addon Bone does not support MAIN content scripts in Manifest V2. It will be built and run in ISOLATED.`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return { ...options, world: ContentScriptWorld.Isolated };
|
|
56
|
+
}
|
|
29
57
|
async group() {
|
|
30
58
|
return this._group ?? (this._group = await this.getGroup());
|
|
31
59
|
}
|
|
@@ -36,15 +64,29 @@ class ContentManager_default {
|
|
|
36
64
|
}
|
|
37
65
|
return entries;
|
|
38
66
|
}
|
|
39
|
-
|
|
40
|
-
|
|
67
|
+
/** Settings are keyed by the final grouped entrypoint name, not the original source files. */
|
|
68
|
+
async entryOptions() {
|
|
69
|
+
const entries = /* @__PURE__ */ new Map();
|
|
41
70
|
for (const [entry, items] of await this.group()) {
|
|
42
|
-
const options = Array.from(items, (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
const options = Array.from(items, (item) => item.options);
|
|
72
|
+
const worlds = new Set(options.map((option) => this.resolveWorld(option.world)));
|
|
73
|
+
if (worlds.size !== 1) {
|
|
74
|
+
throw new Error(`Content entrypoint "${entry}" cannot mix execution worlds`);
|
|
75
|
+
}
|
|
76
|
+
if (new Set(options.map(hasIsolatedTarget)).size !== 1) {
|
|
77
|
+
throw new Error(`Content entrypoint "${entry}" cannot mix isolation style delivery modes`);
|
|
78
|
+
}
|
|
79
|
+
entries.set(entry, Object.assign({}, ...options));
|
|
46
80
|
}
|
|
47
|
-
return
|
|
81
|
+
return entries;
|
|
82
|
+
}
|
|
83
|
+
async manifest() {
|
|
84
|
+
return new Set(
|
|
85
|
+
Array.from(await this.entryOptions(), ([entry, options]) => ({
|
|
86
|
+
entry,
|
|
87
|
+
...getContentScriptConfigFromOptions(options)
|
|
88
|
+
}))
|
|
89
|
+
);
|
|
48
90
|
}
|
|
49
91
|
async hostPermissions() {
|
|
50
92
|
return (await this.calculateHostPermissions())[0];
|
|
@@ -114,9 +156,18 @@ class ContentManager_default {
|
|
|
114
156
|
return [permissions, optionalPermissions];
|
|
115
157
|
}
|
|
116
158
|
virtual(file) {
|
|
159
|
+
if (!this._group) {
|
|
160
|
+
throw new Error(
|
|
161
|
+
`Cannot create virtual file "${file.file}": content group is not prepared. Await entries() or entryOptions() before virtual().`
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
const item = Array.from(this._group.values()).flatMap((items) => Array.from(items)).find((item2) => item2.file.file === file.file);
|
|
165
|
+
if (!item) {
|
|
166
|
+
throw new Error(`Virtual file "${file.file}" is not in the prepared content group.`);
|
|
167
|
+
}
|
|
117
168
|
for (const provider of this.providers) {
|
|
118
169
|
try {
|
|
119
|
-
return provider.virtual(file);
|
|
170
|
+
return provider.virtual(file, item.options);
|
|
120
171
|
} catch {
|
|
121
172
|
}
|
|
122
173
|
}
|
|
@@ -125,16 +176,16 @@ class ContentManager_default {
|
|
|
125
176
|
async empty() {
|
|
126
177
|
return (await this.group()).size === 0;
|
|
127
178
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
179
|
+
resolveWorld(world) {
|
|
180
|
+
switch (world) {
|
|
181
|
+
case void 0:
|
|
182
|
+
case ContentScriptWorld.Isolated:
|
|
183
|
+
return ContentScriptWorld.Isolated;
|
|
184
|
+
case ContentScriptWorld.Main:
|
|
185
|
+
return ContentScriptWorld.Main;
|
|
186
|
+
default:
|
|
187
|
+
throw new Error(`Unsupported content script execution world "${String(world)}"`);
|
|
134
188
|
}
|
|
135
|
-
return [EntrypointType.Relay, EntrypointType.ContentScript].some(
|
|
136
|
-
(type) => name === type || name.endsWith(`.${type}`)
|
|
137
|
-
);
|
|
138
189
|
}
|
|
139
190
|
clear() {
|
|
140
191
|
for (const provider of this.providers) {
|
|
@@ -148,6 +199,6 @@ class ContentManager_default {
|
|
|
148
199
|
}
|
|
149
200
|
}
|
|
150
201
|
export {
|
|
151
|
-
|
|
202
|
+
ContentManager as default
|
|
152
203
|
};
|
|
153
204
|
//# sourceMappingURL=ContentManager.js.map
|