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,34 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContentScriptIsolation,
|
|
3
3
|
ContentScriptShadowMode
|
|
4
|
-
} from "./../../types/content.js";
|
|
4
|
+
} from "./../../types/content/index.js";
|
|
5
5
|
const isContentScriptFrameNavigation = (isolation) => !!isolation && typeof isolation === "object" && "type" in isolation && isolation.type === ContentScriptIsolation.Iframe && ("page" in isolation && isolation.page !== void 0 || "src" in isolation && isolation.src !== void 0);
|
|
6
6
|
const resolveContentScriptIsolation = (value, hasRender = false) => {
|
|
7
7
|
const options = value === void 0 ? { type: ContentScriptIsolation.None } : typeof value === "string" ? { type: value } : value;
|
|
8
8
|
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
|
9
9
|
throw new Error("isolation must be none, shadow, iframe, or an options object with type");
|
|
10
10
|
}
|
|
11
|
-
const { type, mode, page, src
|
|
11
|
+
const { type, mode, page, src } = options;
|
|
12
12
|
if (!Object.values(ContentScriptIsolation).includes(type)) {
|
|
13
13
|
throw new Error(
|
|
14
14
|
"isolation.type must be a statically known ContentScriptIsolation value: none, shadow or iframe"
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
const keys = type === ContentScriptIsolation.Shadow ? ["type", "mode"] : type === ContentScriptIsolation.Iframe ? ["type", "page", "src"
|
|
17
|
+
const keys = type === ContentScriptIsolation.Shadow ? ["type", "mode"] : type === ContentScriptIsolation.Iframe ? ["type", "page", "src"] : ["type"];
|
|
18
18
|
for (const key of Object.keys(options)) {
|
|
19
|
-
if (!keys.includes(key))
|
|
19
|
+
if (!keys.includes(key)) {
|
|
20
|
+
throw new Error(`isolation.${key} is not supported for isolation type "${type}"`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (type === ContentScriptIsolation.None) {
|
|
24
|
+
return { type };
|
|
20
25
|
}
|
|
21
|
-
if (type === ContentScriptIsolation.None) return { type };
|
|
22
26
|
if (type === ContentScriptIsolation.Shadow) {
|
|
23
27
|
if (mode !== void 0 && !Object.values(ContentScriptShadowMode).includes(mode)) {
|
|
24
28
|
throw new Error('isolation.mode must be "open" or "closed"');
|
|
25
29
|
}
|
|
26
30
|
return { type, mode: mode ?? ContentScriptShadowMode.Open };
|
|
27
31
|
}
|
|
28
|
-
if (page !== void 0 && src !== void 0)
|
|
32
|
+
if (page !== void 0 && src !== void 0) {
|
|
29
33
|
throw new Error("isolation.page and isolation.src are mutually exclusive");
|
|
30
|
-
|
|
34
|
+
}
|
|
35
|
+
if (page !== void 0 && (typeof page !== "string" || !page.trim())) {
|
|
31
36
|
throw new Error("isolation.page must be a statically known page alias");
|
|
37
|
+
}
|
|
32
38
|
if (src !== void 0) {
|
|
33
39
|
if (typeof src !== "string" || !/^(https?|chrome-extension|moz-extension):\/\//.test(src)) {
|
|
34
40
|
throw new Error("isolation.src must be an absolute HTTP(S) or extension URL");
|
|
@@ -44,21 +50,8 @@ const resolveContentScriptIsolation = (value, hasRender = false) => {
|
|
|
44
50
|
"isolation.page/isolation.src cannot be combined with render; the embedded page owns its UI and resources"
|
|
45
51
|
);
|
|
46
52
|
}
|
|
47
|
-
for (const [name, size] of [
|
|
48
|
-
["width", width],
|
|
49
|
-
["height", height]
|
|
50
|
-
]) {
|
|
51
|
-
if (size !== void 0 && !(typeof size === "number" && Number.isFinite(size) && size >= 0 || typeof size === "string" && size.trim())) {
|
|
52
|
-
throw new Error(`isolation.${name} must be pixels or a CSS size`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (typeof height === "string" && height.trim().toLowerCase() === "auto") {
|
|
56
|
-
throw new Error('isolation.height: "auto" is not supported yet; specify an explicit height');
|
|
57
|
-
}
|
|
58
53
|
return {
|
|
59
54
|
type,
|
|
60
|
-
width: width ?? "100%",
|
|
61
|
-
height: height ?? 150,
|
|
62
55
|
...page === void 0 ? {} : { page },
|
|
63
56
|
...src === void 0 ? {} : { src }
|
|
64
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/content/isolation.ts"],"sourcesContent":["import {\n ContentScriptIsolation,\n ContentScriptShadowMode,\n type ContentScriptIsolationOptions,\n type ContentScriptIsolationFrameOptions,\n type ContentScriptFramePageOptions,\n type ContentScriptFrameSourceOptions,\n} from \"@typing/content\";\n\nexport const isContentScriptFrameNavigation = (\n isolation: unknown\n): isolation is ContentScriptIsolationFrameOptions &\n (ContentScriptFramePageOptions | ContentScriptFrameSourceOptions) =>\n !!isolation &&\n typeof isolation === \"object\" &&\n \"type\" in isolation &&\n isolation.type === ContentScriptIsolation.Iframe &&\n ((\"page\" in isolation && isolation.page !== undefined) || (\"src\" in isolation && isolation.src !== undefined));\n\n/** Pure normalization and structural validation, shared by CLI and runtime. */\nexport const resolveContentScriptIsolation = (value: unknown, hasRender = false): ContentScriptIsolationOptions => {\n const options =\n value === undefined ? {type: ContentScriptIsolation.None} : typeof value === \"string\" ? {type: value} : value;\n if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\"isolation must be none, shadow, iframe, or an options object with type\");\n }\n const {type, mode, page, src
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/content/isolation.ts"],"sourcesContent":["import {\n ContentScriptIsolation,\n ContentScriptShadowMode,\n type ContentScriptIsolationOptions,\n type ContentScriptIsolationFrameOptions,\n type ContentScriptFramePageOptions,\n type ContentScriptFrameSourceOptions,\n} from \"@typing/content\";\n\nexport const isContentScriptFrameNavigation = (\n isolation: unknown\n): isolation is ContentScriptIsolationFrameOptions &\n (ContentScriptFramePageOptions | ContentScriptFrameSourceOptions) =>\n !!isolation &&\n typeof isolation === \"object\" &&\n \"type\" in isolation &&\n isolation.type === ContentScriptIsolation.Iframe &&\n ((\"page\" in isolation && isolation.page !== undefined) || (\"src\" in isolation && isolation.src !== undefined));\n\n/** Pure normalization and structural validation, shared by CLI and runtime. */\nexport const resolveContentScriptIsolation = (value: unknown, hasRender = false): ContentScriptIsolationOptions => {\n const options =\n value === undefined ? {type: ContentScriptIsolation.None} : typeof value === \"string\" ? {type: value} : value;\n\n if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\"isolation must be none, shadow, iframe, or an options object with type\");\n }\n\n const {type, mode, page, src} = options as Record<string, unknown>;\n\n if (!Object.values(ContentScriptIsolation).includes(type as ContentScriptIsolation)) {\n throw new Error(\n \"isolation.type must be a statically known ContentScriptIsolation value: none, shadow or iframe\"\n );\n }\n\n const keys =\n type === ContentScriptIsolation.Shadow\n ? [\"type\", \"mode\"]\n : type === ContentScriptIsolation.Iframe\n ? [\"type\", \"page\", \"src\"]\n : [\"type\"];\n\n for (const key of Object.keys(options)) {\n if (!keys.includes(key)) {\n throw new Error(`isolation.${key} is not supported for isolation type \"${type}\"`);\n }\n }\n\n if (type === ContentScriptIsolation.None) {\n return {type};\n }\n\n if (type === ContentScriptIsolation.Shadow) {\n if (mode !== undefined && !Object.values(ContentScriptShadowMode).includes(mode as ContentScriptShadowMode)) {\n throw new Error('isolation.mode must be \"open\" or \"closed\"');\n }\n\n return {type, mode: (mode as ContentScriptShadowMode | undefined) ?? ContentScriptShadowMode.Open};\n }\n\n if (page !== undefined && src !== undefined) {\n throw new Error(\"isolation.page and isolation.src are mutually exclusive\");\n }\n\n if (page !== undefined && (typeof page !== \"string\" || !page.trim())) {\n throw new Error(\"isolation.page must be a statically known page alias\");\n }\n\n if (src !== undefined) {\n if (typeof src !== \"string\" || !/^(https?|chrome-extension|moz-extension):\\/\\//.test(src)) {\n throw new Error(\"isolation.src must be an absolute HTTP(S) or extension URL\");\n }\n\n try {\n new URL(src);\n } catch {\n throw new Error(\"isolation.src must be a valid absolute URL\");\n }\n }\n\n if ((page !== undefined || src !== undefined) && hasRender) {\n throw new Error(\n \"isolation.page/isolation.src cannot be combined with render; the embedded page owns its UI and resources\"\n );\n }\n\n return {\n type,\n ...(page === undefined ? {} : {page}),\n ...(src === undefined ? {} : {src}),\n } as ContentScriptIsolationFrameOptions;\n};\n"],"mappings":"AAAA;AAAA,EACI;AAAA,EACA;AAAA,OAKG;AAEA,MAAM,iCAAiC,CAC1C,cAGA,CAAC,CAAC,aACF,OAAO,cAAc,YACrB,UAAU,aACV,UAAU,SAAS,uBAAuB,WACxC,UAAU,aAAa,UAAU,SAAS,UAAe,SAAS,aAAa,UAAU,QAAQ;AAGhG,MAAM,gCAAgC,CAAC,OAAgB,YAAY,UAAyC;AAC/G,QAAM,UACF,UAAU,SAAY,EAAC,MAAM,uBAAuB,KAAI,IAAI,OAAO,UAAU,WAAW,EAAC,MAAM,MAAK,IAAI;AAE5G,MAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACnE,UAAM,IAAI,MAAM,wEAAwE;AAAA,EAC5F;AAEA,QAAM,EAAC,MAAM,MAAM,MAAM,IAAG,IAAI;AAEhC,MAAI,CAAC,OAAO,OAAO,sBAAsB,EAAE,SAAS,IAA8B,GAAG;AACjF,UAAM,IAAI;AAAA,MACN;AAAA,IACJ;AAAA,EACJ;AAEA,QAAM,OACF,SAAS,uBAAuB,SAC1B,CAAC,QAAQ,MAAM,IACf,SAAS,uBAAuB,SAC9B,CAAC,QAAQ,QAAQ,KAAK,IACtB,CAAC,MAAM;AAEnB,aAAW,OAAO,OAAO,KAAK,OAAO,GAAG;AACpC,QAAI,CAAC,KAAK,SAAS,GAAG,GAAG;AACrB,YAAM,IAAI,MAAM,aAAa,GAAG,yCAAyC,IAAI,GAAG;AAAA,IACpF;AAAA,EACJ;AAEA,MAAI,SAAS,uBAAuB,MAAM;AACtC,WAAO,EAAC,KAAI;AAAA,EAChB;AAEA,MAAI,SAAS,uBAAuB,QAAQ;AACxC,QAAI,SAAS,UAAa,CAAC,OAAO,OAAO,uBAAuB,EAAE,SAAS,IAA+B,GAAG;AACzG,YAAM,IAAI,MAAM,2CAA2C;AAAA,IAC/D;AAEA,WAAO,EAAC,MAAM,MAAO,QAAgD,wBAAwB,KAAI;AAAA,EACrG;AAEA,MAAI,SAAS,UAAa,QAAQ,QAAW;AACzC,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC7E;AAEA,MAAI,SAAS,WAAc,OAAO,SAAS,YAAY,CAAC,KAAK,KAAK,IAAI;AAClE,UAAM,IAAI,MAAM,sDAAsD;AAAA,EAC1E;AAEA,MAAI,QAAQ,QAAW;AACnB,QAAI,OAAO,QAAQ,YAAY,CAAC,gDAAgD,KAAK,GAAG,GAAG;AACvF,YAAM,IAAI,MAAM,4DAA4D;AAAA,IAChF;AAEA,QAAI;AACA,UAAI,IAAI,GAAG;AAAA,IACf,QAAQ;AACJ,YAAM,IAAI,MAAM,4CAA4C;AAAA,IAChE;AAAA,EACJ;AAEA,OAAK,SAAS,UAAa,QAAQ,WAAc,WAAW;AACxD,UAAM,IAAI;AAAA,MACN;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO;AAAA,IACH;AAAA,IACA,GAAI,SAAS,SAAY,CAAC,IAAI,EAAC,KAAI;AAAA,IACnC,GAAI,QAAQ,SAAY,CAAC,IAAI,EAAC,IAAG;AAAA,EACrC;AACJ;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { convertLocaleKey, convertLocaleMessageKey, extractLocaleKey, isLocaleKey, modifyLocaleMessageKey } from "./keys.js";
|
|
2
2
|
export { getLocaleDir, isLocaleRtl, resolveLanguage } from "./language.js";
|
|
3
|
-
export { flattenLocaleMessages, getLocaleFilename } from "./messages.js";
|
|
3
|
+
export { escapeLocaleMessage, escapeLocaleMessages, flattenLocaleMessages, getLocaleFilename } from "./messages.js";
|
|
4
4
|
export { selectPluralForm } from "./plural.js";
|
|
5
5
|
export { applySubstitutions, parsePlaceholders } from "./substitutions.js";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { convertLocaleKey, convertLocaleMessageKey, extractLocaleKey, isLocaleKey, modifyLocaleMessageKey } from "./keys.js";
|
|
2
2
|
import { getLocaleDir, isLocaleRtl, resolveLanguage } from "./language.js";
|
|
3
|
-
import { flattenLocaleMessages, getLocaleFilename } from "./messages.js";
|
|
3
|
+
import { escapeLocaleMessage, escapeLocaleMessages, flattenLocaleMessages, getLocaleFilename } from "./messages.js";
|
|
4
4
|
import { selectPluralForm } from "./plural.js";
|
|
5
5
|
import { applySubstitutions, parsePlaceholders } from "./substitutions.js";
|
|
6
6
|
export {
|
|
7
7
|
applySubstitutions,
|
|
8
8
|
convertLocaleKey,
|
|
9
9
|
convertLocaleMessageKey,
|
|
10
|
+
escapeLocaleMessage,
|
|
11
|
+
escapeLocaleMessages,
|
|
10
12
|
extractLocaleKey,
|
|
11
13
|
flattenLocaleMessages,
|
|
12
14
|
getLocaleDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/locale/index.ts"],"sourcesContent":["export {convertLocaleKey, convertLocaleMessageKey, extractLocaleKey, isLocaleKey, modifyLocaleMessageKey} from \"./keys\";\nexport {getLocaleDir, isLocaleRtl, resolveLanguage} from \"./language\";\nexport {flattenLocaleMessages, getLocaleFilename} from \"./messages\";\nexport {selectPluralForm} from \"./plural\";\nexport {applySubstitutions, parsePlaceholders} from \"./substitutions\";\n"],"mappings":"AAAA,SAAQ,kBAAkB,yBAAyB,kBAAkB,aAAa,8BAA6B;AAC/G,SAAQ,cAAc,aAAa,uBAAsB;AACzD,SAAQ,uBAAuB,yBAAwB;
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/locale/index.ts"],"sourcesContent":["export {convertLocaleKey, convertLocaleMessageKey, extractLocaleKey, isLocaleKey, modifyLocaleMessageKey} from \"./keys\";\nexport {getLocaleDir, isLocaleRtl, resolveLanguage} from \"./language\";\nexport {escapeLocaleMessage, escapeLocaleMessages, flattenLocaleMessages, getLocaleFilename} from \"./messages\";\nexport {selectPluralForm} from \"./plural\";\nexport {applySubstitutions, parsePlaceholders} from \"./substitutions\";\n"],"mappings":"AAAA,SAAQ,kBAAkB,yBAAyB,kBAAkB,aAAa,8BAA6B;AAC/G,SAAQ,cAAc,aAAa,uBAAsB;AACzD,SAAQ,qBAAqB,sBAAsB,uBAAuB,yBAAwB;AAClG,SAAQ,wBAAuB;AAC/B,SAAQ,oBAAoB,yBAAwB;","names":[]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { Language, LocaleMessages } from "../../types/locale.js";
|
|
2
|
+
/** Native i18n consumes the first dollar in each escaped run; the catalogue keeps the original text. */
|
|
3
|
+
export declare const escapeLocaleMessage: (message: string) => string;
|
|
4
|
+
/** Protects literal $NAME$ text from the earlier named-placeholder pass as well. */
|
|
5
|
+
export declare const escapeLocaleMessages: (messages: LocaleMessages) => LocaleMessages;
|
|
2
6
|
export declare const getLocaleFilename: (lang: Language) => string;
|
|
3
7
|
export declare const flattenLocaleMessages: (messages: LocaleMessages) => Record<string, string>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
const escapeLocaleMessage = (message) => message.replace(/\$+/g, (dollars) => "$" + dollars);
|
|
2
|
+
const escapeLocaleMessages = (messages) => Object.fromEntries(
|
|
3
|
+
Object.entries(messages).map(([key, value]) => {
|
|
4
|
+
const message = escapeLocaleMessage(value.message);
|
|
5
|
+
return [
|
|
6
|
+
key,
|
|
7
|
+
/\$[a-z0-9_@]+\$/i.test(value.message) ? { ...value, message: "$text$", placeholders: { text: { content: message } } } : { ...value, message }
|
|
8
|
+
];
|
|
9
|
+
})
|
|
10
|
+
);
|
|
1
11
|
const getLocaleFilename = (lang) => {
|
|
2
12
|
return `_locales/${lang}/messages.json`;
|
|
3
13
|
};
|
|
4
14
|
const flattenLocaleMessages = (messages) => Object.fromEntries(Object.entries(messages).map(([key, value]) => [key, value.message]));
|
|
5
15
|
export {
|
|
16
|
+
escapeLocaleMessage,
|
|
17
|
+
escapeLocaleMessages,
|
|
6
18
|
flattenLocaleMessages,
|
|
7
19
|
getLocaleFilename
|
|
8
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/locale/messages.ts"],"sourcesContent":["import type {Language, LocaleMessages} from \"@typing/locale\";\n\nexport const getLocaleFilename = (lang: Language): string => {\n return `_locales/${lang}/messages.json`;\n};\n\nexport const flattenLocaleMessages = (messages: LocaleMessages): Record<string, string> =>\n Object.fromEntries(Object.entries(messages).map(([key, value]) => [key, value.message]));\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/locale/messages.ts"],"sourcesContent":["import type {Language, LocaleMessages} from \"@typing/locale\";\n\n/** Native i18n consumes the first dollar in each escaped run; the catalogue keeps the original text. */\nexport const escapeLocaleMessage = (message: string): string => message.replace(/\\$+/g, dollars => \"$\" + dollars);\n\n/** Protects literal $NAME$ text from the earlier named-placeholder pass as well. */\nexport const escapeLocaleMessages = (messages: LocaleMessages): LocaleMessages =>\n Object.fromEntries(\n Object.entries(messages).map(([key, value]) => {\n const message = escapeLocaleMessage(value.message);\n\n return [\n key,\n /\\$[a-z0-9_@]+\\$/i.test(value.message)\n ? {...value, message: \"$text$\", placeholders: {text: {content: message}}}\n : {...value, message},\n ];\n })\n );\n\nexport const getLocaleFilename = (lang: Language): string => {\n return `_locales/${lang}/messages.json`;\n};\n\nexport const flattenLocaleMessages = (messages: LocaleMessages): Record<string, string> =>\n Object.fromEntries(Object.entries(messages).map(([key, value]) => [key, value.message]));\n"],"mappings":"AAGO,MAAM,sBAAsB,CAAC,YAA4B,QAAQ,QAAQ,QAAQ,aAAW,MAAM,OAAO;AAGzG,MAAM,uBAAuB,CAAC,aACjC,OAAO;AAAA,EACH,OAAO,QAAQ,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAC3C,UAAM,UAAU,oBAAoB,MAAM,OAAO;AAEjD,WAAO;AAAA,MACH;AAAA,MACA,mBAAmB,KAAK,MAAM,OAAO,IAC/B,EAAC,GAAG,OAAO,SAAS,UAAU,cAAc,EAAC,MAAM,EAAC,SAAS,QAAO,EAAC,EAAC,IACtE,EAAC,GAAG,OAAO,QAAO;AAAA,IAC5B;AAAA,EACJ,CAAC;AACL;AAEG,MAAM,oBAAoB,CAAC,SAA2B;AACzD,SAAO,YAAY,IAAI;AAC3B;AAEO,MAAM,wBAAwB,CAAC,aAClC,OAAO,YAAY,OAAO,QAAQ,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,MAAM,OAAO,CAAC,CAAC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ContentScriptIsolation, ContentScriptProps } from "../common.js";
|
|
3
|
+
export type ContentScriptRenderReactComponent<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptProps<Data, Isolation>) => Exclude<ReactNode, Promise<unknown>>;
|
|
4
|
+
export type ContentScriptReactRenderValue<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = Exclude<ReactNode, Promise<unknown>> | ContentScriptRenderReactComponent<Data, Isolation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ContentScriptVanillaRenderValue = Element | string | number | boolean | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ContentScriptContainerProps, ContentScriptIsolation } from "./common.js";
|
|
2
|
+
export interface ContentScriptBoundaryMap {
|
|
3
|
+
none: undefined;
|
|
4
|
+
shadow: ShadowRoot;
|
|
5
|
+
iframe: HTMLIFrameElement;
|
|
6
|
+
}
|
|
7
|
+
/** The browser node implementing isolation, distinct from the container and render target. */
|
|
8
|
+
export type ContentScriptBoundary<Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptBoundaryMap[Isolation];
|
|
9
|
+
/** Available when isolation is created, before its target or child document is ready. */
|
|
10
|
+
export interface ContentScriptBoundaryProps<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends ContentScriptContainerProps<Data> {
|
|
11
|
+
container: Element;
|
|
12
|
+
boundary: Exclude<ContentScriptBoundary<Isolation>, undefined>;
|
|
13
|
+
}
|
|
14
|
+
/** Releases user subscriptions before the boundary is removed. */
|
|
15
|
+
export type ContentScriptBoundaryCleanup = () => void;
|
|
16
|
+
/** Synchronous setup, once per boundary; return cleanup for subscriptions or observers. */
|
|
17
|
+
export type ContentScriptBoundaryHandler<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptBoundaryProps<Data, Isolation>) => void | ContentScriptBoundaryCleanup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { ContentScriptPrepareProps } from "./prepare.js";
|
|
2
|
+
import type { ContentScriptBoundary } from "./boundary.js";
|
|
3
|
+
import type { PageAlias } from "../page.js";
|
|
4
|
+
import type { Optional } from "utility-types";
|
|
5
|
+
import type { EntrypointBuilder, EntrypointOptions } from "../entrypoint.js";
|
|
6
|
+
import type { Awaiter, PickNonFunctionProperties } from "../helpers.js";
|
|
6
7
|
export declare const ContentScriptMatches: string[];
|
|
7
8
|
/** Shared property used by the bundler plugin and the content script's style runtime getter. */
|
|
8
9
|
export declare const ContentScriptStylesRuntimeProperty = "__adnbnIsolatedStyles";
|
|
@@ -52,6 +53,8 @@ export interface ContentScriptStylesRuntime {
|
|
|
52
53
|
initialize(resolveUrl: (file: string) => string): void;
|
|
53
54
|
/** Retry restored styles once on load error; future loads keep the default failure behavior. */
|
|
54
55
|
add(root: ShadowRoot | HTMLElement, target: Element | null, retry?: boolean): void;
|
|
56
|
+
/** Waits for initial and already requested CSS for this root; retries missing failed links. */
|
|
57
|
+
ready(root: ShadowRoot | HTMLElement): Promise<void>;
|
|
55
58
|
delete(root: ShadowRoot | HTMLElement): void;
|
|
56
59
|
load(url: string): Promise<void>;
|
|
57
60
|
}
|
|
@@ -127,20 +130,15 @@ export interface ContentScriptShadowOptions {
|
|
|
127
130
|
*/
|
|
128
131
|
mode?: ContentScriptShadowMode | `${ContentScriptShadowMode}`;
|
|
129
132
|
}
|
|
130
|
-
export interface
|
|
131
|
-
width?: number | string;
|
|
132
|
-
/** Defaults to 150px. Automatic height is not supported yet. */
|
|
133
|
-
height?: number | string;
|
|
134
|
-
}
|
|
135
|
-
export interface ContentScriptFrameRenderOptions extends ContentScriptFrameOptions {
|
|
133
|
+
export interface ContentScriptFrameRenderOptions {
|
|
136
134
|
page?: never;
|
|
137
135
|
src?: never;
|
|
138
136
|
}
|
|
139
|
-
export interface ContentScriptFramePageOptions
|
|
137
|
+
export interface ContentScriptFramePageOptions {
|
|
140
138
|
page: PageAlias;
|
|
141
139
|
src?: never;
|
|
142
140
|
}
|
|
143
|
-
export interface ContentScriptFrameSourceOptions
|
|
141
|
+
export interface ContentScriptFrameSourceOptions {
|
|
144
142
|
src: string;
|
|
145
143
|
page?: never;
|
|
146
144
|
}
|
|
@@ -150,15 +148,11 @@ export interface ContentScriptIsolationNoneOptions {
|
|
|
150
148
|
mode?: never;
|
|
151
149
|
page?: never;
|
|
152
150
|
src?: never;
|
|
153
|
-
width?: never;
|
|
154
|
-
height?: never;
|
|
155
151
|
}
|
|
156
152
|
export interface ContentScriptIsolationShadowOptions extends ContentScriptShadowOptions {
|
|
157
153
|
type: ContentScriptIsolation.Shadow | "shadow";
|
|
158
154
|
page?: never;
|
|
159
155
|
src?: never;
|
|
160
|
-
width?: never;
|
|
161
|
-
height?: never;
|
|
162
156
|
}
|
|
163
157
|
export type ContentScriptIsolationFrameOptions = ContentScriptFrame & {
|
|
164
158
|
type: ContentScriptIsolation.Iframe | "iframe";
|
|
@@ -176,8 +170,16 @@ export interface ContentScriptMount {
|
|
|
176
170
|
mount(): boolean | undefined | void;
|
|
177
171
|
unmount(): boolean | undefined | void;
|
|
178
172
|
}
|
|
179
|
-
export interface
|
|
180
|
-
|
|
173
|
+
export interface ContentScriptContainerProps<Data = unknown> extends ContentScriptPrepareProps {
|
|
174
|
+
data: Data;
|
|
175
|
+
}
|
|
176
|
+
export interface ContentScriptProps<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends ContentScriptContainerProps<Data> {
|
|
177
|
+
/** Outer mounted element; the Shadow host or iframe wrapper when isolated. */
|
|
178
|
+
container: Element;
|
|
179
|
+
/** Actual render destination. Use its root/document for portals and DOM operations. */
|
|
180
|
+
target: Element;
|
|
181
|
+
/** ShadowRoot or iframe for the active isolation; undefined without isolation. */
|
|
182
|
+
boundary: ContentScriptBoundary<Isolation>;
|
|
181
183
|
}
|
|
182
184
|
export type ContentScriptAnchor = string | Element | null | undefined;
|
|
183
185
|
export type ContentScriptAnchorGetter = () => Awaiter<ContentScriptAnchor>;
|
|
@@ -200,18 +202,15 @@ export interface ContentScriptMarkerContract {
|
|
|
200
202
|
export type ContentScriptMarkerType = ContentScriptMarker | `${ContentScriptMarker}` | ContentScriptMarkerContract | undefined;
|
|
201
203
|
export type ContentScriptMarkerGetter = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerType>;
|
|
202
204
|
export type ContentScriptMarkerResolver = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerContract>;
|
|
203
|
-
export type ContentScriptRenderReactComponent = FC<ContentScriptProps>;
|
|
204
|
-
export type ContentScriptRenderValue = Element | ReactNode | ContentScriptRenderReactComponent;
|
|
205
|
-
export type ContentScriptRenderHandler = (props: ContentScriptProps) => Awaiter<undefined | ContentScriptRenderValue>;
|
|
206
205
|
export type ContentScriptContainerTag = Exclude<keyof HTMLElementTagNameMap, "html" | "body">;
|
|
207
206
|
export type ContentScriptContainerOptions = {
|
|
208
207
|
[Tag in ContentScriptContainerTag]: {
|
|
209
208
|
tagName: Tag;
|
|
210
209
|
} & Exclude<Optional<PickNonFunctionProperties<HTMLElementTagNameMap[Tag]>>, "id">;
|
|
211
210
|
}[ContentScriptContainerTag];
|
|
212
|
-
export type ContentScriptContainerFactory = (props:
|
|
213
|
-
export type ContentScriptContainerCreator = (props:
|
|
214
|
-
export type ContentScriptWatchStrategy = (update: () => void
|
|
211
|
+
export type ContentScriptContainerFactory<Data = unknown> = (props: ContentScriptContainerProps<Data>) => Awaiter<Element | ContentScriptContainerTag | ContentScriptContainerOptions>;
|
|
212
|
+
export type ContentScriptContainerCreator<Data = unknown> = (props: ContentScriptContainerProps<Data>) => Awaiter<Element>;
|
|
213
|
+
export type ContentScriptWatchStrategy = (update: () => Awaiter<void>, context: ContentScriptContext) => () => void;
|
|
215
214
|
export type ContentScriptEventCallback = (event: ContentScriptEvent, node: ContentScriptNode) => void;
|
|
216
215
|
export interface ContentScriptEventEmitter {
|
|
217
216
|
on(callback: ContentScriptEventCallback): void;
|
|
@@ -227,6 +226,12 @@ export interface ContentScriptEventEmitter {
|
|
|
227
226
|
}
|
|
228
227
|
export interface ContentScriptContext extends ContentScriptMount {
|
|
229
228
|
nodes: ReadonlySet<ContentScriptNode>;
|
|
229
|
+
/**
|
|
230
|
+
* Whether target belongs to UI mounted by this context, including ShadowRoot descendants.
|
|
231
|
+
* Already-connected site containers and containers wrapping their anchors are excluded.
|
|
232
|
+
* Membership ends at unmount. Traversal does not cross an iframe document into its host.
|
|
233
|
+
*/
|
|
234
|
+
owns(target: Node): boolean;
|
|
230
235
|
/**
|
|
231
236
|
* Registers a callback function that will be invoked when a specific content script context event occurs.
|
|
232
237
|
*
|
|
@@ -248,36 +253,10 @@ export interface ContentScriptNode extends ContentScriptMount {
|
|
|
248
253
|
container?: Element;
|
|
249
254
|
/** Element used by the active adapter as the destination for rendered UI. */
|
|
250
255
|
target?: Element;
|
|
256
|
+
/** Present while isolation is mounted, including navigation-only iframes. */
|
|
257
|
+
boundary?: ContentScriptBoundary;
|
|
251
258
|
}
|
|
252
259
|
export type ContentScriptNodeSet = Set<ContentScriptNode>;
|
|
253
|
-
export interface ContentScriptDefinitionBase extends Partial<ContentScriptOptions> {
|
|
254
|
-
marker?: ContentScriptMarkerType | ContentScriptMarkerGetter;
|
|
255
|
-
anchor?: ContentScriptAnchor | ContentScriptAnchorGetter;
|
|
256
|
-
mount?: ContentScriptMountFunction;
|
|
257
|
-
container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory;
|
|
258
|
-
watch?: true | ContentScriptWatchStrategy;
|
|
259
|
-
main?: ContentScriptMainFunction;
|
|
260
|
-
}
|
|
261
|
-
export type ContentScriptDefinition = ContentScriptDefinitionBase & ({
|
|
262
|
-
isolation?: ContentScriptIsolation | `${ContentScriptIsolation}` | ContentScriptIsolationNoneOptions | ContentScriptIsolationShadowOptions | (ContentScriptIsolationFrameOptions & ContentScriptFrameRenderOptions);
|
|
263
|
-
render?: ContentScriptRenderValue | ContentScriptRenderHandler;
|
|
264
|
-
} | {
|
|
265
|
-
isolation: ContentScriptIsolationFrameOptions & (ContentScriptFramePageOptions | ContentScriptFrameSourceOptions);
|
|
266
|
-
render?: never;
|
|
267
|
-
});
|
|
268
|
-
export interface ContentScriptResolvedDefinition extends Omit<ContentScriptDefinitionBase, "anchor" | "marker" | "mount" | "container" | "watch"> {
|
|
269
|
-
isolation: ContentScriptIsolationOptions;
|
|
270
|
-
marker: ContentScriptMarkerResolver;
|
|
271
|
-
anchor: ContentScriptAnchorGetter;
|
|
272
|
-
mount: ContentScriptMountFunction;
|
|
273
|
-
render?: ContentScriptRenderHandler;
|
|
274
|
-
container: ContentScriptContainerCreator;
|
|
275
|
-
watch: ContentScriptWatchStrategy;
|
|
276
|
-
}
|
|
277
|
-
type ContentScriptAppendVariant<T> = T extends unknown ? Omit<T, "mount"> & {
|
|
278
|
-
append?: ContentScriptAppend;
|
|
279
|
-
} : never;
|
|
280
|
-
export type ContentScriptAppendDefinition = ContentScriptAppendVariant<ContentScriptDefinition>;
|
|
281
260
|
export interface ContentScriptBuilder extends EntrypointBuilder {
|
|
282
261
|
getContext(): ContentScriptContext;
|
|
283
262
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/types/content/common.ts"],"sourcesContent":["import type {ContentScriptPrepareProps} from \"./prepare\";\nimport type {ContentScriptBoundary} from \"./boundary\";\n\nimport type {PageAlias} from \"@typing/page\";\nimport type {Optional} from \"utility-types\";\n\nimport type {EntrypointBuilder, EntrypointOptions} from \"@typing/entrypoint\";\nimport type {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 /** Waits for initial and already requested CSS for this root; retries missing failed links. */\n ready(root: ShadowRoot | HTMLElement): Promise<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 ContentScriptFrameRenderOptions {\n page?: never;\n src?: never;\n}\n\nexport interface ContentScriptFramePageOptions {\n page: PageAlias;\n src?: never;\n}\n\nexport interface ContentScriptFrameSourceOptions {\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}\n\nexport interface ContentScriptIsolationShadowOptions extends ContentScriptShadowOptions {\n type: ContentScriptIsolation.Shadow | \"shadow\";\n page?: never;\n src?: 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 ContentScriptContainerProps<Data = unknown> extends ContentScriptPrepareProps {\n data: Data;\n}\n\nexport interface ContentScriptProps<\n Data = unknown,\n Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`,\n> extends ContentScriptContainerProps<Data> {\n /** Outer mounted element; the Shadow host or iframe wrapper when isolated. */\n container: Element;\n /** Actual render destination. Use its root/document for portals and DOM operations. */\n target: Element;\n /** ShadowRoot or iframe for the active isolation; undefined without isolation. */\n boundary: ContentScriptBoundary<Isolation>;\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// 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<Data = unknown> = (\n props: ContentScriptContainerProps<Data>\n) => Awaiter<Element | ContentScriptContainerTag | ContentScriptContainerOptions>;\n\nexport type ContentScriptContainerCreator<Data = unknown> = (\n props: ContentScriptContainerProps<Data>\n) => Awaiter<Element>;\n\n// Watch\nexport type ContentScriptWatchStrategy = (update: () => Awaiter<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 * Whether target belongs to UI mounted by this context, including ShadowRoot descendants.\n * Already-connected site containers and containers wrapping their anchors are excluded.\n * Membership ends at unmount. Traversal does not cross an iframe document into its host.\n */\n owns(target: Node): boolean;\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 /** Present while isolation is mounted, including navigation-only iframes. */\n boundary?: ContentScriptBoundary;\n}\n\nexport type ContentScriptNodeSet = Set<ContentScriptNode>;\n\n// Builder\nexport interface ContentScriptBuilder extends EntrypointBuilder {\n getContext(): ContentScriptContext;\n}\n"],"mappings":"AASO,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"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ContentScriptPrepareHandler } from "./prepare.js";
|
|
2
|
+
import type { ContentScriptBoundaryHandler } from "./boundary.js";
|
|
3
|
+
import type { ContentScriptAnchor, ContentScriptAnchorGetter, ContentScriptAppend, ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptFramePageOptions, ContentScriptFrameRenderOptions, ContentScriptFrameSourceOptions, ContentScriptIsolation, ContentScriptIsolationFrameOptions, ContentScriptIsolationOptions, ContentScriptIsolationShadowOptions, ContentScriptMainFunction, ContentScriptMarkerGetter, ContentScriptMarkerResolver, ContentScriptMarkerType, ContentScriptMountFunction, ContentScriptOptions, ContentScriptWatchStrategy } from "./common.js";
|
|
4
|
+
import type { ContentScriptRenderHandler, ContentScriptRenderValue } from "./render.js";
|
|
5
|
+
import type { ContentScriptTarget, ContentScriptTargetCreator } from "./target.js";
|
|
6
|
+
export interface ContentScriptDefinitionBase<Data = unknown> extends Partial<ContentScriptOptions> {
|
|
7
|
+
marker?: ContentScriptMarkerType | ContentScriptMarkerGetter;
|
|
8
|
+
anchor?: ContentScriptAnchor | ContentScriptAnchorGetter;
|
|
9
|
+
mount?: ContentScriptMountFunction;
|
|
10
|
+
container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory<NoInfer<Data>>;
|
|
11
|
+
prepare?: ContentScriptPrepareHandler<Data>;
|
|
12
|
+
/**
|
|
13
|
+
* Omit to watch until the first nodes are found; true keeps observing child-list changes.
|
|
14
|
+
* Use a custom strategy to observe attributes or text. Built-in strategies ignore internal
|
|
15
|
+
* changes in owned UI containers unless a container wraps its own anchor.
|
|
16
|
+
*/
|
|
17
|
+
watch?: true | ContentScriptWatchStrategy;
|
|
18
|
+
main?: ContentScriptMainFunction;
|
|
19
|
+
}
|
|
20
|
+
export type ContentScriptRenderDefinition<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = {
|
|
21
|
+
isolation?: Isolation | {
|
|
22
|
+
type: Isolation;
|
|
23
|
+
};
|
|
24
|
+
boundary?: ContentScriptBoundaryHandler<NoInfer<Data>, NoInfer<Isolation>>;
|
|
25
|
+
target?: ContentScriptTarget<NoInfer<Data>, NoInfer<Isolation>>;
|
|
26
|
+
render?: ContentScriptRenderValue<NoInfer<Data>, NoInfer<Isolation>> | ContentScriptRenderHandler<NoInfer<Data>, NoInfer<Isolation>>;
|
|
27
|
+
} & ({
|
|
28
|
+
isolation?: NoInfer<Isolation> | Extract<ContentScriptIsolationOptions, {
|
|
29
|
+
type: `${NoInfer<Isolation>}`;
|
|
30
|
+
page?: never;
|
|
31
|
+
src?: never;
|
|
32
|
+
}>;
|
|
33
|
+
boundary?: never;
|
|
34
|
+
target?: never;
|
|
35
|
+
} | {
|
|
36
|
+
isolation: Extract<NoInfer<Isolation>, "shadow"> | Extract<ContentScriptIsolationShadowOptions, {
|
|
37
|
+
type: `${NoInfer<Isolation>}`;
|
|
38
|
+
}>;
|
|
39
|
+
} | {
|
|
40
|
+
isolation: Extract<NoInfer<Isolation>, "iframe"> | Extract<ContentScriptIsolationFrameOptions & ContentScriptFrameRenderOptions, {
|
|
41
|
+
type: `${NoInfer<Isolation>}`;
|
|
42
|
+
}>;
|
|
43
|
+
} | {
|
|
44
|
+
isolation: Extract<ContentScriptIsolationFrameOptions & (ContentScriptFramePageOptions | ContentScriptFrameSourceOptions), {
|
|
45
|
+
type: `${NoInfer<Isolation>}`;
|
|
46
|
+
}>;
|
|
47
|
+
render?: never;
|
|
48
|
+
target?: never;
|
|
49
|
+
}) & ("none" extends `${NoInfer<Isolation>}` ? unknown : {
|
|
50
|
+
isolation: unknown;
|
|
51
|
+
});
|
|
52
|
+
export type ContentScriptDefinition<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptDefinitionBase<Data> & ContentScriptRenderDefinition<Data, Isolation>;
|
|
53
|
+
export interface ContentScriptResolvedDefinition<Data = unknown> extends Omit<ContentScriptDefinitionBase<Data>, "anchor" | "marker" | "mount" | "container" | "watch"> {
|
|
54
|
+
isolation: ContentScriptIsolationOptions;
|
|
55
|
+
boundary?: ContentScriptBoundaryHandler<Data>;
|
|
56
|
+
marker: ContentScriptMarkerResolver;
|
|
57
|
+
anchor: ContentScriptAnchorGetter;
|
|
58
|
+
mount: ContentScriptMountFunction;
|
|
59
|
+
render?: true | ContentScriptRenderHandler<Data>;
|
|
60
|
+
container: ContentScriptContainerCreator<Data>;
|
|
61
|
+
target: ContentScriptTargetCreator<Data>;
|
|
62
|
+
watch: ContentScriptWatchStrategy;
|
|
63
|
+
}
|
|
64
|
+
export type ContentScriptAppendDefinition<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = Omit<ContentScriptDefinitionBase<Data>, "mount"> & ContentScriptRenderDefinition<Data, Isolation> & {
|
|
65
|
+
append?: ContentScriptAppend;
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/types/content/index.ts"],"sourcesContent":["export * from \"./common\";\n\nexport type * from \"./definition\";\nexport type * from \"./render\";\n\nexport type * from \"./adapters\";\nexport type * from \"./prepare\";\nexport type * from \"./boundary\";\nexport type * from \"./target\";\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Awaiter } from "../helpers.js";
|
|
2
|
+
import type { ContentScriptEntrypointOptions } from "./common.js";
|
|
3
|
+
/** Per-anchor input available before a container or render target exists. */
|
|
4
|
+
export interface ContentScriptPrepareProps extends ContentScriptEntrypointOptions {
|
|
5
|
+
anchor: Element;
|
|
6
|
+
}
|
|
7
|
+
/** False tracks the anchor without creating UI. Other results become render props.data. */
|
|
8
|
+
export type ContentScriptPrepareResult<Data> = Data | false;
|
|
9
|
+
export type ContentScriptPrepareHandler<Data = unknown> = (props: ContentScriptPrepareProps) => Awaiter<ContentScriptPrepareResult<Data>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=prepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContentScriptIsolation, ContentScriptProps } from "./common.js";
|
|
2
|
+
import type { ContentScriptVanillaRenderValue, ContentScriptReactRenderValue } from "./adapters/index.js";
|
|
3
|
+
/** All supported render values; the entrypoint's filename selects the runtime adapter. */
|
|
4
|
+
export type ContentScriptRenderValue<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptVanillaRenderValue | ContentScriptReactRenderValue<Data, Isolation>;
|
|
5
|
+
/** Synchronous rendering into prepared DOM. Await data and decide whether to render in prepare. */
|
|
6
|
+
export type ContentScriptRenderHandler<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptProps<Data, Isolation>) => ContentScriptRenderValue<Data, Isolation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptIsolation } from "./common.js";
|
|
2
|
+
import type { ContentScriptBoundaryProps } from "./boundary.js";
|
|
3
|
+
export type ContentScriptTargetTag = ContentScriptContainerTag;
|
|
4
|
+
export type ContentScriptTargetOptions = ContentScriptContainerOptions;
|
|
5
|
+
/** Available after isolation exists, before the target is created or rendering starts. */
|
|
6
|
+
export interface ContentScriptTargetProps<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends ContentScriptBoundaryProps<Data, Isolation> {
|
|
7
|
+
/** Create elements in this document, including for an iframe's child document. */
|
|
8
|
+
document: Document;
|
|
9
|
+
}
|
|
10
|
+
export type ContentScriptTargetFactory<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = (props: ContentScriptTargetProps<Data, Isolation>) => Element | ContentScriptTargetTag | ContentScriptTargetOptions;
|
|
11
|
+
export type ContentScriptTarget<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> = ContentScriptTargetTag | ContentScriptTargetOptions | ContentScriptTargetFactory<Data, Isolation>;
|
|
12
|
+
/** Synchronous DOM creation; asynchronous work belongs in prepare. */
|
|
13
|
+
export type ContentScriptTargetCreator<Data = unknown> = (props: ContentScriptTargetProps<Data>) => Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types/locale.d.ts
CHANGED