adnbn 0.9.0 → 0.11.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 (608) hide show
  1. package/dist/cli/builders/locale/LocaleBuilder.js +2 -11
  2. package/dist/cli/builders/locale/LocaleBuilder.js.map +1 -1
  3. package/dist/cli/builders/locale/index.js +1 -1
  4. package/dist/cli/builders/locale/index.js.map +1 -1
  5. package/dist/cli/builders/manifest/ManifestBase.d.ts +4 -1
  6. package/dist/cli/builders/manifest/ManifestBase.js +35 -6
  7. package/dist/cli/builders/manifest/ManifestBase.js.map +1 -1
  8. package/dist/cli/builders/manifest/ManifestV2.js +1 -1
  9. package/dist/cli/builders/manifest/ManifestV3.js +12 -5
  10. package/dist/cli/builders/manifest/ManifestV3.js.map +1 -1
  11. package/dist/cli/builders/manifest/utils/data-collection-permissions.d.ts +15 -0
  12. package/dist/cli/builders/manifest/utils/data-collection-permissions.js +26 -0
  13. package/dist/cli/builders/manifest/utils/data-collection-permissions.js.map +1 -0
  14. package/dist/cli/builders/manifest/utils/host-patterns.d.ts +1 -0
  15. package/dist/cli/builders/manifest/utils/host-patterns.js +40 -0
  16. package/dist/cli/builders/manifest/utils/host-patterns.js.map +1 -0
  17. package/dist/cli/builders/manifest/utils/index.d.ts +4 -0
  18. package/dist/cli/builders/manifest/utils/index.js +19 -0
  19. package/dist/cli/builders/manifest/utils/index.js.map +1 -0
  20. package/dist/cli/builders/manifest/utils/permissions.d.ts +14 -0
  21. package/dist/cli/builders/manifest/utils/permissions.js +34 -0
  22. package/dist/cli/builders/manifest/utils/permissions.js.map +1 -0
  23. package/dist/cli/builders/manifest/utils/web-accessible-resources.d.ts +2 -0
  24. package/dist/cli/builders/manifest/utils/web-accessible-resources.js +92 -0
  25. package/dist/cli/builders/manifest/utils/web-accessible-resources.js.map +1 -0
  26. package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.d.ts +14 -0
  27. package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js +523 -0
  28. package/dist/cli/bundler/plugins/build-assets-map/BuildAssetsMapPlugin.js.map +1 -0
  29. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.d.ts +13 -0
  30. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js +16 -0
  31. package/dist/cli/bundler/plugins/build-assets-map/entrypoint-module.js.map +1 -0
  32. package/dist/cli/bundler/plugins/build-assets-map/index.d.ts +3 -0
  33. package/dist/cli/bundler/plugins/build-assets-map/index.js +8 -0
  34. package/dist/cli/bundler/plugins/build-assets-map/index.js.map +1 -0
  35. package/dist/cli/bundler/plugins/build-assets-map/usage.d.ts +12 -0
  36. package/dist/cli/bundler/plugins/build-assets-map/usage.js +28 -0
  37. package/dist/cli/bundler/plugins/build-assets-map/usage.js.map +1 -0
  38. package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.d.ts +9 -0
  39. package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js +43 -0
  40. package/dist/cli/bundler/plugins/chunk-loader/ChunkLoaderPlugin.js.map +1 -0
  41. package/dist/cli/bundler/plugins/chunk-loader/index.d.ts +1 -0
  42. package/dist/cli/bundler/plugins/chunk-loader/index.js +5 -0
  43. package/dist/cli/bundler/plugins/chunk-loader/index.js.map +1 -0
  44. package/dist/cli/bundler/plugins/chunk-loader/templates/runtime.template.d.ts +2 -0
  45. package/dist/cli/bundler/plugins/chunk-loader/templates.d.ts +7 -0
  46. package/dist/cli/bundler/plugins/chunk-loader/templates.js +30 -0
  47. package/dist/cli/bundler/plugins/{EntrypointPlugin.d.ts → entrypoint/EntrypointPlugin.d.ts} +7 -2
  48. package/dist/cli/bundler/plugins/{EntrypointPlugin.js → entrypoint/EntrypointPlugin.js} +46 -26
  49. package/dist/cli/bundler/plugins/entrypoint/EntrypointPlugin.js.map +1 -0
  50. package/dist/cli/bundler/plugins/entrypoint/index.d.ts +1 -0
  51. package/dist/cli/bundler/plugins/entrypoint/index.js +7 -0
  52. package/dist/cli/bundler/plugins/entrypoint/index.js.map +1 -0
  53. package/dist/cli/bundler/plugins/{GenerateJsonPlugin.d.ts → generate-json/GenerateJsonPlugin.d.ts} +1 -0
  54. package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js +73 -0
  55. package/dist/cli/bundler/plugins/generate-json/GenerateJsonPlugin.js.map +1 -0
  56. package/dist/cli/bundler/plugins/generate-json/index.d.ts +1 -0
  57. package/dist/cli/bundler/plugins/generate-json/index.js +5 -0
  58. package/dist/cli/bundler/plugins/generate-json/index.js.map +1 -0
  59. package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.d.ts +23 -0
  60. package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js +88 -0
  61. package/dist/cli/bundler/plugins/generate-module/GenerateModulePlugin.js.map +1 -0
  62. package/dist/cli/bundler/plugins/generate-module/index.d.ts +1 -0
  63. package/dist/cli/bundler/plugins/generate-module/index.js +7 -0
  64. package/dist/cli/bundler/plugins/generate-module/index.js.map +1 -0
  65. package/dist/cli/bundler/plugins/index.d.ts +11 -5
  66. package/dist/cli/bundler/plugins/index.js +32 -10
  67. package/dist/cli/bundler/plugins/index.js.map +1 -1
  68. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.d.ts +21 -0
  69. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js +174 -0
  70. package/dist/cli/bundler/plugins/isolated-styles/IsolatedStylesPlugin.js.map +1 -0
  71. package/dist/cli/bundler/plugins/isolated-styles/index.d.ts +1 -0
  72. package/dist/cli/bundler/plugins/isolated-styles/index.js +5 -0
  73. package/dist/cli/bundler/plugins/isolated-styles/index.js.map +1 -0
  74. package/dist/cli/bundler/plugins/isolated-styles/templates/css-loader.template.d.ts +1 -0
  75. package/dist/cli/bundler/plugins/isolated-styles/templates/runtime.template.d.ts +7 -0
  76. package/dist/cli/bundler/plugins/isolated-styles/templates.d.ts +18 -0
  77. package/dist/cli/bundler/plugins/isolated-styles/templates.js +174 -0
  78. package/dist/cli/bundler/plugins/manifest/ManifestPlugin.d.ts +10 -0
  79. package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js +55 -0
  80. package/dist/cli/bundler/plugins/manifest/ManifestPlugin.js.map +1 -0
  81. package/dist/cli/bundler/plugins/manifest/index.d.ts +1 -0
  82. package/dist/cli/bundler/plugins/manifest/index.js +6 -0
  83. package/dist/cli/bundler/plugins/manifest/index.js.map +1 -0
  84. package/dist/cli/bundler/plugins/replace/ReplacePlugin.js.map +1 -0
  85. package/dist/cli/bundler/plugins/replace/index.d.ts +1 -0
  86. package/dist/cli/bundler/plugins/replace/index.js +5 -0
  87. package/dist/cli/bundler/plugins/replace/index.js.map +1 -0
  88. package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.d.ts +19 -0
  89. package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js +20 -0
  90. package/dist/cli/bundler/plugins/resource-access/ResourceAccessPlugin.js.map +1 -0
  91. package/dist/cli/bundler/plugins/resource-access/index.d.ts +1 -0
  92. package/dist/cli/bundler/plugins/resource-access/index.js +5 -0
  93. package/dist/cli/bundler/plugins/resource-access/index.js.map +1 -0
  94. package/dist/cli/bundler/plugins/resource-access/utils.d.ts +8 -0
  95. package/dist/cli/bundler/plugins/resource-access/utils.js +42 -0
  96. package/dist/cli/bundler/plugins/resource-access/utils.js.map +1 -0
  97. package/dist/cli/bundler/plugins/types.d.ts +4 -0
  98. package/dist/cli/bundler/plugins/types.js +1 -0
  99. package/dist/cli/bundler/plugins/types.js.map +1 -0
  100. package/dist/cli/bundler/plugins/utils/index.d.ts +3 -0
  101. package/dist/cli/bundler/plugins/utils/index.js +9 -0
  102. package/dist/cli/bundler/plugins/utils/index.js.map +1 -0
  103. package/dist/cli/bundler/plugins/utils/manifest-hooks.d.ts +13 -0
  104. package/dist/cli/bundler/plugins/utils/manifest-hooks.js +17 -0
  105. package/dist/cli/bundler/plugins/utils/manifest-hooks.js.map +1 -0
  106. package/dist/cli/bundler/plugins/utils/runtime-template.d.ts +1 -0
  107. package/dist/cli/bundler/plugins/utils/runtime-template.js +18 -0
  108. package/dist/cli/bundler/plugins/utils/runtime-template.js.map +1 -0
  109. package/dist/cli/bundler/plugins/utils/watch-compilation.d.ts +3 -0
  110. package/dist/cli/bundler/plugins/utils/watch-compilation.js +18 -0
  111. package/dist/cli/bundler/plugins/utils/watch-compilation.js.map +1 -0
  112. package/dist/cli/bundler/plugins/watch/WatchPlugin.js +16 -0
  113. package/dist/cli/bundler/plugins/watch/WatchPlugin.js.map +1 -0
  114. package/dist/cli/bundler/plugins/watch/index.d.ts +1 -0
  115. package/dist/cli/bundler/plugins/watch/index.js +5 -0
  116. package/dist/cli/bundler/plugins/watch/index.js.map +1 -0
  117. package/dist/cli/bundler/utils/chunk-filename.d.ts +6 -0
  118. package/dist/cli/bundler/utils/chunk-filename.js +93 -0
  119. package/dist/cli/bundler/utils/chunk-filename.js.map +1 -0
  120. package/dist/cli/bundler/utils/index.d.ts +2 -0
  121. package/dist/cli/bundler/utils/index.js +2 -0
  122. package/dist/cli/bundler/utils/index.js.map +1 -1
  123. package/dist/cli/bundler/utils/layers.d.ts +4 -0
  124. package/dist/cli/bundler/utils/layers.js +10 -0
  125. package/dist/cli/bundler/utils/layers.js.map +1 -0
  126. package/dist/cli/bundler/utils/output.d.ts +6 -2
  127. package/dist/cli/bundler/utils/output.js +165 -7
  128. package/dist/cli/bundler/utils/output.js.map +1 -1
  129. package/dist/cli/bundler/utils/styles.d.ts +5 -0
  130. package/dist/cli/bundler/utils/styles.js +30 -0
  131. package/dist/cli/bundler/utils/styles.js.map +1 -0
  132. package/dist/cli/entrypoint/file/ExpressionFile.d.ts +4 -1
  133. package/dist/cli/entrypoint/file/ExpressionFile.js +11 -0
  134. package/dist/cli/entrypoint/file/ExpressionFile.js.map +1 -1
  135. package/dist/cli/entrypoint/file/OptionFile.d.ts +4 -2
  136. package/dist/cli/entrypoint/file/OptionFile.js +35 -31
  137. package/dist/cli/entrypoint/file/OptionFile.js.map +1 -1
  138. package/dist/cli/entrypoint/file/SourceFile.d.ts +18 -7
  139. package/dist/cli/entrypoint/file/SourceFile.js +260 -156
  140. package/dist/cli/entrypoint/file/SourceFile.js.map +1 -1
  141. package/dist/cli/entrypoint/file/index.d.ts +2 -0
  142. package/dist/cli/entrypoint/file/index.js +2 -0
  143. package/dist/cli/entrypoint/file/index.js.map +1 -1
  144. package/dist/cli/entrypoint/file/injectors/core.js +22 -1
  145. package/dist/cli/entrypoint/file/injectors/core.js.map +1 -1
  146. package/dist/cli/entrypoint/file/parsers/ExportParser.d.ts +14 -0
  147. package/dist/cli/entrypoint/file/parsers/ExportParser.js +71 -0
  148. package/dist/cli/entrypoint/file/parsers/ExportParser.js.map +1 -0
  149. package/dist/cli/entrypoint/file/parsers/NodeFinder.d.ts +2 -0
  150. package/dist/cli/entrypoint/file/parsers/NodeFinder.js +9 -0
  151. package/dist/cli/entrypoint/file/parsers/NodeFinder.js.map +1 -1
  152. package/dist/cli/entrypoint/file/parsers/ObjectParser.js +5 -1
  153. package/dist/cli/entrypoint/file/parsers/ObjectParser.js.map +1 -1
  154. package/dist/cli/entrypoint/file/parsers/index.d.ts +1 -0
  155. package/dist/cli/entrypoint/file/parsers/index.js +2 -0
  156. package/dist/cli/entrypoint/file/parsers/index.js.map +1 -1
  157. package/dist/cli/entrypoint/file/parsers/types.d.ts +16 -0
  158. package/dist/cli/entrypoint/file/parsers/types.js +13 -0
  159. package/dist/cli/entrypoint/file/parsers/types.js.map +1 -1
  160. package/dist/cli/entrypoint/file/resolvers/ImportResolver.d.ts +1 -0
  161. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js +3 -0
  162. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js.map +1 -1
  163. package/dist/cli/entrypoint/file/types.d.ts +26 -1
  164. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.d.ts +2 -2
  165. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js +2 -2
  166. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js.map +1 -1
  167. package/dist/cli/entrypoint/finder/{AbstractOptionsFinder.js → AbstractParsedFinder.js} +3 -3
  168. package/dist/cli/entrypoint/finder/AbstractParsedFinder.js.map +1 -0
  169. package/dist/cli/entrypoint/finder/OptionsFinder.d.ts +13 -0
  170. package/dist/cli/entrypoint/finder/OptionsFinder.js +33 -0
  171. package/dist/cli/entrypoint/finder/OptionsFinder.js.map +1 -0
  172. package/dist/cli/entrypoint/finder/PluginFinder.d.ts +4 -4
  173. package/dist/cli/entrypoint/finder/PluginFinder.js +2 -2
  174. package/dist/cli/entrypoint/finder/PluginFinder.js.map +1 -1
  175. package/dist/cli/entrypoint/finder/index.d.ts +2 -1
  176. package/dist/cli/entrypoint/finder/index.js +20 -18
  177. package/dist/cli/entrypoint/finder/index.js.map +1 -1
  178. package/dist/cli/entrypoint/parser/AbstractParser.d.ts +3 -2
  179. package/dist/cli/entrypoint/parser/AbstractParser.js +6 -3
  180. package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
  181. package/dist/cli/entrypoint/parser/CommandParser.js +1 -1
  182. package/dist/cli/entrypoint/parser/CommandParser.js.map +1 -1
  183. package/dist/cli/entrypoint/parser/ContentParser.d.ts +5 -1
  184. package/dist/cli/entrypoint/parser/ContentParser.js +55 -3
  185. package/dist/cli/entrypoint/parser/ContentParser.js.map +1 -1
  186. package/dist/cli/entrypoint/parser/OptionsParser.d.ts +6 -0
  187. package/dist/cli/entrypoint/parser/OptionsParser.js +16 -0
  188. package/dist/cli/entrypoint/parser/OptionsParser.js.map +1 -0
  189. package/dist/cli/entrypoint/parser/RelayParser.d.ts +21 -2
  190. package/dist/cli/entrypoint/parser/RelayParser.js +4 -0
  191. package/dist/cli/entrypoint/parser/RelayParser.js.map +1 -1
  192. package/dist/cli/entrypoint/parser/index.d.ts +1 -0
  193. package/dist/cli/entrypoint/parser/index.js +16 -14
  194. package/dist/cli/entrypoint/parser/index.js.map +1 -1
  195. package/dist/cli/plugins/asset.js +9 -4
  196. package/dist/cli/plugins/asset.js.map +1 -1
  197. package/dist/cli/plugins/background/index.js +1 -1
  198. package/dist/cli/plugins/background/index.js.map +1 -1
  199. package/dist/cli/plugins/content/Content.d.ts +1 -1
  200. package/dist/cli/plugins/content/Content.js +3 -2
  201. package/dist/cli/plugins/content/Content.js.map +1 -1
  202. package/dist/cli/plugins/content/ContentManager.d.ts +8 -5
  203. package/dist/cli/plugins/content/ContentManager.js +79 -28
  204. package/dist/cli/plugins/content/ContentManager.js.map +1 -1
  205. package/dist/cli/plugins/content/ContentName.d.ts +1 -1
  206. package/dist/cli/plugins/content/ContentName.js +8 -7
  207. package/dist/cli/plugins/content/ContentName.js.map +1 -1
  208. package/dist/cli/plugins/content/Relay.d.ts +1 -1
  209. package/dist/cli/plugins/content/Relay.js +3 -2
  210. package/dist/cli/plugins/content/Relay.js.map +1 -1
  211. package/dist/cli/plugins/content/bundler.d.ts +7 -0
  212. package/dist/cli/plugins/content/bundler.js +47 -0
  213. package/dist/cli/plugins/content/bundler.js.map +1 -0
  214. package/dist/cli/plugins/content/index.js +121 -62
  215. package/dist/cli/plugins/content/index.js.map +1 -1
  216. package/dist/cli/plugins/content/relay-module.d.ts +3 -0
  217. package/dist/cli/plugins/content/relay-module.js +11 -0
  218. package/dist/cli/plugins/content/relay-module.js.map +1 -0
  219. package/dist/cli/plugins/content/types.d.ts +1 -1
  220. package/dist/cli/plugins/content/utils.d.ts +2 -0
  221. package/dist/cli/plugins/content/utils.js +8 -1
  222. package/dist/cli/plugins/content/utils.js.map +1 -1
  223. package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +1 -1
  224. package/dist/cli/plugins/icon/declaration/IconDeclaration.js +6 -6
  225. package/dist/cli/plugins/icon/declaration/IconDeclaration.js.map +1 -1
  226. package/dist/cli/plugins/icon/declaration/icon.d.ts +3 -5
  227. package/dist/cli/plugins/icon/icon-module.d.ts +2 -0
  228. package/dist/cli/plugins/icon/icon-module.js +11 -0
  229. package/dist/cli/plugins/icon/icon-module.js.map +1 -0
  230. package/dist/cli/plugins/icon/index.js +5 -3
  231. package/dist/cli/plugins/icon/index.js.map +1 -1
  232. package/dist/cli/plugins/index.d.ts +1 -0
  233. package/dist/cli/plugins/index.js +22 -20
  234. package/dist/cli/plugins/index.js.map +1 -1
  235. package/dist/cli/plugins/locale/Locale.d.ts +9 -2
  236. package/dist/cli/plugins/locale/Locale.js +37 -5
  237. package/dist/cli/plugins/locale/Locale.js.map +1 -1
  238. package/dist/cli/plugins/locale/declaration/locale.d.ts +1 -1
  239. package/dist/cli/plugins/locale/index.js +57 -22
  240. package/dist/cli/plugins/locale/index.js.map +1 -1
  241. package/dist/cli/plugins/locale/locale-module.d.ts +4 -0
  242. package/dist/cli/plugins/locale/locale-module.js +16 -0
  243. package/dist/cli/plugins/locale/locale-module.js.map +1 -0
  244. package/dist/cli/plugins/offscreen/Offscreen.d.ts +2 -3
  245. package/dist/cli/plugins/offscreen/Offscreen.js.map +1 -1
  246. package/dist/cli/plugins/offscreen/index.js +5 -4
  247. package/dist/cli/plugins/offscreen/index.js.map +1 -1
  248. package/dist/cli/plugins/offscreen/offscreen-module.d.ts +3 -0
  249. package/dist/cli/plugins/offscreen/offscreen-module.js +11 -0
  250. package/dist/cli/plugins/offscreen/offscreen-module.js.map +1 -0
  251. package/dist/cli/plugins/options/Options.d.ts +10 -0
  252. package/dist/cli/plugins/options/Options.js +24 -0
  253. package/dist/cli/plugins/options/Options.js.map +1 -0
  254. package/dist/cli/plugins/options/index.d.ts +2 -0
  255. package/dist/cli/plugins/options/index.js +41 -0
  256. package/dist/cli/plugins/options/index.js.map +1 -0
  257. package/dist/cli/plugins/output.js +33 -3
  258. package/dist/cli/plugins/output.js.map +1 -1
  259. package/dist/cli/plugins/page/declaration/PageDeclaration.js +4 -4
  260. package/dist/cli/plugins/page/declaration/PageDeclaration.js.map +1 -1
  261. package/dist/cli/plugins/page/declaration/page.d.ts +3 -3
  262. package/dist/cli/plugins/page/index.js +14 -10
  263. package/dist/cli/plugins/page/index.js.map +1 -1
  264. package/dist/cli/plugins/page/page-module.d.ts +2 -0
  265. package/dist/cli/plugins/page/page-module.js +11 -0
  266. package/dist/cli/plugins/page/page-module.js.map +1 -0
  267. package/dist/cli/plugins/popup/Popup.d.ts +1 -1
  268. package/dist/cli/plugins/popup/Popup.js +2 -2
  269. package/dist/cli/plugins/popup/Popup.js.map +1 -1
  270. package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +1 -1
  271. package/dist/cli/plugins/popup/declaration/PopupDeclaration.js +6 -6
  272. package/dist/cli/plugins/popup/declaration/PopupDeclaration.js.map +1 -1
  273. package/dist/cli/plugins/popup/declaration/popup.d.ts +3 -3
  274. package/dist/cli/plugins/popup/index.js +6 -5
  275. package/dist/cli/plugins/popup/index.js.map +1 -1
  276. package/dist/cli/plugins/popup/popup-module.d.ts +3 -0
  277. package/dist/cli/plugins/popup/popup-module.js +11 -0
  278. package/dist/cli/plugins/popup/popup-module.js.map +1 -0
  279. package/dist/cli/plugins/sandbox/Sandbox.d.ts +1 -2
  280. package/dist/cli/plugins/sandbox/Sandbox.js.map +1 -1
  281. package/dist/cli/plugins/sandbox/index.js +5 -4
  282. package/dist/cli/plugins/sandbox/index.js.map +1 -1
  283. package/dist/cli/plugins/sandbox/sandbox-module.d.ts +3 -0
  284. package/dist/cli/plugins/sandbox/sandbox-module.js +11 -0
  285. package/dist/cli/plugins/sandbox/sandbox-module.js.map +1 -0
  286. package/dist/cli/plugins/sidebar/Sidebar.d.ts +1 -1
  287. package/dist/cli/plugins/sidebar/Sidebar.js +2 -2
  288. package/dist/cli/plugins/sidebar/Sidebar.js.map +1 -1
  289. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +1 -1
  290. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js +6 -6
  291. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.js.map +1 -1
  292. package/dist/cli/plugins/sidebar/declaration/sidebar.d.ts +3 -3
  293. package/dist/cli/plugins/sidebar/index.js +6 -5
  294. package/dist/cli/plugins/sidebar/index.js.map +1 -1
  295. package/dist/cli/plugins/sidebar/sidebar-module.d.ts +3 -0
  296. package/dist/cli/plugins/sidebar/sidebar-module.js +11 -0
  297. package/dist/cli/plugins/sidebar/sidebar-module.js.map +1 -0
  298. package/dist/cli/plugins/style/index.d.ts +2 -1
  299. package/dist/cli/plugins/style/index.js +52 -25
  300. package/dist/cli/plugins/style/index.js.map +1 -1
  301. package/dist/cli/plugins/style/types.d.ts +5 -0
  302. package/dist/cli/plugins/style/types.js +1 -0
  303. package/dist/cli/plugins/style/types.js.map +1 -0
  304. package/dist/cli/plugins/view/index.js +1 -1
  305. package/dist/cli/plugins/view/index.js.map +1 -1
  306. package/dist/cli/raw.d.ts +4 -0
  307. package/dist/cli/resolvers/bundler.js +9 -7
  308. package/dist/cli/resolvers/bundler.js.map +1 -1
  309. package/dist/cli/resolvers/config.js +4 -1
  310. package/dist/cli/resolvers/config.js.map +1 -1
  311. package/dist/cli/virtual/index.d.ts +2 -2
  312. package/dist/cli/virtual/index.js +11 -8
  313. package/dist/cli/virtual/virtual.d.ts +8 -10
  314. package/dist/entry/content/adapters/react/Builder.js +1 -1
  315. package/dist/entry/content/adapters/react/Builder.js.map +1 -1
  316. package/dist/entry/content/adapters/react/Node.d.ts +2 -0
  317. package/dist/entry/content/adapters/react/Node.js +10 -2
  318. package/dist/entry/content/adapters/react/Node.js.map +1 -1
  319. package/dist/entry/content/adapters/vanilla/Builder.js +1 -1
  320. package/dist/entry/content/adapters/vanilla/Builder.js.map +1 -1
  321. package/dist/entry/content/adapters/vanilla/Node.d.ts +2 -1
  322. package/dist/entry/content/adapters/vanilla/Node.js +10 -7
  323. package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
  324. package/dist/entry/content/core/Builder.d.ts +1 -2
  325. package/dist/entry/content/core/Builder.js +9 -5
  326. package/dist/entry/content/core/Builder.js.map +1 -1
  327. package/dist/entry/content/core/MountBuilder.js +14 -6
  328. package/dist/entry/content/core/MountBuilder.js.map +1 -1
  329. package/dist/entry/content/core/{Context.d.ts → context/Context.d.ts} +2 -1
  330. package/dist/entry/content/core/{Context.js → context/Context.js} +7 -0
  331. package/dist/entry/content/core/context/Context.js.map +1 -0
  332. package/dist/entry/content/core/{EventEmitter.d.ts → context/EventEmitter.d.ts} +1 -1
  333. package/dist/entry/content/core/{EventEmitter.js → context/EventEmitter.js} +1 -1
  334. package/dist/entry/content/core/context/EventEmitter.js.map +1 -0
  335. package/dist/entry/content/core/{ManagedContext.d.ts → context/ManagedContext.d.ts} +1 -1
  336. package/dist/entry/content/core/context/ManagedContext.js.map +1 -0
  337. package/dist/entry/content/core/context/index.d.ts +3 -0
  338. package/dist/entry/content/core/context/index.js +9 -0
  339. package/dist/entry/content/core/context/index.js.map +1 -0
  340. package/dist/entry/content/core/{AbstractMarker.d.ts → markers/AbstractMarker.d.ts} +1 -1
  341. package/dist/entry/content/core/{AbstractMarker.js → markers/AbstractMarker.js} +1 -1
  342. package/dist/entry/content/core/markers/AbstractMarker.js.map +1 -0
  343. package/dist/entry/content/core/{AttributeMarker.d.ts → markers/AttributeMarker.d.ts} +1 -1
  344. package/dist/entry/content/core/markers/AttributeMarker.js.map +1 -0
  345. package/dist/entry/content/core/{WeakMarker.d.ts → markers/WeakMarker.d.ts} +1 -1
  346. package/dist/entry/content/core/markers/WeakMarker.js.map +1 -0
  347. package/dist/entry/content/core/markers/index.d.ts +3 -0
  348. package/dist/entry/content/core/markers/index.js +9 -0
  349. package/dist/entry/content/core/markers/index.js.map +1 -0
  350. package/dist/entry/content/core/{EventNode.d.ts → nodes/EventNode.d.ts} +2 -1
  351. package/dist/entry/content/core/{EventNode.js → nodes/EventNode.js} +3 -0
  352. package/dist/entry/content/core/nodes/EventNode.js.map +1 -0
  353. package/dist/entry/content/core/nodes/FrameNode.d.ts +23 -0
  354. package/dist/entry/content/core/nodes/FrameNode.js +125 -0
  355. package/dist/entry/content/core/nodes/FrameNode.js.map +1 -0
  356. package/dist/entry/content/core/{MarkerNode.d.ts → nodes/MarkerNode.d.ts} +2 -1
  357. package/dist/entry/content/core/{MarkerNode.js → nodes/MarkerNode.js} +3 -0
  358. package/dist/entry/content/core/nodes/MarkerNode.js.map +1 -0
  359. package/dist/entry/content/core/{MountNode.d.ts → nodes/MountNode.d.ts} +2 -1
  360. package/dist/entry/content/core/{MountNode.js → nodes/MountNode.js} +3 -0
  361. package/dist/entry/content/core/nodes/MountNode.js.map +1 -0
  362. package/dist/entry/content/core/{Node.d.ts → nodes/Node.d.ts} +2 -1
  363. package/dist/entry/content/core/{Node.js → nodes/Node.js} +3 -0
  364. package/dist/entry/content/core/nodes/Node.js.map +1 -0
  365. package/dist/entry/content/core/nodes/ShadowNode.d.ts +14 -0
  366. package/dist/entry/content/core/nodes/ShadowNode.js +67 -0
  367. package/dist/entry/content/core/nodes/ShadowNode.js.map +1 -0
  368. package/dist/entry/content/core/nodes/index.d.ts +6 -0
  369. package/dist/entry/content/core/nodes/index.js +15 -0
  370. package/dist/entry/content/core/nodes/index.js.map +1 -0
  371. package/dist/entry/content/core/nodes/isolated-styles.d.ts +2 -0
  372. package/dist/entry/content/core/nodes/isolated-styles.js +14 -0
  373. package/dist/entry/content/core/nodes/isolated-styles.js.map +1 -0
  374. package/dist/entry/content/core/resolvers/watch.js +1 -1
  375. package/dist/entry/content/core/resolvers/watch.js.map +1 -1
  376. package/dist/entry/content/frame/Builder.d.ts +7 -0
  377. package/dist/entry/content/frame/Builder.js +14 -0
  378. package/dist/entry/content/frame/Builder.js.map +1 -0
  379. package/dist/entry/content/frame/index.d.ts +4 -0
  380. package/dist/entry/content/frame/index.js +7 -0
  381. package/dist/entry/content/frame/index.js.map +1 -0
  382. package/dist/entry/relay/Builder.js +5 -1
  383. package/dist/entry/relay/Builder.js.map +1 -1
  384. package/dist/entry/relay/index.d.ts +1 -1
  385. package/dist/locale/adapters/react/ReactLocale.d.ts +18 -0
  386. package/dist/locale/adapters/react/ReactLocale.js +41 -0
  387. package/dist/locale/adapters/react/ReactLocale.js.map +1 -0
  388. package/dist/locale/adapters/react/hooks/use-locale-attributes.d.ts +7 -0
  389. package/dist/locale/adapters/react/hooks/use-locale-attributes.js +30 -0
  390. package/dist/locale/adapters/react/hooks/use-locale-attributes.js.map +1 -0
  391. package/dist/locale/adapters/react/hooks/use-locale.d.ts +3 -0
  392. package/dist/locale/adapters/react/hooks/use-locale.js +17 -0
  393. package/dist/locale/adapters/react/hooks/use-locale.js.map +1 -0
  394. package/dist/locale/adapters/react/hooks/use-native-locale.d.ts +3 -0
  395. package/dist/locale/adapters/react/hooks/use-native-locale.js +10 -0
  396. package/dist/locale/adapters/react/hooks/use-native-locale.js.map +1 -0
  397. package/dist/locale/adapters/react/index.d.ts +4 -2
  398. package/dist/locale/adapters/react/index.js +6 -4
  399. package/dist/locale/adapters/react/index.js.map +1 -1
  400. package/dist/locale/adapters/react/types.d.ts +22 -0
  401. package/dist/locale/adapters/react/types.js +1 -0
  402. package/dist/locale/adapters/react/types.js.map +1 -0
  403. package/dist/locale/helpers.d.ts +4 -5
  404. package/dist/locale/helpers.js +1 -1
  405. package/dist/locale/helpers.js.map +1 -1
  406. package/dist/locale/index.d.ts +2 -1
  407. package/dist/locale/index.js +1 -0
  408. package/dist/locale/index.js.map +1 -1
  409. package/dist/locale/providers/AbstractLocale.d.ts +4 -4
  410. package/dist/locale/providers/AbstractLocale.js +13 -94
  411. package/dist/locale/providers/AbstractLocale.js.map +1 -1
  412. package/dist/locale/providers/CustomLocale.d.ts +3 -3
  413. package/dist/locale/providers/CustomLocale.js +6 -5
  414. package/dist/locale/providers/CustomLocale.js.map +1 -1
  415. package/dist/locale/providers/DynamicLocale.d.ts +18 -11
  416. package/dist/locale/providers/DynamicLocale.js +60 -47
  417. package/dist/locale/providers/DynamicLocale.js.map +1 -1
  418. package/dist/locale/providers/NativeLocale.d.ts +4 -7
  419. package/dist/locale/providers/NativeLocale.js +5 -14
  420. package/dist/locale/providers/NativeLocale.js.map +1 -1
  421. package/dist/locale/providers/ObservableLocale.d.ts +35 -0
  422. package/dist/locale/providers/ObservableLocale.js +179 -0
  423. package/dist/locale/providers/ObservableLocale.js.map +1 -0
  424. package/dist/locale/providers/index.d.ts +2 -1
  425. package/dist/locale/providers/index.js +3 -1
  426. package/dist/locale/providers/index.js.map +1 -1
  427. package/dist/locale/storage/LocaleStorage.d.ts +11 -0
  428. package/dist/locale/storage/LocaleStorage.js +40 -0
  429. package/dist/locale/storage/LocaleStorage.js.map +1 -0
  430. package/dist/locale/storage/index.d.ts +1 -0
  431. package/dist/locale/storage/index.js +5 -0
  432. package/dist/locale/storage/index.js.map +1 -0
  433. package/dist/main/entrypoint.d.ts +4 -0
  434. package/dist/main/entrypoint.js +20 -0
  435. package/dist/main/entrypoint.js.map +1 -0
  436. package/dist/main/icon.d.ts +2 -3
  437. package/dist/main/icon.js +2 -1
  438. package/dist/main/icon.js.map +1 -1
  439. package/dist/main/index.d.ts +2 -0
  440. package/dist/main/index.js +2 -0
  441. package/dist/main/index.js.map +1 -1
  442. package/dist/main/offscreen.d.ts +2 -5
  443. package/dist/main/offscreen.js +5 -2
  444. package/dist/main/offscreen.js.map +1 -1
  445. package/dist/main/options.d.ts +3 -0
  446. package/dist/main/options.js +7 -0
  447. package/dist/main/options.js.map +1 -0
  448. package/dist/main/page.d.ts +2 -4
  449. package/dist/main/page.js +2 -1
  450. package/dist/main/page.js.map +1 -1
  451. package/dist/main/popup.d.ts +2 -5
  452. package/dist/main/popup.js +3 -3
  453. package/dist/main/popup.js.map +1 -1
  454. package/dist/main/relay.d.ts +1 -2
  455. package/dist/main/relay.js +2 -1
  456. package/dist/main/relay.js.map +1 -1
  457. package/dist/main/sandbox.d.ts +1 -4
  458. package/dist/main/sandbox.js +2 -1
  459. package/dist/main/sandbox.js.map +1 -1
  460. package/dist/main/service.d.ts +1 -2
  461. package/dist/main/service.js.map +1 -1
  462. package/dist/main/sidebar.d.ts +2 -5
  463. package/dist/main/sidebar.js +3 -3
  464. package/dist/main/sidebar.js.map +1 -1
  465. package/dist/message/index.d.ts +2 -4
  466. package/dist/message/index.js.map +1 -1
  467. package/dist/offscreen/index.d.ts +2 -6
  468. package/dist/offscreen/index.js.map +1 -1
  469. package/dist/relay/index.d.ts +2 -5
  470. package/dist/relay/index.js.map +1 -1
  471. package/dist/sandbox/index.d.ts +1 -5
  472. package/dist/sandbox/index.js.map +1 -1
  473. package/dist/service/index.d.ts +2 -6
  474. package/dist/service/index.js.map +1 -1
  475. package/dist/shared/content/index.d.ts +1 -0
  476. package/dist/shared/content/index.js +6 -0
  477. package/dist/shared/content/index.js.map +1 -0
  478. package/dist/shared/content/isolation.d.ts +4 -0
  479. package/dist/shared/content/isolation.js +70 -0
  480. package/dist/shared/content/isolation.js.map +1 -0
  481. package/dist/shared/locale/index.d.ts +5 -0
  482. package/dist/shared/locale/index.js +21 -0
  483. package/dist/shared/locale/index.js.map +1 -0
  484. package/dist/shared/locale/keys.d.ts +5 -0
  485. package/dist/shared/locale/keys.js +33 -0
  486. package/dist/shared/locale/keys.js.map +1 -0
  487. package/dist/shared/locale/language.d.ts +4 -0
  488. package/dist/shared/locale/language.js +23 -0
  489. package/dist/shared/locale/language.js.map +1 -0
  490. package/dist/shared/locale/messages.d.ts +3 -0
  491. package/dist/shared/locale/messages.js +9 -0
  492. package/dist/shared/locale/messages.js.map +1 -0
  493. package/dist/shared/locale/plural.d.ts +2 -0
  494. package/dist/shared/locale/plural.js +81 -0
  495. package/dist/shared/locale/plural.js.map +1 -0
  496. package/dist/shared/locale/substitutions.d.ts +10 -0
  497. package/dist/shared/locale/substitutions.js +32 -0
  498. package/dist/shared/locale/substitutions.js.map +1 -0
  499. package/dist/types/background.d.ts +1 -1
  500. package/dist/types/background.js.map +1 -1
  501. package/dist/types/command.d.ts +1 -1
  502. package/dist/types/command.js.map +1 -1
  503. package/dist/types/content.d.ts +120 -31
  504. package/dist/types/content.js +22 -1
  505. package/dist/types/content.js.map +1 -1
  506. package/dist/types/entrypoint.d.ts +20 -0
  507. package/dist/types/entrypoint.js +4 -0
  508. package/dist/types/entrypoint.js.map +1 -1
  509. package/dist/types/icon.d.ts +8 -0
  510. package/dist/types/icon.js.map +1 -1
  511. package/dist/types/language.d.ts +57 -0
  512. package/dist/types/language.js +62 -0
  513. package/dist/types/language.js.map +1 -0
  514. package/dist/types/locale.d.ts +34 -63
  515. package/dist/types/locale.js +62 -119
  516. package/dist/types/locale.js.map +1 -1
  517. package/dist/types/manifest.d.ts +24 -7
  518. package/dist/types/manifest.js.map +1 -1
  519. package/dist/types/message.d.ts +7 -0
  520. package/dist/types/message.js.map +1 -1
  521. package/dist/types/offscreen.d.ts +14 -1
  522. package/dist/types/offscreen.js.map +1 -1
  523. package/dist/types/options.d.ts +9 -0
  524. package/dist/types/options.js +1 -0
  525. package/dist/types/options.js.map +1 -0
  526. package/dist/types/page.d.ts +8 -0
  527. package/dist/types/plugin.d.ts +2 -1
  528. package/dist/types/popup.d.ts +9 -0
  529. package/dist/types/relay.d.ts +16 -7
  530. package/dist/types/relay.js.map +1 -1
  531. package/dist/types/sandbox.d.ts +12 -0
  532. package/dist/types/sandbox.js.map +1 -1
  533. package/dist/types/service.d.ts +10 -1
  534. package/dist/types/service.js.map +1 -1
  535. package/dist/types/sidebar.d.ts +9 -0
  536. package/dist/types/sidebar.js.map +1 -1
  537. package/dist/types/transport.d.ts +4 -0
  538. package/dist/virtual/entrypoint.d.ts +5 -0
  539. package/dist/virtual/entrypoint.js +7 -0
  540. package/dist/virtual/entrypoint.js.map +1 -0
  541. package/dist/virtual/icon.d.ts +2 -0
  542. package/dist/virtual/icon.js +5 -0
  543. package/dist/virtual/icon.js.map +1 -0
  544. package/dist/virtual/locale.d.ts +7 -0
  545. package/dist/virtual/locale.js +13 -0
  546. package/dist/virtual/locale.js.map +1 -0
  547. package/dist/virtual/modules.d.ts +40 -0
  548. package/dist/virtual/offscreen.d.ts +3 -0
  549. package/dist/virtual/offscreen.js +5 -0
  550. package/dist/virtual/offscreen.js.map +1 -0
  551. package/dist/virtual/page.d.ts +2 -0
  552. package/dist/virtual/page.js +5 -0
  553. package/dist/virtual/page.js.map +1 -0
  554. package/dist/virtual/popup.d.ts +3 -0
  555. package/dist/virtual/popup.js +5 -0
  556. package/dist/virtual/popup.js.map +1 -0
  557. package/dist/virtual/relay.d.ts +3 -0
  558. package/dist/virtual/relay.js +5 -0
  559. package/dist/virtual/relay.js.map +1 -0
  560. package/dist/virtual/sandbox.d.ts +3 -0
  561. package/dist/virtual/sandbox.js +5 -0
  562. package/dist/virtual/sandbox.js.map +1 -0
  563. package/dist/virtual/sidebar.d.ts +3 -0
  564. package/dist/virtual/sidebar.js +5 -0
  565. package/dist/virtual/sidebar.js.map +1 -0
  566. package/package.json +31 -10
  567. package/scripts/clean-dist.js +7 -0
  568. package/scripts/copy-dts.js +11 -1
  569. package/types/client.d.ts +15 -0
  570. package/dist/cli/builders/manifest/utils.d.ts +0 -32
  571. package/dist/cli/builders/manifest/utils.js +0 -209
  572. package/dist/cli/builders/manifest/utils.js.map +0 -1
  573. package/dist/cli/bundler/plugins/EntrypointPlugin.js.map +0 -1
  574. package/dist/cli/bundler/plugins/GenerateJsonPlugin.js +0 -40
  575. package/dist/cli/bundler/plugins/GenerateJsonPlugin.js.map +0 -1
  576. package/dist/cli/bundler/plugins/ManifestPlugin.d.ts +0 -10
  577. package/dist/cli/bundler/plugins/ManifestPlugin.js +0 -78
  578. package/dist/cli/bundler/plugins/ManifestPlugin.js.map +0 -1
  579. package/dist/cli/bundler/plugins/ReplacePlugin.js.map +0 -1
  580. package/dist/cli/bundler/plugins/WatchPlugin.js +0 -21
  581. package/dist/cli/bundler/plugins/WatchPlugin.js.map +0 -1
  582. package/dist/cli/entrypoint/finder/AbstractOptionsFinder.js.map +0 -1
  583. package/dist/entry/content/core/AbstractMarker.js.map +0 -1
  584. package/dist/entry/content/core/AttributeMarker.js.map +0 -1
  585. package/dist/entry/content/core/Context.js.map +0 -1
  586. package/dist/entry/content/core/EventEmitter.js.map +0 -1
  587. package/dist/entry/content/core/EventNode.js.map +0 -1
  588. package/dist/entry/content/core/ManagedContext.js.map +0 -1
  589. package/dist/entry/content/core/MarkerNode.js.map +0 -1
  590. package/dist/entry/content/core/MountNode.js.map +0 -1
  591. package/dist/entry/content/core/Node.js.map +0 -1
  592. package/dist/entry/content/core/WeakMarker.js.map +0 -1
  593. package/dist/locale/adapters/react/LocaleProvider.d.ts +0 -7
  594. package/dist/locale/adapters/react/LocaleProvider.js +0 -58
  595. package/dist/locale/adapters/react/LocaleProvider.js.map +0 -1
  596. package/dist/locale/adapters/react/context.d.ts +0 -14
  597. package/dist/locale/adapters/react/context.js +0 -25
  598. package/dist/locale/adapters/react/context.js.map +0 -1
  599. package/dist/locale/utils.d.ts +0 -11
  600. package/dist/locale/utils.js +0 -67
  601. package/dist/locale/utils.js.map +0 -1
  602. /package/dist/cli/bundler/plugins/{ReplacePlugin.d.ts → replace/ReplacePlugin.d.ts} +0 -0
  603. /package/dist/cli/bundler/plugins/{ReplacePlugin.js → replace/ReplacePlugin.js} +0 -0
  604. /package/dist/cli/bundler/plugins/{WatchPlugin.d.ts → watch/WatchPlugin.d.ts} +0 -0
  605. /package/dist/cli/entrypoint/finder/{AbstractOptionsFinder.d.ts → AbstractParsedFinder.d.ts} +0 -0
  606. /package/dist/entry/content/core/{ManagedContext.js → context/ManagedContext.js} +0 -0
  607. /package/dist/entry/content/core/{AttributeMarker.js → markers/AttributeMarker.js} +0 -0
  608. /package/dist/entry/content/core/{WeakMarker.js → markers/WeakMarker.js} +0 -0
@@ -0,0 +1,11 @@
1
+ const PageModuleName = "#adnbn/page";
2
+ const createPageModule = (aliases) => (
3
+ // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.
4
+ `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});
5
+ `
6
+ );
7
+ export {
8
+ PageModuleName,
9
+ createPageModule
10
+ };
11
+ //# sourceMappingURL=page-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/cli/plugins/page/page-module.ts"],"sourcesContent":["export const PageModuleName = \"#adnbn/page\";\n\nexport const createPageModule = (aliases: Record<string, string>): string =>\n // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.\n `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});\\n`;\n"],"mappings":"AAAO,MAAM,iBAAiB;AAEvB,MAAM,mBAAmB,CAAC;AAAA;AAAA,EAE7B,mDAAmD,KAAK,UAAU,KAAK,UAAU,OAAO,CAAC,CAAC;AAAA;AAAA;","names":[]}
@@ -3,7 +3,7 @@ import { PopupFinder } from "../../entrypoint/index.js";
3
3
  import { ReadonlyConfig } from "../../../types/config.js";
4
4
  import { PopupEntrypointOptions } from "../../../types/popup.js";
5
5
  import { ManifestPopup } from "../../../types/manifest.js";
6
- export type PopupNameToManifest = Map<string, ManifestPopup>;
6
+ export type PopupNameToManifest = Record<string, ManifestPopup>;
7
7
  export default class extends PopupFinder {
8
8
  protected _view?: View<PopupEntrypointOptions>;
9
9
  constructor(config: ReadonlyConfig);
@@ -1,5 +1,5 @@
1
1
  import { View } from "../view/index.js";
2
- import { modifyLocaleMessageKey } from "./../../../locale/utils.js";
2
+ import { modifyLocaleMessageKey } from "./../../../shared/locale/index.js";
3
3
  import { PopupFinder } from "./../../../cli/entrypoint/index.js";
4
4
  class Popup_default extends PopupFinder {
5
5
  _view;
@@ -34,7 +34,7 @@ class Popup_default extends PopupFinder {
34
34
  icon
35
35
  }
36
36
  };
37
- }, /* @__PURE__ */ new Map());
37
+ }, {});
38
38
  }
39
39
  clear() {
40
40
  this._view = void 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/popup/Popup.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {modifyLocaleMessageKey} from \"@locale/utils\";\n\nimport {PopupFinder} from \"@cli/entrypoint/index.js\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {PopupEntrypointOptions} from \"@typing/popup\";\nimport {ManifestPopup} from \"@typing/manifest\";\n\nexport type PopupNameToManifest = Map<string, ManifestPopup>;\n\nexport default class extends PopupFinder {\n protected _view?: View<PopupEntrypointOptions>;\n\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public view(): View<PopupEntrypointOptions> {\n return (this._view ??= new View(this.config, this));\n }\n\n public async manifest(): Promise<ManifestPopup | undefined> {\n const views = await this.views();\n\n for (const {filename, options} of views.values()) {\n const {apply = true, title, icon} = options;\n\n if (apply) {\n return {\n path: filename,\n title: modifyLocaleMessageKey(title),\n icon,\n };\n }\n }\n }\n\n public async manifestByAlias(): Promise<PopupNameToManifest> {\n return Array.from(await this.views()).reduce((aliases, [_, item]) => {\n const {options, filename} = item;\n const {title, icon} = options;\n\n return {\n ...aliases,\n [item.alias]: {\n path: filename,\n title,\n icon,\n },\n };\n }, new Map() as PopupNameToManifest);\n }\n\n public clear(): this {\n this._view = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,8BAA6B;AAErC,SAAQ,mBAAkB;AAQ1B,MAAO,sBAAsB,YAAY;AAAA,EAC3B;AAAA,EAEH,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,OAAqC;AACxC,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,IAAI;AAAA,EACrD;AAAA,EAEA,MAAa,WAA+C;AACxD,UAAM,QAAQ,MAAM,KAAK,MAAM;AAE/B,eAAW,EAAC,UAAU,QAAO,KAAK,MAAM,OAAO,GAAG;AAC9C,YAAM,EAAC,QAAQ,MAAM,OAAO,KAAI,IAAI;AAEpC,UAAI,OAAO;AACP,eAAO;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,KAAK;AAAA,UACnC;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,MAAa,kBAAgD;AACzD,WAAO,MAAM,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,MAAM;AACjE,YAAM,EAAC,SAAS,SAAQ,IAAI;AAC5B,YAAM,EAAC,OAAO,KAAI,IAAI;AAEtB,aAAO;AAAA,QACH,GAAG;AAAA,QACH,CAAC,KAAK,KAAK,GAAG;AAAA,UACV,MAAM;AAAA,UACN;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,GAAG,oBAAI,IAAI,CAAwB;AAAA,EACvC;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AAEb,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/popup/Popup.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {modifyLocaleMessageKey} from \"@shared/locale\";\n\nimport {PopupFinder} from \"@cli/entrypoint/index.js\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {PopupEntrypointOptions} from \"@typing/popup\";\nimport {ManifestPopup} from \"@typing/manifest\";\n\nexport type PopupNameToManifest = Record<string, ManifestPopup>;\n\nexport default class extends PopupFinder {\n protected _view?: View<PopupEntrypointOptions>;\n\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public view(): View<PopupEntrypointOptions> {\n return (this._view ??= new View(this.config, this));\n }\n\n public async manifest(): Promise<ManifestPopup | undefined> {\n const views = await this.views();\n\n for (const {filename, options} of views.values()) {\n const {apply = true, title, icon} = options;\n\n if (apply) {\n return {\n path: filename,\n title: modifyLocaleMessageKey(title),\n icon,\n };\n }\n }\n }\n\n public async manifestByAlias(): Promise<PopupNameToManifest> {\n return Array.from(await this.views()).reduce((aliases, [_, item]) => {\n const {options, filename} = item;\n const {title, icon} = options;\n\n return {\n ...aliases,\n [item.alias]: {\n path: filename,\n title,\n icon,\n },\n };\n }, {} as PopupNameToManifest);\n }\n\n public clear(): this {\n this._view = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,8BAA6B;AAErC,SAAQ,mBAAkB;AAQ1B,MAAO,sBAAsB,YAAY;AAAA,EAC3B;AAAA,EAEH,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,OAAqC;AACxC,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,IAAI;AAAA,EACrD;AAAA,EAEA,MAAa,WAA+C;AACxD,UAAM,QAAQ,MAAM,KAAK,MAAM;AAE/B,eAAW,EAAC,UAAU,QAAO,KAAK,MAAM,OAAO,GAAG;AAC9C,YAAM,EAAC,QAAQ,MAAM,OAAO,KAAI,IAAI;AAEpC,UAAI,OAAO;AACP,eAAO;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,KAAK;AAAA,UACnC;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,MAAa,kBAAgD;AACzD,WAAO,MAAM,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,MAAM;AACjE,YAAM,EAAC,SAAS,SAAQ,IAAI;AAC5B,YAAM,EAAC,OAAO,KAAI,IAAI;AAEtB,aAAO;AAAA,QACH,GAAG;AAAA,QACH,CAAC,KAAK,KAAK,GAAG;AAAA,UACV,MAAM;AAAA,UACN;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,GAAG,CAAC,CAAwB;AAAA,EAChC;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AAEb,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { FileBuilder } from "../../../plugins/typescript/index.js";
2
2
  import { ReadonlyConfig } from "../../../../types/config.js";
3
- export default class extends FileBuilder {
3
+ export default class PopupDeclaration extends FileBuilder {
4
4
  protected alias: Set<string>;
5
5
  constructor(config: ReadonlyConfig);
6
6
  protected filename(): string;
@@ -1,5 +1,5 @@
1
1
  import { FileBuilder } from "./../../../../cli/plugins/typescript/index.js";
2
- class PopupDeclaration_default extends FileBuilder {
2
+ class PopupDeclaration extends FileBuilder {
3
3
  alias = /* @__PURE__ */ new Set();
4
4
  constructor(config) {
5
5
  super(config);
@@ -12,10 +12,10 @@ class PopupDeclaration_default extends FileBuilder {
12
12
  }
13
13
  template() {
14
14
  let content = this.readFile();
15
- if (this.alias.size > 0) {
16
- const type = '"' + Array.from(this.alias).join('" | "') + '"';
17
- content = content.replace("type PopupAlias = string", `type PopupAlias = ${type}`);
18
- }
15
+ content = content.replace(
16
+ "// :popup-aliases",
17
+ Array.from(this.alias, (alias) => `${JSON.stringify(alias)}: true;`).join("\n ")
18
+ );
19
19
  return content;
20
20
  }
21
21
  setAlias(alias) {
@@ -24,6 +24,6 @@ class PopupDeclaration_default extends FileBuilder {
24
24
  }
25
25
  }
26
26
  export {
27
- PopupDeclaration_default as default
27
+ PopupDeclaration as default
28
28
  };
29
29
  //# sourceMappingURL=PopupDeclaration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/cli/plugins/popup/declaration/PopupDeclaration.ts"],"sourcesContent":["import {FileBuilder} from \"@cli/plugins/typescript\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends FileBuilder {\n protected alias = new Set<string>();\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"popup.d.ts\";\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected template(): string {\n let content = this.readFile();\n\n if (this.alias.size > 0) {\n const type = '\"' + Array.from(this.alias).join('\" | \"') + '\"';\n\n content = content.replace(\"type PopupAlias = string\", `type PopupAlias = ${type}`);\n }\n\n return content;\n }\n\n public setAlias(alias: Set<string>): this {\n this.alias = alias;\n\n return this;\n }\n}\n"],"mappings":"AAAA,SAAQ,mBAAkB;AAI1B,MAAO,iCAAsB,YAAY;AAAA,EAC3B,QAAQ,oBAAI,IAAY;AAAA,EAElC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,QAAI,UAAU,KAAK,SAAS;AAE5B,QAAI,KAAK,MAAM,OAAO,GAAG;AACrB,YAAM,OAAO,MAAM,MAAM,KAAK,KAAK,KAAK,EAAE,KAAK,OAAO,IAAI;AAE1D,gBAAU,QAAQ,QAAQ,4BAA4B,qBAAqB,IAAI,EAAE;AAAA,IACrF;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,SAAS,OAA0B;AACtC,SAAK,QAAQ;AAEb,WAAO;AAAA,EACX;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/cli/plugins/popup/declaration/PopupDeclaration.ts"],"sourcesContent":["import {FileBuilder} from \"@cli/plugins/typescript\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class PopupDeclaration extends FileBuilder {\n protected alias = new Set<string>();\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"popup.d.ts\";\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected template(): string {\n let content = this.readFile();\n\n content = content.replace(\n \"// :popup-aliases\",\n Array.from(this.alias, alias => `${JSON.stringify(alias)}: true;`).join(\"\\n \")\n );\n\n return content;\n }\n\n public setAlias(alias: Set<string>): this {\n this.alias = alias;\n\n return this;\n }\n}\n"],"mappings":"AAAA,SAAQ,mBAAkB;AAI1B,MAAO,yBAAuC,YAAY;AAAA,EAC5C,QAAQ,oBAAI,IAAY;AAAA,EAElC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,QAAI,UAAU,KAAK,SAAS;AAE5B,cAAU,QAAQ;AAAA,MACd;AAAA,MACA,MAAM,KAAK,KAAK,OAAO,WAAS,GAAG,KAAK,UAAU,KAAK,CAAC,SAAS,EAAE,KAAK,YAAY;AAAA,IACxF;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,SAAS,OAA0B;AACtC,SAAK,QAAQ;AAEb,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import ":package";
2
2
 
3
3
  declare module ":package" {
4
- export type PopupAlias = string;
5
-
6
- export function changePopup(alias: PopupAlias, tab?: number | chrome.tabs.Tab): Promise<void>;
4
+ export interface PopupAliasRegistry {
5
+ // :popup-aliases
6
+ }
7
7
  }
@@ -1,9 +1,10 @@
1
- import { DefinePlugin, HtmlRspackPlugin } from "@rspack/core";
1
+ import { HtmlRspackPlugin } from "@rspack/core";
2
2
  import HtmlRspackTagsPlugin from "html-rspack-tags-plugin";
3
3
  import { definePlugin } from "./../../../main/plugin.js";
4
- import { EntrypointPlugin } from "./../../../cli/bundler/index.js";
4
+ import { EntrypointPlugin, GenerateModulePlugin } from "./../../../cli/bundler/index.js";
5
5
  import { virtualViewModule } from "./../../../cli/virtual/index.js";
6
6
  import Popup from "./Popup.js";
7
+ import { createPopupModule, PopupModuleName } from "./popup-module.js";
7
8
  import { PopupDeclaration } from "./declaration/index.js";
8
9
  import { Command } from "./../../../types/app.js";
9
10
  var popup_default = definePlugin(() => {
@@ -19,7 +20,7 @@ var popup_default = definePlugin(() => {
19
20
  bundler: async ({ config }) => {
20
21
  declaration.setAlias(await popup.getAlias()).build();
21
22
  const plugins = [];
22
- let alias = /* @__PURE__ */ new Map();
23
+ let alias = {};
23
24
  if (await popup.empty()) {
24
25
  if (config.debug) {
25
26
  console.info("Popup entries not found");
@@ -39,8 +40,8 @@ var popup_default = definePlugin(() => {
39
40
  }
40
41
  return {
41
42
  plugins: [
42
- new DefinePlugin({
43
- __ADNBN_POPUP_MAP__: JSON.stringify(alias)
43
+ new GenerateModulePlugin({
44
+ [PopupModuleName]: createPopupModule(alias)
44
45
  }),
45
46
  ...plugins
46
47
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/popup/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, DefinePlugin, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {EntrypointPlugin} from \"@cli/bundler\";\nimport {virtualViewModule} from \"@cli/virtual/index.js\";\n\nimport Popup, {PopupNameToManifest} from \"./Popup\";\n\nimport {PopupDeclaration} from \"./declaration\";\n\nimport {Command} from \"@typing/app\";\n\nexport default definePlugin(() => {\n let popup: Popup;\n let declaration: PopupDeclaration;\n\n return {\n name: \"adnbn:popup\",\n startup: ({config}) => {\n popup = new Popup(config);\n declaration = new PopupDeclaration(config);\n },\n popup: () => popup.files(),\n bundler: async ({config}) => {\n declaration.setAlias(await popup.getAlias()).build();\n\n const plugins: Plugins = [];\n\n let alias: PopupNameToManifest = new Map();\n\n if (await popup.empty()) {\n if (config.debug) {\n console.info(\"Popup entries not found\");\n }\n } else {\n alias = await popup.manifestByAlias();\n\n // prettier-ignore\n const plugin = EntrypointPlugin.from(await popup.view().entries())\n .virtual(file => virtualViewModule(file));\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.setAlias(await popup.clear().getAlias()).build();\n\n return popup.view().entries();\n });\n }\n\n const htmlPlugins = (await popup.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await popup.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new DefinePlugin({\n __ADNBN_POPUP_MAP__: JSON.stringify(alias),\n }),\n ...plugins,\n ],\n } as RspackConfig;\n },\n manifest: async ({manifest}) => {\n manifest.setPopup(await popup.manifest()).appendCsp(await popup.csp());\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,cAAc,wBAAgC;AACrF,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAE3B,SAAQ,wBAAuB;AAC/B,SAAQ,yBAAwB;AAEhC,OAAO,WAAkC;AAEzC,SAAQ,wBAAuB;AAE/B,SAAQ,eAAc;AAEtB,IAAO,gBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,cAAQ,IAAI,MAAM,MAAM;AACxB,oBAAc,IAAI,iBAAiB,MAAM;AAAA,IAC7C;AAAA,IACA,OAAO,MAAM,MAAM,MAAM;AAAA,IACzB,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,SAAS,MAAM,MAAM,SAAS,CAAC,EAAE,MAAM;AAEnD,YAAM,UAAmB,CAAC;AAE1B,UAAI,QAA6B,oBAAI,IAAI;AAEzC,UAAI,MAAM,MAAM,MAAM,GAAG;AACrB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,yBAAyB;AAAA,QAC1C;AAAA,MACJ,OAAO;AACH,gBAAQ,MAAM,MAAM,gBAAgB;AAGpC,cAAM,SAAS,iBAAiB,KAAK,MAAM,MAAM,KAAK,EAAE,QAAQ,CAAC,EAC5D,QAAQ,UAAQ,kBAAkB,IAAI,CAAC;AAE5C,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,SAAS,MAAM,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;AAE3D,mBAAO,MAAM,KAAK,EAAE,QAAQ;AAAA,UAChC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,MAAM,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC5F,cAAM,eAAe,MAAM,MAAM,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAEhG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,aAAa;AAAA,YACb,qBAAqB,KAAK,UAAU,KAAK;AAAA,UAC7C,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,SAAQ,MAAM;AAC5B,eAAS,SAAS,MAAM,MAAM,SAAS,CAAC,EAAE,UAAU,MAAM,MAAM,IAAI,CAAC;AAAA,IACzE;AAAA,EACJ;AACJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/popup/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {EntrypointPlugin, GenerateModulePlugin} from \"@cli/bundler\";\nimport {virtualViewModule} from \"@cli/virtual/index.js\";\n\nimport Popup, {PopupNameToManifest} from \"./Popup\";\nimport {createPopupModule, PopupModuleName} from \"./popup-module\";\n\nimport {PopupDeclaration} from \"./declaration\";\n\nimport {Command} from \"@typing/app\";\n\nexport default definePlugin(() => {\n let popup: Popup;\n let declaration: PopupDeclaration;\n\n return {\n name: \"adnbn:popup\",\n startup: ({config}) => {\n popup = new Popup(config);\n declaration = new PopupDeclaration(config);\n },\n popup: () => popup.files(),\n bundler: async ({config}) => {\n declaration.setAlias(await popup.getAlias()).build();\n\n const plugins: Plugins = [];\n\n let alias: PopupNameToManifest = {};\n\n if (await popup.empty()) {\n if (config.debug) {\n console.info(\"Popup entries not found\");\n }\n } else {\n alias = await popup.manifestByAlias();\n\n // prettier-ignore\n const plugin = EntrypointPlugin.from(await popup.view().entries())\n .virtual(file => virtualViewModule(file));\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.setAlias(await popup.clear().getAlias()).build();\n\n return popup.view().entries();\n });\n }\n\n const htmlPlugins = (await popup.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await popup.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new GenerateModulePlugin({\n [PopupModuleName]: createPopupModule(alias),\n }),\n ...plugins,\n ],\n } as RspackConfig;\n },\n manifest: async ({manifest}) => {\n manifest.setPopup(await popup.manifest()).appendCsp(await popup.csp());\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,wBAAgC;AACvE,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAE3B,SAAQ,kBAAkB,4BAA2B;AACrD,SAAQ,yBAAwB;AAEhC,OAAO,WAAkC;AACzC,SAAQ,mBAAmB,uBAAsB;AAEjD,SAAQ,wBAAuB;AAE/B,SAAQ,eAAc;AAEtB,IAAO,gBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,cAAQ,IAAI,MAAM,MAAM;AACxB,oBAAc,IAAI,iBAAiB,MAAM;AAAA,IAC7C;AAAA,IACA,OAAO,MAAM,MAAM,MAAM;AAAA,IACzB,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,SAAS,MAAM,MAAM,SAAS,CAAC,EAAE,MAAM;AAEnD,YAAM,UAAmB,CAAC;AAE1B,UAAI,QAA6B,CAAC;AAElC,UAAI,MAAM,MAAM,MAAM,GAAG;AACrB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,yBAAyB;AAAA,QAC1C;AAAA,MACJ,OAAO;AACH,gBAAQ,MAAM,MAAM,gBAAgB;AAGpC,cAAM,SAAS,iBAAiB,KAAK,MAAM,MAAM,KAAK,EAAE,QAAQ,CAAC,EAC5D,QAAQ,UAAQ,kBAAkB,IAAI,CAAC;AAE5C,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,SAAS,MAAM,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;AAE3D,mBAAO,MAAM,KAAK,EAAE,QAAQ;AAAA,UAChC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,MAAM,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC5F,cAAM,eAAe,MAAM,MAAM,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAEhG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,qBAAqB;AAAA,YACrB,CAAC,eAAe,GAAG,kBAAkB,KAAK;AAAA,UAC9C,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,SAAQ,MAAM;AAC5B,eAAS,SAAS,MAAM,MAAM,SAAS,CAAC,EAAE,UAAU,MAAM,MAAM,IAAI,CAAC;AAAA,IACzE;AAAA,EACJ;AACJ,CAAC;","names":[]}
@@ -0,0 +1,3 @@
1
+ import type { ManifestPopup } from "../../../types/manifest.js";
2
+ export declare const PopupModuleName = "#adnbn/popup";
3
+ export declare const createPopupModule: (aliases: Record<string, ManifestPopup>) => string;
@@ -0,0 +1,11 @@
1
+ const PopupModuleName = "#adnbn/popup";
2
+ const createPopupModule = (aliases) => (
3
+ // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.
4
+ `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});
5
+ `
6
+ );
7
+ export {
8
+ PopupModuleName,
9
+ createPopupModule
10
+ };
11
+ //# sourceMappingURL=popup-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/cli/plugins/popup/popup-module.ts"],"sourcesContent":["import type {ManifestPopup} from \"@typing/manifest\";\n\nexport const PopupModuleName = \"#adnbn/popup\";\n\nexport const createPopupModule = (aliases: Record<string, ManifestPopup>): string =>\n // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.\n `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});\\n`;\n"],"mappings":"AAEO,MAAM,kBAAkB;AAExB,MAAM,oBAAoB,CAAC;AAAA;AAAA,EAE9B,mDAAmD,KAAK,UAAU,KAAK,UAAU,OAAO,CAAC,CAAC;AAAA;AAAA;","names":[]}
@@ -1,8 +1,7 @@
1
1
  import { View } from "../view/index.js";
2
2
  import { SandboxFinder, SandboxViewFinder } from "../../entrypoint/index.js";
3
3
  import { EntrypointFile } from "../../../types/entrypoint.js";
4
- import { SandboxEntrypointOptions, SandboxParameters } from "../../../types/sandbox.js";
5
- export type SandboxParametersMap = Record<string, SandboxParameters>;
4
+ import { SandboxEntrypointOptions, SandboxParametersMap } from "../../../types/sandbox.js";
6
5
  export default class extends SandboxFinder {
7
6
  protected _view?: View<SandboxEntrypointOptions>;
8
7
  protected _views?: SandboxViewFinder;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/sandbox/Sandbox.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {SandboxFinder, SandboxViewFinder} from \"@cli/entrypoint/index.js\";\nimport {virtualSandboxModule} from \"@cli/virtual/index.js\";\n\nimport {EntrypointFile} from \"@typing/entrypoint\";\nimport {SandboxEntrypointOptions, SandboxParameters} from \"@typing/sandbox\";\n\nexport type SandboxParametersMap = Record<string, SandboxParameters>;\n\nexport default class extends SandboxFinder {\n protected _view?: View<SandboxEntrypointOptions>;\n\n protected _views?: SandboxViewFinder;\n\n public view(): View<SandboxEntrypointOptions> {\n return (this._view ??= new View(this.config, this.views()));\n }\n\n public views(): SandboxViewFinder {\n return (this._views ??= new SandboxViewFinder(this.config, this));\n }\n\n public virtual(file: EntrypointFile): string {\n const options = this._transport?.get(file)?.options;\n\n if (!options) {\n throw new Error(`Sandbox options not found for \"${file.file}\"`);\n }\n\n return virtualSandboxModule(file, options.name);\n }\n\n public async parameters(): Promise<SandboxParametersMap> {\n const sandboxes: SandboxParametersMap = {};\n const files = await this.transport();\n const filenames = await this.views().getFilenames();\n\n for (const [file, transport] of files) {\n const {name, readyTimeout, requestTimeout, removeOnRequestTimeout} = transport.options;\n const url = filenames.get(file);\n\n if (!url) {\n throw new Error(`Sandbox filename not found for \"${file.file}\"`);\n }\n\n sandboxes[name] = {\n url,\n readyTimeout,\n requestTimeout,\n removeOnRequestTimeout,\n };\n }\n\n return sandboxes;\n }\n\n public async sandboxes(): Promise<string[]> {\n return Object.values(await this.parameters()).map(({url}) => url);\n }\n\n public clear(): this {\n this._view = undefined;\n this._views = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,eAAe,yBAAwB;AAC/C,SAAQ,4BAA2B;AAOnC,MAAO,wBAAsB,cAAc;AAAA,EAC7B;AAAA,EAEA;AAAA,EAEH,OAAuC;AAC1C,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,KAAK,MAAM,CAAC;AAAA,EAC7D;AAAA,EAEO,QAA2B;AAC9B,WAAQ,KAAK,WAAL,KAAK,SAAW,IAAI,kBAAkB,KAAK,QAAQ,IAAI;AAAA,EACnE;AAAA,EAEO,QAAQ,MAA8B;AAvBjD;AAwBQ,UAAM,WAAU,gBAAK,eAAL,mBAAiB,IAAI,UAArB,mBAA4B;AAE5C,QAAI,CAAC,SAAS;AACV,YAAM,IAAI,MAAM,kCAAkC,KAAK,IAAI,GAAG;AAAA,IAClE;AAEA,WAAO,qBAAqB,MAAM,QAAQ,IAAI;AAAA,EAClD;AAAA,EAEA,MAAa,aAA4C;AACrD,UAAM,YAAkC,CAAC;AACzC,UAAM,QAAQ,MAAM,KAAK,UAAU;AACnC,UAAM,YAAY,MAAM,KAAK,MAAM,EAAE,aAAa;AAElD,eAAW,CAAC,MAAM,SAAS,KAAK,OAAO;AACnC,YAAM,EAAC,MAAM,cAAc,gBAAgB,uBAAsB,IAAI,UAAU;AAC/E,YAAM,MAAM,UAAU,IAAI,IAAI;AAE9B,UAAI,CAAC,KAAK;AACN,cAAM,IAAI,MAAM,mCAAmC,KAAK,IAAI,GAAG;AAAA,MACnE;AAEA,gBAAU,IAAI,IAAI;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,IACJ;AAEA,WAAO;AAAA,EACX;AAAA,EAEA,MAAa,YAA+B;AACxC,WAAO,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,EAAE,IAAI,CAAC,EAAC,IAAG,MAAM,GAAG;AAAA,EACpE;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AACb,SAAK,SAAS;AAEd,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sandbox/Sandbox.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {SandboxFinder, SandboxViewFinder} from \"@cli/entrypoint/index.js\";\nimport {virtualSandboxModule} from \"@cli/virtual/index.js\";\n\nimport {EntrypointFile} from \"@typing/entrypoint\";\nimport {SandboxEntrypointOptions, SandboxParametersMap} from \"@typing/sandbox\";\n\nexport default class extends SandboxFinder {\n protected _view?: View<SandboxEntrypointOptions>;\n\n protected _views?: SandboxViewFinder;\n\n public view(): View<SandboxEntrypointOptions> {\n return (this._view ??= new View(this.config, this.views()));\n }\n\n public views(): SandboxViewFinder {\n return (this._views ??= new SandboxViewFinder(this.config, this));\n }\n\n public virtual(file: EntrypointFile): string {\n const options = this._transport?.get(file)?.options;\n\n if (!options) {\n throw new Error(`Sandbox options not found for \"${file.file}\"`);\n }\n\n return virtualSandboxModule(file, options.name);\n }\n\n public async parameters(): Promise<SandboxParametersMap> {\n const sandboxes: SandboxParametersMap = {};\n const files = await this.transport();\n const filenames = await this.views().getFilenames();\n\n for (const [file, transport] of files) {\n const {name, readyTimeout, requestTimeout, removeOnRequestTimeout} = transport.options;\n const url = filenames.get(file);\n\n if (!url) {\n throw new Error(`Sandbox filename not found for \"${file.file}\"`);\n }\n\n sandboxes[name] = {\n url,\n readyTimeout,\n requestTimeout,\n removeOnRequestTimeout,\n };\n }\n\n return sandboxes;\n }\n\n public async sandboxes(): Promise<string[]> {\n return Object.values(await this.parameters()).map(({url}) => url);\n }\n\n public clear(): this {\n this._view = undefined;\n this._views = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,eAAe,yBAAwB;AAC/C,SAAQ,4BAA2B;AAKnC,MAAO,wBAAsB,cAAc;AAAA,EAC7B;AAAA,EAEA;AAAA,EAEH,OAAuC;AAC1C,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,KAAK,MAAM,CAAC;AAAA,EAC7D;AAAA,EAEO,QAA2B;AAC9B,WAAQ,KAAK,WAAL,KAAK,SAAW,IAAI,kBAAkB,KAAK,QAAQ,IAAI;AAAA,EACnE;AAAA,EAEO,QAAQ,MAA8B;AArBjD;AAsBQ,UAAM,WAAU,gBAAK,eAAL,mBAAiB,IAAI,UAArB,mBAA4B;AAE5C,QAAI,CAAC,SAAS;AACV,YAAM,IAAI,MAAM,kCAAkC,KAAK,IAAI,GAAG;AAAA,IAClE;AAEA,WAAO,qBAAqB,MAAM,QAAQ,IAAI;AAAA,EAClD;AAAA,EAEA,MAAa,aAA4C;AACrD,UAAM,YAAkC,CAAC;AACzC,UAAM,QAAQ,MAAM,KAAK,UAAU;AACnC,UAAM,YAAY,MAAM,KAAK,MAAM,EAAE,aAAa;AAElD,eAAW,CAAC,MAAM,SAAS,KAAK,OAAO;AACnC,YAAM,EAAC,MAAM,cAAc,gBAAgB,uBAAsB,IAAI,UAAU;AAC/E,YAAM,MAAM,UAAU,IAAI,IAAI;AAE9B,UAAI,CAAC,KAAK;AACN,cAAM,IAAI,MAAM,mCAAmC,KAAK,IAAI,GAAG;AAAA,MACnE;AAEA,gBAAU,IAAI,IAAI;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,IACJ;AAEA,WAAO;AAAA,EACX;AAAA,EAEA,MAAa,YAA+B;AACxC,WAAO,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,EAAE,IAAI,CAAC,EAAC,IAAG,MAAM,GAAG;AAAA,EACpE;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AACb,SAAK,SAAS;AAEd,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
@@ -1,9 +1,10 @@
1
- import { DefinePlugin, HtmlRspackPlugin } from "@rspack/core";
1
+ import { HtmlRspackPlugin } from "@rspack/core";
2
2
  import HtmlRspackTagsPlugin from "html-rspack-tags-plugin";
3
3
  import { definePlugin } from "./../../../main/plugin.js";
4
- import { EntrypointPlugin } from "./../../../cli/bundler/index.js";
4
+ import { EntrypointPlugin, GenerateModulePlugin } from "./../../../cli/bundler/index.js";
5
5
  import Sandbox from "./Sandbox.js";
6
6
  import SandboxDeclaration from "./SandboxDeclaration.js";
7
+ import { createSandboxModule, SandboxModuleName } from "./sandbox-module.js";
7
8
  import { Command } from "./../../../types/app.js";
8
9
  var sandbox_default = definePlugin(() => {
9
10
  let sandbox;
@@ -43,8 +44,8 @@ var sandbox_default = definePlugin(() => {
43
44
  }
44
45
  return {
45
46
  plugins: [
46
- new DefinePlugin({
47
- __ADNBN_SANDBOX_PARAMETERS__: JSON.stringify(parameters)
47
+ new GenerateModulePlugin({
48
+ [SandboxModuleName]: createSandboxModule(parameters)
48
49
  }),
49
50
  ...plugins
50
51
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/sandbox/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, DefinePlugin, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\nimport {EntrypointPlugin} from \"@cli/bundler\";\n\nimport Sandbox, {SandboxParametersMap} from \"./Sandbox\";\nimport SandboxDeclaration from \"./SandboxDeclaration\";\n\nimport {Command} from \"@typing/app\";\n\nexport default definePlugin(() => {\n let sandbox: Sandbox;\n let declaration: SandboxDeclaration;\n\n return {\n name: \"adnbn:sandbox\",\n startup: ({config}) => {\n sandbox = new Sandbox(config);\n declaration = new SandboxDeclaration(config);\n },\n sandbox: () => sandbox.files(),\n bundler: async ({config}) => {\n declaration.dictionary(await sandbox.dictionary()).build();\n\n let build = true;\n\n if (await sandbox.empty()) {\n if (config.debug) {\n console.info(\"Sandbox entries not found\");\n }\n\n build = false;\n }\n\n const plugins: Plugins = [];\n let parameters: SandboxParametersMap = {};\n\n if (build) {\n parameters = await sandbox.parameters();\n\n const plugin = EntrypointPlugin.from(await sandbox.view().entries()).virtual(file =>\n sandbox.virtual(file)\n );\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.dictionary(await sandbox.clear().dictionary()).build();\n\n return sandbox.view().entries();\n });\n }\n\n const htmlPlugins = (await sandbox.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await sandbox.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new DefinePlugin({\n __ADNBN_SANDBOX_PARAMETERS__: JSON.stringify(parameters),\n }),\n ...plugins,\n ],\n } satisfies RspackConfig;\n },\n manifest: async ({manifest}) => {\n if (await sandbox.exists()) {\n manifest.appendSandboxes(await sandbox.sandboxes()).appendSandboxCsp(await sandbox.views().csp());\n }\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,cAAc,wBAAgC;AACrF,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAC3B,SAAQ,wBAAuB;AAE/B,OAAO,aAAqC;AAC5C,OAAO,wBAAwB;AAE/B,SAAQ,eAAc;AAEtB,IAAO,kBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,gBAAU,IAAI,QAAQ,MAAM;AAC5B,oBAAc,IAAI,mBAAmB,MAAM;AAAA,IAC/C;AAAA,IACA,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,WAAW,MAAM,QAAQ,WAAW,CAAC,EAAE,MAAM;AAEzD,UAAI,QAAQ;AAEZ,UAAI,MAAM,QAAQ,MAAM,GAAG;AACvB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,2BAA2B;AAAA,QAC5C;AAEA,gBAAQ;AAAA,MACZ;AAEA,YAAM,UAAmB,CAAC;AAC1B,UAAI,aAAmC,CAAC;AAExC,UAAI,OAAO;AACP,qBAAa,MAAM,QAAQ,WAAW;AAEtC,cAAM,SAAS,iBAAiB,KAAK,MAAM,QAAQ,KAAK,EAAE,QAAQ,CAAC,EAAE;AAAA,UAAQ,UACzE,QAAQ,QAAQ,IAAI;AAAA,QACxB;AAEA,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,WAAW,MAAM,QAAQ,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;AAEjE,mBAAO,QAAQ,KAAK,EAAE,QAAQ;AAAA,UAClC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC9F,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAElG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,aAAa;AAAA,YACb,8BAA8B,KAAK,UAAU,UAAU;AAAA,UAC3D,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,SAAQ,MAAM;AAC5B,UAAI,MAAM,QAAQ,OAAO,GAAG;AACxB,iBAAS,gBAAgB,MAAM,QAAQ,UAAU,CAAC,EAAE,iBAAiB,MAAM,QAAQ,MAAM,EAAE,IAAI,CAAC;AAAA,MACpG;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sandbox/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\nimport {EntrypointPlugin, GenerateModulePlugin} from \"@cli/bundler\";\n\nimport Sandbox from \"./Sandbox\";\nimport SandboxDeclaration from \"./SandboxDeclaration\";\nimport {createSandboxModule, SandboxModuleName} from \"./sandbox-module\";\n\nimport {Command} from \"@typing/app\";\nimport type {SandboxParametersMap} from \"@typing/sandbox\";\n\nexport default definePlugin(() => {\n let sandbox: Sandbox;\n let declaration: SandboxDeclaration;\n\n return {\n name: \"adnbn:sandbox\",\n startup: ({config}) => {\n sandbox = new Sandbox(config);\n declaration = new SandboxDeclaration(config);\n },\n sandbox: () => sandbox.files(),\n bundler: async ({config}) => {\n declaration.dictionary(await sandbox.dictionary()).build();\n\n let build = true;\n\n if (await sandbox.empty()) {\n if (config.debug) {\n console.info(\"Sandbox entries not found\");\n }\n\n build = false;\n }\n\n const plugins: Plugins = [];\n let parameters: SandboxParametersMap = {};\n\n if (build) {\n parameters = await sandbox.parameters();\n\n const plugin = EntrypointPlugin.from(await sandbox.view().entries()).virtual(file =>\n sandbox.virtual(file)\n );\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.dictionary(await sandbox.clear().dictionary()).build();\n\n return sandbox.view().entries();\n });\n }\n\n const htmlPlugins = (await sandbox.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await sandbox.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new GenerateModulePlugin({\n [SandboxModuleName]: createSandboxModule(parameters),\n }),\n ...plugins,\n ],\n } satisfies RspackConfig;\n },\n manifest: async ({manifest}) => {\n if (await sandbox.exists()) {\n manifest.appendSandboxes(await sandbox.sandboxes()).appendSandboxCsp(await sandbox.views().csp());\n }\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,wBAAgC;AACvE,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAC3B,SAAQ,kBAAkB,4BAA2B;AAErD,OAAO,aAAa;AACpB,OAAO,wBAAwB;AAC/B,SAAQ,qBAAqB,yBAAwB;AAErD,SAAQ,eAAc;AAGtB,IAAO,kBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,gBAAU,IAAI,QAAQ,MAAM;AAC5B,oBAAc,IAAI,mBAAmB,MAAM;AAAA,IAC/C;AAAA,IACA,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,WAAW,MAAM,QAAQ,WAAW,CAAC,EAAE,MAAM;AAEzD,UAAI,QAAQ;AAEZ,UAAI,MAAM,QAAQ,MAAM,GAAG;AACvB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,2BAA2B;AAAA,QAC5C;AAEA,gBAAQ;AAAA,MACZ;AAEA,YAAM,UAAmB,CAAC;AAC1B,UAAI,aAAmC,CAAC;AAExC,UAAI,OAAO;AACP,qBAAa,MAAM,QAAQ,WAAW;AAEtC,cAAM,SAAS,iBAAiB,KAAK,MAAM,QAAQ,KAAK,EAAE,QAAQ,CAAC,EAAE;AAAA,UAAQ,UACzE,QAAQ,QAAQ,IAAI;AAAA,QACxB;AAEA,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,WAAW,MAAM,QAAQ,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;AAEjE,mBAAO,QAAQ,KAAK,EAAE,QAAQ;AAAA,UAClC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC9F,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAElG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,qBAAqB;AAAA,YACrB,CAAC,iBAAiB,GAAG,oBAAoB,UAAU;AAAA,UACvD,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,SAAQ,MAAM;AAC5B,UAAI,MAAM,QAAQ,OAAO,GAAG;AACxB,iBAAS,gBAAgB,MAAM,QAAQ,UAAU,CAAC,EAAE,iBAAiB,MAAM,QAAQ,MAAM,EAAE,IAAI,CAAC;AAAA,MACpG;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
@@ -0,0 +1,3 @@
1
+ import type { SandboxParametersMap } from "../../../types/sandbox.js";
2
+ export declare const SandboxModuleName = "#adnbn/sandbox";
3
+ export declare const createSandboxModule: (parameters: SandboxParametersMap) => string;
@@ -0,0 +1,11 @@
1
+ const SandboxModuleName = "#adnbn/sandbox";
2
+ const createSandboxModule = (parameters) => (
3
+ // Preserve omitted optional values and allow unused data to be removed from optimized bundles.
4
+ `export const parameters = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(parameters))});
5
+ `
6
+ );
7
+ export {
8
+ SandboxModuleName,
9
+ createSandboxModule
10
+ };
11
+ //# sourceMappingURL=sandbox-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sandbox/sandbox-module.ts"],"sourcesContent":["import type {SandboxParametersMap} from \"@typing/sandbox\";\n\nexport const SandboxModuleName = \"#adnbn/sandbox\";\n\nexport const createSandboxModule = (parameters: SandboxParametersMap): string =>\n // Preserve omitted optional values and allow unused data to be removed from optimized bundles.\n `export const parameters = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(parameters))});\\n`;\n"],"mappings":"AAEO,MAAM,oBAAoB;AAE1B,MAAM,sBAAsB,CAAC;AAAA;AAAA,EAEhC,sDAAsD,KAAK,UAAU,KAAK,UAAU,UAAU,CAAC,CAAC;AAAA;AAAA;","names":[]}
@@ -3,7 +3,7 @@ import { SidebarFinder } from "../../entrypoint/index.js";
3
3
  import { ReadonlyConfig } from "../../../types/config.js";
4
4
  import { SidebarEntrypointOptions } from "../../../types/sidebar.js";
5
5
  import { ManifestSidebar } from "../../../types/manifest.js";
6
- export type SidebarNameToManifest = Map<string, ManifestSidebar>;
6
+ export type SidebarNameToManifest = Record<string, ManifestSidebar>;
7
7
  export default class extends SidebarFinder {
8
8
  protected _view?: View<SidebarEntrypointOptions>;
9
9
  constructor(config: ReadonlyConfig);
@@ -1,5 +1,5 @@
1
1
  import { View } from "../view/index.js";
2
- import { modifyLocaleMessageKey } from "./../../../locale/utils.js";
2
+ import { modifyLocaleMessageKey } from "./../../../shared/locale/index.js";
3
3
  import { SidebarFinder } from "./../../../cli/entrypoint/index.js";
4
4
  class Sidebar_default extends SidebarFinder {
5
5
  _view;
@@ -34,7 +34,7 @@ class Sidebar_default extends SidebarFinder {
34
34
  icon
35
35
  }
36
36
  };
37
- }, /* @__PURE__ */ new Map());
37
+ }, {});
38
38
  }
39
39
  clear() {
40
40
  this._view = void 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/sidebar/Sidebar.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {modifyLocaleMessageKey} from \"@locale/utils\";\n\nimport {SidebarFinder} from \"@cli/entrypoint/index.js\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {SidebarEntrypointOptions} from \"@typing/sidebar\";\nimport {ManifestSidebar} from \"@typing/manifest\";\n\nexport type SidebarNameToManifest = Map<string, ManifestSidebar>;\n\nexport default class extends SidebarFinder {\n protected _view?: View<SidebarEntrypointOptions>;\n\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public view(): View<SidebarEntrypointOptions> {\n return (this._view ??= new View(this.config, this));\n }\n\n public async manifest(): Promise<ManifestSidebar | undefined> {\n const views = await this.views();\n\n for (const {filename, options} of views.values()) {\n const {apply = true, title, icon} = options;\n\n if (apply) {\n return {\n path: filename,\n title: modifyLocaleMessageKey(title),\n icon,\n };\n }\n }\n }\n\n public async manifestByAlias(): Promise<SidebarNameToManifest> {\n return Array.from(await this.views()).reduce((aliases, [_, item]) => {\n const {options, filename} = item;\n const {title, icon} = options;\n\n return {\n ...aliases,\n [item.alias]: {\n path: filename,\n title,\n icon,\n },\n };\n }, new Map() as SidebarNameToManifest);\n }\n\n public clear(): this {\n this._view = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,8BAA6B;AAErC,SAAQ,qBAAoB;AAQ5B,MAAO,wBAAsB,cAAc;AAAA,EAC7B;AAAA,EAEH,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,OAAuC;AAC1C,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,IAAI;AAAA,EACrD;AAAA,EAEA,MAAa,WAAiD;AAC1D,UAAM,QAAQ,MAAM,KAAK,MAAM;AAE/B,eAAW,EAAC,UAAU,QAAO,KAAK,MAAM,OAAO,GAAG;AAC9C,YAAM,EAAC,QAAQ,MAAM,OAAO,KAAI,IAAI;AAEpC,UAAI,OAAO;AACP,eAAO;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,KAAK;AAAA,UACnC;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,MAAa,kBAAkD;AAC3D,WAAO,MAAM,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,MAAM;AACjE,YAAM,EAAC,SAAS,SAAQ,IAAI;AAC5B,YAAM,EAAC,OAAO,KAAI,IAAI;AAEtB,aAAO;AAAA,QACH,GAAG;AAAA,QACH,CAAC,KAAK,KAAK,GAAG;AAAA,UACV,MAAM;AAAA,UACN;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,GAAG,oBAAI,IAAI,CAA0B;AAAA,EACzC;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AAEb,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sidebar/Sidebar.ts"],"sourcesContent":["import {View} from \"../view\";\n\nimport {modifyLocaleMessageKey} from \"@shared/locale\";\n\nimport {SidebarFinder} from \"@cli/entrypoint/index.js\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {SidebarEntrypointOptions} from \"@typing/sidebar\";\nimport {ManifestSidebar} from \"@typing/manifest\";\n\nexport type SidebarNameToManifest = Record<string, ManifestSidebar>;\n\nexport default class extends SidebarFinder {\n protected _view?: View<SidebarEntrypointOptions>;\n\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public view(): View<SidebarEntrypointOptions> {\n return (this._view ??= new View(this.config, this));\n }\n\n public async manifest(): Promise<ManifestSidebar | undefined> {\n const views = await this.views();\n\n for (const {filename, options} of views.values()) {\n const {apply = true, title, icon} = options;\n\n if (apply) {\n return {\n path: filename,\n title: modifyLocaleMessageKey(title),\n icon,\n };\n }\n }\n }\n\n public async manifestByAlias(): Promise<SidebarNameToManifest> {\n return Array.from(await this.views()).reduce((aliases, [_, item]) => {\n const {options, filename} = item;\n const {title, icon} = options;\n\n return {\n ...aliases,\n [item.alias]: {\n path: filename,\n title,\n icon,\n },\n };\n }, {} as SidebarNameToManifest);\n }\n\n public clear(): this {\n this._view = undefined;\n\n return super.clear();\n }\n}\n"],"mappings":"AAAA,SAAQ,YAAW;AAEnB,SAAQ,8BAA6B;AAErC,SAAQ,qBAAoB;AAQ5B,MAAO,wBAAsB,cAAc;AAAA,EAC7B;AAAA,EAEH,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,OAAuC;AAC1C,WAAQ,KAAK,UAAL,KAAK,QAAU,IAAI,KAAK,KAAK,QAAQ,IAAI;AAAA,EACrD;AAAA,EAEA,MAAa,WAAiD;AAC1D,UAAM,QAAQ,MAAM,KAAK,MAAM;AAE/B,eAAW,EAAC,UAAU,QAAO,KAAK,MAAM,OAAO,GAAG;AAC9C,YAAM,EAAC,QAAQ,MAAM,OAAO,KAAI,IAAI;AAEpC,UAAI,OAAO;AACP,eAAO;AAAA,UACH,MAAM;AAAA,UACN,OAAO,uBAAuB,KAAK;AAAA,UACnC;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAAA,EAEA,MAAa,kBAAkD;AAC3D,WAAO,MAAM,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,MAAM;AACjE,YAAM,EAAC,SAAS,SAAQ,IAAI;AAC5B,YAAM,EAAC,OAAO,KAAI,IAAI;AAEtB,aAAO;AAAA,QACH,GAAG;AAAA,QACH,CAAC,KAAK,KAAK,GAAG;AAAA,UACV,MAAM;AAAA,UACN;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,GAAG,CAAC,CAA0B;AAAA,EAClC;AAAA,EAEO,QAAc;AACjB,SAAK,QAAQ;AAEb,WAAO,MAAM,MAAM;AAAA,EACvB;AACJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { FileBuilder } from "../../../plugins/typescript/index.js";
2
2
  import { ReadonlyConfig } from "../../../../types/config.js";
3
- export default class extends FileBuilder {
3
+ export default class SidebarDeclaration extends FileBuilder {
4
4
  protected alias: Set<string>;
5
5
  constructor(config: ReadonlyConfig);
6
6
  protected filename(): string;
@@ -1,5 +1,5 @@
1
1
  import { FileBuilder } from "./../../../../cli/plugins/typescript/index.js";
2
- class SidebarDeclaration_default extends FileBuilder {
2
+ class SidebarDeclaration extends FileBuilder {
3
3
  alias = /* @__PURE__ */ new Set();
4
4
  constructor(config) {
5
5
  super(config);
@@ -12,10 +12,10 @@ class SidebarDeclaration_default extends FileBuilder {
12
12
  }
13
13
  template() {
14
14
  let content = this.readFile();
15
- if (this.alias.size > 0) {
16
- const type = '"' + Array.from(this.alias).join('" | "') + '"';
17
- content = content.replace("type SidebarAlias = string", `type SidebarAlias = ${type}`);
18
- }
15
+ content = content.replace(
16
+ "// :sidebar-aliases",
17
+ Array.from(this.alias, (alias) => `${JSON.stringify(alias)}: true;`).join("\n ")
18
+ );
19
19
  return content;
20
20
  }
21
21
  setAlias(alias) {
@@ -24,6 +24,6 @@ class SidebarDeclaration_default extends FileBuilder {
24
24
  }
25
25
  }
26
26
  export {
27
- SidebarDeclaration_default as default
27
+ SidebarDeclaration as default
28
28
  };
29
29
  //# sourceMappingURL=SidebarDeclaration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/cli/plugins/sidebar/declaration/SidebarDeclaration.ts"],"sourcesContent":["import {FileBuilder} from \"@cli/plugins/typescript\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends FileBuilder {\n protected alias = new Set<string>();\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"sidebar.d.ts\";\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected template(): string {\n let content = this.readFile();\n\n if (this.alias.size > 0) {\n const type = '\"' + Array.from(this.alias).join('\" | \"') + '\"';\n\n content = content.replace(\"type SidebarAlias = string\", `type SidebarAlias = ${type}`);\n }\n\n return content;\n }\n\n public setAlias(alias: Set<string>): this {\n this.alias = alias;\n\n return this;\n }\n}\n"],"mappings":"AAAA,SAAQ,mBAAkB;AAI1B,MAAO,mCAAsB,YAAY;AAAA,EAC3B,QAAQ,oBAAI,IAAY;AAAA,EAElC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,QAAI,UAAU,KAAK,SAAS;AAE5B,QAAI,KAAK,MAAM,OAAO,GAAG;AACrB,YAAM,OAAO,MAAM,MAAM,KAAK,KAAK,KAAK,EAAE,KAAK,OAAO,IAAI;AAE1D,gBAAU,QAAQ,QAAQ,8BAA8B,uBAAuB,IAAI,EAAE;AAAA,IACzF;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,SAAS,OAA0B;AACtC,SAAK,QAAQ;AAEb,WAAO;AAAA,EACX;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/cli/plugins/sidebar/declaration/SidebarDeclaration.ts"],"sourcesContent":["import {FileBuilder} from \"@cli/plugins/typescript\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class SidebarDeclaration extends FileBuilder {\n protected alias = new Set<string>();\n\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"sidebar.d.ts\";\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected template(): string {\n let content = this.readFile();\n\n content = content.replace(\n \"// :sidebar-aliases\",\n Array.from(this.alias, alias => `${JSON.stringify(alias)}: true;`).join(\"\\n \")\n );\n\n return content;\n }\n\n public setAlias(alias: Set<string>): this {\n this.alias = alias;\n\n return this;\n }\n}\n"],"mappings":"AAAA,SAAQ,mBAAkB;AAI1B,MAAO,2BAAyC,YAAY;AAAA,EAC9C,QAAQ,oBAAI,IAAY;AAAA,EAElC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,QAAI,UAAU,KAAK,SAAS;AAE5B,cAAU,QAAQ;AAAA,MACd;AAAA,MACA,MAAM,KAAK,KAAK,OAAO,WAAS,GAAG,KAAK,UAAU,KAAK,CAAC,SAAS,EAAE,KAAK,YAAY;AAAA,IACxF;AAEA,WAAO;AAAA,EACX;AAAA,EAEO,SAAS,OAA0B;AACtC,SAAK,QAAQ;AAEb,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import ":package";
2
2
 
3
3
  declare module ":package" {
4
- export type SidebarAlias = string;
5
-
6
- export function changeSidebar(alias: SidebarAlias, tab?: number | chrome.tabs.Tab): Promise<void>;
4
+ export interface SidebarAliasRegistry {
5
+ // :sidebar-aliases
6
+ }
7
7
  }
@@ -1,9 +1,10 @@
1
- import { DefinePlugin, HtmlRspackPlugin } from "@rspack/core";
1
+ import { HtmlRspackPlugin } from "@rspack/core";
2
2
  import HtmlRspackTagsPlugin from "html-rspack-tags-plugin";
3
3
  import { definePlugin } from "./../../../main/plugin.js";
4
- import { EntrypointPlugin } from "./../../../cli/bundler/index.js";
4
+ import { EntrypointPlugin, GenerateModulePlugin } from "./../../../cli/bundler/index.js";
5
5
  import { virtualViewModule } from "./../../../cli/virtual/index.js";
6
6
  import Sidebar from "./Sidebar.js";
7
+ import { createSidebarModule, SidebarModuleName } from "./sidebar-module.js";
7
8
  import { SidebarDeclaration } from "./declaration/index.js";
8
9
  import { Command } from "./../../../types/app.js";
9
10
  import { SidebarAlternativeBrowsers } from "./../../../types/sidebar.js";
@@ -34,7 +35,7 @@ var sidebar_default = definePlugin(() => {
34
35
  build = false;
35
36
  }
36
37
  const plugins = [];
37
- let alias = /* @__PURE__ */ new Map();
38
+ let alias = {};
38
39
  if (build) {
39
40
  alias = await sidebar.manifestByAlias();
40
41
  const plugin = EntrypointPlugin.from(await sidebar.view().entries()).virtual((file) => virtualViewModule(file));
@@ -50,8 +51,8 @@ var sidebar_default = definePlugin(() => {
50
51
  }
51
52
  return {
52
53
  plugins: [
53
- new DefinePlugin({
54
- __ADNBN_SIDEBAR_MAP__: JSON.stringify(alias)
54
+ new GenerateModulePlugin({
55
+ [SidebarModuleName]: createSidebarModule(alias)
55
56
  }),
56
57
  ...plugins
57
58
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/sidebar/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, DefinePlugin, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {EntrypointPlugin} from \"@cli/bundler\";\nimport {virtualViewModule} from \"@cli/virtual/index.js\";\n\nimport Sidebar, {SidebarNameToManifest} from \"./Sidebar\";\n\nimport {SidebarDeclaration} from \"./declaration\";\n\nimport {Command} from \"@typing/app\";\nimport {SidebarAlternativeBrowsers} from \"@typing/sidebar\";\n\nexport default definePlugin(() => {\n let sidebar: Sidebar;\n let declaration: SidebarDeclaration;\n\n let sidebarAvailable: boolean = false;\n\n return {\n name: \"adnbn:sidebar\",\n startup: ({config}) => {\n sidebar = new Sidebar(config);\n declaration = new SidebarDeclaration(config);\n\n sidebarAvailable = SidebarAlternativeBrowsers.has(config.browser) || config.manifestVersion !== 2;\n },\n sidebar: () => sidebar.files(),\n bundler: async ({config}) => {\n declaration.setAlias(await sidebar.getAlias()).build();\n\n let build: boolean = true;\n\n if (await sidebar.empty()) {\n if (config.debug) {\n console.info(\"Sidebar entries not found\");\n }\n\n build = false;\n } else if (!sidebarAvailable) {\n if (config.debug) {\n console.warn(\"Sidebar not supported for manifest version 2\");\n }\n\n build = false;\n }\n\n const plugins: Plugins = [];\n\n let alias: SidebarNameToManifest = new Map();\n\n if (build) {\n alias = await sidebar.manifestByAlias();\n\n // prettier-ignore\n const plugin = EntrypointPlugin.from(await sidebar.view().entries())\n .virtual(file => virtualViewModule(file));\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.setAlias(await sidebar.clear().getAlias()).build();\n\n return sidebar.view().entries();\n });\n }\n\n const htmlPlugins = (await sidebar.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await sidebar.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new DefinePlugin({\n __ADNBN_SIDEBAR_MAP__: JSON.stringify(alias),\n }),\n ...plugins,\n ],\n } as RspackConfig;\n },\n manifest: async ({manifest, config}) => {\n if (!sidebarAvailable) {\n return;\n }\n\n manifest.setSidebar(await sidebar.manifest());\n manifest.appendCsp(await sidebar.csp());\n\n if ((await sidebar.exists()) && !SidebarAlternativeBrowsers.has(config.browser)) {\n manifest.addPermission(\"sidePanel\");\n }\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,cAAc,wBAAgC;AACrF,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAE3B,SAAQ,wBAAuB;AAC/B,SAAQ,yBAAwB;AAEhC,OAAO,aAAsC;AAE7C,SAAQ,0BAAyB;AAEjC,SAAQ,eAAc;AACtB,SAAQ,kCAAiC;AAEzC,IAAO,kBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,MAAI,mBAA4B;AAEhC,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,gBAAU,IAAI,QAAQ,MAAM;AAC5B,oBAAc,IAAI,mBAAmB,MAAM;AAE3C,yBAAmB,2BAA2B,IAAI,OAAO,OAAO,KAAK,OAAO,oBAAoB;AAAA,IACpG;AAAA,IACA,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,SAAS,MAAM,QAAQ,SAAS,CAAC,EAAE,MAAM;AAErD,UAAI,QAAiB;AAErB,UAAI,MAAM,QAAQ,MAAM,GAAG;AACvB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,2BAA2B;AAAA,QAC5C;AAEA,gBAAQ;AAAA,MACZ,WAAW,CAAC,kBAAkB;AAC1B,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,8CAA8C;AAAA,QAC/D;AAEA,gBAAQ;AAAA,MACZ;AAEA,YAAM,UAAmB,CAAC;AAE1B,UAAI,QAA+B,oBAAI,IAAI;AAE3C,UAAI,OAAO;AACP,gBAAQ,MAAM,QAAQ,gBAAgB;AAGtC,cAAM,SAAS,iBAAiB,KAAK,MAAM,QAAQ,KAAK,EAAE,QAAQ,CAAC,EAC9D,QAAQ,UAAQ,kBAAkB,IAAI,CAAC;AAE5C,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,SAAS,MAAM,QAAQ,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;AAE7D,mBAAO,QAAQ,KAAK,EAAE,QAAQ;AAAA,UAClC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC9F,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAElG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,aAAa;AAAA,YACb,uBAAuB,KAAK,UAAU,KAAK;AAAA,UAC/C,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,UAAU,OAAM,MAAM;AACpC,UAAI,CAAC,kBAAkB;AACnB;AAAA,MACJ;AAEA,eAAS,WAAW,MAAM,QAAQ,SAAS,CAAC;AAC5C,eAAS,UAAU,MAAM,QAAQ,IAAI,CAAC;AAEtC,UAAK,MAAM,QAAQ,OAAO,KAAM,CAAC,2BAA2B,IAAI,OAAO,OAAO,GAAG;AAC7E,iBAAS,cAAc,WAAW;AAAA,MACtC;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sidebar/index.ts"],"sourcesContent":["import {Configuration as RspackConfig, HtmlRspackPlugin, Plugins} from \"@rspack/core\";\nimport HtmlRspackTagsPlugin from \"html-rspack-tags-plugin\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {EntrypointPlugin, GenerateModulePlugin} from \"@cli/bundler\";\nimport {virtualViewModule} from \"@cli/virtual/index.js\";\n\nimport Sidebar, {SidebarNameToManifest} from \"./Sidebar\";\nimport {createSidebarModule, SidebarModuleName} from \"./sidebar-module\";\n\nimport {SidebarDeclaration} from \"./declaration\";\n\nimport {Command} from \"@typing/app\";\nimport {SidebarAlternativeBrowsers} from \"@typing/sidebar\";\n\nexport default definePlugin(() => {\n let sidebar: Sidebar;\n let declaration: SidebarDeclaration;\n\n let sidebarAvailable: boolean = false;\n\n return {\n name: \"adnbn:sidebar\",\n startup: ({config}) => {\n sidebar = new Sidebar(config);\n declaration = new SidebarDeclaration(config);\n\n sidebarAvailable = SidebarAlternativeBrowsers.has(config.browser) || config.manifestVersion !== 2;\n },\n sidebar: () => sidebar.files(),\n bundler: async ({config}) => {\n declaration.setAlias(await sidebar.getAlias()).build();\n\n let build: boolean = true;\n\n if (await sidebar.empty()) {\n if (config.debug) {\n console.info(\"Sidebar entries not found\");\n }\n\n build = false;\n } else if (!sidebarAvailable) {\n if (config.debug) {\n console.warn(\"Sidebar not supported for manifest version 2\");\n }\n\n build = false;\n }\n\n const plugins: Plugins = [];\n\n let alias: SidebarNameToManifest = {};\n\n if (build) {\n alias = await sidebar.manifestByAlias();\n\n // prettier-ignore\n const plugin = EntrypointPlugin.from(await sidebar.view().entries())\n .virtual(file => virtualViewModule(file));\n\n if (config.command === Command.Watch) {\n plugin.watch(async () => {\n declaration.setAlias(await sidebar.clear().getAlias()).build();\n\n return sidebar.view().entries();\n });\n }\n\n const htmlPlugins = (await sidebar.view().html()).map(options => new HtmlRspackPlugin(options));\n const tagsPlugins = (await sidebar.view().tags()).map(options => new HtmlRspackTagsPlugin(options));\n\n plugins.push(plugin, ...htmlPlugins, ...tagsPlugins);\n }\n\n return {\n plugins: [\n new GenerateModulePlugin({\n [SidebarModuleName]: createSidebarModule(alias),\n }),\n ...plugins,\n ],\n } as RspackConfig;\n },\n manifest: async ({manifest, config}) => {\n if (!sidebarAvailable) {\n return;\n }\n\n manifest.setSidebar(await sidebar.manifest());\n manifest.appendCsp(await sidebar.csp());\n\n if ((await sidebar.exists()) && !SidebarAlternativeBrowsers.has(config.browser)) {\n manifest.addPermission(\"sidePanel\");\n }\n },\n };\n});\n"],"mappings":"AAAA,SAAuC,wBAAgC;AACvE,OAAO,0BAA0B;AAEjC,SAAQ,oBAAmB;AAE3B,SAAQ,kBAAkB,4BAA2B;AACrD,SAAQ,yBAAwB;AAEhC,OAAO,aAAsC;AAC7C,SAAQ,qBAAqB,yBAAwB;AAErD,SAAQ,0BAAyB;AAEjC,SAAQ,eAAc;AACtB,SAAQ,kCAAiC;AAEzC,IAAO,kBAAQ,aAAa,MAAM;AAC9B,MAAI;AACJ,MAAI;AAEJ,MAAI,mBAA4B;AAEhC,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,CAAC,EAAC,OAAM,MAAM;AACnB,gBAAU,IAAI,QAAQ,MAAM;AAC5B,oBAAc,IAAI,mBAAmB,MAAM;AAE3C,yBAAmB,2BAA2B,IAAI,OAAO,OAAO,KAAK,OAAO,oBAAoB;AAAA,IACpG;AAAA,IACA,SAAS,MAAM,QAAQ,MAAM;AAAA,IAC7B,SAAS,OAAO,EAAC,OAAM,MAAM;AACzB,kBAAY,SAAS,MAAM,QAAQ,SAAS,CAAC,EAAE,MAAM;AAErD,UAAI,QAAiB;AAErB,UAAI,MAAM,QAAQ,MAAM,GAAG;AACvB,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,2BAA2B;AAAA,QAC5C;AAEA,gBAAQ;AAAA,MACZ,WAAW,CAAC,kBAAkB;AAC1B,YAAI,OAAO,OAAO;AACd,kBAAQ,KAAK,8CAA8C;AAAA,QAC/D;AAEA,gBAAQ;AAAA,MACZ;AAEA,YAAM,UAAmB,CAAC;AAE1B,UAAI,QAA+B,CAAC;AAEpC,UAAI,OAAO;AACP,gBAAQ,MAAM,QAAQ,gBAAgB;AAGtC,cAAM,SAAS,iBAAiB,KAAK,MAAM,QAAQ,KAAK,EAAE,QAAQ,CAAC,EAC9D,QAAQ,UAAQ,kBAAkB,IAAI,CAAC;AAE5C,YAAI,OAAO,YAAY,QAAQ,OAAO;AAClC,iBAAO,MAAM,YAAY;AACrB,wBAAY,SAAS,MAAM,QAAQ,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;AAE7D,mBAAO,QAAQ,KAAK,EAAE,QAAQ;AAAA,UAClC,CAAC;AAAA,QACL;AAEA,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,iBAAiB,OAAO,CAAC;AAC9F,cAAM,eAAe,MAAM,QAAQ,KAAK,EAAE,KAAK,GAAG,IAAI,aAAW,IAAI,qBAAqB,OAAO,CAAC;AAElG,gBAAQ,KAAK,QAAQ,GAAG,aAAa,GAAG,WAAW;AAAA,MACvD;AAEA,aAAO;AAAA,QACH,SAAS;AAAA,UACL,IAAI,qBAAqB;AAAA,YACrB,CAAC,iBAAiB,GAAG,oBAAoB,KAAK;AAAA,UAClD,CAAC;AAAA,UACD,GAAG;AAAA,QACP;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,UAAU,OAAO,EAAC,UAAU,OAAM,MAAM;AACpC,UAAI,CAAC,kBAAkB;AACnB;AAAA,MACJ;AAEA,eAAS,WAAW,MAAM,QAAQ,SAAS,CAAC;AAC5C,eAAS,UAAU,MAAM,QAAQ,IAAI,CAAC;AAEtC,UAAK,MAAM,QAAQ,OAAO,KAAM,CAAC,2BAA2B,IAAI,OAAO,OAAO,GAAG;AAC7E,iBAAS,cAAc,WAAW;AAAA,MACtC;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
@@ -0,0 +1,3 @@
1
+ import type { ManifestSidebar } from "../../../types/manifest.js";
2
+ export declare const SidebarModuleName = "#adnbn/sidebar";
3
+ export declare const createSidebarModule: (aliases: Record<string, ManifestSidebar>) => string;
@@ -0,0 +1,11 @@
1
+ const SidebarModuleName = "#adnbn/sidebar";
2
+ const createSidebarModule = (aliases) => (
3
+ // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.
4
+ `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});
5
+ `
6
+ );
7
+ export {
8
+ SidebarModuleName,
9
+ createSidebarModule
10
+ };
11
+ //# sourceMappingURL=sidebar-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/cli/plugins/sidebar/sidebar-module.ts"],"sourcesContent":["import type {ManifestSidebar} from \"@typing/manifest\";\n\nexport const SidebarModuleName = \"#adnbn/sidebar\";\n\nexport const createSidebarModule = (aliases: Record<string, ManifestSidebar>): string =>\n // Preserve own __proto__ keys and allow unused data to be removed from optimized bundles.\n `export const aliases = /*#__PURE__*/ JSON.parse(${JSON.stringify(JSON.stringify(aliases))});\\n`;\n"],"mappings":"AAEO,MAAM,oBAAoB;AAE1B,MAAM,sBAAsB,CAAC;AAAA;AAAA,EAEhC,mDAAmD,KAAK,UAAU,KAAK,UAAU,OAAO,CAAC,CAAC;AAAA;AAAA;","names":[]}
@@ -1,2 +1,3 @@
1
- declare const _default: import("../../../main/plugin.js").PluginDefinition<[]>;
1
+ import type { StylePluginOptions } from "./types.js";
2
+ declare const _default: import("../../../main/plugin.js").PluginDefinition<[(StylePluginOptions | undefined)?]>;
2
3
  export default _default;