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.
Files changed (378) hide show
  1. package/README.md +3 -0
  2. package/dist/cli/builders/manifest/ManifestBase.js +1 -1
  3. package/dist/cli/bundler/index.d.ts +1 -0
  4. package/dist/cli/bundler/index.js +1 -0
  5. package/dist/cli/bundler/index.js.map +1 -1
  6. package/dist/cli/bundler/layers.d.ts +5 -0
  7. package/dist/cli/bundler/layers.js +11 -0
  8. package/dist/cli/bundler/layers.js.map +1 -0
  9. package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +44 -15
  10. package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -1
  11. package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +1 -2
  12. package/dist/cli/bundler/plugins/build-assets-map/index.js +0 -3
  13. package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -1
  14. package/dist/cli/bundler/plugins/build-assets-map/normalize.d.ts +3 -0
  15. package/dist/cli/bundler/plugins/build-assets-map/normalize.js +24 -0
  16. package/dist/cli/bundler/plugins/build-assets-map/normalize.js.map +1 -0
  17. package/dist/cli/bundler/plugins/build-assets-map/templates/runtime.template.d.ts +2 -0
  18. package/dist/cli/bundler/plugins/build-assets-map/templates.d.ts +9 -0
  19. package/dist/cli/bundler/plugins/build-assets-map/templates.js +32 -0
  20. package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +3 -6
  21. package/dist/cli/bundler/plugins/build-assets-map/usage.js +6 -3
  22. package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -1
  23. package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js +11 -0
  24. package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -1
  25. package/dist/cli/bundler/plugins/index.d.ts +2 -2
  26. package/dist/cli/bundler/plugins/index.js +2 -6
  27. package/dist/cli/bundler/plugins/index.js.map +1 -1
  28. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +1 -1
  29. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +38 -13
  30. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -1
  31. package/dist/cli/bundler/plugins/isolated-styles/chunks.d.ts +7 -0
  32. package/dist/cli/bundler/plugins/isolated-styles/chunks.js +33 -0
  33. package/dist/cli/bundler/plugins/isolated-styles/chunks.js.map +1 -0
  34. package/dist/cli/bundler/plugins/isolated-styles/split-chunks.d.ts +4 -0
  35. package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js +51 -0
  36. package/dist/cli/bundler/plugins/isolated-styles/split-chunks.js.map +1 -0
  37. package/dist/cli/bundler/plugins/isolated-styles/templates.js +36 -6
  38. package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +1 -2
  39. package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -1
  40. package/dist/cli/bundler/plugins/types.d.ts +4 -0
  41. package/dist/cli/bundler/plugins/utils/compilation-assets.d.ts +4 -0
  42. package/dist/cli/bundler/plugins/utils/compilation-assets.js +12 -0
  43. package/dist/cli/bundler/plugins/utils/compilation-assets.js.map +1 -0
  44. package/dist/cli/bundler/plugins/utils/index.d.ts +2 -0
  45. package/dist/cli/bundler/plugins/utils/index.js +5 -0
  46. package/dist/cli/bundler/plugins/utils/index.js.map +1 -1
  47. package/dist/cli/bundler/plugins/utils/runtime-module.d.ts +3 -0
  48. package/dist/cli/bundler/plugins/utils/runtime-module.js +11 -0
  49. package/dist/cli/bundler/plugins/utils/runtime-module.js.map +1 -0
  50. package/dist/cli/bundler/utils/app-filename.d.ts +2 -0
  51. package/dist/cli/bundler/utils/app-filename.js +19 -0
  52. package/dist/cli/bundler/utils/app-filename.js.map +1 -0
  53. package/dist/cli/bundler/utils/assets.d.ts +3 -0
  54. package/dist/cli/bundler/utils/{output.js → assets.js} +22 -33
  55. package/dist/cli/bundler/utils/assets.js.map +1 -0
  56. package/dist/cli/bundler/utils/index.d.ts +2 -3
  57. package/dist/cli/bundler/utils/index.js +2 -3
  58. package/dist/cli/bundler/utils/index.js.map +1 -1
  59. package/dist/cli/entrypoint/file/injectors/core.js +1 -1
  60. package/dist/cli/entrypoint/finder/ContentFinder.d.ts +1 -1
  61. package/dist/cli/entrypoint/parser/ContentParser.d.ts +2 -2
  62. package/dist/cli/entrypoint/parser/ContentParser.js +6 -22
  63. package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
  64. package/dist/cli/entrypoint/parser/RelayParser.js +1 -1
  65. package/dist/cli/entrypoint/parser/utils/content/default-render.d.ts +3 -0
  66. package/dist/cli/entrypoint/parser/utils/content/default-render.js +21 -0
  67. package/dist/cli/entrypoint/parser/utils/content/default-render.js.map +1 -0
  68. package/dist/cli/plugins/content/Content.d.ts +1 -1
  69. package/dist/cli/plugins/content/ContentDriver.d.ts +1 -1
  70. package/dist/cli/plugins/content/ContentManager.d.ts +1 -1
  71. package/dist/cli/plugins/content/ContentManager.js +1 -1
  72. package/dist/cli/plugins/content/ContentName.d.ts +1 -1
  73. package/dist/cli/plugins/content/ContentName.js +1 -1
  74. package/dist/cli/plugins/content/Relay.d.ts +1 -1
  75. package/dist/cli/plugins/content/RelayDriver.d.ts +1 -1
  76. package/dist/cli/plugins/content/RelayDriver.js +1 -1
  77. package/dist/cli/plugins/content/bundler.d.ts +1 -4
  78. package/dist/cli/plugins/content/bundler.js +5 -21
  79. package/dist/cli/plugins/content/bundler.js.map +1 -1
  80. package/dist/cli/plugins/content/index.js +4 -5
  81. package/dist/cli/plugins/content/index.js.map +1 -1
  82. package/dist/cli/plugins/content/types.d.ts +1 -1
  83. package/dist/cli/plugins/content/utils.d.ts +1 -1
  84. package/dist/cli/plugins/content/utils.js +1 -1
  85. package/dist/cli/plugins/index.d.ts +1 -1
  86. package/dist/cli/plugins/index.js +1 -1
  87. package/dist/cli/plugins/locale/Locale.js +5 -2
  88. package/dist/cli/plugins/locale/Locale.js.map +1 -1
  89. package/dist/cli/plugins/locale/index.js +2 -2
  90. package/dist/cli/plugins/locale/index.js.map +1 -1
  91. package/dist/cli/plugins/output/index.d.ts +2 -0
  92. package/dist/cli/plugins/{output.js → output/index.js} +11 -13
  93. package/dist/cli/plugins/output/index.js.map +1 -0
  94. package/dist/cli/plugins/output/runtime.d.ts +26 -0
  95. package/dist/cli/plugins/output/runtime.js +19 -0
  96. package/dist/cli/plugins/output/runtime.js.map +1 -0
  97. package/dist/cli/plugins/style/index.d.ts +1 -2
  98. package/dist/cli/plugins/style/index.js +19 -30
  99. package/dist/cli/plugins/style/index.js.map +1 -1
  100. package/dist/cli/resolvers/config.js +1 -2
  101. package/dist/cli/resolvers/config.js.map +1 -1
  102. package/dist/cli/virtual/index.js +4 -4
  103. package/dist/cli/virtual/virtual.d.ts +8 -3
  104. package/dist/content/index.d.ts +3 -0
  105. package/dist/content/index.js +8 -0
  106. package/dist/content/index.js.map +1 -0
  107. package/dist/entry/content/adapters/react/Builder.d.ts +7 -6
  108. package/dist/entry/content/adapters/react/Builder.js +12 -19
  109. package/dist/entry/content/adapters/react/Builder.js.map +1 -1
  110. package/dist/entry/content/adapters/react/Node.d.ts +6 -14
  111. package/dist/entry/content/adapters/react/Node.js +11 -35
  112. package/dist/entry/content/adapters/react/Node.js.map +1 -1
  113. package/dist/entry/content/adapters/react/definition.d.ts +2 -0
  114. package/dist/entry/content/adapters/react/definition.js +12 -0
  115. package/dist/entry/content/adapters/react/definition.js.map +1 -0
  116. package/dist/entry/content/adapters/react/index.d.ts +2 -1
  117. package/dist/entry/content/adapters/react/index.js +3 -1
  118. package/dist/entry/content/adapters/react/index.js.map +1 -1
  119. package/dist/entry/content/adapters/vanilla/Builder.d.ts +7 -5
  120. package/dist/entry/content/adapters/vanilla/Builder.js +17 -14
  121. package/dist/entry/content/adapters/vanilla/Builder.js.map +1 -1
  122. package/dist/entry/content/adapters/vanilla/Node.d.ts +5 -11
  123. package/dist/entry/content/adapters/vanilla/Node.js +11 -37
  124. package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
  125. package/dist/entry/content/adapters/vanilla/definition.d.ts +2 -0
  126. package/dist/entry/content/adapters/vanilla/definition.js +9 -0
  127. package/dist/entry/content/adapters/vanilla/definition.js.map +1 -0
  128. package/dist/entry/content/adapters/vanilla/index.d.ts +2 -1
  129. package/dist/entry/content/adapters/vanilla/index.js +3 -1
  130. package/dist/entry/content/adapters/vanilla/index.js.map +1 -1
  131. package/dist/entry/content/adapters/vanilla/utils.d.ts +1 -0
  132. package/dist/entry/content/adapters/vanilla/utils.js +7 -0
  133. package/dist/entry/content/adapters/vanilla/utils.js.map +1 -0
  134. package/dist/entry/content/index.d.ts +5 -1
  135. package/dist/entry/content/index.js +8 -1
  136. package/dist/entry/content/index.js.map +1 -1
  137. package/dist/entry/content/lifecycle/Builder.d.ts +32 -0
  138. package/dist/entry/content/lifecycle/Builder.js +254 -0
  139. package/dist/entry/content/lifecycle/Builder.js.map +1 -0
  140. package/dist/entry/content/lifecycle/IsolationSetup.d.ts +16 -0
  141. package/dist/entry/content/lifecycle/IsolationSetup.js +37 -0
  142. package/dist/entry/content/lifecycle/IsolationSetup.js.map +1 -0
  143. package/dist/entry/content/lifecycle/MountBuilder.d.ts +11 -0
  144. package/dist/entry/content/lifecycle/MountBuilder.js +73 -0
  145. package/dist/entry/content/lifecycle/MountBuilder.js.map +1 -0
  146. package/dist/entry/content/lifecycle/context/ContainerRegistry.d.ts +7 -0
  147. package/dist/entry/content/lifecycle/context/ContainerRegistry.js +45 -0
  148. package/dist/entry/content/lifecycle/context/ContainerRegistry.js.map +1 -0
  149. package/dist/entry/content/lifecycle/context/Context.d.ts +17 -0
  150. package/dist/entry/content/lifecycle/context/Context.js +88 -0
  151. package/dist/entry/content/lifecycle/context/Context.js.map +1 -0
  152. package/dist/entry/content/{core → lifecycle}/context/EventEmitter.d.ts +2 -2
  153. package/dist/entry/content/{core → lifecycle}/context/EventEmitter.js +3 -3
  154. package/dist/entry/content/lifecycle/context/EventEmitter.js.map +1 -0
  155. package/dist/entry/content/lifecycle/context/ManagedContext.d.ts +8 -0
  156. package/dist/entry/content/lifecycle/context/ManagedContext.js +19 -0
  157. package/dist/entry/content/lifecycle/context/ManagedContext.js.map +1 -0
  158. package/dist/entry/content/{core → lifecycle}/context/index.d.ts +1 -0
  159. package/dist/entry/content/lifecycle/context/index.js +11 -0
  160. package/dist/entry/content/lifecycle/context/index.js.map +1 -0
  161. package/dist/entry/content/{core → lifecycle}/markers/AbstractMarker.d.ts +2 -2
  162. package/dist/entry/content/{core → lifecycle}/markers/AbstractMarker.js +3 -3
  163. package/dist/entry/content/lifecycle/markers/AbstractMarker.js.map +1 -0
  164. package/dist/entry/content/{core → lifecycle}/markers/AttributeMarker.d.ts +2 -2
  165. package/dist/entry/content/{core → lifecycle}/markers/AttributeMarker.js +5 -3
  166. package/dist/entry/content/lifecycle/markers/AttributeMarker.js.map +1 -0
  167. package/dist/entry/content/{core → lifecycle}/markers/WeakMarker.d.ts +2 -2
  168. package/dist/entry/content/{core → lifecycle}/markers/WeakMarker.js +2 -2
  169. package/dist/entry/content/lifecycle/markers/WeakMarker.js.map +1 -0
  170. package/dist/entry/content/lifecycle/markers/index.js.map +1 -0
  171. package/dist/entry/content/lifecycle/nodes/EventNode.d.ts +15 -0
  172. package/dist/entry/content/lifecycle/nodes/EventNode.js +49 -0
  173. package/dist/entry/content/lifecycle/nodes/EventNode.js.map +1 -0
  174. package/dist/entry/content/lifecycle/nodes/FrameNode.d.ts +30 -0
  175. package/dist/entry/content/lifecycle/nodes/FrameNode.js +190 -0
  176. package/dist/entry/content/lifecycle/nodes/FrameNode.js.map +1 -0
  177. package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.d.ts +3 -2
  178. package/dist/entry/content/{core → lifecycle}/nodes/MarkerNode.js +5 -2
  179. package/dist/entry/content/lifecycle/nodes/MarkerNode.js.map +1 -0
  180. package/dist/entry/content/lifecycle/nodes/MountNode.d.ts +17 -0
  181. package/dist/entry/content/lifecycle/nodes/MountNode.js +80 -0
  182. package/dist/entry/content/lifecycle/nodes/MountNode.js.map +1 -0
  183. package/dist/entry/content/{core → lifecycle}/nodes/Node.d.ts +2 -2
  184. package/dist/entry/content/{core → lifecycle}/nodes/Node.js +2 -2
  185. package/dist/entry/content/lifecycle/nodes/Node.js.map +1 -0
  186. package/dist/entry/content/lifecycle/nodes/RenderNode.d.ts +28 -0
  187. package/dist/entry/content/lifecycle/nodes/RenderNode.js +140 -0
  188. package/dist/entry/content/lifecycle/nodes/RenderNode.js.map +1 -0
  189. package/dist/entry/content/lifecycle/nodes/ShadowNode.d.ts +22 -0
  190. package/dist/entry/content/lifecycle/nodes/ShadowNode.js +124 -0
  191. package/dist/entry/content/lifecycle/nodes/ShadowNode.js.map +1 -0
  192. package/dist/entry/content/{core → lifecycle}/nodes/index.d.ts +1 -0
  193. package/dist/entry/content/lifecycle/nodes/index.js +17 -0
  194. package/dist/entry/content/lifecycle/nodes/index.js.map +1 -0
  195. package/dist/entry/content/{core → lifecycle}/nodes/isolated-styles.d.ts +1 -1
  196. package/dist/entry/content/{core → lifecycle}/nodes/isolated-styles.js +2 -2
  197. package/dist/entry/content/lifecycle/nodes/isolated-styles.js.map +1 -0
  198. package/dist/entry/content/lifecycle/types.d.ts +28 -0
  199. package/dist/entry/content/resolvers/anchor.d.ts +2 -0
  200. package/dist/entry/content/{core/resolvers → resolvers}/anchor.js +2 -2
  201. package/dist/entry/content/resolvers/anchor.js.map +1 -0
  202. package/dist/entry/content/resolvers/container.d.ts +2 -0
  203. package/dist/entry/content/{core/resolvers → resolvers}/container.js +2 -2
  204. package/dist/entry/content/resolvers/container.js.map +1 -0
  205. package/dist/entry/content/resolvers/definition.d.ts +5 -0
  206. package/dist/entry/content/resolvers/definition.js +24 -0
  207. package/dist/entry/content/resolvers/definition.js.map +1 -0
  208. package/dist/entry/content/{core/resolvers → resolvers}/index.d.ts +1 -1
  209. package/dist/entry/content/{core/resolvers → resolvers}/index.js +1 -1
  210. package/dist/entry/content/resolvers/index.js.map +1 -0
  211. package/dist/entry/content/resolvers/mount.d.ts +2 -0
  212. package/dist/entry/content/{core/resolvers → resolvers}/mount.js +3 -3
  213. package/dist/entry/content/resolvers/mount.js.map +1 -0
  214. package/dist/entry/content/resolvers/target.d.ts +3 -0
  215. package/dist/entry/content/resolvers/target.js +34 -0
  216. package/dist/entry/content/resolvers/target.js.map +1 -0
  217. package/dist/entry/content/resolvers/watch.d.ts +6 -0
  218. package/dist/entry/content/resolvers/watch.js +81 -0
  219. package/dist/entry/content/resolvers/watch.js.map +1 -0
  220. package/dist/entry/relay/Builder.d.ts +8 -8
  221. package/dist/entry/relay/Builder.js +28 -19
  222. package/dist/entry/relay/Builder.js.map +1 -1
  223. package/dist/entry/relay/TransportBuilder.d.ts +3 -2
  224. package/dist/entry/relay/TransportBuilder.js +3 -3
  225. package/dist/entry/relay/TransportBuilder.js.map +1 -1
  226. package/dist/entry/relay/index.d.ts +5 -2
  227. package/dist/entry/relay/index.js +8 -2
  228. package/dist/entry/relay/index.js.map +1 -1
  229. package/dist/entry/relay/resolvers/definition.d.ts +4 -0
  230. package/dist/entry/relay/resolvers/definition.js +16 -0
  231. package/dist/entry/relay/resolvers/definition.js.map +1 -0
  232. package/dist/main/content.d.ts +4 -6
  233. package/dist/main/content.js +3 -16
  234. package/dist/main/content.js.map +1 -1
  235. package/dist/main/entrypoint.js +1 -1
  236. package/dist/main/entrypoint.js.map +1 -1
  237. package/dist/main/relay.d.ts +2 -1
  238. package/dist/main/relay.js.map +1 -1
  239. package/dist/relay/RelayPermission.js +1 -1
  240. package/dist/shared/content/isolation.d.ts +1 -1
  241. package/dist/shared/content/isolation.js +13 -20
  242. package/dist/shared/content/isolation.js.map +1 -1
  243. package/dist/shared/locale/index.d.ts +1 -1
  244. package/dist/shared/locale/index.js +3 -1
  245. package/dist/shared/locale/index.js.map +1 -1
  246. package/dist/shared/locale/messages.d.ts +4 -0
  247. package/dist/shared/locale/messages.js +12 -0
  248. package/dist/shared/locale/messages.js.map +1 -1
  249. package/dist/types/content/adapters/index.d.ts +2 -0
  250. package/dist/types/content/adapters/index.js +1 -0
  251. package/dist/types/content/adapters/index.js.map +1 -0
  252. package/dist/types/content/adapters/react.d.ts +4 -0
  253. package/dist/types/content/adapters/react.js +1 -0
  254. package/dist/types/content/adapters/react.js.map +1 -0
  255. package/dist/types/content/adapters/vanilla.d.ts +1 -0
  256. package/dist/types/content/adapters/vanilla.js +1 -0
  257. package/dist/types/content/adapters/vanilla.js.map +1 -0
  258. package/dist/types/content/boundary.d.ts +17 -0
  259. package/dist/types/content/boundary.js +1 -0
  260. package/dist/types/content/boundary.js.map +1 -0
  261. package/dist/types/{content.d.ts → content/common.d.ts} +32 -53
  262. package/dist/types/{content.js → content/common.js} +1 -1
  263. package/dist/types/content/common.js.map +1 -0
  264. package/dist/types/content/definition.d.ts +66 -0
  265. package/dist/types/content/definition.js +1 -0
  266. package/dist/types/content/definition.js.map +1 -0
  267. package/dist/types/content/index.d.ts +7 -0
  268. package/dist/types/content/index.js +2 -0
  269. package/dist/types/content/index.js.map +1 -0
  270. package/dist/types/content/prepare.d.ts +9 -0
  271. package/dist/types/content/prepare.js +1 -0
  272. package/dist/types/content/prepare.js.map +1 -0
  273. package/dist/types/content/render.d.ts +6 -0
  274. package/dist/types/content/render.js +1 -0
  275. package/dist/types/content/render.js.map +1 -0
  276. package/dist/types/content/target.d.ts +13 -0
  277. package/dist/types/content/target.js +1 -0
  278. package/dist/types/content/target.js.map +1 -0
  279. package/dist/types/locale.d.ts +3 -0
  280. package/dist/types/locale.js.map +1 -1
  281. package/dist/types/manifest.d.ts +1 -1
  282. package/dist/types/relay.d.ts +3 -4
  283. package/dist/types/relay.js.map +1 -1
  284. package/dist/virtual/modules.d.ts +4 -3
  285. package/dist/virtual/{entrypoint.d.ts → runtime.d.ts} +3 -0
  286. package/dist/virtual/runtime.js +9 -0
  287. package/dist/virtual/runtime.js.map +1 -0
  288. package/package.json +32 -25
  289. package/scripts/merge-coverage.mjs +12 -0
  290. package/scripts/pre-commit.mjs +22 -0
  291. package/scripts/test-inventory.mjs +38 -0
  292. package/scripts/test-run.mjs +25 -0
  293. package/types/client.d.ts +3 -3
  294. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.d.ts +0 -13
  295. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js +0 -16
  296. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js.map +0 -1
  297. package/dist/cli/bundler/utils/layers.d.ts +0 -4
  298. package/dist/cli/bundler/utils/layers.js +0 -10
  299. package/dist/cli/bundler/utils/layers.js.map +0 -1
  300. package/dist/cli/bundler/utils/output.d.ts +0 -6
  301. package/dist/cli/bundler/utils/output.js.map +0 -1
  302. package/dist/cli/bundler/utils/styles.d.ts +0 -5
  303. package/dist/cli/bundler/utils/styles.js +0 -30
  304. package/dist/cli/bundler/utils/styles.js.map +0 -1
  305. package/dist/cli/plugins/output.d.ts +0 -2
  306. package/dist/cli/plugins/output.js.map +0 -1
  307. package/dist/cli/plugins/style/types.d.ts +0 -5
  308. package/dist/entry/content/adapters/react/resolvers/index.d.ts +0 -1
  309. package/dist/entry/content/adapters/react/resolvers/index.js +0 -2
  310. package/dist/entry/content/adapters/react/resolvers/index.js.map +0 -1
  311. package/dist/entry/content/adapters/react/resolvers/render.d.ts +0 -2
  312. package/dist/entry/content/adapters/react/resolvers/render.js +0 -11
  313. package/dist/entry/content/adapters/react/resolvers/render.js.map +0 -1
  314. package/dist/entry/content/core/Builder.d.ts +0 -26
  315. package/dist/entry/content/core/Builder.js +0 -128
  316. package/dist/entry/content/core/Builder.js.map +0 -1
  317. package/dist/entry/content/core/MountBuilder.d.ts +0 -10
  318. package/dist/entry/content/core/MountBuilder.js +0 -48
  319. package/dist/entry/content/core/MountBuilder.js.map +0 -1
  320. package/dist/entry/content/core/context/Context.d.ts +0 -12
  321. package/dist/entry/content/core/context/Context.js +0 -50
  322. package/dist/entry/content/core/context/Context.js.map +0 -1
  323. package/dist/entry/content/core/context/EventEmitter.js.map +0 -1
  324. package/dist/entry/content/core/context/ManagedContext.d.ts +0 -5
  325. package/dist/entry/content/core/context/ManagedContext.js +0 -12
  326. package/dist/entry/content/core/context/ManagedContext.js.map +0 -1
  327. package/dist/entry/content/core/context/index.js +0 -9
  328. package/dist/entry/content/core/context/index.js.map +0 -1
  329. package/dist/entry/content/core/markers/AbstractMarker.js.map +0 -1
  330. package/dist/entry/content/core/markers/AttributeMarker.js.map +0 -1
  331. package/dist/entry/content/core/markers/WeakMarker.js.map +0 -1
  332. package/dist/entry/content/core/markers/index.js.map +0 -1
  333. package/dist/entry/content/core/nodes/EventNode.d.ts +0 -11
  334. package/dist/entry/content/core/nodes/EventNode.js +0 -35
  335. package/dist/entry/content/core/nodes/EventNode.js.map +0 -1
  336. package/dist/entry/content/core/nodes/FrameNode.d.ts +0 -23
  337. package/dist/entry/content/core/nodes/FrameNode.js +0 -125
  338. package/dist/entry/content/core/nodes/FrameNode.js.map +0 -1
  339. package/dist/entry/content/core/nodes/MarkerNode.js.map +0 -1
  340. package/dist/entry/content/core/nodes/MountNode.d.ts +0 -12
  341. package/dist/entry/content/core/nodes/MountNode.js +0 -42
  342. package/dist/entry/content/core/nodes/MountNode.js.map +0 -1
  343. package/dist/entry/content/core/nodes/Node.js.map +0 -1
  344. package/dist/entry/content/core/nodes/ShadowNode.d.ts +0 -14
  345. package/dist/entry/content/core/nodes/ShadowNode.js +0 -67
  346. package/dist/entry/content/core/nodes/ShadowNode.js.map +0 -1
  347. package/dist/entry/content/core/nodes/index.js +0 -15
  348. package/dist/entry/content/core/nodes/index.js.map +0 -1
  349. package/dist/entry/content/core/nodes/isolated-styles.js.map +0 -1
  350. package/dist/entry/content/core/resolvers/anchor.d.ts +0 -2
  351. package/dist/entry/content/core/resolvers/anchor.js.map +0 -1
  352. package/dist/entry/content/core/resolvers/container.d.ts +0 -2
  353. package/dist/entry/content/core/resolvers/container.js.map +0 -1
  354. package/dist/entry/content/core/resolvers/definition.d.ts +0 -3
  355. package/dist/entry/content/core/resolvers/definition.js +0 -12
  356. package/dist/entry/content/core/resolvers/definition.js.map +0 -1
  357. package/dist/entry/content/core/resolvers/index.js.map +0 -1
  358. package/dist/entry/content/core/resolvers/mount.d.ts +0 -2
  359. package/dist/entry/content/core/resolvers/mount.js.map +0 -1
  360. package/dist/entry/content/core/resolvers/render.d.ts +0 -3
  361. package/dist/entry/content/core/resolvers/render.js +0 -18
  362. package/dist/entry/content/core/resolvers/render.js.map +0 -1
  363. package/dist/entry/content/core/resolvers/watch.d.ts +0 -4
  364. package/dist/entry/content/core/resolvers/watch.js +0 -62
  365. package/dist/entry/content/core/resolvers/watch.js.map +0 -1
  366. package/dist/entry/content/frame/Builder.d.ts +0 -7
  367. package/dist/entry/content/frame/Builder.js +0 -14
  368. package/dist/entry/content/frame/Builder.js.map +0 -1
  369. package/dist/entry/content/frame/index.d.ts +0 -4
  370. package/dist/entry/content/frame/index.js +0 -7
  371. package/dist/entry/content/frame/index.js.map +0 -1
  372. package/dist/types/content.js.map +0 -1
  373. package/dist/virtual/entrypoint.js +0 -7
  374. package/dist/virtual/entrypoint.js.map +0 -1
  375. /package/dist/entry/content/{core → lifecycle}/markers/index.d.ts +0 -0
  376. /package/dist/entry/content/{core → lifecycle}/markers/index.js +0 -0
  377. /package/dist/{cli/plugins/style → entry/content/lifecycle}/types.js +0 -0
  378. /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 type {ContentScriptDefinition} from "adnbn";\nimport {isContentScriptDefinition, isValidContentScriptDefinitionRenderValue} from "adnbn/entry/content";\n\nimport contentScript from "virtual:content-builder";\n\nimport * as module from "virtual:content-entrypoint";\n\ntry {\n const {default: defaultDefinition, ...otherDefinition} = module;\n\n let definition: object = otherDefinition;\n\n if (isContentScriptDefinition(defaultDefinition)) {\n definition = {...definition, ...defaultDefinition};\n } else if (isValidContentScriptDefinitionRenderValue(defaultDefinition)) {\n definition = {...definition, render: defaultDefinition} as ContentScriptDefinition;\n }\n\n contentScript(definition as ContentScriptDefinition);\n} catch (e) {\n console.error("The content script crashed on startup:", e);\n}\n';
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 type {ContentScriptDefinition} from "adnbn";\nimport type {TransportType} from "adnbn/transport";\nimport {isValidTransportDefinition, isValidTransportInitFunction} from "adnbn/entry/transport";\nimport {Builder as RelayBuilder, type RelayUnresolvedDefinition} from "adnbn/entry/relay";\n\nimport {Builder as ContentScriptBuilder} from "virtual:content-builder";\n\nimport * as module from "virtual:relay-entrypoint";\n\ntry {\n const relayName = "virtual:relay-name";\n\n const {default: defaultDefinition, ...otherDefinition} = module;\n\n let definition: RelayUnresolvedDefinition<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 const {method, allFrames, ...contentOptions} = options;\n\n new RelayBuilder({\n name: relayName,\n init,\n main,\n ...options,\n })\n .content(\n new ContentScriptBuilder({\n ...contentOptions,\n ...(allFrames === undefined ? {} : {allFrames: allFrames !== false}),\n } as ContentScriptDefinition)\n )\n .build()\n .catch(e => {\n console.error("Failed to build relay: ", e);\n });\n} catch (e) {\n console.error("The relay crashed on startup:", e);\n}\n';
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/frame` : getEntryFramework(file, "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/frame` : getEntryFramework(file, "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/frame/index.js").Builder;
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/frame/index.js").default;
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 MountBuilder from "../../core/MountBuilder.js";
2
- import { ContentScriptDefinition, ContentScriptNode, ContentScriptRenderHandler, ContentScriptRenderValue } from "../../../../types/content.js";
3
- export default class extends MountBuilder {
4
- constructor(definition: ContentScriptDefinition);
5
- protected resolveRender(render?: ContentScriptRenderValue): ContentScriptRenderHandler | undefined;
6
- protected createNode(anchor: Element): Promise<ContentScriptNode>;
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 { contentScriptReactRenderResolver } from "./resolvers/index.js";
6
- class Builder_default extends MountBuilder {
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 contentScriptReactRenderResolver(render);
9
+ return (props) => {
10
+ const value = typeof render === "function" ? createElement(render, props) : render;
11
+ return isValidElement(value) ? value : void 0;
12
+ };
15
13
  }
16
- async createNode(anchor) {
17
- let value = await this.getValue(anchor);
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
- Builder_default as default
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 MountBuilder from \"../../core/MountBuilder\";\nimport EventNode from \"../../core/nodes/EventNode\";\nimport ReactNode from \"./Node\";\n\nimport {contentScriptReactRenderResolver} from \"./resolvers\";\n\nimport {\n ContentScriptDefinition,\n ContentScriptNode,\n ContentScriptRenderHandler,\n ContentScriptRenderValue,\n} from \"@typing/content\";\n\nexport default class extends MountBuilder {\n constructor(definition: ContentScriptDefinition) {\n super(definition);\n }\n\n protected resolveRender(render?: ContentScriptRenderValue): ContentScriptRenderHandler | undefined {\n if (render === undefined) {\n return;\n }\n\n return contentScriptReactRenderResolver(render);\n }\n\n protected async createNode(anchor: Element): Promise<ContentScriptNode> {\n let value = await this.getValue(anchor);\n\n if (!isValidElement(value)) {\n value = undefined;\n\n console.warn(\"Content script react value is not a valid React element\");\n }\n\n return new EventNode(new ReactNode(await super.createNode(anchor), value), this.emitter);\n }\n}\n"],"mappings":"AAAA,SAAQ,sBAAqB;AAE7B,OAAO,kBAAkB;AACzB,OAAO,eAAe;AACtB,OAAO,eAAe;AAEtB,SAAQ,wCAAuC;AAS/C,MAAO,wBAAsB,aAAa;AAAA,EACtC,YAAY,YAAqC;AAC7C,UAAM,UAAU;AAAA,EACpB;AAAA,EAEU,cAAc,QAA2E;AAC/F,QAAI,WAAW,QAAW;AACtB;AAAA,IACJ;AAEA,WAAO,iCAAiC,MAAM;AAAA,EAClD;AAAA,EAEA,MAAgB,WAAW,QAA6C;AACpE,QAAI,QAAQ,MAAM,KAAK,SAAS,MAAM;AAEtC,QAAI,CAAC,eAAe,KAAK,GAAG;AACxB,cAAQ;AAER,cAAQ,KAAK,yDAAyD;AAAA,IAC1E;AAEA,WAAO,IAAI,UAAU,IAAI,UAAU,MAAM,MAAM,WAAW,MAAM,GAAG,KAAK,GAAG,KAAK,OAAO;AAAA,EAC3F;AACJ;","names":[]}
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 { ReactNode as ReactComponent } from "react";
2
- import { Root } from "react-dom/client";
3
- import { ContentScriptNode } from "../../../../types/content.js";
4
- export default class implements ContentScriptNode {
5
- protected readonly node: ContentScriptNode;
6
- protected readonly component?: ReactComponent;
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
- class Node_default {
3
- constructor(node, component) {
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
- renderedTarget;
11
- get anchor() {
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
- (_a = this.root) == null ? void 0 : _a.unmount();
31
- this.renderedTarget = this.target;
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
- unmount() {
37
- var _a;
38
- (_a = this.root) == null ? void 0 : _a.unmount();
14
+ clear() {
15
+ const root = this.root;
39
16
  this.root = void 0;
40
- this.renderedTarget = void 0;
41
- return !!this.node.unmount();
17
+ root == null ? void 0 : root.unmount();
42
18
  }
43
19
  }
44
20
  export {
45
- Node_default as default
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 {ReactNode as ReactComponent} from \"react\";\nimport {createRoot, Root} from \"react-dom/client\";\n\nimport {ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n protected root?: Root;\n\n private renderedTarget?: Element;\n\n constructor(\n protected readonly node: ContentScriptNode,\n protected readonly component?: ReactComponent\n ) {}\n\n public get anchor(): Element {\n return this.node.anchor;\n }\n\n public get container(): Element | undefined {\n return this.node.container;\n }\n\n public get target(): Element | undefined {\n return this.node.target;\n }\n\n public mount(): boolean {\n this.node.mount();\n\n if (!this.target || (this.root && this.renderedTarget === this.target)) {\n return false;\n }\n\n if (!this.component) {\n console.warn(\"Content script react component is empty\");\n\n return false;\n }\n\n this.root?.unmount();\n this.renderedTarget = this.target;\n this.root = createRoot(this.target);\n\n this.root.render(this.component);\n\n return true;\n }\n\n public unmount(): boolean {\n this.root?.unmount();\n this.root = undefined;\n this.renderedTarget = undefined;\n\n return !!this.node.unmount();\n }\n}\n"],"mappings":"AACA,SAAQ,kBAAuB;AAI/B,MAAO,aAA2C;AAAA,EAK9C,YACuB,MACA,WACrB;AAFqB;AACA;AAAA,EACpB;AAAA,EAFoB;AAAA,EACA;AAAA,EANb;AAAA,EAEF;AAAA,EAOR,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,SAA8B;AACrC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEO,QAAiB;AA3B5B;AA4BQ,SAAK,KAAK,MAAM;AAEhB,QAAI,CAAC,KAAK,UAAW,KAAK,QAAQ,KAAK,mBAAmB,KAAK,QAAS;AACpE,aAAO;AAAA,IACX;AAEA,QAAI,CAAC,KAAK,WAAW;AACjB,cAAQ,KAAK,yCAAyC;AAEtD,aAAO;AAAA,IACX;AAEA,eAAK,SAAL,mBAAW;AACX,SAAK,iBAAiB,KAAK;AAC3B,SAAK,OAAO,WAAW,KAAK,MAAM;AAElC,SAAK,KAAK,OAAO,KAAK,SAAS;AAE/B,WAAO;AAAA,EACX;AAAA,EAEO,UAAmB;AAjD9B;AAkDQ,eAAK,SAAL,mBAAW;AACX,SAAK,OAAO;AACZ,SAAK,iBAAiB;AAEtB,WAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;AAAA,EAC/B;AACJ;","names":[]}
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,2 @@
1
+ import type { ContentScriptDefinition } from "../../../../types/content/index.js";
2
+ export declare const resolveDefinition: (module: object) => ContentScriptDefinition;
@@ -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
- declare const _default: (definition: import("../../../../index.js").ContentScriptDefinition) => void;
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;AAIpB,IAAO,gBAAQ,QAAQ,SAAS;","names":[]}
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 "../../core/MountBuilder.js";
2
- import { ContentScriptDefinition, ContentScriptNode } from "../../../../types/content.js";
3
- export default class extends MountBuilder {
4
- constructor(definition: ContentScriptDefinition);
5
- protected createNode(anchor: Element): Promise<ContentScriptNode>;
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 { isValidContentScriptRenderValue } from "../../core/resolvers/index.js";
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
- class Builder_default extends MountBuilder {
6
- constructor(definition) {
7
- super(definition);
8
- }
9
- async createNode(anchor) {
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 new EventNode(new VanillaNode(await super.createNode(anchor), value), this.emitter);
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
- Builder_default as default
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 {isValidContentScriptRenderValue} from \"../../core/resolvers\";\n\nimport MountBuilder from \"../../core/MountBuilder\";\nimport EventNode from \"../../core/nodes/EventNode\";\nimport VanillaNode from \"./Node\";\n\nimport {ContentScriptDefinition, ContentScriptNode} from \"@typing/content\";\n\nexport default class extends MountBuilder {\n public constructor(definition: ContentScriptDefinition) {\n super(definition);\n }\n\n protected async createNode(anchor: Element): Promise<ContentScriptNode> {\n let value = await this.getValue(anchor);\n\n if (value !== true && !isValidContentScriptRenderValue(value)) {\n value = undefined;\n\n console.warn(\"Content script vanilla value is not a valid render value\");\n }\n\n return new EventNode(new VanillaNode(await super.createNode(anchor), value), this.emitter);\n }\n}\n"],"mappings":"AAAA,SAAQ,uCAAsC;AAE9C,OAAO,kBAAkB;AACzB,OAAO,eAAe;AACtB,OAAO,iBAAiB;AAIxB,MAAO,wBAAsB,aAAa;AAAA,EAC/B,YAAY,YAAqC;AACpD,UAAM,UAAU;AAAA,EACpB;AAAA,EAEA,MAAgB,WAAW,QAA6C;AACpE,QAAI,QAAQ,MAAM,KAAK,SAAS,MAAM;AAEtC,QAAI,UAAU,QAAQ,CAAC,gCAAgC,KAAK,GAAG;AAC3D,cAAQ;AAER,cAAQ,KAAK,0DAA0D;AAAA,IAC3E;AAEA,WAAO,IAAI,UAAU,IAAI,YAAY,MAAM,MAAM,WAAW,MAAM,GAAG,KAAK,GAAG,KAAK,OAAO;AAAA,EAC7F;AACJ;","names":[]}
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 { ContentScriptNode } from "../../../../types/content.js";
2
- export default class implements ContentScriptNode {
3
- protected readonly node: ContentScriptNode;
4
- protected readonly value?: (null | boolean | string | number | Element) | undefined;
5
- private renderedTarget?;
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
- class Node_default {
2
- constructor(node, value) {
3
- this.node = node;
4
- this.value = value;
5
- }
6
- node;
7
- value;
8
- renderedTarget;
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
- let result = true;
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
- unmount() {
38
- this.renderedTarget = void 0;
39
- return !!this.node.unmount();
13
+ clear() {
40
14
  }
41
15
  }
42
16
  export {
43
- Node_default as default
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 {ContentScriptNode} from \"@typing/content\";\n\nexport default class implements ContentScriptNode {\n private renderedTarget?: Element;\n\n constructor(\n protected readonly node: ContentScriptNode,\n protected readonly value?: null | boolean | string | number | Element\n ) {}\n\n public get anchor(): Element {\n return this.node.anchor;\n }\n\n public get container(): Element | undefined {\n return this.node.container;\n }\n\n public get target(): Element | undefined {\n return this.node.target;\n }\n\n public mount(): boolean {\n this.node.mount();\n\n if (!this.target || this.renderedTarget === this.target) {\n return false;\n }\n\n let result: boolean = true;\n\n if (this.value && typeof this.value === \"object\" && this.value.nodeType === 1) {\n this.target.appendChild(this.value);\n } else if (typeof this.value === \"string\" || typeof this.value === \"number\") {\n this.target.textContent = String(this.value);\n } else if (this.value === null || this.value === undefined || this.value === false) {\n result = false;\n\n console.warn(\"Content script vanilla value is empty\");\n } else if (this.value === true) {\n result = false;\n }\n\n this.renderedTarget = this.target;\n\n return result;\n }\n\n public unmount(): boolean {\n this.renderedTarget = undefined;\n\n return !!this.node.unmount();\n }\n}\n"],"mappings":"AAEA,MAAO,aAA2C;AAAA,EAG9C,YACuB,MACA,OACrB;AAFqB;AACA;AAAA,EACpB;AAAA,EAFoB;AAAA,EACA;AAAA,EAJf;AAAA,EAOR,IAAW,SAAkB;AACzB,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,YAAiC;AACxC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEA,IAAW,SAA8B;AACrC,WAAO,KAAK,KAAK;AAAA,EACrB;AAAA,EAEO,QAAiB;AACpB,SAAK,KAAK,MAAM;AAEhB,QAAI,CAAC,KAAK,UAAU,KAAK,mBAAmB,KAAK,QAAQ;AACrD,aAAO;AAAA,IACX;AAEA,QAAI,SAAkB;AAEtB,QAAI,KAAK,SAAS,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,aAAa,GAAG;AAC3E,WAAK,OAAO,YAAY,KAAK,KAAK;AAAA,IACtC,WAAW,OAAO,KAAK,UAAU,YAAY,OAAO,KAAK,UAAU,UAAU;AACzE,WAAK,OAAO,cAAc,OAAO,KAAK,KAAK;AAAA,IAC/C,WAAW,KAAK,UAAU,QAAQ,KAAK,UAAU,UAAa,KAAK,UAAU,OAAO;AAChF,eAAS;AAET,cAAQ,KAAK,uCAAuC;AAAA,IACxD,WAAW,KAAK,UAAU,MAAM;AAC5B,eAAS;AAAA,IACb;AAEA,SAAK,iBAAiB,KAAK;AAE3B,WAAO;AAAA,EACX;AAAA,EAEO,UAAmB;AACtB,SAAK,iBAAiB;AAEtB,WAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;AAAA,EAC/B;AACJ;","names":[]}
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,2 @@
1
+ import type { ContentScriptDefinition } from "../../../../types/content/index.js";
2
+ export declare const resolveDefinition: (module: object) => ContentScriptDefinition;
@@ -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
- declare const _default: (definition: import("../../../../index.js").ContentScriptDefinition) => void;
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;AAIpB,IAAO,kBAAQ,QAAQ,SAAS;","names":[]}
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,7 @@
1
+ const isValidRenderValue = (value) => {
2
+ return typeof value === "string" && value.length > 0 || typeof value === "number" || value instanceof Element;
3
+ };
4
+ export {
5
+ isValidRenderValue
6
+ };
7
+ //# sourceMappingURL=utils.js.map
@@ -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
- export * from "./core/resolvers/definition.js";
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
- export * from "./core/resolvers/definition.js";
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":["export * from \"./core/resolvers/definition\";\n"],"mappings":"AAAA,cAAc;","names":[]}
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":[]}