adnbn 0.11.0 → 0.13.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/manifest/ManifestBase.js +1 -1
- 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 +11 -0
- package/dist/cli/bundler/layers.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +44 -15
- package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +1 -2
- package/dist/cli/bundler/plugins/build-assets-map/index.js +0 -3
- package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -1
- package/dist/cli/bundler/plugins/build-assets-map/normalize.d.ts +3 -0
- package/dist/cli/bundler/plugins/build-assets-map/normalize.js +24 -0
- package/dist/cli/bundler/plugins/build-assets-map/normalize.js.map +1 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates/runtime.template.d.ts +2 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates.d.ts +9 -0
- package/dist/cli/bundler/plugins/build-assets-map/templates.js +32 -0
- package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +3 -6
- package/dist/cli/bundler/plugins/build-assets-map/usage.js +6 -3
- package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -1
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js +11 -0
- package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/index.d.ts +2 -2
- package/dist/cli/bundler/plugins/index.js +2 -6
- package/dist/cli/bundler/plugins/index.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +38 -13
- package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +7 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js +33 -0
- package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.d.ts +4 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js +51 -0
- package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js.map +1 -0
- package/dist/cli/bundler/plugins/isolated-styles/templates.js +36 -6
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +1 -2
- package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -1
- package/dist/cli/bundler/plugins/types.d.ts +4 -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 +2 -0
- package/dist/cli/bundler/plugins/utils/index.js +5 -0
- package/dist/cli/bundler/plugins/utils/index.js.map +1 -1
- 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/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/{output.js → assets.js} +22 -33
- package/dist/cli/bundler/utils/assets.js.map +1 -0
- package/dist/cli/bundler/utils/index.d.ts +2 -3
- package/dist/cli/bundler/utils/index.js +2 -3
- package/dist/cli/bundler/utils/index.js.map +1 -1
- package/dist/cli/entrypoint/file/injectors/core.js +1 -1
- package/dist/cli/entrypoint/finder/ContentFinder.d.ts +1 -1
- package/dist/cli/entrypoint/parser/ContentParser.d.ts +2 -2
- package/dist/cli/entrypoint/parser/ContentParser.js +6 -22
- package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
- package/dist/cli/entrypoint/parser/RelayParser.js +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/content/Content.d.ts +1 -1
- package/dist/cli/plugins/content/ContentDriver.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.d.ts +1 -1
- package/dist/cli/plugins/content/ContentManager.js +1 -1
- package/dist/cli/plugins/content/ContentName.d.ts +1 -1
- package/dist/cli/plugins/content/ContentName.js +1 -1
- package/dist/cli/plugins/content/Relay.d.ts +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 +1 -4
- package/dist/cli/plugins/content/bundler.js +5 -21
- package/dist/cli/plugins/content/bundler.js.map +1 -1
- package/dist/cli/plugins/content/index.js +4 -5
- package/dist/cli/plugins/content/index.js.map +1 -1
- package/dist/cli/plugins/content/types.d.ts +1 -1
- package/dist/cli/plugins/content/utils.d.ts +1 -1
- package/dist/cli/plugins/content/utils.js +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.js +5 -2
- package/dist/cli/plugins/locale/Locale.js.map +1 -1
- package/dist/cli/plugins/locale/index.js +2 -2
- package/dist/cli/plugins/locale/index.js.map +1 -1
- package/dist/cli/plugins/output/index.d.ts +2 -0
- package/dist/cli/plugins/{output.js → output/index.js} +11 -13
- 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/style/index.d.ts +1 -2
- package/dist/cli/plugins/style/index.js +19 -30
- package/dist/cli/plugins/style/index.js.map +1 -1
- package/dist/cli/resolvers/config.js +1 -2
- package/dist/cli/resolvers/config.js.map +1 -1
- package/dist/cli/virtual/index.js +4 -4
- package/dist/cli/virtual/virtual.d.ts +8 -3
- 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 +7 -6
- package/dist/entry/content/adapters/react/Builder.js +12 -19
- package/dist/entry/content/adapters/react/Builder.js.map +1 -1
- package/dist/entry/content/adapters/react/Node.d.ts +6 -14
- package/dist/entry/content/adapters/react/Node.js +11 -35
- package/dist/entry/content/adapters/react/Node.js.map +1 -1
- package/dist/entry/content/adapters/react/definition.d.ts +2 -0
- package/dist/entry/content/adapters/react/definition.js +12 -0
- package/dist/entry/content/adapters/react/definition.js.map +1 -0
- 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/vanilla/Builder.d.ts +7 -5
- package/dist/entry/content/adapters/vanilla/Builder.js +17 -14
- package/dist/entry/content/adapters/vanilla/Builder.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/Node.d.ts +5 -11
- package/dist/entry/content/adapters/vanilla/Node.js +11 -37
- package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
- package/dist/entry/content/adapters/vanilla/definition.d.ts +2 -0
- package/dist/entry/content/adapters/vanilla/definition.js +9 -0
- package/dist/entry/content/adapters/vanilla/definition.js.map +1 -0
- 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/utils.d.ts +1 -0
- package/dist/entry/content/adapters/vanilla/utils.js +7 -0
- package/dist/entry/content/adapters/vanilla/utils.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 +32 -0
- package/dist/entry/content/lifecycle/Builder.js +254 -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 +11 -0
- package/dist/entry/content/lifecycle/MountBuilder.js +73 -0
- package/dist/entry/content/lifecycle/MountBuilder.js.map +1 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.d.ts +7 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.js +45 -0
- package/dist/entry/content/lifecycle/context/ContainerRegistry.js.map +1 -0
- package/dist/entry/content/lifecycle/context/Context.d.ts +17 -0
- package/dist/entry/content/lifecycle/context/Context.js +88 -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 +8 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.js +19 -0
- package/dist/entry/content/lifecycle/context/ManagedContext.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/context/index.d.ts +1 -0
- package/dist/entry/content/lifecycle/context/index.js +11 -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 +5 -3
- 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.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.d.ts +15 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.js +49 -0
- package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.d.ts +30 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js +190 -0
- package/dist/entry/content/lifecycle/nodes/FrameNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.d.ts +3 -2
- package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.js +5 -2
- package/dist/entry/content/lifecycle/nodes/MarkerNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.d.ts +17 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.js +80 -0
- package/dist/entry/content/lifecycle/nodes/MountNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/Node.d.ts +2 -2
- package/dist/entry/content/{core → lifecycle}/nodes/Node.js +2 -2
- package/dist/entry/content/lifecycle/nodes/Node.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.d.ts +28 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js +140 -0
- package/dist/entry/content/lifecycle/nodes/RenderNode.js.map +1 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.d.ts +22 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js +124 -0
- package/dist/entry/content/lifecycle/nodes/ShadowNode.js.map +1 -0
- package/dist/entry/content/{core → lifecycle}/nodes/index.d.ts +1 -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/{core → lifecycle}/nodes/isolated-styles.d.ts +1 -1
- package/dist/entry/content/{core → lifecycle}/nodes/isolated-styles.js +2 -2
- package/dist/entry/content/lifecycle/nodes/isolated-styles.js.map +1 -0
- package/dist/entry/content/lifecycle/types.d.ts +28 -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/resolvers/watch.js +81 -0
- 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 +28 -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/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.js +1 -1
- package/dist/main/entrypoint.js.map +1 -1
- package/dist/main/relay.d.ts +2 -1
- package/dist/main/relay.js.map +1 -1
- package/dist/relay/RelayPermission.js +1 -1
- package/dist/shared/content/isolation.d.ts +1 -1
- package/dist/shared/content/isolation.js +13 -20
- package/dist/shared/content/isolation.js.map +1 -1
- package/dist/shared/locale/index.d.ts +1 -1
- package/dist/shared/locale/index.js +3 -1
- package/dist/shared/locale/index.js.map +1 -1
- package/dist/shared/locale/messages.d.ts +4 -0
- package/dist/shared/locale/messages.js +12 -0
- package/dist/shared/locale/messages.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} +32 -53
- package/dist/types/{content.js → content/common.js} +1 -1
- package/dist/types/content/common.js.map +1 -0
- package/dist/types/content/definition.d.ts +66 -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/locale.d.ts +3 -0
- package/dist/types/locale.js.map +1 -1
- package/dist/types/manifest.d.ts +1 -1
- package/dist/types/relay.d.ts +3 -4
- package/dist/types/relay.js.map +1 -1
- package/dist/virtual/modules.d.ts +4 -3
- package/dist/virtual/{entrypoint.d.ts → runtime.d.ts} +3 -0
- package/dist/virtual/runtime.js +9 -0
- package/dist/virtual/runtime.js.map +1 -0
- package/package.json +32 -25
- 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 +3 -3
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.d.ts +0 -13
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js +0 -16
- package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js.map +0 -1
- package/dist/cli/bundler/utils/layers.d.ts +0 -4
- package/dist/cli/bundler/utils/layers.js +0 -10
- package/dist/cli/bundler/utils/layers.js.map +0 -1
- package/dist/cli/bundler/utils/output.d.ts +0 -6
- package/dist/cli/bundler/utils/output.js.map +0 -1
- package/dist/cli/bundler/utils/styles.d.ts +0 -5
- package/dist/cli/bundler/utils/styles.js +0 -30
- package/dist/cli/bundler/utils/styles.js.map +0 -1
- package/dist/cli/plugins/output.d.ts +0 -2
- package/dist/cli/plugins/output.js.map +0 -1
- package/dist/cli/plugins/style/types.d.ts +0 -5
- 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/adapters/react/resolvers/render.d.ts +0 -2
- package/dist/entry/content/adapters/react/resolvers/render.js +0 -11
- package/dist/entry/content/adapters/react/resolvers/render.js.map +0 -1
- package/dist/entry/content/core/Builder.d.ts +0 -26
- package/dist/entry/content/core/Builder.js +0 -128
- package/dist/entry/content/core/Builder.js.map +0 -1
- package/dist/entry/content/core/MountBuilder.d.ts +0 -10
- package/dist/entry/content/core/MountBuilder.js +0 -48
- package/dist/entry/content/core/MountBuilder.js.map +0 -1
- package/dist/entry/content/core/context/Context.d.ts +0 -12
- package/dist/entry/content/core/context/Context.js +0 -50
- package/dist/entry/content/core/context/Context.js.map +0 -1
- package/dist/entry/content/core/context/EventEmitter.js.map +0 -1
- package/dist/entry/content/core/context/ManagedContext.d.ts +0 -5
- package/dist/entry/content/core/context/ManagedContext.js +0 -12
- package/dist/entry/content/core/context/ManagedContext.js.map +0 -1
- package/dist/entry/content/core/context/index.js +0 -9
- package/dist/entry/content/core/context/index.js.map +0 -1
- package/dist/entry/content/core/markers/AbstractMarker.js.map +0 -1
- package/dist/entry/content/core/markers/AttributeMarker.js.map +0 -1
- package/dist/entry/content/core/markers/WeakMarker.js.map +0 -1
- package/dist/entry/content/core/markers/index.js.map +0 -1
- package/dist/entry/content/core/nodes/EventNode.d.ts +0 -11
- package/dist/entry/content/core/nodes/EventNode.js +0 -35
- package/dist/entry/content/core/nodes/EventNode.js.map +0 -1
- package/dist/entry/content/core/nodes/FrameNode.d.ts +0 -23
- package/dist/entry/content/core/nodes/FrameNode.js +0 -125
- package/dist/entry/content/core/nodes/FrameNode.js.map +0 -1
- package/dist/entry/content/core/nodes/MarkerNode.js.map +0 -1
- package/dist/entry/content/core/nodes/MountNode.d.ts +0 -12
- package/dist/entry/content/core/nodes/MountNode.js +0 -42
- package/dist/entry/content/core/nodes/MountNode.js.map +0 -1
- package/dist/entry/content/core/nodes/Node.js.map +0 -1
- package/dist/entry/content/core/nodes/ShadowNode.d.ts +0 -14
- package/dist/entry/content/core/nodes/ShadowNode.js +0 -67
- package/dist/entry/content/core/nodes/ShadowNode.js.map +0 -1
- package/dist/entry/content/core/nodes/index.js +0 -15
- package/dist/entry/content/core/nodes/index.js.map +0 -1
- package/dist/entry/content/core/nodes/isolated-styles.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 +0 -62
- package/dist/entry/content/core/resolvers/watch.js.map +0 -1
- package/dist/entry/content/frame/Builder.d.ts +0 -7
- package/dist/entry/content/frame/Builder.js +0 -14
- package/dist/entry/content/frame/Builder.js.map +0 -1
- package/dist/entry/content/frame/index.d.ts +0 -4
- package/dist/entry/content/frame/index.js +0 -7
- package/dist/entry/content/frame/index.js.map +0 -1
- package/dist/types/content.js.map +0 -1
- package/dist/virtual/entrypoint.js +0 -7
- package/dist/virtual/entrypoint.js.map +0 -1
- /package/dist/entry/content/{core → lifecycle}/markers/index.d.ts +0 -0
- /package/dist/entry/content/{core → lifecycle}/markers/index.js +0 -0
- /package/dist/{cli/plugins/style → entry/content/lifecycle}/types.js +0 -0
- /package/dist/{cli/plugins/style → entry/content/lifecycle}/types.js.map +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
class MountNode_default {
|
|
2
|
-
constructor(node, mounter) {
|
|
3
|
-
this.node = node;
|
|
4
|
-
this.mounter = mounter;
|
|
5
|
-
}
|
|
6
|
-
node;
|
|
7
|
-
mounter;
|
|
8
|
-
unmounting;
|
|
9
|
-
get anchor() {
|
|
10
|
-
return this.node.anchor;
|
|
11
|
-
}
|
|
12
|
-
get container() {
|
|
13
|
-
return this.node.container;
|
|
14
|
-
}
|
|
15
|
-
get target() {
|
|
16
|
-
return this.node.target;
|
|
17
|
-
}
|
|
18
|
-
mount() {
|
|
19
|
-
this.node.mount();
|
|
20
|
-
if (!this.container || this.container.isConnected) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (this.mounter) {
|
|
24
|
-
const unmounting = this.mounter(this.anchor, this.container);
|
|
25
|
-
if (unmounting) {
|
|
26
|
-
this.unmounting = unmounting;
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
unmount() {
|
|
33
|
-
var _a;
|
|
34
|
-
(_a = this.unmounting) == null ? void 0 : _a.call(this);
|
|
35
|
-
this.unmounting = void 0;
|
|
36
|
-
return !!this.node.unmount();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
MountNode_default as default
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=MountNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/nodes/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 get target(): Element | undefined {\n return this.node.target;\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,EAEA,IAAW,SAA8B;AACrC,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;AA1C9B;AA2CQ,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/nodes/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 get target(): Element | undefined {\n return this.container;\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,EAWjB,IAAW,SAA8B;AACrC,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,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,14 +0,0 @@
|
|
|
1
|
-
import { type ContentScriptShadowOptions, type ContentScriptNode } from "../../../../types/content.js";
|
|
2
|
-
export default class ShadowNode implements ContentScriptNode {
|
|
3
|
-
protected readonly node: ContentScriptNode;
|
|
4
|
-
private readonly options;
|
|
5
|
-
private root?;
|
|
6
|
-
private _target?;
|
|
7
|
-
private runtime?;
|
|
8
|
-
constructor(node: ContentScriptNode, options?: ContentScriptShadowOptions);
|
|
9
|
-
get anchor(): Element;
|
|
10
|
-
get container(): Element | undefined;
|
|
11
|
-
get target(): Element | undefined;
|
|
12
|
-
mount(): boolean;
|
|
13
|
-
unmount(): boolean;
|
|
14
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { getContentScriptStylesRuntime } from "./isolated-styles.js";
|
|
2
|
-
import {
|
|
3
|
-
ContentScriptShadowMode
|
|
4
|
-
} from "./../../../../types/content.js";
|
|
5
|
-
class ShadowNode {
|
|
6
|
-
constructor(node, options = {}) {
|
|
7
|
-
this.node = node;
|
|
8
|
-
this.options = options;
|
|
9
|
-
}
|
|
10
|
-
node;
|
|
11
|
-
options;
|
|
12
|
-
root;
|
|
13
|
-
_target;
|
|
14
|
-
runtime;
|
|
15
|
-
get anchor() {
|
|
16
|
-
return this.node.anchor;
|
|
17
|
-
}
|
|
18
|
-
get container() {
|
|
19
|
-
return this.node.container;
|
|
20
|
-
}
|
|
21
|
-
get target() {
|
|
22
|
-
return this._target;
|
|
23
|
-
}
|
|
24
|
-
mount() {
|
|
25
|
-
const mounted = !!this.node.mount();
|
|
26
|
-
if (!this.container || this.root) {
|
|
27
|
-
return mounted;
|
|
28
|
-
}
|
|
29
|
-
if (!("attachShadow" in this.container) || typeof this.container.attachShadow !== "function") {
|
|
30
|
-
throw new Error("Content script container does not support Shadow DOM");
|
|
31
|
-
}
|
|
32
|
-
if (this.container.shadowRoot) {
|
|
33
|
-
throw new Error("Content script container already has an open ShadowRoot");
|
|
34
|
-
}
|
|
35
|
-
let root;
|
|
36
|
-
try {
|
|
37
|
-
root = this.container.attachShadow({ mode: this.options.mode ?? ContentScriptShadowMode.Open });
|
|
38
|
-
} catch (cause) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
"Cannot attach ShadowRoot: the content script container may already have a root or not support Shadow DOM",
|
|
41
|
-
{ cause }
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
const target = this.container.ownerDocument.createElement("div");
|
|
45
|
-
root.appendChild(target);
|
|
46
|
-
const runtime = getContentScriptStylesRuntime();
|
|
47
|
-
runtime.add(root, target);
|
|
48
|
-
this.root = root;
|
|
49
|
-
this._target = target;
|
|
50
|
-
this.runtime = runtime;
|
|
51
|
-
return mounted;
|
|
52
|
-
}
|
|
53
|
-
unmount() {
|
|
54
|
-
var _a;
|
|
55
|
-
if (this.root) {
|
|
56
|
-
(_a = this.runtime) == null ? void 0 : _a.delete(this.root);
|
|
57
|
-
}
|
|
58
|
-
this.root = void 0;
|
|
59
|
-
this._target = void 0;
|
|
60
|
-
this.runtime = void 0;
|
|
61
|
-
return !!this.node.unmount();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
ShadowNode as default
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=ShadowNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/nodes/ShadowNode.ts"],"sourcesContent":["import {getContentScriptStylesRuntime} from \"./isolated-styles\";\nimport {\n ContentScriptShadowMode,\n type ContentScriptShadowOptions,\n type ContentScriptStylesRuntime,\n type ContentScriptNode,\n} from \"@typing/content\";\n\nexport default class ShadowNode implements ContentScriptNode {\n private root?: ShadowRoot;\n\n private _target?: Element;\n\n private runtime?: ContentScriptStylesRuntime;\n\n public constructor(\n protected readonly node: ContentScriptNode,\n private readonly options: ContentScriptShadowOptions = {}\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 get target(): Element | undefined {\n return this._target;\n }\n\n public mount(): boolean {\n const mounted = !!this.node.mount();\n\n if (!this.container || this.root) {\n return mounted;\n }\n\n if (!(\"attachShadow\" in this.container) || typeof this.container.attachShadow !== \"function\") {\n throw new Error(\"Content script container does not support Shadow DOM\");\n }\n\n if (this.container.shadowRoot) {\n throw new Error(\"Content script container already has an open ShadowRoot\");\n }\n\n let root: ShadowRoot;\n try {\n root = this.container.attachShadow({mode: this.options.mode ?? ContentScriptShadowMode.Open});\n } catch (cause) {\n // A pre-existing closed root is not observable through container.shadowRoot.\n throw new Error(\n \"Cannot attach ShadowRoot: the content script container may already have a root or not support Shadow DOM\",\n {cause}\n );\n }\n const target = this.container.ownerDocument.createElement(\"div\");\n root.appendChild(target);\n\n const runtime = getContentScriptStylesRuntime();\n runtime.add(root, target);\n\n this.root = root;\n this._target = target;\n this.runtime = runtime;\n\n return mounted;\n }\n\n public unmount(): boolean {\n if (this.root) {\n this.runtime?.delete(this.root);\n }\n\n this.root = undefined;\n this._target = undefined;\n this.runtime = undefined;\n\n return !!this.node.unmount();\n }\n}\n"],"mappings":"AAAA,SAAQ,qCAAoC;AAC5C;AAAA,EACI;AAAA,OAIG;AAEP,MAAO,WAAsD;AAAA,EAOlD,YACgB,MACF,UAAsC,CAAC,GAC1D;AAFqB;AACF;AAAA,EAClB;AAAA,EAFoB;AAAA,EACF;AAAA,EARb;AAAA,EAEA;AAAA,EAEA;AAAA,EAOR,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,SAA8B;AACrC,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,QAAiB;AACpB,UAAM,UAAU,CAAC,CAAC,KAAK,KAAK,MAAM;AAElC,QAAI,CAAC,KAAK,aAAa,KAAK,MAAM;AAC9B,aAAO;AAAA,IACX;AAEA,QAAI,EAAE,kBAAkB,KAAK,cAAc,OAAO,KAAK,UAAU,iBAAiB,YAAY;AAC1F,YAAM,IAAI,MAAM,sDAAsD;AAAA,IAC1E;AAEA,QAAI,KAAK,UAAU,YAAY;AAC3B,YAAM,IAAI,MAAM,yDAAyD;AAAA,IAC7E;AAEA,QAAI;AACJ,QAAI;AACA,aAAO,KAAK,UAAU,aAAa,EAAC,MAAM,KAAK,QAAQ,QAAQ,wBAAwB,KAAI,CAAC;AAAA,IAChG,SAAS,OAAO;AAEZ,YAAM,IAAI;AAAA,QACN;AAAA,QACA,EAAC,MAAK;AAAA,MACV;AAAA,IACJ;AACA,UAAM,SAAS,KAAK,UAAU,cAAc,cAAc,KAAK;AAC/D,SAAK,YAAY,MAAM;AAEvB,UAAM,UAAU,8BAA8B;AAC9C,YAAQ,IAAI,MAAM,MAAM;AAExB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,UAAU;AAEf,WAAO;AAAA,EACX;AAAA,EAEO,UAAmB;AAtE9B;AAuEQ,QAAI,KAAK,MAAM;AACX,iBAAK,YAAL,mBAAc,OAAO,KAAK;AAAA,IAC9B;AAEA,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,UAAU;AAEf,WAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;AAAA,EAC/B;AACJ;","names":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as default2 } from "./Node.js";
|
|
2
|
-
import { default as default3 } from "./MountNode.js";
|
|
3
|
-
import { default as default4 } from "./MarkerNode.js";
|
|
4
|
-
import { default as default5 } from "./EventNode.js";
|
|
5
|
-
import { default as default6 } from "./ShadowNode.js";
|
|
6
|
-
import { default as default7 } from "./FrameNode.js";
|
|
7
|
-
export {
|
|
8
|
-
default5 as EventNode,
|
|
9
|
-
default7 as FrameNode,
|
|
10
|
-
default4 as MarkerNode,
|
|
11
|
-
default3 as MountNode,
|
|
12
|
-
default2 as Node,
|
|
13
|
-
default6 as ShadowNode
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/nodes/index.ts"],"sourcesContent":["export {default as Node} from \"./Node\";\nexport {default as MountNode} from \"./MountNode\";\nexport {default as MarkerNode} from \"./MarkerNode\";\nexport {default as EventNode} from \"./EventNode\";\nexport {default as ShadowNode} from \"./ShadowNode\";\nexport {default as FrameNode} from \"./FrameNode\";\n"],"mappings":"AAAA,SAAmB,WAAXA,gBAAsB;AAC9B,SAAmB,WAAXA,gBAA2B;AACnC,SAAmB,WAAXA,gBAA4B;AACpC,SAAmB,WAAXA,gBAA2B;AACnC,SAAmB,WAAXA,gBAA4B;AACpC,SAAmB,WAAXA,gBAA2B;","names":["default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/nodes/isolated-styles.ts"],"sourcesContent":["import {getUrl} from \"@addon-core/browser\";\n\nimport {ContentScriptStylesRuntimeProperty, type ContentScriptStylesRuntime} from \"@typing/content\";\n\ninterface WebpackRuntime {\n (moduleId: string | number): unknown;\n [ContentScriptStylesRuntimeProperty]?: ContentScriptStylesRuntime;\n}\n\ndeclare const __webpack_require__: WebpackRuntime;\n\nexport const getContentScriptStylesRuntime = (): ContentScriptStylesRuntime => {\n const runtime =\n typeof __webpack_require__ === \"function\" ? __webpack_require__[ContentScriptStylesRuntimeProperty] : undefined;\n\n if (!runtime) {\n throw new Error(\"Isolated styles runtime is unavailable in this content entrypoint\");\n }\n\n runtime.initialize(getUrl);\n\n return runtime;\n};\n"],"mappings":"AAAA,SAAQ,cAAa;AAErB,SAAQ,0CAA0E;AAS3E,MAAM,gCAAgC,MAAkC;AAC3E,QAAM,UACF,OAAO,wBAAwB,aAAa,oBAAoB,kCAAkC,IAAI;AAE1G,MAAI,CAAC,SAAS;AACV,UAAM,IAAI,MAAM,mEAAmE;AAAA,EACvF;AAEA,UAAQ,WAAW,MAAM;AAEzB,SAAO;AACX;","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;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isValidContentScriptRenderValue } from "./render.js";
|
|
2
|
-
const isContentScriptDefinition = (definition) => {
|
|
3
|
-
return definition && typeof definition === "object" && definition.constructor === Object && !("$$typeof" in definition);
|
|
4
|
-
};
|
|
5
|
-
const isValidContentScriptDefinitionRenderValue = (definition) => {
|
|
6
|
-
return isValidContentScriptRenderValue(definition) || typeof definition === "function" || typeof definition === "object" && definition.constructor === Object && "$$typeof" in definition;
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
isContentScriptDefinition,
|
|
10
|
-
isValidContentScriptDefinitionRenderValue
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=definition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/definition.ts"],"sourcesContent":["import {isValidContentScriptRenderValue} from \"./render\";\n\nimport {ContentScriptDefinition, ContentScriptRenderHandler, ContentScriptRenderValue} from \"@typing/content\";\n\nexport const isContentScriptDefinition = (definition: any): definition is ContentScriptDefinition => {\n return (\n definition && typeof definition === \"object\" && definition.constructor === Object && !(\"$$typeof\" in definition)\n );\n};\n\nexport const isValidContentScriptDefinitionRenderValue = (\n definition: any\n): definition is ContentScriptRenderValue | ContentScriptRenderHandler => {\n return (\n isValidContentScriptRenderValue(definition) ||\n typeof definition === \"function\" ||\n (typeof definition === \"object\" && definition.constructor === Object && \"$$typeof\" in definition)\n );\n};\n"],"mappings":"AAAA,SAAQ,uCAAsC;AAIvC,MAAM,4BAA4B,CAAC,eAA2D;AACjG,SACI,cAAc,OAAO,eAAe,YAAY,WAAW,gBAAgB,UAAU,EAAE,cAAc;AAE7G;AAEO,MAAM,4CAA4C,CACrD,eACsE;AACtE,SACI,gCAAgC,UAAU,KAC1C,OAAO,eAAe,cACrB,OAAO,eAAe,YAAY,WAAW,gBAAgB,UAAU,cAAc;AAE9F;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/index.ts"],"sourcesContent":["export * from \"./anchor\";\nexport * from \"./container\";\nexport * from \"./definition\";\nexport * from \"./mount\";\nexport * from \"./render\";\nexport * from \"./watch\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/mount.ts"],"sourcesContent":["import {ContentScriptAppend, ContentScriptMountFunction} from \"@typing/content\";\n\n// prettier-ignore\nexport const contentScriptMountAppendResolver =\n (append?: ContentScriptAppend): ContentScriptMountFunction =>\n (anchor: Element, container: Element): void => {\n switch (append) {\n case ContentScriptAppend.Last:\n anchor.append(container);\n break;\n default:\n case undefined:\n case ContentScriptAppend.First:\n anchor.prepend(container);\n break;\n case ContentScriptAppend.Replace:\n anchor.replaceWith(container);\n break;\n case ContentScriptAppend.After:\n anchor.parentElement?.insertBefore(container, anchor.nextElementSibling);\n break;\n case ContentScriptAppend.Before:\n anchor.parentElement?.insertBefore(container, anchor);\n break;\n }\n };\n"],"mappings":"AAAA,SAAQ,2BAAsD;AAGvD,MAAM,mCACT,CAAC,WACG,CAAC,QAAiB,cAA6B;AALvD;AAMY,UAAQ,QAAQ;AAAA,IACZ,KAAK,oBAAoB;AACrB,aAAO,OAAO,SAAS;AACvB;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,KAAK,oBAAoB;AACrB,aAAO,QAAQ,SAAS;AACxB;AAAA,IACJ,KAAK,oBAAoB;AACrB,aAAO,YAAY,SAAS;AAC5B;AAAA,IACJ,KAAK,oBAAoB;AACrB,mBAAO,kBAAP,mBAAsB,aAAa,WAAW,OAAO;AACrD;AAAA,IACJ,KAAK,oBAAoB;AACrB,mBAAO,kBAAP,mBAAsB,aAAa,WAAW;AAC9C;AAAA,EACR;AACJ;","names":[]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ContentScriptRenderHandler, ContentScriptRenderValue } from "../../../../types/content.js";
|
|
2
|
-
export declare const isValidContentScriptRenderValue: (value: unknown) => value is string | number | Element;
|
|
3
|
-
export declare const contentScriptRenderResolver: (render?: ContentScriptRenderValue | ContentScriptRenderHandler) => ContentScriptRenderHandler;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const isValidContentScriptRenderValue = (value) => {
|
|
2
|
-
return typeof value === "string" && value.length > 0 || typeof value === "number" || value instanceof Element;
|
|
3
|
-
};
|
|
4
|
-
const contentScriptRenderResolver = (render) => async (props) => {
|
|
5
|
-
let resolvedRender = typeof render === "function" ? render(props) : render;
|
|
6
|
-
if (resolvedRender instanceof Promise) {
|
|
7
|
-
resolvedRender = await resolvedRender;
|
|
8
|
-
}
|
|
9
|
-
if (resolvedRender !== true && !isValidContentScriptRenderValue(resolvedRender)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
return resolvedRender;
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
contentScriptRenderResolver,
|
|
16
|
-
isValidContentScriptRenderValue
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=render.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/render.ts"],"sourcesContent":["import {ContentScriptRenderHandler, ContentScriptRenderValue} from \"@typing/content\";\n\nexport const isValidContentScriptRenderValue = (value: unknown): value is string | number | Element => {\n return (typeof value === \"string\" && value.length > 0) || typeof value === \"number\" || value instanceof Element;\n};\n\n// prettier-ignore\nexport const contentScriptRenderResolver =\n (render?: ContentScriptRenderValue | ContentScriptRenderHandler): ContentScriptRenderHandler =>\n async (props): Promise<undefined | ContentScriptRenderValue> => {\n let resolvedRender = typeof render === \"function\" ? render(props) : render;\n\n if (resolvedRender instanceof Promise) {\n resolvedRender = await resolvedRender;\n }\n\n if (resolvedRender !== true && !isValidContentScriptRenderValue(resolvedRender)) {\n return;\n }\n\n return resolvedRender;\n };\n"],"mappings":"AAEO,MAAM,kCAAkC,CAAC,UAAuD;AACnG,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,KAAM,OAAO,UAAU,YAAY,iBAAiB;AAC5G;AAGO,MAAM,8BACT,CAAC,WACG,OAAO,UAAyD;AAC5D,MAAI,iBAAiB,OAAO,WAAW,aAAa,OAAO,KAAK,IAAI;AAEpE,MAAI,0BAA0B,SAAS;AACnC,qBAAiB,MAAM;AAAA,EAC3B;AAEA,MAAI,mBAAmB,QAAQ,CAAC,gCAAgC,cAAc,GAAG;AAC7E;AAAA,EACJ;AAEA,SAAO;AACX;","names":[]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ContentScriptWatchStrategy } from "../../../../types/content.js";
|
|
2
|
-
export declare const contentScriptMutationObserverResolver: (options?: MutationObserverInit) => ContentScriptWatchStrategy;
|
|
3
|
-
export declare const contentScriptAwaitFirstResolver: (options?: MutationObserverInit) => ContentScriptWatchStrategy;
|
|
4
|
-
export declare const contentScriptLocationResolver: (strategy: ContentScriptWatchStrategy) => ContentScriptWatchStrategy;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import debounce from "debounce";
|
|
2
|
-
const contentScriptMutationObserverResolver = (options) => (update) => {
|
|
3
|
-
if (!options) {
|
|
4
|
-
options = {};
|
|
5
|
-
}
|
|
6
|
-
const handle = debounce(update, 200);
|
|
7
|
-
const observer = new MutationObserver(handle);
|
|
8
|
-
observer.observe(document.body ?? document.documentElement ?? document, {
|
|
9
|
-
childList: true,
|
|
10
|
-
subtree: true,
|
|
11
|
-
attributes: true,
|
|
12
|
-
characterData: true,
|
|
13
|
-
...options
|
|
14
|
-
});
|
|
15
|
-
return () => {
|
|
16
|
-
handle.clear();
|
|
17
|
-
observer.disconnect();
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
const contentScriptAwaitFirstResolver = (options) => (update, context) => {
|
|
21
|
-
const resolver = contentScriptMutationObserverResolver({
|
|
22
|
-
attributes: false,
|
|
23
|
-
characterData: false,
|
|
24
|
-
...options
|
|
25
|
-
});
|
|
26
|
-
let unwatch;
|
|
27
|
-
const clear = () => {
|
|
28
|
-
unwatch && unwatch();
|
|
29
|
-
unwatch = void 0;
|
|
30
|
-
};
|
|
31
|
-
if (context.nodes.size === 0) {
|
|
32
|
-
unwatch = resolver(() => {
|
|
33
|
-
update();
|
|
34
|
-
if (context.nodes.size > 0) {
|
|
35
|
-
clear();
|
|
36
|
-
}
|
|
37
|
-
}, context);
|
|
38
|
-
}
|
|
39
|
-
return () => {
|
|
40
|
-
clear();
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const contentScriptLocationResolver = (strategy) => (update, context) => {
|
|
44
|
-
let currentUrl = location.href;
|
|
45
|
-
const interval = setInterval(() => {
|
|
46
|
-
if (currentUrl !== location.href) {
|
|
47
|
-
currentUrl = location.href;
|
|
48
|
-
context.mount();
|
|
49
|
-
}
|
|
50
|
-
}, 300);
|
|
51
|
-
const unwatch = strategy(update, context);
|
|
52
|
-
return () => {
|
|
53
|
-
clearInterval(interval);
|
|
54
|
-
unwatch();
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
contentScriptAwaitFirstResolver,
|
|
59
|
-
contentScriptLocationResolver,
|
|
60
|
-
contentScriptMutationObserverResolver
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=watch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/core/resolvers/watch.ts"],"sourcesContent":["import debounce from \"debounce\";\n\nimport {ContentScriptWatchStrategy} from \"@typing/content\";\n\n// prettier-ignore\nexport const contentScriptMutationObserverResolver =\n (options?: MutationObserverInit): ContentScriptWatchStrategy =>\n update => {\n if (!options) {\n options = {};\n }\n\n const handle = debounce(update, 200);\n\n const observer = new MutationObserver(handle);\n\n observer.observe(document.body ?? document.documentElement ?? document, {\n childList: true,\n subtree: true,\n attributes: true,\n characterData: true,\n ...options,\n });\n\n return () => {\n handle.clear();\n observer.disconnect();\n };\n };\n\n// prettier-ignore\nexport const contentScriptAwaitFirstResolver =\n (options?: MutationObserverInit): ContentScriptWatchStrategy =>\n (update, context) => {\n const resolver = contentScriptMutationObserverResolver({\n attributes: false,\n characterData: false,\n ...options,\n });\n\n let unwatch: { (): void } | undefined;\n\n const clear = () => {\n unwatch && unwatch();\n unwatch = undefined;\n };\n\n if (context.nodes.size === 0) {\n unwatch = resolver(() => {\n update();\n\n if (context.nodes.size > 0) {\n clear();\n }\n }, context);\n }\n\n return () => {\n clear();\n };\n };\n\n// prettier-ignore\nexport const contentScriptLocationResolver =\n (strategy: ContentScriptWatchStrategy): ContentScriptWatchStrategy =>\n (update, context) => {\n let currentUrl = location.href;\n\n const interval = setInterval(() => {\n if (currentUrl !== location.href) {\n currentUrl = location.href;\n\n context.mount();\n }\n }, 300);\n\n const unwatch = strategy(update, context);\n\n return () => {\n clearInterval(interval);\n unwatch();\n };\n };\n"],"mappings":"AAAA,OAAO,cAAc;AAKd,MAAM,wCACT,CAAC,YACG,YAAU;AACN,MAAI,CAAC,SAAS;AACV,cAAU,CAAC;AAAA,EACf;AAEA,QAAM,SAAS,SAAS,QAAQ,GAAG;AAEnC,QAAM,WAAW,IAAI,iBAAiB,MAAM;AAE5C,WAAS,QAAQ,SAAS,QAAQ,SAAS,mBAAmB,UAAU;AAAA,IACpE,WAAW;AAAA,IACX,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,GAAG;AAAA,EACP,CAAC;AAED,SAAO,MAAM;AACT,WAAO,MAAM;AACb,aAAS,WAAW;AAAA,EACxB;AACJ;AAGD,MAAM,kCACT,CAAC,YACG,CAAC,QAAQ,YAAY;AACjB,QAAM,WAAW,sCAAsC;AAAA,IACnD,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,GAAG;AAAA,EACP,CAAC;AAED,MAAI;AAEJ,QAAM,QAAQ,MAAM;AAChB,eAAW,QAAQ;AACnB,cAAU;AAAA,EACd;AAEA,MAAI,QAAQ,MAAM,SAAS,GAAG;AAC1B,cAAU,SAAS,MAAM;AACrB,aAAO;AAEP,UAAI,QAAQ,MAAM,OAAO,GAAG;AACxB,cAAM;AAAA,MACV;AAAA,IACJ,GAAG,OAAO;AAAA,EACd;AAEA,SAAO,MAAM;AACT,UAAM;AAAA,EACV;AACJ;AAGD,MAAM,gCACT,CAAC,aACG,CAAC,QAAQ,YAAY;AACjB,MAAI,aAAa,SAAS;AAE1B,QAAM,WAAW,YAAY,MAAM;AAC/B,QAAI,eAAe,SAAS,MAAM;AAC9B,mBAAa,SAAS;AAEtB,cAAQ,MAAM;AAAA,IAClB;AAAA,EACJ,GAAG,GAAG;AAEN,QAAM,UAAU,SAAS,QAAQ,OAAO;AAExC,SAAO,MAAM;AACT,kBAAc,QAAQ;AACtB,YAAQ;AAAA,EACZ;AACJ;","names":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import MountBuilder from "../core/MountBuilder.js";
|
|
2
|
-
import type { ContentScriptDefinition, ContentScriptNode } from "../../../types/content.js";
|
|
3
|
-
/** Page/src navigation has a document owner of its own and does not use a UI renderer. */
|
|
4
|
-
export default class Builder extends MountBuilder {
|
|
5
|
-
constructor(definition: ContentScriptDefinition);
|
|
6
|
-
protected createNode(anchor: Element): Promise<ContentScriptNode>;
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import MountBuilder from "../core/MountBuilder.js";
|
|
2
|
-
import EventNode from "../core/nodes/EventNode.js";
|
|
3
|
-
class Builder extends MountBuilder {
|
|
4
|
-
constructor(definition) {
|
|
5
|
-
super(definition);
|
|
6
|
-
}
|
|
7
|
-
async createNode(anchor) {
|
|
8
|
-
return new EventNode(await super.createNode(anchor), this.emitter);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
Builder as default
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/frame/Builder.ts"],"sourcesContent":["import MountBuilder from \"../core/MountBuilder\";\nimport EventNode from \"../core/nodes/EventNode\";\nimport type {ContentScriptDefinition, ContentScriptNode} from \"@typing/content\";\n\n/** Page/src navigation has a document owner of its own and does not use a UI renderer. */\nexport default class Builder extends MountBuilder {\n public constructor(definition: ContentScriptDefinition) {\n super(definition);\n }\n\n protected async createNode(anchor: Element): Promise<ContentScriptNode> {\n return new EventNode(await super.createNode(anchor), this.emitter);\n }\n}\n"],"mappings":"AAAA,OAAO,kBAAkB;AACzB,OAAO,eAAe;AAItB,MAAO,gBAA8B,aAAa;AAAA,EACvC,YAAY,YAAqC;AACpD,UAAM,UAAU;AAAA,EACpB;AAAA,EAEA,MAAgB,WAAW,QAA6C;AACpE,WAAO,IAAI,UAAU,MAAM,MAAM,WAAW,MAAM,GAAG,KAAK,OAAO;AAAA,EACrE;AACJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/entry/content/frame/index.ts"],"sourcesContent":["import Builder from \"./Builder\";\n\nexport {Builder};\nexport default Builder.resolver();\n"],"mappings":"AAAA,OAAO,aAAa;AAGpB,IAAO,gBAAQ,QAAQ,SAAS;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/content.ts"],"sourcesContent":["import type {PageAlias} from \"@typing/page\";\nimport type {FC, ReactNode} from \"react\";\nimport {Optional} from \"utility-types\";\n\nimport {EntrypointBuilder, EntrypointOptions} from \"@typing/entrypoint\";\nimport {Awaiter, PickNonFunctionProperties} from \"@typing/helpers\";\n\nexport const ContentScriptMatches = [\"http://*/*\", \"https://*/*\"];\n\n/** Shared property used by the bundler plugin and the content script's style runtime getter. */\nexport const ContentScriptStylesRuntimeProperty = \"__adnbnIsolatedStyles\";\n\nexport enum ContentScriptWorld {\n Isolated = \"ISOLATED\",\n Main = \"MAIN\",\n}\n\nexport enum ContentScriptDeclarative {\n Required = \"required\",\n Optional = \"optional\",\n}\n\nexport enum ContentScriptIsolation {\n None = \"none\",\n Shadow = \"shadow\",\n Iframe = \"iframe\",\n}\n\nexport enum ContentScriptShadowMode {\n Open = \"open\",\n Closed = \"closed\",\n}\n\n// Append\nexport enum ContentScriptAppend {\n Last = \"last\",\n First = \"first\",\n Replace = \"replace\",\n Before = \"before\",\n After = \"after\",\n}\n\n// Marker\nexport enum ContentScriptMarker {\n /** In-memory marking (no DOM mutations). */\n Weak = \"weak\",\n /** DOM attribute-based marking. */\n Attribute = \"attribute\",\n}\n\nexport enum ContentScriptMarkerValue {\n Mounted = \"1\",\n Unmounted = \"0\",\n}\n\n// Event\nexport enum ContentScriptEvent {\n Mount = \"mount\",\n Unmount = \"unmount\",\n Add = \"add\",\n Remove = \"remove\",\n}\n\ntype RunAt = chrome.extensionTypes.RunAt;\n\nexport interface ContentScriptStylesRuntime {\n /** Resolves initial stylesheet URLs once, before the first root is registered. */\n initialize(resolveUrl: (file: string) => string): void;\n /** Retry restored styles once on load error; future loads keep the default failure behavior. */\n add(root: ShadowRoot | HTMLElement, target: Element | null, retry?: boolean): void;\n delete(root: ShadowRoot | HTMLElement): void;\n load(url: string): Promise<void>;\n}\n\nexport type ContentScriptWorldValue = ContentScriptWorld | `${chrome.scripting.ExecutionWorld}`;\n\nexport interface ContentScriptConfig {\n matches?: string[];\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default []\n */\n excludeMatches?: string[];\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default []\n */\n includeGlobs?: string[];\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default []\n */\n excludeGlobs?: string[];\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default false\n */\n allFrames?: boolean;\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default \"documentIdle\"\n */\n runAt?: RunAt;\n /**\n * See https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#isolated_world\n *\n * Dynamic imports keep physical async chunks in ISOLATED. MAIN keeps the same Promise-based\n * execution semantics but includes dynamic dependencies in the initial entrypoint graph.\n * Manifest V2 builds always use ISOLATED. Requesting MAIN emits a build warning and applies\n * ISOLATED grouping and chunk loading rules before generating the manifest.\n */\n world?: ContentScriptWorldValue;\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default false\n */\n matchAboutBlank?: boolean;\n /**\n * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/\n * @default false\n */\n matchOriginAsFallback?: boolean;\n /**\n * Whether this content script requires explicit host permission declaration in the extension manifest.\n *\n * Accepted values:\n * - ContentScriptDeclarative.Required — adds the corresponding host patterns to manifest.host_permissions.\n * - ContentScriptDeclarative.Optional — adds the corresponding host patterns to manifest.optional_host_permissions.\n *\n * Backward compatibility:\n * - true ≡ ContentScriptDeclarative.Required\n * - false ≡ undefined (as if the value is not set)\n *\n * @see https://developer.chrome.com/docs/extensions/mv3/declare_permissions/\n *\n * @default undefined\n */\n declarative?: boolean | `${ContentScriptDeclarative}` | ContentScriptDeclarative;\n}\n\nexport type ContentScriptOptions = ContentScriptConfig & EntrypointOptions;\n\nexport interface ContentScriptShadowOptions {\n /**\n * Controls access through the host's shadowRoot property, not CSS isolation or UI visibility.\n * @default ContentScriptShadowMode.Open\n */\n mode?: ContentScriptShadowMode | `${ContentScriptShadowMode}`;\n}\n\nexport interface ContentScriptFrameOptions {\n width?: number | string;\n /** Defaults to 150px. Automatic height is not supported yet. */\n height?: number | string;\n}\n\nexport interface ContentScriptFrameRenderOptions extends ContentScriptFrameOptions {\n page?: never;\n src?: never;\n}\n\nexport interface ContentScriptFramePageOptions extends ContentScriptFrameOptions {\n page: PageAlias;\n src?: never;\n}\n\nexport interface ContentScriptFrameSourceOptions extends ContentScriptFrameOptions {\n src: string;\n page?: never;\n}\n\nexport type ContentScriptFrame =\n | ContentScriptFrameRenderOptions\n | ContentScriptFramePageOptions\n | ContentScriptFrameSourceOptions;\n\nexport interface ContentScriptIsolationNoneOptions {\n type: ContentScriptIsolation.None | \"none\";\n mode?: never;\n page?: never;\n src?: never;\n width?: never;\n height?: never;\n}\n\nexport interface ContentScriptIsolationShadowOptions extends ContentScriptShadowOptions {\n type: ContentScriptIsolation.Shadow | \"shadow\";\n page?: never;\n src?: never;\n width?: never;\n height?: never;\n}\n\nexport type ContentScriptIsolationFrameOptions = ContentScriptFrame & {\n type: ContentScriptIsolation.Iframe | \"iframe\";\n mode?: never;\n};\n\n/** Object form of isolation, also used after resolving shorthand values. */\nexport type ContentScriptIsolationOptions =\n | ContentScriptIsolationNoneOptions\n | ContentScriptIsolationShadowOptions\n | ContentScriptIsolationFrameOptions;\n\nexport type ContentScriptIsolationValue =\n | ContentScriptIsolation\n | `${ContentScriptIsolation}`\n | ContentScriptIsolationOptions;\n\n/** Statically resolved configuration; runtime render values are never retained here. */\nexport type ContentScriptEntrypointOptions = Partial<ContentScriptOptions> & {\n isolation?: ContentScriptIsolationOptions;\n};\n\n// Mount\nexport type ContentScriptMountFunction = (anchor: Element, container: Element) => void | (() => void);\n\nexport interface ContentScriptMount {\n mount(): boolean | undefined | void;\n\n unmount(): boolean | undefined | void;\n}\n\n// Props\nexport interface ContentScriptProps extends ContentScriptEntrypointOptions {\n anchor: Element;\n}\n\n// Anchor\nexport type ContentScriptAnchor = string | Element | null | undefined;\n\nexport type ContentScriptAnchorGetter = () => Awaiter<ContentScriptAnchor>;\n\nexport interface ContentScriptMarkerContract {\n for(anchor: ContentScriptAnchor): ContentScriptMarkerContract;\n\n /**\n * Returns elements that are not tracked yet (no marker attribute present).\n * MUST NOT mutate marker state.\n */\n unmarked(): Element[];\n\n marked(): Element[];\n\n mark(element: Element, value: ContentScriptMarkerValue): boolean;\n\n unmark(element: Element): boolean;\n\n isMarked(element: Element): boolean;\n\n value(element: Element): ContentScriptMarkerValue | undefined;\n\n mount(element: Element): boolean;\n\n unmount(element: Element): boolean;\n\n reset(): ContentScriptMarkerContract;\n}\n\nexport type ContentScriptMarkerType =\n | ContentScriptMarker\n | `${ContentScriptMarker}`\n | ContentScriptMarkerContract\n | undefined;\n\nexport type ContentScriptMarkerGetter = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerType>;\n\nexport type ContentScriptMarkerResolver = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerContract>;\n\n// Render\nexport type ContentScriptRenderReactComponent = FC<ContentScriptProps>;\n\nexport type ContentScriptRenderValue = Element | ReactNode | ContentScriptRenderReactComponent;\n\nexport type ContentScriptRenderHandler = (props: ContentScriptProps) => Awaiter<undefined | ContentScriptRenderValue>;\n\n// Container\nexport type ContentScriptContainerTag = Exclude<keyof HTMLElementTagNameMap, \"html\" | \"body\">;\n\nexport type ContentScriptContainerOptions = {\n [Tag in ContentScriptContainerTag]: {\n tagName: Tag;\n } & Exclude<Optional<PickNonFunctionProperties<HTMLElementTagNameMap[Tag]>>, \"id\">;\n}[ContentScriptContainerTag];\n\nexport type ContentScriptContainerFactory = (\n props: ContentScriptProps\n) => Awaiter<Element | ContentScriptContainerTag | ContentScriptContainerOptions>;\n\nexport type ContentScriptContainerCreator = (props: ContentScriptProps) => Awaiter<Element>;\n\n// Watch\nexport type ContentScriptWatchStrategy = (update: () => void, context: ContentScriptContext) => () => void;\n\nexport type ContentScriptEventCallback = (event: ContentScriptEvent, node: ContentScriptNode) => void;\n\nexport interface ContentScriptEventEmitter {\n on(callback: ContentScriptEventCallback): void;\n\n off(callback: ContentScriptEventCallback): void;\n\n emit(event: ContentScriptEvent, node: ContentScriptNode): void;\n\n emitMount(node: ContentScriptNode): void;\n\n emitUnmount(node: ContentScriptNode): void;\n\n emitAdd(node: ContentScriptNode): void;\n\n emitRemove(node: ContentScriptNode): void;\n\n removeAllListeners(): void;\n\n listenerCount(): number;\n\n hasListeners(): boolean;\n}\n\n// Context\nexport interface ContentScriptContext extends ContentScriptMount {\n nodes: ReadonlySet<ContentScriptNode>;\n\n /**\n * Registers a callback function that will be invoked when a specific content script context event occurs.\n *\n * @param {ContentScriptEventCallback} callback - The function to be executed when the event is triggered. Receives event-related data as its argument.\n * @return {Function} A function that can be called to unsubscribe the callback from the event.\n */\n watch(callback: ContentScriptEventCallback): () => void;\n\n /**\n * Stops watching for changes or events that were previously being observed.\n * Unsubscribes from all event listeners that were registered through the watch method.\n *\n * @return {void} No return value.\n */\n unwatch(): void;\n}\n\n// Main\nexport type ContentScriptMainFunction = (context: ContentScriptContext, options: ContentScriptOptions) => Awaiter<void>;\n\n// Node\nexport interface ContentScriptNode extends ContentScriptMount {\n anchor: Element;\n container?: Element;\n\n /** Element used by the active adapter as the destination for rendered UI. */\n target?: Element;\n}\n\nexport type ContentScriptNodeSet = Set<ContentScriptNode>;\n\n// Definition\nexport interface ContentScriptDefinitionBase extends Partial<ContentScriptOptions> {\n marker?: ContentScriptMarkerType | ContentScriptMarkerGetter;\n anchor?: ContentScriptAnchor | ContentScriptAnchorGetter;\n mount?: ContentScriptMountFunction;\n container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory;\n watch?: true | ContentScriptWatchStrategy;\n main?: ContentScriptMainFunction;\n}\n\nexport type ContentScriptDefinition = ContentScriptDefinitionBase &\n (\n | {\n isolation?:\n | ContentScriptIsolation\n | `${ContentScriptIsolation}`\n | ContentScriptIsolationNoneOptions\n | ContentScriptIsolationShadowOptions\n | (ContentScriptIsolationFrameOptions & ContentScriptFrameRenderOptions);\n render?: ContentScriptRenderValue | ContentScriptRenderHandler;\n }\n | {\n isolation: ContentScriptIsolationFrameOptions &\n (ContentScriptFramePageOptions | ContentScriptFrameSourceOptions);\n render?: never;\n }\n );\n\nexport interface ContentScriptResolvedDefinition extends Omit<\n ContentScriptDefinitionBase,\n \"anchor\" | \"marker\" | \"mount\" | \"container\" | \"watch\"\n> {\n isolation: ContentScriptIsolationOptions;\n marker: ContentScriptMarkerResolver;\n anchor: ContentScriptAnchorGetter;\n mount: ContentScriptMountFunction;\n render?: ContentScriptRenderHandler;\n container: ContentScriptContainerCreator;\n watch: ContentScriptWatchStrategy;\n}\n\ntype ContentScriptAppendVariant<T> = T extends unknown ? Omit<T, \"mount\"> & {append?: ContentScriptAppend} : never;\n\nexport type ContentScriptAppendDefinition = ContentScriptAppendVariant<ContentScriptDefinition>;\n\n// Builder\nexport interface ContentScriptBuilder extends EntrypointBuilder {\n getContext(): ContentScriptContext;\n}\n"],"mappings":"AAOO,MAAM,uBAAuB,CAAC,cAAc,aAAa;AAGzD,MAAM,qCAAqC;AAE3C,IAAK,qBAAL,kBAAKA,wBAAL;AACH,EAAAA,oBAAA,cAAW;AACX,EAAAA,oBAAA,UAAO;AAFC,SAAAA;AAAA,GAAA;AAKL,IAAK,2BAAL,kBAAKC,8BAAL;AACH,EAAAA,0BAAA,cAAW;AACX,EAAAA,0BAAA,cAAW;AAFH,SAAAA;AAAA,GAAA;AAKL,IAAK,yBAAL,kBAAKC,4BAAL;AACH,EAAAA,wBAAA,UAAO;AACP,EAAAA,wBAAA,YAAS;AACT,EAAAA,wBAAA,YAAS;AAHD,SAAAA;AAAA,GAAA;AAML,IAAK,0BAAL,kBAAKC,6BAAL;AACH,EAAAA,yBAAA,UAAO;AACP,EAAAA,yBAAA,YAAS;AAFD,SAAAA;AAAA,GAAA;AAML,IAAK,sBAAL,kBAAKC,yBAAL;AACH,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,WAAQ;AALA,SAAAA;AAAA,GAAA;AASL,IAAK,sBAAL,kBAAKC,yBAAL;AAEH,EAAAA,qBAAA,UAAO;AAEP,EAAAA,qBAAA,eAAY;AAJJ,SAAAA;AAAA,GAAA;AAOL,IAAK,2BAAL,kBAAKC,8BAAL;AACH,EAAAA,0BAAA,aAAU;AACV,EAAAA,0BAAA,eAAY;AAFJ,SAAAA;AAAA,GAAA;AAML,IAAK,qBAAL,kBAAKC,wBAAL;AACH,EAAAA,oBAAA,WAAQ;AACR,EAAAA,oBAAA,aAAU;AACV,EAAAA,oBAAA,SAAM;AACN,EAAAA,oBAAA,YAAS;AAJD,SAAAA;AAAA,GAAA;","names":["ContentScriptWorld","ContentScriptDeclarative","ContentScriptIsolation","ContentScriptShadowMode","ContentScriptAppend","ContentScriptMarker","ContentScriptMarkerValue","ContentScriptEvent"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/virtual/entrypoint.ts"],"sourcesContent":["import type {EntrypointAssets, EntrypointAssetsMap} from \"@typing/entrypoint\";\n\n/** Package fallback; extension builds provide access to their own bundler runtime. */\nexport const readAssets = (): EntrypointAssets | undefined => undefined;\n\n/** Package fallback; the complete map is supplied only by a consuming background runtime. */\nexport const readAssetsMap = (): EntrypointAssetsMap | undefined => undefined;\n"],"mappings":"AAGO,MAAM,aAAa,MAAoC;AAGvD,MAAM,gBAAgB,MAAuC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|