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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/plugins/GenerateJsonPlugin.ts"],"sourcesContent":["import {Compilation, Compiler, sources} from \"@rspack/core\";\n\ntype JsonValue = string | number | boolean | null | JsonObject | JsonArray;\n\ninterface JsonObject {\n [key: string]: JsonValue;\n}\n\ntype JsonArray = JsonValue[];\n\nexport type GenerateJsonPluginData = Record<string, JsonValue>;\n\nexport type GenerateJsonPluginUpdate = () => Promise<GenerateJsonPluginData>;\n\nexport default class GenerateJsonPlugin {\n private readonly pluginName: string = \"GenerateJsonPlugin\";\n\n private update?: GenerateJsonPluginUpdate;\n\n constructor(protected data: GenerateJsonPluginData) {}\n\n public apply(compiler: Compiler): void {\n compiler.hooks.watchRun.tapPromise(this.pluginName, async () => {\n const update = this.update;\n\n if (update) {\n // Let the compiler fail this rebuild rather than emit stale JSON.\n this.data = await update();\n }\n });\n\n compiler.hooks.compilation.tap(this.pluginName, (compilation: Compilation) => {\n compilation.hooks.processAssets.tap(\n {\n name: this.pluginName,\n stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,\n },\n () => this.generateFiles(compilation)\n );\n });\n }\n\n public watch(update: GenerateJsonPluginUpdate): this {\n this.update = update;\n\n return this;\n }\n\n protected generateFiles(compilation: Compilation): void {\n Object.entries(this.data).forEach(([filename, jsonData]) => {\n const json = JSON.stringify(jsonData, null, 2);\n\n compilation.emitAsset(filename, new sources.RawSource(json));\n });\n }\n}\n"],"mappings":"AAAA,SAAQ,aAAuB,eAAc;AAc7C,MAAO,mBAAiC;AAAA,EAKpC,YAAsB,MAA8B;AAA9B;AAAA,EAA+B;AAAA,EAA/B;AAAA,EAJL,aAAqB;AAAA,EAE9B;AAAA,EAID,MAAM,UAA0B;AACnC,aAAS,MAAM,SAAS,WAAW,KAAK,YAAY,YAAY;AAC5D,YAAM,SAAS,KAAK;AAEpB,UAAI,QAAQ;AAER,aAAK,OAAO,MAAM,OAAO;AAAA,MAC7B;AAAA,IACJ,CAAC;AAED,aAAS,MAAM,YAAY,IAAI,KAAK,YAAY,CAAC,gBAA6B;AAC1E,kBAAY,MAAM,cAAc;AAAA,QAC5B;AAAA,UACI,MAAM,KAAK;AAAA,UACX,OAAO,YAAY;AAAA,QACvB;AAAA,QACA,MAAM,KAAK,cAAc,WAAW;AAAA,MACxC;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEO,MAAM,QAAwC;AACjD,SAAK,SAAS;AAEd,WAAO;AAAA,EACX;AAAA,EAEU,cAAc,aAAgC;AACpD,WAAO,QAAQ,KAAK,IAAI,EAAE,QAAQ,CAAC,CAAC,UAAU,QAAQ,MAAM;AACxD,YAAM,OAAO,KAAK,UAAU,UAAU,MAAM,CAAC;AAE7C,kBAAY,UAAU,UAAU,IAAI,QAAQ,UAAU,IAAI,CAAC;AAAA,IAC/D,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Compiler } from "@rspack/core";
|
|
2
|
-
import { ManifestBuilder } from "../../../types/manifest.js";
|
|
3
|
-
declare class ManifestPlugin {
|
|
4
|
-
private readonly manifest;
|
|
5
|
-
constructor(manifest: ManifestBuilder);
|
|
6
|
-
apply(compiler: Compiler): void;
|
|
7
|
-
private collectAllChunks;
|
|
8
|
-
private isAsset;
|
|
9
|
-
}
|
|
10
|
-
export default ManifestPlugin;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import rspack, { Compilation } from "@rspack/core";
|
|
2
|
-
import { toPosix } from "./../../../cli/utils/path.js";
|
|
3
|
-
class ManifestPlugin {
|
|
4
|
-
constructor(manifest) {
|
|
5
|
-
this.manifest = manifest;
|
|
6
|
-
}
|
|
7
|
-
manifest;
|
|
8
|
-
apply(compiler) {
|
|
9
|
-
compiler.hooks.compilation.tap("ManifestPlugin", (compilation) => {
|
|
10
|
-
compilation.hooks.processAssets.tap(
|
|
11
|
-
{
|
|
12
|
-
name: "ManifestPlugin",
|
|
13
|
-
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS
|
|
14
|
-
},
|
|
15
|
-
() => {
|
|
16
|
-
const entryDependencies = /* @__PURE__ */ new Map();
|
|
17
|
-
compilation.entrypoints.forEach((entryPoint, entryName) => {
|
|
18
|
-
const dependencies = {
|
|
19
|
-
assets: /* @__PURE__ */ new Set(),
|
|
20
|
-
css: /* @__PURE__ */ new Set(),
|
|
21
|
-
js: /* @__PURE__ */ new Set()
|
|
22
|
-
};
|
|
23
|
-
const allChunks = /* @__PURE__ */ new Set();
|
|
24
|
-
this.collectAllChunks(entryPoint, allChunks);
|
|
25
|
-
allChunks.forEach((chunk) => {
|
|
26
|
-
chunk.files.forEach((fileName) => {
|
|
27
|
-
fileName = toPosix(fileName);
|
|
28
|
-
if (fileName.endsWith(".js")) {
|
|
29
|
-
dependencies.js.add(fileName);
|
|
30
|
-
} else if (fileName.endsWith(".css")) {
|
|
31
|
-
dependencies.css.add(fileName);
|
|
32
|
-
} else if (this.isAsset(fileName)) {
|
|
33
|
-
dependencies.assets.add(fileName);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const auxiliaryFiles = chunk.auxiliaryFiles || [];
|
|
37
|
-
auxiliaryFiles.forEach((fileName) => {
|
|
38
|
-
fileName = toPosix(fileName);
|
|
39
|
-
if (fileName.endsWith(".css")) {
|
|
40
|
-
dependencies.css.add(fileName);
|
|
41
|
-
} else if (this.isAsset(fileName)) {
|
|
42
|
-
dependencies.assets.add(fileName);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
entryDependencies.set(entryName, dependencies);
|
|
47
|
-
});
|
|
48
|
-
const manifest = this.manifest.setDependencies(entryDependencies).get();
|
|
49
|
-
const json = JSON.stringify(manifest, null, 2);
|
|
50
|
-
compilation.emitAsset("manifest.json", new rspack.sources.RawSource(json));
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
collectAllChunks(entryPointOrChunkGroup, collectedChunks) {
|
|
56
|
-
if (entryPointOrChunkGroup.chunks) {
|
|
57
|
-
entryPointOrChunkGroup.chunks.forEach((chunk) => {
|
|
58
|
-
if (!collectedChunks.has(chunk)) {
|
|
59
|
-
collectedChunks.add(chunk);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (entryPointOrChunkGroup.childrenIterable) {
|
|
64
|
-
for (const childGroup of entryPointOrChunkGroup.childrenIterable) {
|
|
65
|
-
this.collectAllChunks(childGroup, collectedChunks);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return collectedChunks;
|
|
69
|
-
}
|
|
70
|
-
isAsset(file) {
|
|
71
|
-
return /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/.test(file);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var ManifestPlugin_default = ManifestPlugin;
|
|
75
|
-
export {
|
|
76
|
-
ManifestPlugin_default as default
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=ManifestPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/plugins/ManifestPlugin.ts"],"sourcesContent":["import rspack, {Chunk, Compilation, Compiler} from \"@rspack/core\";\n\nimport {toPosix} from \"@cli/utils/path\";\n\nimport {ManifestBuilder, ManifestDependencies, ManifestDependency} from \"@typing/manifest\";\n\nclass ManifestPlugin {\n constructor(private readonly manifest: ManifestBuilder) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.compilation.tap(\"ManifestPlugin\", compilation => {\n compilation.hooks.processAssets.tap(\n {\n name: \"ManifestPlugin\",\n stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n () => {\n const entryDependencies: ManifestDependencies = new Map();\n\n compilation.entrypoints.forEach((entryPoint, entryName) => {\n const dependencies: ManifestDependency = {\n assets: new Set(),\n css: new Set(),\n js: new Set(),\n };\n\n const allChunks = new Set<Chunk>();\n\n this.collectAllChunks(entryPoint, allChunks);\n\n allChunks.forEach((chunk: Chunk) => {\n chunk.files.forEach((fileName: string) => {\n fileName = toPosix(fileName);\n\n if (fileName.endsWith(\".js\")) {\n dependencies.js.add(fileName);\n } else if (fileName.endsWith(\".css\")) {\n dependencies.css.add(fileName);\n } else if (this.isAsset(fileName)) {\n dependencies.assets.add(fileName);\n }\n });\n\n const auxiliaryFiles = chunk.auxiliaryFiles || [];\n\n auxiliaryFiles.forEach((fileName: string) => {\n fileName = toPosix(fileName);\n\n if (fileName.endsWith(\".css\")) {\n dependencies.css.add(fileName);\n } else if (this.isAsset(fileName)) {\n dependencies.assets.add(fileName);\n }\n });\n });\n\n entryDependencies.set(entryName, dependencies);\n });\n\n const manifest = this.manifest.setDependencies(entryDependencies).get();\n const json = JSON.stringify(manifest, null, 2);\n\n compilation.emitAsset(\"manifest.json\", new rspack.sources.RawSource(json));\n }\n );\n });\n }\n\n private collectAllChunks(entryPointOrChunkGroup: any, collectedChunks: Set<Chunk>): Set<Chunk> {\n if (entryPointOrChunkGroup.chunks) {\n entryPointOrChunkGroup.chunks.forEach((chunk: Chunk) => {\n if (!collectedChunks.has(chunk)) {\n collectedChunks.add(chunk);\n }\n });\n }\n\n if (entryPointOrChunkGroup.childrenIterable) {\n for (const childGroup of entryPointOrChunkGroup.childrenIterable) {\n this.collectAllChunks(childGroup, collectedChunks);\n }\n }\n\n return collectedChunks;\n }\n\n private isAsset(file: string): boolean {\n return /\\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/.test(file);\n }\n}\n\nexport default ManifestPlugin;\n"],"mappings":"AAAA,OAAO,UAAgB,mBAA4B;AAEnD,SAAQ,eAAc;AAItB,MAAM,eAAe;AAAA,EACjB,YAA6B,UAA2B;AAA3B;AAAA,EAA4B;AAAA,EAA5B;AAAA,EAE7B,MAAM,UAA0B;AAC5B,aAAS,MAAM,YAAY,IAAI,kBAAkB,iBAAe;AAC5D,kBAAY,MAAM,cAAc;AAAA,QAC5B;AAAA,UACI,MAAM;AAAA,UACN,OAAO,YAAY;AAAA,QACvB;AAAA,QACA,MAAM;AACF,gBAAM,oBAA0C,oBAAI,IAAI;AAExD,sBAAY,YAAY,QAAQ,CAAC,YAAY,cAAc;AACvD,kBAAM,eAAmC;AAAA,cACrC,QAAQ,oBAAI,IAAI;AAAA,cAChB,KAAK,oBAAI,IAAI;AAAA,cACb,IAAI,oBAAI,IAAI;AAAA,YAChB;AAEA,kBAAM,YAAY,oBAAI,IAAW;AAEjC,iBAAK,iBAAiB,YAAY,SAAS;AAE3C,sBAAU,QAAQ,CAAC,UAAiB;AAChC,oBAAM,MAAM,QAAQ,CAAC,aAAqB;AACtC,2BAAW,QAAQ,QAAQ;AAE3B,oBAAI,SAAS,SAAS,KAAK,GAAG;AAC1B,+BAAa,GAAG,IAAI,QAAQ;AAAA,gBAChC,WAAW,SAAS,SAAS,MAAM,GAAG;AAClC,+BAAa,IAAI,IAAI,QAAQ;AAAA,gBACjC,WAAW,KAAK,QAAQ,QAAQ,GAAG;AAC/B,+BAAa,OAAO,IAAI,QAAQ;AAAA,gBACpC;AAAA,cACJ,CAAC;AAED,oBAAM,iBAAiB,MAAM,kBAAkB,CAAC;AAEhD,6BAAe,QAAQ,CAAC,aAAqB;AACzC,2BAAW,QAAQ,QAAQ;AAE3B,oBAAI,SAAS,SAAS,MAAM,GAAG;AAC3B,+BAAa,IAAI,IAAI,QAAQ;AAAA,gBACjC,WAAW,KAAK,QAAQ,QAAQ,GAAG;AAC/B,+BAAa,OAAO,IAAI,QAAQ;AAAA,gBACpC;AAAA,cACJ,CAAC;AAAA,YACL,CAAC;AAED,8BAAkB,IAAI,WAAW,YAAY;AAAA,UACjD,CAAC;AAED,gBAAM,WAAW,KAAK,SAAS,gBAAgB,iBAAiB,EAAE,IAAI;AACtE,gBAAM,OAAO,KAAK,UAAU,UAAU,MAAM,CAAC;AAE7C,sBAAY,UAAU,iBAAiB,IAAI,OAAO,QAAQ,UAAU,IAAI,CAAC;AAAA,QAC7E;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEQ,iBAAiB,wBAA6B,iBAAyC;AAC3F,QAAI,uBAAuB,QAAQ;AAC/B,6BAAuB,OAAO,QAAQ,CAAC,UAAiB;AACpD,YAAI,CAAC,gBAAgB,IAAI,KAAK,GAAG;AAC7B,0BAAgB,IAAI,KAAK;AAAA,QAC7B;AAAA,MACJ,CAAC;AAAA,IACL;AAEA,QAAI,uBAAuB,kBAAkB;AACzC,iBAAW,cAAc,uBAAuB,kBAAkB;AAC9D,aAAK,iBAAiB,YAAY,eAAe;AAAA,MACrD;AAAA,IACJ;AAEA,WAAO;AAAA,EACX;AAAA,EAEQ,QAAQ,MAAuB;AACnC,WAAO,+CAA+C,KAAK,IAAI;AAAA,EACnE;AACJ;AAEA,IAAO,yBAAQ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/plugins/ReplacePlugin.ts"],"sourcesContent":["import {type Compiler} from \"@rspack/core\";\n\ninterface ReplaceOptions {\n values: Record<string, string>;\n}\n\nexport default class ReplacePlugin {\n constructor(private options: ReplaceOptions) {}\n\n apply(compiler: Compiler): void {\n compiler.hooks.emit.tap(\"ReplacePlugin\", compilation => {\n for (const filename in compilation.assets) {\n let content = compilation.assets[filename].source().toString();\n let hasChanges = false;\n\n for (const [search, replace] of Object.entries(this.options.values)) {\n if (content.includes(search)) {\n content = content.replace(new RegExp(search, \"g\"), replace);\n hasChanges = true;\n }\n }\n\n if (hasChanges) {\n const sourceMap = {\n version: 3,\n sources: [],\n names: [],\n mappings: \"\",\n file: filename,\n };\n\n compilation.assets[filename] = {\n source: () => content,\n size: () => content.length,\n buffer: () => Buffer.from(content),\n map: () => sourceMap,\n sourceAndMap: () => ({source: content, map: sourceMap}),\n updateHash: () => {},\n };\n }\n }\n });\n }\n}\n"],"mappings":"AAMA,MAAO,cAA4B;AAAA,EAC/B,YAAoB,SAAyB;AAAzB;AAAA,EAA0B;AAAA,EAA1B;AAAA,EAEpB,MAAM,UAA0B;AAC5B,aAAS,MAAM,KAAK,IAAI,iBAAiB,iBAAe;AACpD,iBAAW,YAAY,YAAY,QAAQ;AACvC,YAAI,UAAU,YAAY,OAAO,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC7D,YAAI,aAAa;AAEjB,mBAAW,CAAC,QAAQ,OAAO,KAAK,OAAO,QAAQ,KAAK,QAAQ,MAAM,GAAG;AACjE,cAAI,QAAQ,SAAS,MAAM,GAAG;AAC1B,sBAAU,QAAQ,QAAQ,IAAI,OAAO,QAAQ,GAAG,GAAG,OAAO;AAC1D,yBAAa;AAAA,UACjB;AAAA,QACJ;AAEA,YAAI,YAAY;AACZ,gBAAM,YAAY;AAAA,YACd,SAAS;AAAA,YACT,SAAS,CAAC;AAAA,YACV,OAAO,CAAC;AAAA,YACR,UAAU;AAAA,YACV,MAAM;AAAA,UACV;AAEA,sBAAY,OAAO,QAAQ,IAAI;AAAA,YAC3B,QAAQ,MAAM;AAAA,YACd,MAAM,MAAM,QAAQ;AAAA,YACpB,QAAQ,MAAM,OAAO,KAAK,OAAO;AAAA,YACjC,KAAK,MAAM;AAAA,YACX,cAAc,OAAO,EAAC,QAAQ,SAAS,KAAK,UAAS;AAAA,YACrD,YAAY,MAAM;AAAA,YAAC;AAAA,UACvB;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
class WatchPlugin {
|
|
2
|
-
constructor(callback) {
|
|
3
|
-
this.callback = callback;
|
|
4
|
-
}
|
|
5
|
-
callback;
|
|
6
|
-
apply(compiler) {
|
|
7
|
-
compiler.hooks.watchRun.tapAsync("WatchPlugin", async (compiler2, callback) => {
|
|
8
|
-
try {
|
|
9
|
-
const { modifiedFiles = /* @__PURE__ */ new Set() } = compiler2;
|
|
10
|
-
await this.callback(modifiedFiles);
|
|
11
|
-
callback();
|
|
12
|
-
} catch (e) {
|
|
13
|
-
callback(e);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
WatchPlugin as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=WatchPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/plugins/WatchPlugin.ts"],"sourcesContent":["import {Compiler} from \"@rspack/core\";\n\nexport type WatchPluginCallback = (files: ReadonlySet<string>) => Promise<void>;\n\nexport default class WatchPlugin {\n constructor(private readonly callback: WatchPluginCallback) {}\n\n public apply(compiler: Compiler): void {\n compiler.hooks.watchRun.tapAsync(\"WatchPlugin\", async (compiler, callback) => {\n try {\n const {modifiedFiles = new Set()} = compiler;\n\n await this.callback(modifiedFiles);\n\n callback();\n } catch (e) {\n callback(e as Error);\n }\n });\n }\n}\n"],"mappings":"AAIA,MAAO,YAA0B;AAAA,EAC7B,YAA6B,UAA+B;AAA/B;AAAA,EAAgC;AAAA,EAAhC;AAAA,EAEtB,MAAM,UAA0B;AACnC,aAAS,MAAM,SAAS,SAAS,eAAe,OAAOA,WAAU,aAAa;AAC1E,UAAI;AACA,cAAM,EAAC,gBAAgB,oBAAI,IAAI,EAAC,IAAIA;AAEpC,cAAM,KAAK,SAAS,aAAa;AAEjC,iBAAS;AAAA,MACb,SAAS,GAAG;AACR,iBAAS,CAAU;AAAA,MACvB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":["compiler"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
import path from "path";
|
|
3
|
-
const appFilenameResolver = (app, filename, dirname) => (pathData, assetInfo) => {
|
|
4
|
-
app = _.kebabCase(app);
|
|
5
|
-
let name = _.isFunction(filename) ? filename(pathData, assetInfo) : filename;
|
|
6
|
-
name = name.replaceAll("[app]", app);
|
|
7
|
-
if (dirname) {
|
|
8
|
-
return path.posix.join(dirname, name);
|
|
9
|
-
}
|
|
10
|
-
return name;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
appFilenameResolver
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=output.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/cli/bundler/utils/output.ts"],"sourcesContent":["import {Filename} from \"@rspack/core\";\nimport _ from \"lodash\";\nimport path from \"path\";\n\n// prettier-ignore\nexport const appFilenameResolver =\n (app: string, filename: Filename, dirname?: string): Extract<Filename, Filename> =>\n (pathData, assetInfo): string => {\n app = _.kebabCase(app);\n\n let name = _.isFunction(filename) ? filename(pathData, assetInfo) : filename;\n\n name = name.replaceAll(\"[app]\", app);\n\n if (dirname) {\n return path.posix.join(dirname, name);\n }\n\n return name;\n };\n"],"mappings":"AACA,OAAO,OAAO;AACd,OAAO,UAAU;AAGV,MAAM,sBACT,CAAC,KAAa,UAAoB,YAC9B,CAAC,UAAU,cAAsB;AAC7B,QAAM,EAAE,UAAU,GAAG;AAErB,MAAI,OAAO,EAAE,WAAW,QAAQ,IAAI,SAAS,UAAU,SAAS,IAAI;AAEpE,SAAO,KAAK,WAAW,SAAS,GAAG;AAEnC,MAAI,SAAS;AACT,WAAO,KAAK,MAAM,KAAK,SAAS,IAAI;AAAA,EACxC;AAEA,SAAO;AACX;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/cli/entrypoint/finder/tests/fixtures/options/discovery/advanced.options/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
import { definePlugin } from "./../../main/plugin.js";
|
|
3
|
-
import { appFilenameResolver } from "./../../cli/bundler/index.js";
|
|
4
|
-
import { getOutputPath, getResolvePath } from "./../../cli/resolvers/path.js";
|
|
5
|
-
import { Command } from "./../../types/app.js";
|
|
6
|
-
var output_default = definePlugin(() => {
|
|
7
|
-
return {
|
|
8
|
-
name: "adnbn:output",
|
|
9
|
-
bundler: ({ config }) => {
|
|
10
|
-
const { app, jsDir, jsFilename } = config;
|
|
11
|
-
const kebabApp = _.kebabCase(app);
|
|
12
|
-
const camelApp = _.camelCase(app);
|
|
13
|
-
const filename = appFilenameResolver(app, jsFilename, jsDir);
|
|
14
|
-
return {
|
|
15
|
-
output: {
|
|
16
|
-
path: getResolvePath(getOutputPath(config)),
|
|
17
|
-
filename,
|
|
18
|
-
chunkFilename: filename,
|
|
19
|
-
hashSalt: kebabApp,
|
|
20
|
-
hotUpdateGlobal: camelApp + "HotUpdate",
|
|
21
|
-
chunkLoadingGlobal: camelApp + "ChunkLoading",
|
|
22
|
-
uniqueName: kebabApp,
|
|
23
|
-
clean: config.command === Command.Build
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
export {
|
|
30
|
-
output_default as default
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=output.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/plugins/output.ts"],"sourcesContent":["import _ from \"lodash\";\nimport {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {appFilenameResolver} from \"@cli/bundler\";\nimport {getOutputPath, getResolvePath} from \"@cli/resolvers/path\";\n\nimport {Command} from \"@typing/app\";\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:output\",\n bundler: ({config}) => {\n const {app, jsDir, jsFilename} = config;\n\n const kebabApp = _.kebabCase(app);\n const camelApp = _.camelCase(app);\n\n const filename = appFilenameResolver(app, jsFilename, jsDir);\n\n return {\n output: {\n path: getResolvePath(getOutputPath(config)),\n filename,\n chunkFilename: filename,\n hashSalt: kebabApp,\n hotUpdateGlobal: camelApp + \"HotUpdate\",\n chunkLoadingGlobal: camelApp + \"ChunkLoading\",\n uniqueName: kebabApp,\n clean: config.command === Command.Build,\n },\n } satisfies RspackConfig;\n },\n };\n});\n"],"mappings":"AAAA,OAAO,OAAO;AAGd,SAAQ,oBAAmB;AAE3B,SAAQ,2BAA0B;AAClC,SAAQ,eAAe,sBAAqB;AAE5C,SAAQ,eAAc;AAEtB,IAAO,iBAAQ,aAAa,MAAM;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,YAAM,EAAC,KAAK,OAAO,WAAU,IAAI;AAEjC,YAAM,WAAW,EAAE,UAAU,GAAG;AAChC,YAAM,WAAW,EAAE,UAAU,GAAG;AAEhC,YAAM,WAAW,oBAAoB,KAAK,YAAY,KAAK;AAE3D,aAAO;AAAA,QACH,QAAQ;AAAA,UACJ,MAAM,eAAe,cAAc,MAAM,CAAC;AAAA,UAC1C;AAAA,UACA,eAAe;AAAA,UACf,UAAU;AAAA,UACV,iBAAiB,WAAW;AAAA,UAC5B,oBAAoB,WAAW;AAAA,UAC/B,YAAY;AAAA,UACZ,OAAO,OAAO,YAAY,QAAQ;AAAA,QACtC;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./render.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/entry/content/adapters/react/resolvers/index.ts"],"sourcesContent":["export * from \"./render\";\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/AbstractMarker.ts"],"sourcesContent":["import {ContentScriptAnchor, ContentScriptMarkerContract, ContentScriptMarkerValue} from \"@typing/content\";\n\nexport default abstract class implements ContentScriptMarkerContract {\n public abstract mark(element: Element, value: ContentScriptMarkerValue): boolean;\n\n public abstract unmark(element: Element): boolean;\n\n public abstract isMarked(element: Element): boolean;\n\n public abstract value(element: Element): ContentScriptMarkerValue | undefined;\n\n protected constructor(protected anchor: ContentScriptAnchor) {}\n\n public for(anchor: ContentScriptAnchor): ContentScriptMarkerContract {\n this.anchor = anchor;\n\n return this;\n }\n\n public unmarked(): Element[] {\n return this.query(false);\n }\n\n public marked(): Element[] {\n return this.query(true);\n }\n\n public mount(element: Element): boolean {\n return this.mark(element, ContentScriptMarkerValue.Mounted);\n }\n\n public unmount(element: Element): boolean {\n return this.mark(element, ContentScriptMarkerValue.Unmounted);\n }\n\n public reset(): ContentScriptMarkerContract {\n for (const element of this.marked()) {\n this.unmark(element);\n }\n\n return this;\n }\n\n protected query(marked: boolean): Element[] {\n const anchor = this.anchor;\n\n if (anchor instanceof Element) {\n const isMarked = this.isMarked(anchor);\n\n if ((isMarked && marked) || (!isMarked && !marked)) {\n return [anchor];\n }\n } else if (typeof anchor === \"string\") {\n return this.queryAnchor(anchor, marked);\n }\n\n return [];\n }\n\n protected queryAnchor(anchor: string, marked: boolean = false): Element[] {\n try {\n if (anchor.startsWith(\"/\")) {\n return this.queryXpath(anchor, marked);\n }\n\n return this.querySelector(anchor, marked);\n } catch (e) {\n console.error(\"Invalid anchor format. Expected a valid string (CSS selector/XPath)\", e);\n\n return [];\n }\n }\n\n protected querySelector(selector: string, _marked: boolean = false): Element[] {\n return Array.from(document.querySelectorAll(selector));\n }\n\n protected queryXpath(xpath: string, _marked: boolean = false): Element[] {\n const elements: Element[] = [];\n\n const result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\n for (let i = 0; i < result.snapshotLength; i++) {\n elements.push(result.snapshotItem(i) as Element);\n }\n\n return elements;\n }\n\n protected isValidValue(value: any): value is ContentScriptMarkerValue {\n return [ContentScriptMarkerValue.Unmounted, ContentScriptMarkerValue.Mounted].includes(value);\n }\n}\n"],"mappings":"AAAA,SAA0D,gCAA+B;AAEzF,MAAO,uBAA8D;AAAA,EASvD,YAAsB,QAA6B;AAA7B;AAAA,EAA8B;AAAA,EAA9B;AAAA,EAEzB,IAAI,QAA0D;AACjE,SAAK,SAAS;AAEd,WAAO;AAAA,EACX;AAAA,EAEO,WAAsB;AACzB,WAAO,KAAK,MAAM,KAAK;AAAA,EAC3B;AAAA,EAEO,SAAoB;AACvB,WAAO,KAAK,MAAM,IAAI;AAAA,EAC1B;AAAA,EAEO,MAAM,SAA2B;AACpC,WAAO,KAAK,KAAK,SAAS,yBAAyB,OAAO;AAAA,EAC9D;AAAA,EAEO,QAAQ,SAA2B;AACtC,WAAO,KAAK,KAAK,SAAS,yBAAyB,SAAS;AAAA,EAChE;AAAA,EAEO,QAAqC;AACxC,eAAW,WAAW,KAAK,OAAO,GAAG;AACjC,WAAK,OAAO,OAAO;AAAA,IACvB;AAEA,WAAO;AAAA,EACX;AAAA,EAEU,MAAM,QAA4B;AACxC,UAAM,SAAS,KAAK;AAEpB,QAAI,kBAAkB,SAAS;AAC3B,YAAM,WAAW,KAAK,SAAS,MAAM;AAErC,UAAK,YAAY,UAAY,CAAC,YAAY,CAAC,QAAS;AAChD,eAAO,CAAC,MAAM;AAAA,MAClB;AAAA,IACJ,WAAW,OAAO,WAAW,UAAU;AACnC,aAAO,KAAK,YAAY,QAAQ,MAAM;AAAA,IAC1C;AAEA,WAAO,CAAC;AAAA,EACZ;AAAA,EAEU,YAAY,QAAgB,SAAkB,OAAkB;AACtE,QAAI;AACA,UAAI,OAAO,WAAW,GAAG,GAAG;AACxB,eAAO,KAAK,WAAW,QAAQ,MAAM;AAAA,MACzC;AAEA,aAAO,KAAK,cAAc,QAAQ,MAAM;AAAA,IAC5C,SAAS,GAAG;AACR,cAAQ,MAAM,uEAAuE,CAAC;AAEtF,aAAO,CAAC;AAAA,IACZ;AAAA,EACJ;AAAA,EAEU,cAAc,UAAkB,UAAmB,OAAkB;AAC3E,WAAO,MAAM,KAAK,SAAS,iBAAiB,QAAQ,CAAC;AAAA,EACzD;AAAA,EAEU,WAAW,OAAe,UAAmB,OAAkB;AACrE,UAAM,WAAsB,CAAC;AAE7B,UAAM,SAAS,SAAS,SAAS,OAAO,UAAU,MAAM,YAAY,4BAA4B,IAAI;AAEpG,aAAS,IAAI,GAAG,IAAI,OAAO,gBAAgB,KAAK;AAC5C,eAAS,KAAK,OAAO,aAAa,CAAC,CAAY;AAAA,IACnD;AAEA,WAAO;AAAA,EACX;AAAA,EAEU,aAAa,OAA+C;AAClE,WAAO,CAAC,yBAAyB,WAAW,yBAAyB,OAAO,EAAE,SAAS,KAAK;AAAA,EAChG;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/AttributeMarker.ts"],"sourcesContent":["import {customAlphabet} from \"nanoid\";\n\nimport AbstractMarker from \"./AbstractMarker\";\n\nimport {ContentScriptAnchor, ContentScriptMarkerValue} from \"@typing/content\";\n\nexport default class extends AbstractMarker {\n protected readonly attr: string;\n\n constructor(anchor?: ContentScriptAnchor, attr?: string) {\n super(anchor);\n\n this.attr = attr ?? `data-${customAlphabet(\"abcdefghijklmnopqrstuvwxyz\", 7)()}`;\n }\n\n public isMarked(element: Element): boolean {\n return element.hasAttribute(this.attr);\n }\n\n public mark(element: Element, value: ContentScriptMarkerValue): boolean {\n element.setAttribute(this.attr, value);\n\n return true;\n }\n\n public unmark(element: Element): boolean {\n element.removeAttribute(this.attr);\n\n return true;\n }\n\n public value(element: Element): ContentScriptMarkerValue | undefined {\n const value = element.getAttribute(this.attr);\n\n return this.isValidValue(value) ? value : undefined;\n }\n\n protected querySelector(selector: string, marked: boolean = false): Element[] {\n const filter = marked ? `[${this.attr}]` : `:not([${this.attr}])`;\n\n return super.querySelector(`:is(${selector})${filter}`, marked);\n }\n\n protected queryXpath(xpath: string, marked: boolean = false): Element[] {\n const filter = marked ? `[@${this.attr}]` : `[not(@${this.attr})]`;\n\n return super.queryXpath(`(${xpath.trim()})${filter}`, marked);\n }\n}\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAE7B,OAAO,oBAAoB;AAI3B,MAAO,gCAAsB,eAAe;AAAA,EACrB;AAAA,EAEnB,YAAY,QAA8B,MAAe;AACrD,UAAM,MAAM;AAEZ,SAAK,OAAO,QAAQ,QAAQ,eAAe,8BAA8B,CAAC,EAAE,CAAC;AAAA,EACjF;AAAA,EAEO,SAAS,SAA2B;AACvC,WAAO,QAAQ,aAAa,KAAK,IAAI;AAAA,EACzC;AAAA,EAEO,KAAK,SAAkB,OAA0C;AACpE,YAAQ,aAAa,KAAK,MAAM,KAAK;AAErC,WAAO;AAAA,EACX;AAAA,EAEO,OAAO,SAA2B;AACrC,YAAQ,gBAAgB,KAAK,IAAI;AAEjC,WAAO;AAAA,EACX;AAAA,EAEO,MAAM,SAAwD;AACjE,UAAM,QAAQ,QAAQ,aAAa,KAAK,IAAI;AAE5C,WAAO,KAAK,aAAa,KAAK,IAAI,QAAQ;AAAA,EAC9C;AAAA,EAEU,cAAc,UAAkB,SAAkB,OAAkB;AAC1E,UAAM,SAAS,SAAS,IAAI,KAAK,IAAI,MAAM,SAAS,KAAK,IAAI;AAE7D,WAAO,MAAM,cAAc,OAAO,QAAQ,IAAI,MAAM,IAAI,MAAM;AAAA,EAClE;AAAA,EAEU,WAAW,OAAe,SAAkB,OAAkB;AACpE,UAAM,SAAS,SAAS,KAAK,KAAK,IAAI,MAAM,SAAS,KAAK,IAAI;AAE9D,WAAO,MAAM,WAAW,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,IAAI,MAAM;AAAA,EAChE;AACJ;","names":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Builder from "../../core/Builder.js";
|
|
2
|
-
import ManagedContext from "./ManagedContext.js";
|
|
3
|
-
import EventEmitter from "./EventEmitter.js";
|
|
4
|
-
import { ContentScriptAnchor, ContentScriptAnchorGetter, ContentScriptBuilder, ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptContext, ContentScriptDefinition, ContentScriptMarkerContract, ContentScriptMarkerGetter, ContentScriptMarkerResolver, ContentScriptMarkerType, ContentScriptMountFunction, ContentScriptNode, ContentScriptRenderHandler, ContentScriptRenderValue, ContentScriptResolvedDefinition, ContentScriptWatchStrategy } from "../../../types/content.js";
|
|
5
|
-
import { Awaiter } from "../../../types/helpers.js";
|
|
6
|
-
export default abstract class extends Builder implements ContentScriptBuilder {
|
|
7
|
-
private readonly lock;
|
|
8
|
-
protected readonly definition: ContentScriptResolvedDefinition;
|
|
9
|
-
protected readonly emitter: EventEmitter;
|
|
10
|
-
protected readonly context: ManagedContext;
|
|
11
|
-
protected marker: ContentScriptMarkerContract;
|
|
12
|
-
protected unwatch?: () => void;
|
|
13
|
-
protected abstract createNode(anchor: Element): Promise<ContentScriptNode>;
|
|
14
|
-
protected abstract cleanupNode(anchor: Element): Awaiter<void>;
|
|
15
|
-
protected constructor(definition: ContentScriptDefinition);
|
|
16
|
-
protected resolveMarker(marker: ContentScriptMarkerType | ContentScriptMarkerGetter): ContentScriptMarkerResolver;
|
|
17
|
-
protected resolveAnchor(anchor?: ContentScriptAnchor | ContentScriptAnchorGetter): ContentScriptAnchorGetter;
|
|
18
|
-
protected resolveMount(mount?: ContentScriptMountFunction): ContentScriptMountFunction;
|
|
19
|
-
protected resolveContainer(container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory): ContentScriptContainerCreator;
|
|
20
|
-
protected resolveRender(render?: ContentScriptRenderValue | ContentScriptRenderHandler): ContentScriptRenderHandler | undefined;
|
|
21
|
-
protected resolveWatch(watch?: true | ContentScriptWatchStrategy): ContentScriptWatchStrategy;
|
|
22
|
-
getContext(): ContentScriptContext;
|
|
23
|
-
build(): Promise<void>;
|
|
24
|
-
destroy(): Promise<void>;
|
|
25
|
-
protected processing(): Promise<void>;
|
|
26
|
-
protected processAnchor(anchor: Element): Promise<void>;
|
|
27
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import AwaitLock from "await-lock";
|
|
2
|
-
import Builder from "./../../../entry/core/Builder.js";
|
|
3
|
-
import {
|
|
4
|
-
contentScriptAnchorResolver,
|
|
5
|
-
contentScriptAwaitFirstResolver,
|
|
6
|
-
contentScriptContainerResolver,
|
|
7
|
-
contentScriptLocationResolver,
|
|
8
|
-
contentScriptMountAppendResolver,
|
|
9
|
-
contentScriptMutationObserverResolver,
|
|
10
|
-
contentScriptRenderResolver
|
|
11
|
-
} from "./resolvers/index.js";
|
|
12
|
-
import ManagedContext from "./ManagedContext.js";
|
|
13
|
-
import EventEmitter from "./EventEmitter.js";
|
|
14
|
-
import AttributeMarker from "./AttributeMarker.js";
|
|
15
|
-
import WeakMarker from "./WeakMarker.js";
|
|
16
|
-
import {
|
|
17
|
-
ContentScriptMarker
|
|
18
|
-
} from "./../../../types/content.js";
|
|
19
|
-
class Builder_default extends Builder {
|
|
20
|
-
lock = new AwaitLock();
|
|
21
|
-
definition;
|
|
22
|
-
emitter = new EventEmitter();
|
|
23
|
-
context = new ManagedContext(this.emitter);
|
|
24
|
-
marker = new AttributeMarker();
|
|
25
|
-
unwatch;
|
|
26
|
-
constructor(definition) {
|
|
27
|
-
super();
|
|
28
|
-
this.definition = {
|
|
29
|
-
...definition,
|
|
30
|
-
marker: this.resolveMarker(definition.marker),
|
|
31
|
-
anchor: this.resolveAnchor(definition.anchor),
|
|
32
|
-
mount: this.resolveMount(definition.mount),
|
|
33
|
-
container: this.resolveContainer(definition.container),
|
|
34
|
-
render: this.resolveRender(definition.render),
|
|
35
|
-
watch: this.resolveWatch(definition.watch)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
resolveMarker(marker) {
|
|
39
|
-
return async (options) => {
|
|
40
|
-
if (typeof marker === "function") {
|
|
41
|
-
marker = await marker(options);
|
|
42
|
-
}
|
|
43
|
-
if (!marker) {
|
|
44
|
-
marker = ContentScriptMarker.Attribute;
|
|
45
|
-
}
|
|
46
|
-
if (typeof marker === "string") {
|
|
47
|
-
switch (marker) {
|
|
48
|
-
case ContentScriptMarker.Weak:
|
|
49
|
-
return new WeakMarker();
|
|
50
|
-
case ContentScriptMarker.Attribute:
|
|
51
|
-
default:
|
|
52
|
-
return new AttributeMarker();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return marker;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
resolveAnchor(anchor) {
|
|
59
|
-
return contentScriptAnchorResolver(anchor);
|
|
60
|
-
}
|
|
61
|
-
resolveMount(mount) {
|
|
62
|
-
return mount || contentScriptMountAppendResolver();
|
|
63
|
-
}
|
|
64
|
-
resolveContainer(container) {
|
|
65
|
-
return contentScriptContainerResolver(container);
|
|
66
|
-
}
|
|
67
|
-
resolveRender(render) {
|
|
68
|
-
if (render === void 0) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
return contentScriptRenderResolver(render);
|
|
72
|
-
}
|
|
73
|
-
resolveWatch(watch) {
|
|
74
|
-
if (watch === void 0) {
|
|
75
|
-
watch = contentScriptAwaitFirstResolver();
|
|
76
|
-
} else if (watch === true) {
|
|
77
|
-
watch = contentScriptMutationObserverResolver();
|
|
78
|
-
}
|
|
79
|
-
return contentScriptLocationResolver(watch);
|
|
80
|
-
}
|
|
81
|
-
getContext() {
|
|
82
|
-
return this.context;
|
|
83
|
-
}
|
|
84
|
-
async build() {
|
|
85
|
-
await this.destroy();
|
|
86
|
-
const { render, main, anchor, marker, container, watch, mount, ...options } = this.definition;
|
|
87
|
-
this.marker = await marker(options);
|
|
88
|
-
await (main == null ? void 0 : main(this.context, options));
|
|
89
|
-
if (render !== void 0) {
|
|
90
|
-
await this.processing();
|
|
91
|
-
this.unwatch = watch(() => {
|
|
92
|
-
this.processing().catch((e) => {
|
|
93
|
-
console.error("Content script processing on watch error", e);
|
|
94
|
-
});
|
|
95
|
-
}, this.context);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async destroy() {
|
|
99
|
-
var _a;
|
|
100
|
-
(_a = this.unwatch) == null ? void 0 : _a.call(this);
|
|
101
|
-
this.unwatch = void 0;
|
|
102
|
-
this.marker.reset();
|
|
103
|
-
}
|
|
104
|
-
async processing() {
|
|
105
|
-
await this.lock.acquireAsync();
|
|
106
|
-
try {
|
|
107
|
-
const anchor = await this.definition.anchor();
|
|
108
|
-
const anchors = this.marker.for(anchor).unmarked();
|
|
109
|
-
await Promise.allSettled(anchors.map(this.processAnchor.bind(this)));
|
|
110
|
-
} finally {
|
|
111
|
-
this.lock.release();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async processAnchor(anchor) {
|
|
115
|
-
const node = await this.createNode(anchor);
|
|
116
|
-
this.context.add(node);
|
|
117
|
-
await this.cleanupNode(anchor);
|
|
118
|
-
node.mount();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
export {
|
|
122
|
-
Builder_default as default
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/Builder.ts"],"sourcesContent":["import AwaitLock from \"await-lock\";\n\nimport Builder from \"@entry/core/Builder\";\n\nimport {\n contentScriptAnchorResolver,\n contentScriptAwaitFirstResolver,\n contentScriptContainerResolver,\n contentScriptLocationResolver,\n contentScriptMountAppendResolver,\n contentScriptMutationObserverResolver,\n contentScriptRenderResolver,\n} from \"./resolvers\";\n\nimport ManagedContext from \"./ManagedContext\";\nimport EventEmitter from \"./EventEmitter\";\nimport AttributeMarker from \"./AttributeMarker\";\nimport WeakMarker from \"./WeakMarker\";\n\nimport {\n ContentScriptAnchor,\n ContentScriptAnchorGetter,\n ContentScriptBuilder,\n ContentScriptContainerCreator,\n ContentScriptContainerFactory,\n ContentScriptContainerOptions,\n ContentScriptContainerTag,\n ContentScriptContext,\n ContentScriptDefinition,\n ContentScriptMarker,\n ContentScriptMarkerContract,\n ContentScriptMarkerGetter,\n ContentScriptMarkerResolver,\n ContentScriptMarkerType,\n ContentScriptMountFunction,\n ContentScriptNode,\n ContentScriptOptions,\n ContentScriptRenderHandler,\n ContentScriptRenderValue,\n ContentScriptResolvedDefinition,\n ContentScriptWatchStrategy,\n} from \"@typing/content\";\n\nimport {Awaiter} from \"@typing/helpers\";\n\nexport default abstract class extends Builder implements ContentScriptBuilder {\n private readonly lock: AwaitLock = new AwaitLock();\n\n protected readonly definition: ContentScriptResolvedDefinition;\n\n protected readonly emitter = new EventEmitter();\n\n protected readonly context = new ManagedContext(this.emitter);\n\n protected marker: ContentScriptMarkerContract = new AttributeMarker();\n\n protected unwatch?: () => void;\n\n protected abstract createNode(anchor: Element): Promise<ContentScriptNode>;\n\n protected abstract cleanupNode(anchor: Element): Awaiter<void>;\n\n protected constructor(definition: ContentScriptDefinition) {\n super();\n\n this.definition = {\n ...definition,\n marker: this.resolveMarker(definition.marker),\n anchor: this.resolveAnchor(definition.anchor),\n mount: this.resolveMount(definition.mount),\n container: this.resolveContainer(definition.container),\n render: this.resolveRender(definition.render),\n watch: this.resolveWatch(definition.watch),\n };\n }\n\n protected resolveMarker(marker: ContentScriptMarkerType | ContentScriptMarkerGetter): ContentScriptMarkerResolver {\n return async (options: ContentScriptOptions) => {\n if (typeof marker === \"function\") {\n marker = await marker(options);\n }\n\n if (!marker) {\n marker = ContentScriptMarker.Attribute;\n }\n\n if (typeof marker === \"string\") {\n switch (marker) {\n case ContentScriptMarker.Weak:\n return new WeakMarker();\n\n case ContentScriptMarker.Attribute:\n default:\n return new AttributeMarker();\n }\n }\n\n return marker;\n };\n }\n\n protected resolveAnchor(anchor?: ContentScriptAnchor | ContentScriptAnchorGetter): ContentScriptAnchorGetter {\n return contentScriptAnchorResolver(anchor);\n }\n\n protected resolveMount(mount?: ContentScriptMountFunction): ContentScriptMountFunction {\n return mount || contentScriptMountAppendResolver();\n }\n\n protected resolveContainer(\n container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory\n ): ContentScriptContainerCreator {\n return contentScriptContainerResolver(container);\n }\n\n protected resolveRender(\n render?: ContentScriptRenderValue | ContentScriptRenderHandler\n ): ContentScriptRenderHandler | undefined {\n if (render === undefined) {\n return;\n }\n\n return contentScriptRenderResolver(render);\n }\n\n protected resolveWatch(watch?: true | ContentScriptWatchStrategy): ContentScriptWatchStrategy {\n if (watch === undefined) {\n watch = contentScriptAwaitFirstResolver();\n } else if (watch === true) {\n watch = contentScriptMutationObserverResolver();\n }\n\n return contentScriptLocationResolver(watch);\n }\n\n public getContext(): ContentScriptContext {\n return this.context;\n }\n\n public async build(): Promise<void> {\n await this.destroy();\n\n const {render, main, anchor, marker, container, watch, mount, ...options} = this.definition;\n\n this.marker = await marker(options);\n\n await main?.(this.context, options);\n\n if (render !== undefined) {\n await this.processing();\n\n this.unwatch = watch(() => {\n this.processing().catch(e => {\n console.error(\"Content script processing on watch error\", e);\n });\n }, this.context);\n }\n }\n\n public async destroy(): Promise<void> {\n this.unwatch?.();\n this.unwatch = undefined;\n\n this.marker.reset();\n }\n\n protected async processing(): Promise<void> {\n await this.lock.acquireAsync();\n\n try {\n const anchor = await this.definition.anchor();\n\n const anchors = this.marker.for(anchor).unmarked();\n\n await Promise.allSettled(anchors.map(this.processAnchor.bind(this)));\n } finally {\n this.lock.release();\n }\n }\n\n protected async processAnchor(anchor: Element): Promise<void> {\n const node = await this.createNode(anchor);\n\n this.context.add(node);\n\n await this.cleanupNode(anchor);\n\n node.mount();\n }\n}\n"],"mappings":"AAAA,OAAO,eAAe;AAEtB,OAAO,aAAa;AAEpB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO,oBAAoB;AAC3B,OAAO,kBAAkB;AACzB,OAAO,qBAAqB;AAC5B,OAAO,gBAAgB;AAEvB;AAAA,EAUI;AAAA,OAYG;AAIP,MAAO,wBAA+B,QAAwC;AAAA,EACzD,OAAkB,IAAI,UAAU;AAAA,EAE9B;AAAA,EAEA,UAAU,IAAI,aAAa;AAAA,EAE3B,UAAU,IAAI,eAAe,KAAK,OAAO;AAAA,EAElD,SAAsC,IAAI,gBAAgB;AAAA,EAE1D;AAAA,EAMA,YAAY,YAAqC;AACvD,UAAM;AAEN,SAAK,aAAa;AAAA,MACd,GAAG;AAAA,MACH,QAAQ,KAAK,cAAc,WAAW,MAAM;AAAA,MAC5C,QAAQ,KAAK,cAAc,WAAW,MAAM;AAAA,MAC5C,OAAO,KAAK,aAAa,WAAW,KAAK;AAAA,MACzC,WAAW,KAAK,iBAAiB,WAAW,SAAS;AAAA,MACrD,QAAQ,KAAK,cAAc,WAAW,MAAM;AAAA,MAC5C,OAAO,KAAK,aAAa,WAAW,KAAK;AAAA,IAC7C;AAAA,EACJ;AAAA,EAEU,cAAc,QAA0F;AAC9G,WAAO,OAAO,YAAkC;AAC5C,UAAI,OAAO,WAAW,YAAY;AAC9B,iBAAS,MAAM,OAAO,OAAO;AAAA,MACjC;AAEA,UAAI,CAAC,QAAQ;AACT,iBAAS,oBAAoB;AAAA,MACjC;AAEA,UAAI,OAAO,WAAW,UAAU;AAC5B,gBAAQ,QAAQ;AAAA,UACZ,KAAK,oBAAoB;AACrB,mBAAO,IAAI,WAAW;AAAA,UAE1B,KAAK,oBAAoB;AAAA,UACzB;AACI,mBAAO,IAAI,gBAAgB;AAAA,QACnC;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AAAA,EAEU,cAAc,QAAqF;AACzG,WAAO,4BAA4B,MAAM;AAAA,EAC7C;AAAA,EAEU,aAAa,OAAgE;AACnF,WAAO,SAAS,iCAAiC;AAAA,EACrD;AAAA,EAEU,iBACN,WAC6B;AAC7B,WAAO,+BAA+B,SAAS;AAAA,EACnD;AAAA,EAEU,cACN,QACsC;AACtC,QAAI,WAAW,QAAW;AACtB;AAAA,IACJ;AAEA,WAAO,4BAA4B,MAAM;AAAA,EAC7C;AAAA,EAEU,aAAa,OAAuE;AAC1F,QAAI,UAAU,QAAW;AACrB,cAAQ,gCAAgC;AAAA,IAC5C,WAAW,UAAU,MAAM;AACvB,cAAQ,sCAAsC;AAAA,IAClD;AAEA,WAAO,8BAA8B,KAAK;AAAA,EAC9C;AAAA,EAEO,aAAmC;AACtC,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,MAAa,QAAuB;AAChC,UAAM,KAAK,QAAQ;AAEnB,UAAM,EAAC,QAAQ,MAAM,QAAQ,QAAQ,WAAW,OAAO,OAAO,GAAG,QAAO,IAAI,KAAK;AAEjF,SAAK,SAAS,MAAM,OAAO,OAAO;AAElC,WAAM,6BAAO,KAAK,SAAS;AAE3B,QAAI,WAAW,QAAW;AACtB,YAAM,KAAK,WAAW;AAEtB,WAAK,UAAU,MAAM,MAAM;AACvB,aAAK,WAAW,EAAE,MAAM,OAAK;AACzB,kBAAQ,MAAM,4CAA4C,CAAC;AAAA,QAC/D,CAAC;AAAA,MACL,GAAG,KAAK,OAAO;AAAA,IACnB;AAAA,EACJ;AAAA,EAEA,MAAa,UAAyB;AA/J1C;AAgKQ,eAAK,YAAL;AACA,SAAK,UAAU;AAEf,SAAK,OAAO,MAAM;AAAA,EACtB;AAAA,EAEA,MAAgB,aAA4B;AACxC,UAAM,KAAK,KAAK,aAAa;AAE7B,QAAI;AACA,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAE5C,YAAM,UAAU,KAAK,OAAO,IAAI,MAAM,EAAE,SAAS;AAEjD,YAAM,QAAQ,WAAW,QAAQ,IAAI,KAAK,cAAc,KAAK,IAAI,CAAC,CAAC;AAAA,IACvE,UAAE;AACE,WAAK,KAAK,QAAQ;AAAA,IACtB;AAAA,EACJ;AAAA,EAEA,MAAgB,cAAc,QAAgC;AAC1D,UAAM,OAAO,MAAM,KAAK,WAAW,MAAM;AAEzC,SAAK,QAAQ,IAAI,IAAI;AAErB,UAAM,KAAK,YAAY,MAAM;AAE7B,SAAK,MAAM;AAAA,EACf;AACJ;","names":[]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
class Context_default {
|
|
2
|
-
constructor(emitter) {
|
|
3
|
-
this.emitter = emitter;
|
|
4
|
-
}
|
|
5
|
-
emitter;
|
|
6
|
-
collection = /* @__PURE__ */ new Set();
|
|
7
|
-
get nodes() {
|
|
8
|
-
return this.collection;
|
|
9
|
-
}
|
|
10
|
-
mount() {
|
|
11
|
-
for (const node of this.collection) {
|
|
12
|
-
if (!node.anchor.isConnected) {
|
|
13
|
-
node.unmount();
|
|
14
|
-
this.collection.delete(node);
|
|
15
|
-
this.emitter.emitRemove(node);
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
node.mount();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
unmount() {
|
|
22
|
-
for (const node of this.collection) {
|
|
23
|
-
node.unmount();
|
|
24
|
-
if (!node.anchor.isConnected) {
|
|
25
|
-
this.collection.delete(node);
|
|
26
|
-
this.emitter.emitRemove(node);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
watch(callback) {
|
|
31
|
-
this.emitter.on(callback);
|
|
32
|
-
return () => {
|
|
33
|
-
this.emitter.off(callback);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
unwatch() {
|
|
37
|
-
this.emitter.removeAllListeners();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
Context_default as default
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/Context.ts"],"sourcesContent":["import {\n ContentScriptContext,\n ContentScriptEventCallback,\n ContentScriptEventEmitter,\n ContentScriptNode,\n ContentScriptNodeSet,\n} from \"@typing/content\";\n\nexport default class implements ContentScriptContext {\n protected readonly collection: ContentScriptNodeSet = new Set();\n\n constructor(protected readonly emitter: ContentScriptEventEmitter) {}\n\n public get nodes(): ReadonlySet<ContentScriptNode> {\n return this.collection;\n }\n\n public mount(): void {\n for (const node of this.collection) {\n if (!node.anchor.isConnected) {\n node.unmount();\n\n this.collection.delete(node);\n\n this.emitter.emitRemove(node);\n\n continue;\n }\n\n node.mount();\n }\n }\n\n public unmount(): void {\n for (const node of this.collection) {\n node.unmount();\n\n if (!node.anchor.isConnected) {\n this.collection.delete(node);\n\n this.emitter.emitRemove(node);\n }\n }\n }\n\n public watch(callback: ContentScriptEventCallback): () => void {\n this.emitter.on(callback);\n\n return () => {\n this.emitter.off(callback);\n };\n }\n\n public unwatch(): void {\n this.emitter.removeAllListeners();\n }\n}\n"],"mappings":"AAQA,MAAO,gBAA8C;AAAA,EAGjD,YAA+B,SAAoC;AAApC;AAAA,EAAqC;AAAA,EAArC;AAAA,EAFZ,aAAmC,oBAAI,IAAI;AAAA,EAI9D,IAAW,QAAwC;AAC/C,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,QAAc;AACjB,eAAW,QAAQ,KAAK,YAAY;AAChC,UAAI,CAAC,KAAK,OAAO,aAAa;AAC1B,aAAK,QAAQ;AAEb,aAAK,WAAW,OAAO,IAAI;AAE3B,aAAK,QAAQ,WAAW,IAAI;AAE5B;AAAA,MACJ;AAEA,WAAK,MAAM;AAAA,IACf;AAAA,EACJ;AAAA,EAEO,UAAgB;AACnB,eAAW,QAAQ,KAAK,YAAY;AAChC,WAAK,QAAQ;AAEb,UAAI,CAAC,KAAK,OAAO,aAAa;AAC1B,aAAK,WAAW,OAAO,IAAI;AAE3B,aAAK,QAAQ,WAAW,IAAI;AAAA,MAChC;AAAA,IACJ;AAAA,EACJ;AAAA,EAEO,MAAM,UAAkD;AAC3D,SAAK,QAAQ,GAAG,QAAQ;AAExB,WAAO,MAAM;AACT,WAAK,QAAQ,IAAI,QAAQ;AAAA,IAC7B;AAAA,EACJ;AAAA,EAEO,UAAgB;AACnB,SAAK,QAAQ,mBAAmB;AAAA,EACpC;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/EventEmitter.ts"],"sourcesContent":["import {\n ContentScriptEvent,\n ContentScriptEventCallback,\n ContentScriptEventEmitter,\n ContentScriptNode,\n} from \"@typing/content\";\n\nexport default class implements ContentScriptEventEmitter {\n private readonly listeners: Set<ContentScriptEventCallback> = new Set();\n\n public emit(event: ContentScriptEvent, node: ContentScriptNode): void {\n for (const listener of this.listeners) {\n listener(event, node);\n }\n }\n\n public emitAdd(node: ContentScriptNode): void {\n this.emit(ContentScriptEvent.Add, node);\n }\n\n public emitMount(node: ContentScriptNode): void {\n this.emit(ContentScriptEvent.Mount, node);\n }\n\n public emitRemove(node: ContentScriptNode): void {\n this.emit(ContentScriptEvent.Remove, node);\n }\n\n public emitUnmount(node: ContentScriptNode): void {\n this.emit(ContentScriptEvent.Unmount, node);\n }\n\n public hasListeners(): boolean {\n return this.listenerCount() > 0;\n }\n\n public listenerCount(): number {\n return this.listeners.size;\n }\n\n public off(callback: ContentScriptEventCallback): void {\n this.listeners.delete(callback);\n }\n\n public on(callback: ContentScriptEventCallback): void {\n this.listeners.add(callback);\n }\n\n public removeAllListeners(): void {\n this.listeners.clear();\n }\n}\n"],"mappings":"AAAA;AAAA,EACI;AAAA,OAIG;AAEP,MAAO,qBAAmD;AAAA,EACrC,YAA6C,oBAAI,IAAI;AAAA,EAE/D,KAAK,OAA2B,MAA+B;AAClE,eAAW,YAAY,KAAK,WAAW;AACnC,eAAS,OAAO,IAAI;AAAA,IACxB;AAAA,EACJ;AAAA,EAEO,QAAQ,MAA+B;AAC1C,SAAK,KAAK,mBAAmB,KAAK,IAAI;AAAA,EAC1C;AAAA,EAEO,UAAU,MAA+B;AAC5C,SAAK,KAAK,mBAAmB,OAAO,IAAI;AAAA,EAC5C;AAAA,EAEO,WAAW,MAA+B;AAC7C,SAAK,KAAK,mBAAmB,QAAQ,IAAI;AAAA,EAC7C;AAAA,EAEO,YAAY,MAA+B;AAC9C,SAAK,KAAK,mBAAmB,SAAS,IAAI;AAAA,EAC9C;AAAA,EAEO,eAAwB;AAC3B,WAAO,KAAK,cAAc,IAAI;AAAA,EAClC;AAAA,EAEO,gBAAwB;AAC3B,WAAO,KAAK,UAAU;AAAA,EAC1B;AAAA,EAEO,IAAI,UAA4C;AACnD,SAAK,UAAU,OAAO,QAAQ;AAAA,EAClC;AAAA,EAEO,GAAG,UAA4C;AAClD,SAAK,UAAU,IAAI,QAAQ;AAAA,EAC/B;AAAA,EAEO,qBAA2B;AAC9B,SAAK,UAAU,MAAM;AAAA,EACzB;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/EventNode.ts"],"sourcesContent":["import {ContentScriptEventEmitter, ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n constructor(\n protected readonly node: ContentScriptNode,\n protected readonly emitter: ContentScriptEventEmitter\n ) {}\n\n public get anchor(): Element {\n return this.node.anchor;\n }\n\n public get container(): Element | undefined {\n return this.node.container;\n }\n\n public mount(): boolean {\n const result = this.node.mount();\n\n if (result === true) {\n this.emitter.emitMount(this.node);\n }\n\n return !!result;\n }\n\n public unmount(): boolean {\n const result = this.node.unmount();\n\n if (result === true) {\n this.emitter.emitUnmount(this.node);\n }\n\n return !!result;\n }\n}\n"],"mappings":"AAEA,MAAO,kBAA2C;AAAA,EAC9C,YACuB,MACA,SACrB;AAFqB;AACA;AAAA,EACpB;AAAA,EAFoB;AAAA,EACA;AAAA,EAGvB,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEO,QAAiB;AACpB,UAAM,SAAS,KAAK,KAAK,MAAM;AAE/B,QAAI,WAAW,MAAM;AACjB,WAAK,QAAQ,UAAU,KAAK,IAAI;AAAA,IACpC;AAEA,WAAO,CAAC,CAAC;AAAA,EACb;AAAA,EAEO,UAAmB;AACtB,UAAM,SAAS,KAAK,KAAK,QAAQ;AAEjC,QAAI,WAAW,MAAM;AACjB,WAAK,QAAQ,YAAY,KAAK,IAAI;AAAA,IACtC;AAEA,WAAO,CAAC,CAAC;AAAA,EACb;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/ManagedContext.ts"],"sourcesContent":["import Context from \"./Context\";\n\nimport {ContentScriptNode} from \"@typing/content\";\n\nexport default class extends Context {\n public add(node: ContentScriptNode): this {\n this.collection.add(node);\n\n this.emitter.emitAdd(node);\n\n return this;\n }\n}\n"],"mappings":"AAAA,OAAO,aAAa;AAIpB,MAAO,+BAAsB,QAAQ;AAAA,EAC1B,IAAI,MAA+B;AACtC,SAAK,WAAW,IAAI,IAAI;AAExB,SAAK,QAAQ,QAAQ,IAAI;AAEzB,WAAO;AAAA,EACX;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/MarkerNode.ts"],"sourcesContent":["import {ContentScriptMarkerContract, ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n constructor(\n protected readonly node: ContentScriptNode,\n protected readonly marker: ContentScriptMarkerContract\n ) {}\n\n public get anchor(): Element {\n return this.node.anchor;\n }\n\n public get container(): Element | undefined {\n return this.node.container;\n }\n\n public mount(): boolean | undefined | void {\n this.marker.mount(this.anchor);\n\n return this.node.mount();\n }\n\n public unmount(): boolean | undefined | void {\n this.marker.unmount(this.anchor);\n\n return this.node.unmount();\n }\n}\n"],"mappings":"AAEA,MAAO,mBAA2C;AAAA,EAC9C,YACuB,MACA,QACrB;AAFqB;AACA;AAAA,EACpB;AAAA,EAFoB;AAAA,EACA;AAAA,EAGvB,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEO,QAAoC;AACvC,SAAK,OAAO,MAAM,KAAK,MAAM;AAE7B,WAAO,KAAK,KAAK,MAAM;AAAA,EAC3B;AAAA,EAEO,UAAsC;AACzC,SAAK,OAAO,QAAQ,KAAK,MAAM;AAE/B,WAAO,KAAK,KAAK,QAAQ;AAAA,EAC7B;AACJ;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Builder from "./Builder.js";
|
|
2
|
-
import { ContentScriptNode, ContentScriptProps, ContentScriptRenderValue } from "../../../types/content.js";
|
|
3
|
-
export default abstract class extends Builder {
|
|
4
|
-
private values;
|
|
5
|
-
protected getProps(anchor: Element): ContentScriptProps;
|
|
6
|
-
protected getValue(anchor: Element): Promise<undefined | ContentScriptRenderValue>;
|
|
7
|
-
protected renderValue(anchor: Element): Promise<undefined | ContentScriptRenderValue>;
|
|
8
|
-
protected createNode(anchor: Element): Promise<ContentScriptNode>;
|
|
9
|
-
protected cleanupNode(anchor: Element): void;
|
|
10
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import Builder from "./Builder.js";
|
|
2
|
-
import Node from "./Node.js";
|
|
3
|
-
import MountNode from "./MountNode.js";
|
|
4
|
-
import MarkerNode from "./MarkerNode.js";
|
|
5
|
-
class MountBuilder_default extends Builder {
|
|
6
|
-
values = /* @__PURE__ */ new Map();
|
|
7
|
-
getProps(anchor) {
|
|
8
|
-
const { anchor: _, mount, watch, render, container, main, ...options } = this.definition;
|
|
9
|
-
return { ...options, anchor };
|
|
10
|
-
}
|
|
11
|
-
async getValue(anchor) {
|
|
12
|
-
if (!this.values.has(anchor)) {
|
|
13
|
-
const value = await this.renderValue(anchor);
|
|
14
|
-
this.values.set(anchor, value === void 0 ? void 0 : value);
|
|
15
|
-
}
|
|
16
|
-
return this.values.get(anchor);
|
|
17
|
-
}
|
|
18
|
-
async renderValue(anchor) {
|
|
19
|
-
const { render } = this.definition;
|
|
20
|
-
if (render === void 0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
return render(this.getProps(anchor));
|
|
24
|
-
}
|
|
25
|
-
async createNode(anchor) {
|
|
26
|
-
let container;
|
|
27
|
-
const value = await this.getValue(anchor);
|
|
28
|
-
if (typeof value !== "boolean" && value !== void 0) {
|
|
29
|
-
container = await this.definition.container(this.getProps(anchor));
|
|
30
|
-
}
|
|
31
|
-
return new MountNode(new MarkerNode(new Node(anchor, container), this.marker), this.definition.mount);
|
|
32
|
-
}
|
|
33
|
-
cleanupNode(anchor) {
|
|
34
|
-
this.values.delete(anchor);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
MountBuilder_default as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=MountBuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/MountBuilder.ts"],"sourcesContent":["import Builder from \"./Builder\";\nimport Node from \"./Node\";\nimport MountNode from \"./MountNode\";\nimport MarkerNode from \"./MarkerNode\";\n\nimport {ContentScriptNode, ContentScriptProps, ContentScriptRenderValue} from \"@typing/content\";\n\nexport default abstract class extends Builder {\n private values = new Map<Element, null | ContentScriptRenderValue>();\n\n protected getProps(anchor: Element): ContentScriptProps {\n const {anchor: _, mount, watch, render, container, main, ...options} = this.definition;\n\n return {...options, anchor};\n }\n\n protected async getValue(anchor: Element): Promise<undefined | ContentScriptRenderValue> {\n if (!this.values.has(anchor)) {\n const value = await this.renderValue(anchor);\n\n this.values.set(anchor, value === undefined ? undefined : value);\n }\n\n return this.values.get(anchor);\n }\n\n protected async renderValue(anchor: Element): Promise<undefined | ContentScriptRenderValue> {\n const {render} = this.definition;\n\n if (render === undefined) {\n return;\n }\n\n return render(this.getProps(anchor));\n }\n\n protected async createNode(anchor: Element): Promise<ContentScriptNode> {\n let container: Element | undefined;\n\n const value = await this.getValue(anchor);\n\n if (typeof value !== \"boolean\" && value !== undefined) {\n container = (await this.definition.container(this.getProps(anchor))) as Element | undefined;\n }\n\n return new MountNode(new MarkerNode(new Node(anchor, container), this.marker), this.definition.mount);\n }\n\n protected cleanupNode(anchor: Element): void {\n this.values.delete(anchor);\n }\n}\n"],"mappings":"AAAA,OAAO,aAAa;AACpB,OAAO,UAAU;AACjB,OAAO,eAAe;AACtB,OAAO,gBAAgB;AAIvB,MAAO,6BAA+B,QAAQ;AAAA,EAClC,SAAS,oBAAI,IAA8C;AAAA,EAEzD,SAAS,QAAqC;AACpD,UAAM,EAAC,QAAQ,GAAG,OAAO,OAAO,QAAQ,WAAW,MAAM,GAAG,QAAO,IAAI,KAAK;AAE5E,WAAO,EAAC,GAAG,SAAS,OAAM;AAAA,EAC9B;AAAA,EAEA,MAAgB,SAAS,QAAgE;AACrF,QAAI,CAAC,KAAK,OAAO,IAAI,MAAM,GAAG;AAC1B,YAAM,QAAQ,MAAM,KAAK,YAAY,MAAM;AAE3C,WAAK,OAAO,IAAI,QAAQ,UAAU,SAAY,SAAY,KAAK;AAAA,IACnE;AAEA,WAAO,KAAK,OAAO,IAAI,MAAM;AAAA,EACjC;AAAA,EAEA,MAAgB,YAAY,QAAgE;AACxF,UAAM,EAAC,OAAM,IAAI,KAAK;AAEtB,QAAI,WAAW,QAAW;AACtB;AAAA,IACJ;AAEA,WAAO,OAAO,KAAK,SAAS,MAAM,CAAC;AAAA,EACvC;AAAA,EAEA,MAAgB,WAAW,QAA6C;AACpE,QAAI;AAEJ,UAAM,QAAQ,MAAM,KAAK,SAAS,MAAM;AAExC,QAAI,OAAO,UAAU,aAAa,UAAU,QAAW;AACnD,kBAAa,MAAM,KAAK,WAAW,UAAU,KAAK,SAAS,MAAM,CAAC;AAAA,IACtE;AAEA,WAAO,IAAI,UAAU,IAAI,WAAW,IAAI,KAAK,QAAQ,SAAS,GAAG,KAAK,MAAM,GAAG,KAAK,WAAW,KAAK;AAAA,EACxG;AAAA,EAEU,YAAY,QAAuB;AACzC,SAAK,OAAO,OAAO,MAAM;AAAA,EAC7B;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/MountNode.ts"],"sourcesContent":["import {ContentScriptMountFunction, ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n private unmounting?: () => void;\n\n constructor(\n protected node: ContentScriptNode,\n protected mounter?: ContentScriptMountFunction\n ) {}\n\n public get anchor(): Element {\n return this.node.anchor;\n }\n\n public get container(): Element | undefined {\n return this.node.container;\n }\n\n public mount(): boolean {\n this.node.mount();\n\n if (!this.container || this.container.isConnected) {\n return false;\n }\n\n if (this.mounter) {\n const unmounting = this.mounter(this.anchor, this.container);\n\n if (unmounting) {\n this.unmounting = unmounting;\n }\n\n return true;\n }\n\n return false;\n }\n\n public unmount(): boolean {\n this.unmounting?.();\n this.unmounting = undefined;\n\n return !!this.node.unmount();\n }\n}\n"],"mappings":"AAEA,MAAO,kBAA2C;AAAA,EAG9C,YACc,MACA,SACZ;AAFY;AACA;AAAA,EACX;AAAA,EAFW;AAAA,EACA;AAAA,EAJN;AAAA,EAOR,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEO,QAAiB;AACpB,SAAK,KAAK,MAAM;AAEhB,QAAI,CAAC,KAAK,aAAa,KAAK,UAAU,aAAa;AAC/C,aAAO;AAAA,IACX;AAEA,QAAI,KAAK,SAAS;AACd,YAAM,aAAa,KAAK,QAAQ,KAAK,QAAQ,KAAK,SAAS;AAE3D,UAAI,YAAY;AACZ,aAAK,aAAa;AAAA,MACtB;AAEA,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,UAAmB;AAtC9B;AAuCQ,eAAK,eAAL;AACA,SAAK,aAAa;AAElB,WAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;AAAA,EAC/B;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/Node.ts"],"sourcesContent":["import {ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n private readonly _container?: Element;\n\n constructor(\n public readonly anchor: Element,\n public container?: Element\n ) {\n if (this.container) {\n this._container = this.container.cloneNode(false) as Element;\n }\n }\n\n public mount(): boolean {\n if (!this.container && this._container) {\n this.container = this._container.cloneNode(false) as Element;\n\n return true;\n }\n\n return false;\n }\n\n public unmount(): boolean {\n if (this.container) {\n this.container.remove();\n this.container = undefined;\n\n return true;\n }\n\n return false;\n }\n}\n"],"mappings":"AAEA,MAAO,aAA2C;AAAA,EAG9C,YACoB,QACT,WACT;AAFkB;AACT;AAEP,QAAI,KAAK,WAAW;AAChB,WAAK,aAAa,KAAK,UAAU,UAAU,KAAK;AAAA,IACpD;AAAA,EACJ;AAAA,EANoB;AAAA,EACT;AAAA,EAJM;AAAA,EAWV,QAAiB;AACpB,QAAI,CAAC,KAAK,aAAa,KAAK,YAAY;AACpC,WAAK,YAAY,KAAK,WAAW,UAAU,KAAK;AAEhD,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,UAAmB;AACtB,QAAI,KAAK,WAAW;AAChB,WAAK,UAAU,OAAO;AACtB,WAAK,YAAY;AAEjB,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,EACX;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/core/WeakMarker.ts"],"sourcesContent":["import AbstractMarker from \"./AbstractMarker\";\n\nimport {ContentScriptAnchor, ContentScriptMarkerValue} from \"@typing/content\";\n\nexport default class extends AbstractMarker {\n private readonly map: WeakMap<Element, ContentScriptMarkerValue> = new WeakMap();\n\n constructor(anchor?: ContentScriptAnchor) {\n super(anchor);\n }\n\n public mark(element: Element, value: ContentScriptMarkerValue): boolean {\n this.map.set(element, value);\n\n return true;\n }\n\n public unmark(element: Element): boolean {\n if (this.map.has(element)) {\n this.map.delete(element);\n\n return true;\n }\n\n return false;\n }\n\n public value(element: Element): ContentScriptMarkerValue | undefined {\n return this.map.get(element);\n }\n\n public isMarked(element: Element): boolean {\n return this.map.has(element);\n }\n\n protected queryAnchor(anchor: string, marked: boolean = false): Element[] {\n const elements = super.queryAnchor(anchor, marked);\n\n return elements.filter(element => this.isMarked(element) === marked);\n }\n}\n"],"mappings":"AAAA,OAAO,oBAAoB;AAI3B,MAAO,2BAAsB,eAAe;AAAA,EACvB,MAAkD,oBAAI,QAAQ;AAAA,EAE/E,YAAY,QAA8B;AACtC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,KAAK,SAAkB,OAA0C;AACpE,SAAK,IAAI,IAAI,SAAS,KAAK;AAE3B,WAAO;AAAA,EACX;AAAA,EAEO,OAAO,SAA2B;AACrC,QAAI,KAAK,IAAI,IAAI,OAAO,GAAG;AACvB,WAAK,IAAI,OAAO,OAAO;AAEvB,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,MAAM,SAAwD;AACjE,WAAO,KAAK,IAAI,IAAI,OAAO;AAAA,EAC/B;AAAA,EAEO,SAAS,SAA2B;AACvC,WAAO,KAAK,IAAI,IAAI,OAAO;AAAA,EAC/B;AAAA,EAEU,YAAY,QAAgB,SAAkB,OAAkB;AACtE,UAAM,WAAW,MAAM,YAAY,QAAQ,MAAM;AAEjD,WAAO,SAAS,OAAO,aAAW,KAAK,SAAS,OAAO,MAAM,MAAM;AAAA,EACvE;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/anchor.ts"],"sourcesContent":["import {ContentScriptAnchor, ContentScriptAnchorGetter} from \"@typing/content\";\n\n// prettier-ignore\nexport const contentScriptAnchorResolver =\n (anchor?: ContentScriptAnchor | ContentScriptAnchorGetter): ContentScriptAnchorGetter =>\n async (): Promise<ContentScriptAnchor> => {\n let resolved = typeof anchor === \"function\" ? anchor() : anchor;\n\n if (resolved instanceof Promise) {\n resolved = await resolved;\n }\n\n if (resolved === undefined || resolved === null) {\n return document.body;\n }\n\n return resolved;\n };\n"],"mappings":"AAGO,MAAM,8BACT,CAAC,WACG,YAA0C;AACtC,MAAI,WAAW,OAAO,WAAW,aAAa,OAAO,IAAI;AAEzD,MAAI,oBAAoB,SAAS;AAC7B,eAAW,MAAM;AAAA,EACrB;AAEA,MAAI,aAAa,UAAa,aAAa,MAAM;AAC7C,WAAO,SAAS;AAAA,EACpB;AAEA,SAAO;AACX;","names":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag } from "../../../../types/content.js";
|
|
2
|
-
export declare const contentScriptContainerResolver: (container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory) => ContentScriptContainerCreator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/container.ts"],"sourcesContent":["import {\n ContentScriptContainerCreator,\n ContentScriptContainerFactory,\n ContentScriptContainerOptions,\n ContentScriptContainerTag,\n ContentScriptProps,\n} from \"@typing/content\";\n\n// prettier-ignore\nexport const contentScriptContainerResolver = (\n container?:\n ContentScriptContainerTag |\n ContentScriptContainerOptions |\n ContentScriptContainerFactory\n): ContentScriptContainerCreator =>\n async (props: ContentScriptProps): Promise<Element> => {\n let resolvedContainer = typeof container === \"function\" ? container(props) : container;\n\n if (resolvedContainer instanceof Promise) {\n resolvedContainer = await resolvedContainer;\n }\n\n if (resolvedContainer === undefined || typeof resolvedContainer === \"string\") {\n resolvedContainer = document.createElement(resolvedContainer || \"div\");\n } else if (typeof resolvedContainer === \"object\" && resolvedContainer.constructor === Object) {\n const {tagName = \"div\", ...options} = resolvedContainer as ContentScriptContainerOptions;\n\n resolvedContainer = document.createElement(tagName);\n\n Object.assign(resolvedContainer, options);\n }\n\n if (!(resolvedContainer instanceof Element)) {\n throw new Error(\"The content script container must be a valid element\");\n }\n\n return resolvedContainer;\n };\n"],"mappings":"AASO,MAAM,iCAAiC,CAC1C,cAKA,OAAO,UAAgD;AACnD,MAAI,oBAAoB,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI;AAE7E,MAAI,6BAA6B,SAAS;AACtC,wBAAoB,MAAM;AAAA,EAC9B;AAEA,MAAI,sBAAsB,UAAa,OAAO,sBAAsB,UAAU;AAC1E,wBAAoB,SAAS,cAAc,qBAAqB,KAAK;AAAA,EACzE,WAAW,OAAO,sBAAsB,YAAY,kBAAkB,gBAAgB,QAAQ;AAC1F,UAAM,EAAC,UAAU,OAAO,GAAG,QAAO,IAAI;AAEtC,wBAAoB,SAAS,cAAc,OAAO;AAElD,WAAO,OAAO,mBAAmB,OAAO;AAAA,EAC5C;AAEA,MAAI,EAAE,6BAA6B,UAAU;AACzC,UAAM,IAAI,MAAM,sDAAsD;AAAA,EAC1E;AAEA,SAAO;AACX;","names":[]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ContentScriptDefinition, ContentScriptRenderHandler, ContentScriptRenderValue } from "../../../../types/content.js";
|
|
2
|
-
export declare const isContentScriptDefinition: (definition: any) => definition is ContentScriptDefinition;
|
|
3
|
-
export declare const isValidContentScriptDefinitionRenderValue: (definition: any) => definition is ContentScriptRenderValue | ContentScriptRenderHandler;
|