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
|
@@ -5,7 +5,7 @@ var background_default = 'import type {BackgroundDefinition} from "adnbn";\nimpo
|
|
|
5
5
|
var command_default = 'import type {CommandUnresolvedDefinition} from "adnbn";\nimport command, {isValidCommandDefinition, isValidCommandExecuteFunction} from "adnbn/entry/command";\n\nimport * as module from "virtual:command-entrypoint";\n\ntry {\n const commandName = "virtual:command-name";\n\n const {default: defaultDefinition, ...otherDefinition} = module;\n\n let definition: CommandUnresolvedDefinition = otherDefinition;\n\n if (isValidCommandDefinition(defaultDefinition)) {\n definition = {...definition, ...defaultDefinition};\n } else if (isValidCommandExecuteFunction(defaultDefinition)) {\n definition = {...definition, execute: defaultDefinition};\n }\n\n const {execute, name = commandName, ...options} = definition;\n\n command({\n name,\n execute,\n ...options,\n });\n} catch (e) {\n console.error("The command crashed on startup:", e);\n}\n';
|
|
6
6
|
|
|
7
7
|
// raw-loader:/home/runner/work/addon-bone/addon-bone/src/cli/virtual/content.ts?raw
|
|
8
|
-
var content_default = 'import
|
|
8
|
+
var content_default = 'import contentScript, {resolveDefinition} from "virtual:content-builder";\n\nimport * as module from "virtual:content-entrypoint";\n\ntry {\n contentScript(resolveDefinition(module));\n} catch (e) {\n console.error("The content script crashed on startup:", e);\n}\n';
|
|
9
9
|
|
|
10
10
|
// raw-loader:/home/runner/work/addon-bone/addon-bone/src/cli/virtual/transport.ts?raw
|
|
11
11
|
var transport_default = 'import type {TransportOptions, TransportType, TransportUnresolvedDefinition} from "adnbn/transport";\nimport {isValidTransportDefinition, isValidTransportInitFunction} from "adnbn/entry/transport";\n\n//@ts-ignore\nimport transport from "adnbn/entry/:entry";\n\nimport * as module from "virtual:transport-entrypoint";\n\ntry {\n const transportName = "virtual:transport-name";\n\n const {default: defaultDefinition, ...otherDefinition} = module;\n\n let definition: TransportUnresolvedDefinition<TransportOptions, TransportType> = otherDefinition;\n\n if (isValidTransportDefinition(defaultDefinition)) {\n definition = {...definition, ...defaultDefinition};\n } else if (isValidTransportInitFunction(defaultDefinition)) {\n definition = {...definition, init: defaultDefinition};\n }\n\n const {init, name, ...options} = definition;\n\n transport({name: transportName, init, ...options});\n} catch (e) {\n console.error("The :entry crashed on startup:", e);\n}\n';
|
|
@@ -17,7 +17,7 @@ var offscreen_default = 'import type {OffscreenUnresolvedDefinition} from "adnbn
|
|
|
17
17
|
var offscreen_background_default = 'import {OffscreenBackground} from "adnbn/offscreen";\n\ntry {\n new OffscreenBackground().build();\n} catch (e) {\n console.error("Failed to build offscreen layer on background:", e);\n}\n';
|
|
18
18
|
|
|
19
19
|
// raw-loader:/home/runner/work/addon-bone/addon-bone/src/cli/virtual/relay.ts?raw
|
|
20
|
-
var relay_default = 'import
|
|
20
|
+
var relay_default = 'import relay, {resolveDefinition} from "adnbn/entry/relay";\n\nimport {Builder as ContentBuilder} from "virtual:content-builder";\n\nimport * as module from "virtual:relay-entrypoint";\n\ntry {\n relay(resolveDefinition(module, "virtual:relay-name"), ContentBuilder);\n} catch (error) {\n console.error("The relay crashed on startup:", error);\n}\n';
|
|
21
21
|
|
|
22
22
|
// raw-loader:/home/runner/work/addon-bone/addon-bone/src/cli/virtual/sandbox.ts?raw
|
|
23
23
|
var sandbox_default = 'import type {SandboxUnresolvedDefinition} from "adnbn";\nimport type {TransportType} from "adnbn/transport";\nimport {isValidTransportDefinition, isValidTransportInitFunction} from "adnbn/entry/transport";\nimport {Builder as SandboxBuilder} from "adnbn/entry/sandbox";\n\nimport {Builder as ViewBuilder} from "virtual:view-framework";\n\nimport * as module from "virtual:sandbox-entrypoint";\n\ntry {\n const sandboxName = "virtual:sandbox-name";\n\n const {default: defaultDefinition, ...otherDefinition} = module;\n\n let definition: SandboxUnresolvedDefinition<TransportType> = otherDefinition;\n\n if (isValidTransportDefinition(defaultDefinition)) {\n definition = {...definition, ...defaultDefinition};\n } else if (isValidTransportInitFunction(defaultDefinition)) {\n definition = {...definition, init: defaultDefinition};\n }\n\n const {init, main, name, ...options} = definition;\n\n new SandboxBuilder({\n name: sandboxName,\n init,\n main,\n ...options,\n })\n .view(new ViewBuilder(options))\n .build()\n .catch(e => {\n console.error("Failed to build sandbox: ", e);\n });\n} catch (e) {\n console.error("The sandbox crashed on startup:", e);\n}\n';
|
|
@@ -49,7 +49,7 @@ var virtualCommandModule = (file, name) => {
|
|
|
49
49
|
return getVirtualModule(file, "command").replace("virtual:command-name", name);
|
|
50
50
|
};
|
|
51
51
|
var virtualContentScriptModule = (file, navigation = false) => {
|
|
52
|
-
return getVirtualModule(file, "content").replace(`virtual:content-builder`, navigation ? `${PackageName}/entry/content
|
|
52
|
+
return getVirtualModule(file, "content").replace(`virtual:content-builder`, navigation ? `${PackageName}/entry/content` : getEntryFramework(file, "content"));
|
|
53
53
|
};
|
|
54
54
|
var virtualOffscreenModule = (file, name) => {
|
|
55
55
|
return getVirtualModule(file, "offscreen").replace("virtual:offscreen-name", name).replace(`virtual:view-framework`, getEntryFramework(file, "view"));
|
|
@@ -60,7 +60,7 @@ var virtualOffscreenBackgroundModule = () => {
|
|
|
60
60
|
var virtualRelayModule = (file, name, navigation = false) => {
|
|
61
61
|
return getVirtualModule(file, "relay").replace("virtual:relay-name", name).replace(
|
|
62
62
|
`virtual:content-builder`,
|
|
63
|
-
navigation ? `${PackageName}/entry/content
|
|
63
|
+
navigation ? `${PackageName}/entry/content` : getEntryFramework(file, "content")
|
|
64
64
|
);
|
|
65
65
|
};
|
|
66
66
|
var virtualSandboxModule = (file, name) => {
|
|
@@ -21,7 +21,7 @@ declare module "virtual:command-entrypoint" {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
declare module "virtual:content-entrypoint" {
|
|
24
|
-
type ContentScriptDefinition = import("../../types/content.js").ContentScriptDefinition;
|
|
24
|
+
type ContentScriptDefinition = import("../../types/content/index.js").ContentScriptDefinition;
|
|
25
25
|
|
|
26
26
|
interface ModuleType {
|
|
27
27
|
[name: string]: unknown;
|
|
@@ -33,15 +33,17 @@ declare module "virtual:content-entrypoint" {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
declare module "virtual:content-builder" {
|
|
36
|
+
export const resolveDefinition: (module: object) => import("../../types/content/index.js").ContentScriptDefinition;
|
|
37
|
+
|
|
36
38
|
export const Builder:
|
|
37
39
|
| typeof import("../../entry/content/adapters/vanilla/index.js").Builder
|
|
38
40
|
| typeof import("../../entry/content/adapters/react/index.js").Builder
|
|
39
|
-
| typeof import("../../entry/content/
|
|
41
|
+
| typeof import("../../entry/content/index.js").Builder;
|
|
40
42
|
|
|
41
43
|
const content:
|
|
42
44
|
| typeof import("../../entry/content/adapters/vanilla/index.js").default
|
|
43
45
|
| typeof import("../../entry/content/adapters/react/index.js").default
|
|
44
|
-
| typeof import("../../entry/content/
|
|
46
|
+
| typeof import("../../entry/content/index.js").default;
|
|
45
47
|
export default content;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -80,8 +82,11 @@ declare module "virtual:relay-entrypoint" {
|
|
|
80
82
|
marker,
|
|
81
83
|
anchor,
|
|
82
84
|
mount,
|
|
85
|
+
prepare,
|
|
83
86
|
render,
|
|
84
87
|
container,
|
|
88
|
+
boundary,
|
|
89
|
+
target,
|
|
85
90
|
watch,
|
|
86
91
|
includeBrowser,
|
|
87
92
|
excludeBrowser,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createMutationObserverStrategy, createAwaitFirstStrategy } from "../entry/content/resolvers/watch.js";
|
|
2
|
+
export { ContentScriptEvent } from "../types/content/index.js";
|
|
3
|
+
export type { ContentScriptWatchStrategy, ContentScriptContext, ContentScriptEventCallback, ContentScriptNode, } from "../types/content/index.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMutationObserverStrategy, createAwaitFirstStrategy } from "./../entry/content/resolvers/watch.js";
|
|
2
|
+
import { ContentScriptEvent } from "./../types/content/index.js";
|
|
3
|
+
export {
|
|
4
|
+
ContentScriptEvent,
|
|
5
|
+
createAwaitFirstStrategy,
|
|
6
|
+
createMutationObserverStrategy
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/content/index.ts"],"sourcesContent":["export {createMutationObserverStrategy, createAwaitFirstStrategy} from \"@entry/content/resolvers/watch\";\n\nexport {ContentScriptEvent} from \"@typing/content\";\nexport type {\n ContentScriptWatchStrategy,\n ContentScriptContext,\n ContentScriptEventCallback,\n ContentScriptNode,\n} from \"@typing/content\";\n"],"mappings":"AAAA,SAAQ,gCAAgC,gCAA+B;AAEvE,SAAQ,0BAAyB;","names":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
protected
|
|
1
|
+
import ReactNode from "./Node.js";
|
|
2
|
+
import MountBuilder from "../../lifecycle/MountBuilder.js";
|
|
3
|
+
import type { ContentScriptRenderOptions } from "../../lifecycle/types.js";
|
|
4
|
+
import type { ContentScriptNode, ContentScriptIsolation, ContentScriptProps, ContentScriptRenderHandler, ContentScriptRenderValue } from "../../../../types/content/index.js";
|
|
5
|
+
export default class Builder<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends MountBuilder<Data, Isolation> {
|
|
6
|
+
protected resolveRender(render?: ContentScriptRenderValue<Data> | ContentScriptRenderHandler<Data>): true | ContentScriptRenderHandler<Data> | undefined;
|
|
7
|
+
protected createRenderer(node: ContentScriptNode, render: ContentScriptRenderHandler<Data>, props: () => ContentScriptProps<Data>, options: ContentScriptRenderOptions): ReactNode<Data>;
|
|
7
8
|
}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import { isValidElement } from "react";
|
|
2
|
-
import MountBuilder from "../../core/MountBuilder.js";
|
|
3
|
-
import EventNode from "../../core/nodes/EventNode.js";
|
|
1
|
+
import { createElement, isValidElement } from "react";
|
|
4
2
|
import ReactNode from "./Node.js";
|
|
5
|
-
import
|
|
6
|
-
class
|
|
7
|
-
constructor(definition) {
|
|
8
|
-
super(definition);
|
|
9
|
-
}
|
|
3
|
+
import MountBuilder from "../../lifecycle/MountBuilder.js";
|
|
4
|
+
class Builder extends MountBuilder {
|
|
10
5
|
resolveRender(render) {
|
|
11
|
-
if (render === void 0) {
|
|
12
|
-
return;
|
|
6
|
+
if (render === true || render === void 0) {
|
|
7
|
+
return render;
|
|
13
8
|
}
|
|
14
|
-
return
|
|
9
|
+
return (props) => {
|
|
10
|
+
const value = typeof render === "function" ? createElement(render, props) : render;
|
|
11
|
+
return isValidElement(value) ? value : void 0;
|
|
12
|
+
};
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!isValidElement(value)) {
|
|
19
|
-
value = void 0;
|
|
20
|
-
console.warn("Content script react value is not a valid React element");
|
|
21
|
-
}
|
|
22
|
-
return new EventNode(new ReactNode(await super.createNode(anchor), value), this.emitter);
|
|
14
|
+
createRenderer(node, render, props, options) {
|
|
15
|
+
return new ReactNode(node, render, props, options);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
25
18
|
export {
|
|
26
|
-
|
|
19
|
+
Builder as default
|
|
27
20
|
};
|
|
28
21
|
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/Builder.ts"],"sourcesContent":["import {isValidElement} from \"react\";\n\nimport
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/Builder.ts"],"sourcesContent":["import {createElement, isValidElement} from \"react\";\n\nimport ReactNode from \"./Node\";\n\nimport MountBuilder from \"../../lifecycle/MountBuilder\";\nimport type {ContentScriptRenderOptions} from \"../../lifecycle/types\";\n\nimport type {\n ContentScriptNode,\n ContentScriptIsolation,\n ContentScriptProps,\n ContentScriptRenderHandler,\n ContentScriptRenderReactComponent,\n ContentScriptRenderValue,\n} from \"@typing/content\";\n\nexport default class Builder<\n Data = unknown,\n Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`,\n> extends MountBuilder<Data, Isolation> {\n protected resolveRender(\n render?: ContentScriptRenderValue<Data> | ContentScriptRenderHandler<Data>\n ): true | ContentScriptRenderHandler<Data> | undefined {\n if (render === true || render === undefined) {\n return render;\n }\n\n return props => {\n // Functions in React entrypoints are components; React owns their invocation and hooks.\n const value =\n typeof render === \"function\"\n ? createElement(render as ContentScriptRenderReactComponent<Data>, props)\n : render;\n\n return isValidElement(value) ? value : undefined;\n };\n }\n\n protected createRenderer(\n node: ContentScriptNode,\n render: ContentScriptRenderHandler<Data>,\n props: () => ContentScriptProps<Data>,\n options: ContentScriptRenderOptions\n ): ReactNode<Data> {\n return new ReactNode(node, render, props, options);\n }\n}\n"],"mappings":"AAAA,SAAQ,eAAe,sBAAqB;AAE5C,OAAO,eAAe;AAEtB,OAAO,kBAAkB;AAYzB,MAAO,gBAGG,aAA8B;AAAA,EAC1B,cACN,QACmD;AACnD,QAAI,WAAW,QAAQ,WAAW,QAAW;AACzC,aAAO;AAAA,IACX;AAEA,WAAO,WAAS;AAEZ,YAAM,QACF,OAAO,WAAW,aACZ,cAAc,QAAmD,KAAK,IACtE;AAEV,aAAO,eAAe,KAAK,IAAI,QAAQ;AAAA,IAC3C;AAAA,EACJ;AAAA,EAEU,eACN,MACA,QACA,OACA,SACe;AACf,WAAO,IAAI,UAAU,MAAM,QAAQ,OAAO,OAAO;AAAA,EACrD;AACJ;","names":[]}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
protected
|
|
6
|
-
protected
|
|
7
|
-
protected root?: Root;
|
|
8
|
-
private renderedTarget?;
|
|
9
|
-
constructor(node: ContentScriptNode, component?: ReactComponent);
|
|
10
|
-
get anchor(): Element;
|
|
11
|
-
get container(): Element | undefined;
|
|
12
|
-
get target(): Element | undefined;
|
|
13
|
-
mount(): boolean;
|
|
14
|
-
unmount(): boolean;
|
|
1
|
+
import { RenderNode } from "../../lifecycle/nodes/index.js";
|
|
2
|
+
import type { ContentScriptRenderValue } from "../../../../types/content/index.js";
|
|
3
|
+
export default class Node<Data = unknown> extends RenderNode<Data> {
|
|
4
|
+
private root?;
|
|
5
|
+
protected render(value: ContentScriptRenderValue<Data> | undefined, target: Element): boolean;
|
|
6
|
+
protected clear(): void;
|
|
15
7
|
}
|
|
@@ -1,47 +1,23 @@
|
|
|
1
|
+
import { isValidElement } from "react";
|
|
1
2
|
import { createRoot } from "react-dom/client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
this.node = node;
|
|
5
|
-
this.component = component;
|
|
6
|
-
}
|
|
7
|
-
node;
|
|
8
|
-
component;
|
|
3
|
+
import { RenderNode } from "../../lifecycle/nodes/index.js";
|
|
4
|
+
class Node extends RenderNode {
|
|
9
5
|
root;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return this.node.anchor;
|
|
13
|
-
}
|
|
14
|
-
get container() {
|
|
15
|
-
return this.node.container;
|
|
16
|
-
}
|
|
17
|
-
get target() {
|
|
18
|
-
return this.node.target;
|
|
19
|
-
}
|
|
20
|
-
mount() {
|
|
21
|
-
var _a;
|
|
22
|
-
this.node.mount();
|
|
23
|
-
if (!this.target || this.root && this.renderedTarget === this.target) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
if (!this.component) {
|
|
27
|
-
console.warn("Content script react component is empty");
|
|
6
|
+
render(value, target) {
|
|
7
|
+
if (!isValidElement(value)) {
|
|
28
8
|
return false;
|
|
29
9
|
}
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
this.root = createRoot(this.target);
|
|
33
|
-
this.root.render(this.component);
|
|
10
|
+
this.root = createRoot(target);
|
|
11
|
+
this.root.render(value);
|
|
34
12
|
return true;
|
|
35
13
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(_a = this.root) == null ? void 0 : _a.unmount();
|
|
14
|
+
clear() {
|
|
15
|
+
const root = this.root;
|
|
39
16
|
this.root = void 0;
|
|
40
|
-
|
|
41
|
-
return !!this.node.unmount();
|
|
17
|
+
root == null ? void 0 : root.unmount();
|
|
42
18
|
}
|
|
43
19
|
}
|
|
44
20
|
export {
|
|
45
|
-
|
|
21
|
+
Node as default
|
|
46
22
|
};
|
|
47
23
|
//# sourceMappingURL=Node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/Node.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/Node.ts"],"sourcesContent":["import {isValidElement} from \"react\";\nimport {createRoot, type Root} from \"react-dom/client\";\n\nimport {RenderNode} from \"../../lifecycle/nodes\";\n\nimport type {ContentScriptRenderValue} from \"@typing/content\";\n\nexport default class Node<Data = unknown> extends RenderNode<Data> {\n private root?: Root;\n\n protected render(value: ContentScriptRenderValue<Data> | undefined, target: Element): boolean {\n if (!isValidElement(value)) {\n return false;\n }\n\n this.root = createRoot(target);\n this.root.render(value);\n\n return true;\n }\n\n protected clear(): void {\n const root = this.root;\n this.root = undefined;\n root?.unmount();\n }\n}\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAC7B,SAAQ,kBAA4B;AAEpC,SAAQ,kBAAiB;AAIzB,MAAO,aAA2C,WAAiB;AAAA,EACvD;AAAA,EAEE,OAAO,OAAmD,QAA0B;AAC1F,QAAI,CAAC,eAAe,KAAK,GAAG;AACxB,aAAO;AAAA,IACX;AAEA,SAAK,OAAO,WAAW,MAAM;AAC7B,SAAK,KAAK,OAAO,KAAK;AAEtB,WAAO;AAAA,EACX;AAAA,EAEU,QAAc;AACpB,UAAM,OAAO,KAAK;AAClB,SAAK,OAAO;AACZ,iCAAM;AAAA,EACV;AACJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isValidElement } from "react";
|
|
2
|
+
import { mergeDefinition } from "../../resolvers/definition.js";
|
|
3
|
+
const resolveDefinition = (module) => {
|
|
4
|
+
return mergeDefinition(
|
|
5
|
+
module,
|
|
6
|
+
(value) => typeof value === "function" || isValidElement(value) || typeof value === "number" || typeof value === "string" && value.length > 0 || value instanceof Element
|
|
7
|
+
);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
resolveDefinition
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/definition.ts"],"sourcesContent":["import {isValidElement} from \"react\";\nimport {mergeDefinition} from \"../../resolvers/definition\";\n\nimport type {ContentScriptDefinition} from \"@typing/content\";\n\nexport const resolveDefinition = (module: object): ContentScriptDefinition => {\n return mergeDefinition(\n module,\n value =>\n typeof value === \"function\" ||\n isValidElement(value) ||\n typeof value === \"number\" ||\n (typeof value === \"string\" && value.length > 0) ||\n value instanceof Element\n );\n};\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAC7B,SAAQ,uBAAsB;AAIvB,MAAM,oBAAoB,CAAC,WAA4C;AAC1E,SAAO;AAAA,IACH;AAAA,IACA,WACI,OAAO,UAAU,cACjB,eAAe,KAAK,KACpB,OAAO,UAAU,YAChB,OAAO,UAAU,YAAY,MAAM,SAAS,KAC7C,iBAAiB;AAAA,EACzB;AACJ;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Builder from "./Builder.js";
|
|
2
2
|
export { Builder };
|
|
3
|
-
|
|
3
|
+
export { resolveDefinition } from "./definition.js";
|
|
4
|
+
declare const _default: (definition: import("../../../../index.js").ContentScriptDefinition<unknown, "none" | "shadow" | "iframe">) => void;
|
|
4
5
|
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Builder from "./Builder.js";
|
|
2
|
+
import { resolveDefinition } from "./definition.js";
|
|
2
3
|
var react_default = Builder.resolver();
|
|
3
4
|
export {
|
|
4
5
|
Builder,
|
|
5
|
-
react_default as default
|
|
6
|
+
react_default as default,
|
|
7
|
+
resolveDefinition
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/index.ts"],"sourcesContent":["import Builder from \"./Builder\";\n\nexport {Builder};\n\nexport default Builder.resolver();\n"],"mappings":"AAAA,OAAO,aAAa;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/react/index.ts"],"sourcesContent":["import Builder from \"./Builder\";\n\nexport {Builder};\nexport {resolveDefinition} from \"./definition\";\n\nexport default Builder.resolver();\n"],"mappings":"AAAA,OAAO,aAAa;AAGpB,SAAQ,yBAAwB;AAEhC,IAAO,gBAAQ,QAAQ,SAAS;","names":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import MountBuilder from "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import MountBuilder from "../../lifecycle/MountBuilder.js";
|
|
2
|
+
import VanillaNode from "./Node.js";
|
|
3
|
+
import type { ContentScriptRenderOptions } from "../../lifecycle/types.js";
|
|
4
|
+
import type { ContentScriptNode, ContentScriptIsolation, ContentScriptProps, ContentScriptRenderHandler, ContentScriptRenderValue } from "../../../../types/content/index.js";
|
|
5
|
+
export default class Builder<Data = unknown, Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`> extends MountBuilder<Data, Isolation> {
|
|
6
|
+
protected resolveRender(render?: ContentScriptRenderValue<Data> | ContentScriptRenderHandler<Data>): true | ContentScriptRenderHandler<Data> | undefined;
|
|
7
|
+
protected createRenderer(node: ContentScriptNode, render: ContentScriptRenderHandler<Data>, props: () => ContentScriptProps<Data>, options: ContentScriptRenderOptions): VanillaNode<Data>;
|
|
6
8
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MountBuilder from "../../core/MountBuilder.js";
|
|
3
|
-
import EventNode from "../../core/nodes/EventNode.js";
|
|
1
|
+
import MountBuilder from "../../lifecycle/MountBuilder.js";
|
|
4
2
|
import VanillaNode from "./Node.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let value = await this.getValue(anchor);
|
|
11
|
-
if (value !== true && !isValidContentScriptRenderValue(value)) {
|
|
12
|
-
value = void 0;
|
|
13
|
-
console.warn("Content script vanilla value is not a valid render value");
|
|
3
|
+
import { isValidRenderValue } from "./utils.js";
|
|
4
|
+
class Builder extends MountBuilder {
|
|
5
|
+
resolveRender(render) {
|
|
6
|
+
if (render === true || render === void 0) {
|
|
7
|
+
return render;
|
|
14
8
|
}
|
|
15
|
-
return
|
|
9
|
+
return (props) => {
|
|
10
|
+
const resolvedRender = typeof render === "function" ? render(props) : render;
|
|
11
|
+
if (!isValidRenderValue(resolvedRender)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
return resolvedRender;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
createRenderer(node, render, props, options) {
|
|
18
|
+
return new VanillaNode(node, render, props, options);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
export {
|
|
19
|
-
|
|
22
|
+
Builder as default
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/Builder.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/Builder.ts"],"sourcesContent":["import MountBuilder from \"../../lifecycle/MountBuilder\";\nimport VanillaNode from \"./Node\";\nimport {isValidRenderValue} from \"./utils\";\nimport type {ContentScriptRenderOptions} from \"../../lifecycle/types\";\n\nimport type {\n ContentScriptNode,\n ContentScriptIsolation,\n ContentScriptProps,\n ContentScriptRenderHandler,\n ContentScriptRenderValue,\n} from \"@typing/content\";\n\nexport default class Builder<\n Data = unknown,\n Isolation extends `${ContentScriptIsolation}` = `${ContentScriptIsolation}`,\n> extends MountBuilder<Data, Isolation> {\n protected resolveRender(\n render?: ContentScriptRenderValue<Data> | ContentScriptRenderHandler<Data>\n ): true | ContentScriptRenderHandler<Data> | undefined {\n if (render === true || render === undefined) {\n return render;\n }\n\n return props => {\n const resolvedRender = typeof render === \"function\" ? render(props) : render;\n\n if (!isValidRenderValue(resolvedRender)) {\n return;\n }\n\n return resolvedRender;\n };\n }\n\n protected createRenderer(\n node: ContentScriptNode,\n render: ContentScriptRenderHandler<Data>,\n props: () => ContentScriptProps<Data>,\n options: ContentScriptRenderOptions\n ): VanillaNode<Data> {\n return new VanillaNode(node, render, props, options);\n }\n}\n"],"mappings":"AAAA,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,SAAQ,0BAAyB;AAWjC,MAAO,gBAGG,aAA8B;AAAA,EAC1B,cACN,QACmD;AACnD,QAAI,WAAW,QAAQ,WAAW,QAAW;AACzC,aAAO;AAAA,IACX;AAEA,WAAO,WAAS;AACZ,YAAM,iBAAiB,OAAO,WAAW,aAAa,OAAO,KAAK,IAAI;AAEtE,UAAI,CAAC,mBAAmB,cAAc,GAAG;AACrC;AAAA,MACJ;AAEA,aAAO;AAAA,IACX;AAAA,EACJ;AAAA,EAEU,eACN,MACA,QACA,OACA,SACiB;AACjB,WAAO,IAAI,YAAY,MAAM,QAAQ,OAAO,OAAO;AAAA,EACvD;AACJ;","names":[]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
protected
|
|
5
|
-
|
|
6
|
-
constructor(node: ContentScriptNode, value?: (null | boolean | string | number | Element) | undefined);
|
|
7
|
-
get anchor(): Element;
|
|
8
|
-
get container(): Element | undefined;
|
|
9
|
-
get target(): Element | undefined;
|
|
10
|
-
mount(): boolean;
|
|
11
|
-
unmount(): boolean;
|
|
1
|
+
import { RenderNode } from "../../lifecycle/nodes/index.js";
|
|
2
|
+
import type { ContentScriptRenderValue } from "../../../../types/content/index.js";
|
|
3
|
+
export default class Node<Data = unknown> extends RenderNode<Data> {
|
|
4
|
+
protected render(value: ContentScriptRenderValue<Data> | undefined, target: Element): boolean;
|
|
5
|
+
protected clear(): void;
|
|
12
6
|
}
|
|
@@ -1,45 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.target || this.renderedTarget === this.target) {
|
|
1
|
+
import { RenderNode } from "../../lifecycle/nodes/index.js";
|
|
2
|
+
class Node extends RenderNode {
|
|
3
|
+
render(value, target) {
|
|
4
|
+
if (value && typeof value === "object" && "nodeType" in value && value.nodeType === 1) {
|
|
5
|
+
target.appendChild(value);
|
|
6
|
+
} else if (typeof value === "string" || typeof value === "number") {
|
|
7
|
+
target.textContent = String(value);
|
|
8
|
+
} else {
|
|
21
9
|
return false;
|
|
22
10
|
}
|
|
23
|
-
|
|
24
|
-
if (this.value && typeof this.value === "object" && this.value.nodeType === 1) {
|
|
25
|
-
this.target.appendChild(this.value);
|
|
26
|
-
} else if (typeof this.value === "string" || typeof this.value === "number") {
|
|
27
|
-
this.target.textContent = String(this.value);
|
|
28
|
-
} else if (this.value === null || this.value === void 0 || this.value === false) {
|
|
29
|
-
result = false;
|
|
30
|
-
console.warn("Content script vanilla value is empty");
|
|
31
|
-
} else if (this.value === true) {
|
|
32
|
-
result = false;
|
|
33
|
-
}
|
|
34
|
-
this.renderedTarget = this.target;
|
|
35
|
-
return result;
|
|
11
|
+
return true;
|
|
36
12
|
}
|
|
37
|
-
|
|
38
|
-
this.renderedTarget = void 0;
|
|
39
|
-
return !!this.node.unmount();
|
|
13
|
+
clear() {
|
|
40
14
|
}
|
|
41
15
|
}
|
|
42
16
|
export {
|
|
43
|
-
|
|
17
|
+
Node as default
|
|
44
18
|
};
|
|
45
19
|
//# sourceMappingURL=Node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/Node.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/Node.ts"],"sourcesContent":["import {RenderNode} from \"../../lifecycle/nodes\";\nimport type {ContentScriptRenderValue} from \"@typing/content\";\n\nexport default class Node<Data = unknown> extends RenderNode<Data> {\n protected render(value: ContentScriptRenderValue<Data> | undefined, target: Element): boolean {\n if (value && typeof value === \"object\" && \"nodeType\" in value && value.nodeType === 1) {\n target.appendChild(value as Element);\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n target.textContent = String(value);\n } else {\n return false;\n }\n\n return true;\n }\n\n protected clear(): void {}\n}\n"],"mappings":"AAAA,SAAQ,kBAAiB;AAGzB,MAAO,aAA2C,WAAiB;AAAA,EACrD,OAAO,OAAmD,QAA0B;AAC1F,QAAI,SAAS,OAAO,UAAU,YAAY,cAAc,SAAS,MAAM,aAAa,GAAG;AACnF,aAAO,YAAY,KAAgB;AAAA,IACvC,WAAW,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC/D,aAAO,cAAc,OAAO,KAAK;AAAA,IACrC,OAAO;AACH,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,EACX;AAAA,EAEU,QAAc;AAAA,EAAC;AAC7B;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { mergeDefinition } from "../../resolvers/definition.js";
|
|
2
|
+
import { isValidRenderValue } from "./utils.js";
|
|
3
|
+
const resolveDefinition = (module) => {
|
|
4
|
+
return mergeDefinition(module, (value) => typeof value === "function" || isValidRenderValue(value));
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
resolveDefinition
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/definition.ts"],"sourcesContent":["import {mergeDefinition} from \"../../resolvers/definition\";\nimport {isValidRenderValue} from \"./utils\";\n\nimport type {ContentScriptDefinition} from \"@typing/content\";\n\nexport const resolveDefinition = (module: object): ContentScriptDefinition => {\n return mergeDefinition(module, value => typeof value === \"function\" || isValidRenderValue(value));\n};\n"],"mappings":"AAAA,SAAQ,uBAAsB;AAC9B,SAAQ,0BAAyB;AAI1B,MAAM,oBAAoB,CAAC,WAA4C;AAC1E,SAAO,gBAAgB,QAAQ,WAAS,OAAO,UAAU,cAAc,mBAAmB,KAAK,CAAC;AACpG;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Builder from "./Builder.js";
|
|
2
2
|
export { Builder };
|
|
3
|
-
|
|
3
|
+
export { resolveDefinition } from "./definition.js";
|
|
4
|
+
declare const _default: (definition: import("../../../../index.js").ContentScriptDefinition<unknown, "none" | "shadow" | "iframe">) => void;
|
|
4
5
|
export default _default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Builder from "./Builder.js";
|
|
2
|
+
import { resolveDefinition } from "./definition.js";
|
|
2
3
|
var vanilla_default = Builder.resolver();
|
|
3
4
|
export {
|
|
4
5
|
Builder,
|
|
5
|
-
vanilla_default as default
|
|
6
|
+
vanilla_default as default,
|
|
7
|
+
resolveDefinition
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/index.ts"],"sourcesContent":["import Builder from \"./Builder\";\n\nexport {Builder};\n\nexport default Builder.resolver();\n"],"mappings":"AAAA,OAAO,aAAa;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/index.ts"],"sourcesContent":["import Builder from \"./Builder\";\n\nexport {Builder};\nexport {resolveDefinition} from \"./definition\";\n\nexport default Builder.resolver();\n"],"mappings":"AAAA,OAAO,aAAa;AAGpB,SAAQ,yBAAwB;AAEhC,IAAO,kBAAQ,QAAQ,SAAS;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isValidRenderValue: (value: unknown) => value is string | number | Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/entry/content/adapters/vanilla/utils.ts"],"sourcesContent":["export const isValidRenderValue = (value: unknown): value is string | number | Element => {\n return (typeof value === \"string\" && value.length > 0) || typeof value === \"number\" || value instanceof Element;\n};\n"],"mappings":"AAAO,MAAM,qBAAqB,CAAC,UAAuD;AACtF,SAAQ,OAAO,UAAU,YAAY,MAAM,SAAS,KAAM,OAAO,UAAU,YAAY,iBAAiB;AAC5G;","names":[]}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import MountBuilder from "./lifecycle/MountBuilder.js";
|
|
2
|
+
export { MountBuilder as Builder };
|
|
3
|
+
export { resolveDefinition } from "./resolvers/definition.js";
|
|
4
|
+
declare const _default: (definition: import("../../index.js").ContentScriptDefinition<unknown, "none" | "shadow" | "iframe">) => void;
|
|
5
|
+
export default _default;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import MountBuilder from "./lifecycle/MountBuilder.js";
|
|
2
|
+
import { resolveDefinition } from "./resolvers/definition.js";
|
|
3
|
+
var content_default = MountBuilder.resolver();
|
|
4
|
+
export {
|
|
5
|
+
MountBuilder as Builder,
|
|
6
|
+
content_default as default,
|
|
7
|
+
resolveDefinition
|
|
8
|
+
};
|
|
2
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/entry/content/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/entry/content/index.ts"],"sourcesContent":["import MountBuilder from \"./lifecycle/MountBuilder\";\n\nexport {MountBuilder as Builder};\nexport {resolveDefinition} from \"./resolvers/definition\";\n\nexport default MountBuilder.resolver();\n"],"mappings":"AAAA,OAAO,kBAAkB;AAGzB,SAAQ,yBAAwB;AAEhC,IAAO,kBAAQ,aAAa,SAAS;","names":[]}
|