@wix/cli-app 1.1.18 → 1.1.20

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 (124) hide show
  1. package/build/CreateVersionCommand-SW4ZOQ6N.js +4 -0
  2. package/build/{CreateVersionCommand-CHX2UWME.js.map → CreateVersionCommand-SW4ZOQ6N.js.map} +1 -1
  3. package/build/DevCommand-5ZXJQCYA.js +4 -0
  4. package/build/DevCommand-5ZXJQCYA.js.map +1 -0
  5. package/build/GenerateCommand-IJSMXTIA.js +99 -0
  6. package/build/GenerateCommand-IJSMXTIA.js.map +1 -0
  7. package/build/PreviewCommand-2MM4267L.js +4 -0
  8. package/build/{ServeCommand-XTHWLUDT.js → ServeCommand-QOKAYFJP.js} +2 -2
  9. package/build/ServeCommand-QOKAYFJP.js.map +1 -0
  10. package/build/build-FJY4BC54.js +4 -0
  11. package/build/build-FJY4BC54.js.map +1 -0
  12. package/build/chunk-3VQX7LRS.js +4 -0
  13. package/build/chunk-3VQX7LRS.js.map +1 -0
  14. package/build/chunk-423K4EW3.js +4 -0
  15. package/build/chunk-5OTJBADY.js +4 -0
  16. package/build/chunk-5OTJBADY.js.map +1 -0
  17. package/build/chunk-ALZJFJ23.js +4 -0
  18. package/build/chunk-ALZJFJ23.js.map +1 -0
  19. package/build/chunk-BMK5ZXHB.js +4 -0
  20. package/build/chunk-BMK5ZXHB.js.map +1 -0
  21. package/build/chunk-C632XAQG.js +23 -0
  22. package/build/chunk-C632XAQG.js.map +1 -0
  23. package/build/{chunk-RCDIKBVN.js → chunk-CTWRW76F.js} +36 -36
  24. package/build/chunk-CTWRW76F.js.map +1 -0
  25. package/build/{chunk-PYBYLDJB.js → chunk-ESE4L44D.js} +2 -2
  26. package/build/chunk-F2ZEWDAK.js +73 -0
  27. package/build/chunk-F2ZEWDAK.js.map +1 -0
  28. package/build/chunk-INHSYB3J.js +4 -0
  29. package/build/chunk-INHSYB3J.js.map +1 -0
  30. package/build/chunk-LNZPUJZM.js +11 -0
  31. package/build/chunk-LNZPUJZM.js.map +1 -0
  32. package/build/{chunk-HLCGKBPK.js → chunk-MZN364Q6.js} +2 -2
  33. package/build/{chunk-HLCGKBPK.js.map → chunk-MZN364Q6.js.map} +1 -1
  34. package/build/chunk-N5OCWMLI.js +4 -0
  35. package/build/chunk-N5OCWMLI.js.map +1 -0
  36. package/build/{chunk-S7NF452E.js → chunk-PCBMS46R.js} +2 -2
  37. package/build/{chunk-S7NF452E.js.map → chunk-PCBMS46R.js.map} +1 -1
  38. package/build/chunk-PYEFXRM2.js +87 -0
  39. package/build/chunk-PYEFXRM2.js.map +1 -0
  40. package/build/chunk-QZS4ARDD.js +4 -0
  41. package/build/chunk-QZS4ARDD.js.map +1 -0
  42. package/build/{chunk-QBIV5U5A.js → chunk-R2DHQREZ.js} +2 -2
  43. package/build/chunk-RIDNK3X3.js +4 -0
  44. package/build/chunk-RIDNK3X3.js.map +1 -0
  45. package/build/{chunk-BKNV2B7T.js → chunk-RPZCQEPB.js} +2 -2
  46. package/build/chunk-SARV44FW.js +6 -0
  47. package/build/chunk-SARV44FW.js.map +1 -0
  48. package/build/chunk-TTTQ7SZK.js +4 -0
  49. package/build/chunk-TTTQ7SZK.js.map +1 -0
  50. package/build/{chunk-HFDLXX7R.js → chunk-V4TR6DCM.js} +1 -1
  51. package/build/{chunk-5XZSJPLU.js → chunk-XTLXT6QW.js} +2 -2
  52. package/build/chunk-YKE3BZS3.js +27 -0
  53. package/build/chunk-YKE3BZS3.js.map +1 -0
  54. package/build/{devtools-WFBFD7GB.js → devtools-FITZMLEV.js} +2 -2
  55. package/build/devtools-FITZMLEV.js.map +1 -0
  56. package/build/{esm-QEHFRL6L.js → esm-IHGGGJ6T.js} +3 -3
  57. package/build/{esm-QEHFRL6L.js.map → esm-IHGGGJ6T.js.map} +1 -1
  58. package/build/index.js +14 -14
  59. package/build/index.js.map +1 -1
  60. package/build/preview-4GL6ALWD.js +4 -0
  61. package/build/preview-4GL6ALWD.js.map +1 -0
  62. package/build/{render-command-PDPDZKND.js → render-command-32GXLYY2.js} +2 -2
  63. package/build/{types.impl-HD4UTKFC.js → types.impl-L2DPGJ77.js} +2 -2
  64. package/build/types.impl-L2DPGJ77.js.map +1 -0
  65. package/package.json +13 -9
  66. package/schemas/custom-element.json +1 -1
  67. package/schemas/dashboard-menu-plugin.json +1 -1
  68. package/schemas/dashboard-modal.json +1 -1
  69. package/schemas/dashboard-page.json +1 -1
  70. package/schemas/dashboard-plugin.json +1 -1
  71. package/schemas/embedded-script.json +1 -1
  72. package/schemas/wix-config.json +1 -1
  73. package/templates/custom-element/element.tsx.ejs +27 -4
  74. package/templates/custom-element/panel.tsx.ejs +43 -6
  75. package/build/CreateVersionCommand-CHX2UWME.js +0 -4
  76. package/build/DevCommand-TKHJTH22.js +0 -4
  77. package/build/DevCommand-TKHJTH22.js.map +0 -1
  78. package/build/GenerateCommand-PIRMS3PT.js +0 -99
  79. package/build/GenerateCommand-PIRMS3PT.js.map +0 -1
  80. package/build/PreviewCommand-2DQ252RA.js +0 -4
  81. package/build/PreviewCommand-2DQ252RA.js.map +0 -1
  82. package/build/ServeCommand-XTHWLUDT.js.map +0 -1
  83. package/build/build-QLE4H4H2.js +0 -4
  84. package/build/build-QLE4H4H2.js.map +0 -1
  85. package/build/chunk-3L5LQKB7.js +0 -4
  86. package/build/chunk-3L5LQKB7.js.map +0 -1
  87. package/build/chunk-6OPLPT2G.js +0 -87
  88. package/build/chunk-6OPLPT2G.js.map +0 -1
  89. package/build/chunk-6R3ZFQVO.js +0 -27
  90. package/build/chunk-6R3ZFQVO.js.map +0 -1
  91. package/build/chunk-7JJKVPKL.js +0 -6
  92. package/build/chunk-7JJKVPKL.js.map +0 -1
  93. package/build/chunk-BGSKNKJF.js +0 -4
  94. package/build/chunk-BGSKNKJF.js.map +0 -1
  95. package/build/chunk-LZ4SXWLW.js +0 -11
  96. package/build/chunk-LZ4SXWLW.js.map +0 -1
  97. package/build/chunk-O4DV7EH5.js +0 -4
  98. package/build/chunk-O4DV7EH5.js.map +0 -1
  99. package/build/chunk-PE3RXVKE.js +0 -4
  100. package/build/chunk-PE3RXVKE.js.map +0 -1
  101. package/build/chunk-RCDIKBVN.js.map +0 -1
  102. package/build/chunk-RDIPEKL2.js +0 -23
  103. package/build/chunk-RDIPEKL2.js.map +0 -1
  104. package/build/chunk-SIP7BHV7.js +0 -4
  105. package/build/chunk-TBT2V5T7.js +0 -4
  106. package/build/chunk-TBT2V5T7.js.map +0 -1
  107. package/build/chunk-UQ7NP6NA.js +0 -4
  108. package/build/chunk-UQ7NP6NA.js.map +0 -1
  109. package/build/chunk-XHPVJXDY.js +0 -73
  110. package/build/chunk-XHPVJXDY.js.map +0 -1
  111. package/build/chunk-XYNUUMC2.js +0 -4
  112. package/build/chunk-XYNUUMC2.js.map +0 -1
  113. package/build/devtools-WFBFD7GB.js.map +0 -1
  114. package/build/preview-LQ6YX5QD.js +0 -4
  115. package/build/preview-LQ6YX5QD.js.map +0 -1
  116. package/schemas/dashboard-sidebar-category.json +0 -1
  117. /package/build/{types.impl-HD4UTKFC.js.map → PreviewCommand-2MM4267L.js.map} +0 -0
  118. /package/build/{chunk-SIP7BHV7.js.map → chunk-423K4EW3.js.map} +0 -0
  119. /package/build/{chunk-PYBYLDJB.js.map → chunk-ESE4L44D.js.map} +0 -0
  120. /package/build/{chunk-QBIV5U5A.js.map → chunk-R2DHQREZ.js.map} +0 -0
  121. /package/build/{chunk-BKNV2B7T.js.map → chunk-RPZCQEPB.js.map} +0 -0
  122. /package/build/{chunk-HFDLXX7R.js.map → chunk-V4TR6DCM.js.map} +0 -0
  123. /package/build/{chunk-5XZSJPLU.js.map → chunk-XTLXT6QW.js.map} +0 -0
  124. /package/build/{render-command-PDPDZKND.js.map → render-command-32GXLYY2.js.map} +0 -0
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as m}from"./chunk-XYNUUMC2.js";import"./chunk-3L5LQKB7.js";import"./chunk-UQ7NP6NA.js";import"./chunk-TBT2V5T7.js";import"./chunk-PYBYLDJB.js";import"./chunk-RDIPEKL2.js";import"./chunk-QBIV5U5A.js";import"./chunk-PE3RXVKE.js";import"./chunk-BKNV2B7T.js";import"./chunk-6R3ZFQVO.js";import"./chunk-6OPLPT2G.js";import"./chunk-O4DV7EH5.js";import"./chunk-XHPVJXDY.js";import"./chunk-7JJKVPKL.js";import{h as e}from"./chunk-HFDLXX7R.js";e();export{m as PreviewCommand};
4
- //# sourceMappingURL=PreviewCommand-2DQ252RA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/PreviewCommand/index.ts"],"sourcesContent":["export { PreviewCommand } from './PreviewCommand.js';\n"],"mappings":";;4bAAAA","names":["init_esm_shims"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ServeCommand/index.ts","../src/components/ServeCommand/ServeCommand.tsx","../src/components/ServeCommand/ServeEnvironment.tsx","../src/components/ServeCommand/hooks/usePreviewServer.ts","../src/components/ServeCommand/ServeCommandScreen.tsx"],"sourcesContent":["export { ServeCommand } from './ServeCommand.js';\nexport {\n ServeEnvironmentProvider,\n useServeEnvironment,\n} from './ServeEnvironment.js';\n","import React, { type FC } from 'react';\nimport { SiteIdProvider } from '../../site-id/SiteIdProvider.js';\nimport { ServeEnvironmentProvider } from './ServeEnvironment.js';\nimport { ServeCommandScreen } from './ServeCommandScreen.js';\n\nexport const ServeCommand: FC = () => {\n return (\n <SiteIdProvider>\n <ServeEnvironmentProvider>\n <ServeCommandScreen />\n </ServeEnvironmentProvider>\n </SiteIdProvider>\n );\n};\n","import React, {\n type FC,\n type ReactNode,\n createContext,\n useContext,\n} from 'react';\nimport { match } from 'variant';\nimport { updateAppManifestWithBaseUrl } from '@wix/cli-app-manifest';\nimport { useARMClient } from '@wix/arm-client';\nimport { Spinner, useAsync } from '@wix/cli-ui-kit';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { ArmTagProvider } from '../../context/armTag.js';\nimport { readAppManifestFile } from '../../app-manifest/file.js';\nimport { assertBuildOutputExists } from '../../files/assert-build-output-exists.js';\nimport { usePreviewServer } from './hooks/usePreviewServer.js';\nimport { useProjectModel } from '../../model.js';\n\ntype ServeEnvironment = {\n serverUrl: string;\n};\n\nconst ServeEnvironmentContext = createContext<ServeEnvironment | null>(null);\n\nexport const ServeEnvironmentProvider: FC<{\n children: ReactNode;\n}> = ({ children }) => {\n const { model } = useProjectModel();\n const { t } = useTranslation();\n const arm = useARMClient();\n const createPreviewServer = usePreviewServer();\n\n const { status } = useAsync(async () => {\n await assertBuildOutputExists(model.projectFolder);\n const serverUrl = await createPreviewServer();\n\n const manifest = await readAppManifestFile(model.projectFolder);\n const updatedManifest = updateAppManifestWithBaseUrl(manifest, serverUrl);\n\n const armTag = await arm.createAppRelease(\n updatedManifest,\n model.config.projectId\n );\n\n return { armTag, serverUrl };\n }, []);\n\n return match(status, {\n Error: () => null,\n Loading: () => (\n <Spinner text={t('serve_command.starting_serve_environment')}></Spinner>\n ),\n Success: ({ result: { armTag, serverUrl } }) => (\n <ServeEnvironmentContext.Provider value={{ serverUrl }}>\n <ArmTagProvider armTag={armTag}>{children}</ArmTagProvider>\n </ServeEnvironmentContext.Provider>\n ),\n });\n};\n\nexport function useServeEnvironment(): ServeEnvironment {\n const context = useContext(ServeEnvironmentContext);\n if (context === null) {\n throw new Error(\n 'useServeEnvironment() cannot be used without an <ServeEnvironmentProvider>'\n );\n }\n return context;\n}\n","import { preview, type PreviewServer } from 'vite';\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useProjectModel } from '../../../model.js';\nimport { getViteConfig } from '../../../vite/index.js';\nimport { getViteServerUrl } from '../../../vite/vite-server-url.js';\nimport { ConfigType } from '../../../vite/vite-config-options.js';\n\nexport function usePreviewServer() {\n const previewServerRef = useRef<PreviewServer>();\n const { model } = useProjectModel();\n\n useEffect(() => {\n return () => {\n previewServerRef.current?.httpServer.close();\n };\n }, []);\n\n return useCallback(async () => {\n const previewServer = await preview(\n await getViteConfig(model, { type: ConfigType.build })\n );\n\n previewServerRef.current = previewServer;\n\n return getViteServerUrl(previewServer);\n }, [model]);\n}\n","import {\n Box,\n InfoIcon,\n Link,\n PointerIcon,\n SuccessIcon,\n Text,\n} from '@wix/cli-ui-kit';\nimport React from 'react';\nimport { Trans } from '@wix/cli-i18n';\nimport { useSiteId } from '../../site-id/useSiteId.js';\nimport { useServeEnvironment } from './ServeEnvironment.js';\nimport { PlatformViewer } from '../extensions/PlatformViewer.js';\n\nexport function ServeCommandScreen() {\n const { site } = useSiteId();\n const { serverUrl } = useServeEnvironment();\n\n return (\n <Box flexDirection=\"column\">\n <Box gap={1}>\n <Text skin=\"success\">\n <SuccessIcon />\n </Text>\n <Trans\n i18nKey=\"serve_command.starting_serve_environment_success\"\n components={[<Link url={serverUrl} />]}\n />\n </Box>\n <Box gap={1}>\n <InfoIcon />\n <Trans i18nKey=\"serve_command.production_build\" />\n </Box>\n <Box gap={1} paddingTop={1} paddingBottom={1}>\n <PointerIcon />\n <Trans\n i18nKey=\"general.dev_site.current\"\n values={{ name: site.displayName }}\n />\n </Box>\n <Box paddingBottom={1} flexDirection=\"column\">\n <PlatformViewer />\n </Box>\n </Box>\n );\n}\n"],"mappings":"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","names":["init_esm_shims","init_esm_shims","React","init_esm_shims","import_variant","React","createContext","useContext","init_esm_shims","preview","useCallback","useEffect","useRef","usePreviewServer","previewServerRef","useRef","model","useProjectModel","useEffect","useCallback","previewServer","preview","getViteConfig","getViteServerUrl","ServeEnvironmentContext","createContext","ServeEnvironmentProvider","children","model","useProjectModel","t","useTranslation","arm","useARMClient","createPreviewServer","usePreviewServer","status","useAsync","assertBuildOutputExists","serverUrl","manifest","readAppManifestFile","updatedManifest","updateAppManifestWithBaseUrl","React","Spinner","armTag","ArmTagProvider","useServeEnvironment","context","useContext","init_esm_shims","React","ServeCommandScreen","site","useSiteId","serverUrl","useServeEnvironment","React","Box_default","Text","SuccessIcon","Trans","Link","InfoIcon","PointerIcon","PlatformViewer","ServeCommand","React","SiteIdProvider","ServeEnvironmentProvider","ServeCommandScreen"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as m,b as c,c as a}from"./chunk-BGSKNKJF.js";import{b as n}from"./chunk-RCDIKBVN.js";import{a as p}from"./chunk-QBIV5U5A.js";import"./chunk-O4DV7EH5.js";import{na as i}from"./chunk-XHPVJXDY.js";import{c as t,d as e}from"./chunk-7JJKVPKL.js";import{h as r}from"./chunk-HFDLXX7R.js";r();import{cwd as f}from"node:process";import{build as s}from"vite";async function S(){let o=await i(f());if(o.components.length===0)throw new t({code:e.NoExtensionsFound()});m(o.components);let d=await s(await n(o,{type:"build"})).catch(()=>{throw new t({code:e.FailedToBuildApp()})}),l=await c({appId:o.config.appId,components:o.components,sentryDSN:o.config.sentryDSN,componentSourceBuilder:a({model:o,buildOutput:d})});await p({projectFolder:o.projectFolder,manifest:l})}export{S as build};
4
- //# sourceMappingURL=build-QLE4H4H2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/build.ts"],"sourcesContent":["import { cwd } from 'node:process';\nimport { build as viteBuild } from 'vite';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { loadProjectModel } from './model.js';\nimport { getViteConfig } from './vite/index.js';\nimport { writeAppManifestFile } from './app-manifest/file.js';\nimport { createAppManifest } from './app-manifest/create.js';\nimport { getComponentSourceBuilder } from './app-manifest/component-source.js';\nimport { ConfigType } from './vite/vite-config-options.js';\nimport { validateComponents } from './app-manifest/validate.js';\n\nexport async function build() {\n const projectModel = await loadProjectModel(cwd());\n\n // Validate before building the project, to fail fast in case of a validation issue\n if (projectModel.components.length === 0) {\n throw new CliError({\n code: CliErrorCode.NoExtensionsFound(),\n });\n }\n validateComponents(projectModel.components);\n const buildOutput = await viteBuild(\n await getViteConfig(projectModel, { type: ConfigType.build })\n ).catch(() => {\n throw new CliError({\n code: CliErrorCode.FailedToBuildApp(),\n });\n });\n\n const manifest = await createAppManifest({\n appId: projectModel.config.appId,\n components: projectModel.components,\n sentryDSN: projectModel.config.sentryDSN,\n componentSourceBuilder: getComponentSourceBuilder({\n model: projectModel,\n buildOutput,\n }),\n });\n\n await writeAppManifestFile({\n projectFolder: projectModel.projectFolder,\n manifest,\n });\n}\n"],"mappings":";;kSAAAA,IAAA,OAAS,OAAAC,MAAW,eACpB,OAAS,SAASC,MAAiB,OAUnC,eAAsBC,GAAQ,CAC5B,IAAMC,EAAe,MAAMC,EAAiBC,EAAI,CAAC,EAGjD,GAAIF,EAAa,WAAW,SAAW,EACrC,MAAM,IAAIG,EAAS,CACjB,KAAMC,EAAa,kBAAkB,CACvC,CAAC,EAEHC,EAAmBL,EAAa,UAAU,EAC1C,IAAMM,EAAc,MAAMC,EACxB,MAAMC,EAAcR,EAAc,CAAE,YAAuB,CAAC,CAC9D,EAAE,MAAM,IAAM,CACZ,MAAM,IAAIG,EAAS,CACjB,KAAMC,EAAa,iBAAiB,CACtC,CAAC,CACH,CAAC,EAEKK,EAAW,MAAMC,EAAkB,CACvC,MAAOV,EAAa,OAAO,MAC3B,WAAYA,EAAa,WACzB,UAAWA,EAAa,OAAO,UAC/B,uBAAwBW,EAA0B,CAChD,MAAOX,EACP,YAAAM,CACF,CAAC,CACH,CAAC,EAED,MAAMM,EAAqB,CACzB,cAAeZ,EAAa,cAC5B,SAAAS,CACF,CAAC,CACH","names":["init_esm_shims","cwd","viteBuild","build","projectModel","loadProjectModel","cwd","CliError","CliErrorCode","validateComponents","buildOutput","viteBuild","getViteConfig","manifest","createAppManifest","getComponentSourceBuilder","writeAppManifestFile"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{b as y}from"./chunk-TBT2V5T7.js";import{l as C,m as L,n as d}from"./chunk-PE3RXVKE.js";import{A as p,B,d as i,g as h,j as f,s as b}from"./chunk-6OPLPT2G.js";import{F as w,I as E,K as t,f as m}from"./chunk-XHPVJXDY.js";import{c as g,d as P}from"./chunk-7JJKVPKL.js";import{h as s}from"./chunk-HFDLXX7R.js";s();async function S(o){let e=w(o),n=E(o);if(!await m(e)||!await m(n))throw new g({code:P.BuiltProjectNeeded()})}s();import r from"react";var a=({url:o,label:e,withPointer:n=!0})=>r.createElement(i,null,r.createElement(i,{marginRight:1},n&&r.createElement(f,null),r.createElement(i,{marginLeft:1},r.createElement(b,{url:o},e)))),j=()=>{let{t:o}=B(),{isPlatformExists:e,hasSinglePlatform:n,dashboardExtensions:u}=y(),l=C(),x=v=>L({envConfig:l,platformType:v});return r.createElement(r.Fragment,null,n(t.Dashboard())?r.createElement(i,{flexDirection:"row"},r.createElement(p,{i18nKey:"general.open_preview.title_single"}),r.createElement(a,{withPointer:!1,url:d({envConfig:l,extension:u[0]}),label:o("general.platform.dashboard")})):r.createElement(i,{flexDirection:"column"},r.createElement(p,{i18nKey:"general.open_preview.title_multiple"}),r.createElement(i,{paddingLeft:2,flexDirection:"column"},e(t.Site())&&(l.site.viewUrl?r.createElement(a,{url:x(t.Site()),label:o("general.platform.site")}):r.createElement(i,{marginRight:1},r.createElement(f,null),r.createElement(i,{marginLeft:1},r.createElement(h,{skin:"secondary",underline:!0},o("general.platform.unpublished_site"))))),e(t.Editor())&&r.createElement(a,{url:x(t.Editor()),label:o("general.platform.editor")}),e(t.Dashboard())&&r.createElement(a,{url:d({envConfig:l,extension:u[0]}),label:o("general.platform.dashboard")}))))};export{j as a,S as b};
4
- //# sourceMappingURL=chunk-3L5LQKB7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/files/assert-build-output-exists.ts","../src/components/extensions/PlatformViewer.tsx"],"sourcesContent":["import { pathExists } from '@wix/cli-fs';\nimport {\n getAppBuildFolder,\n getAppManifestPath,\n} from '@wix/cli-app-definitions';\nimport { CliErrorCode, CliError } from '@wix/cli-error';\n\nexport async function assertBuildOutputExists(projectFolder: string) {\n const buildFolder = getAppBuildFolder(projectFolder);\n const manifestPath = getAppManifestPath(projectFolder);\n\n if (!(await pathExists(buildFolder)) || !(await pathExists(manifestPath))) {\n throw new CliError({\n code: CliErrorCode.BuiltProjectNeeded(),\n });\n }\n}\n","import React, { type FC } from 'react';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { Box, Link, PointerSmallIcon, Text } from '@wix/cli-ui-kit';\nimport { PlatformType } from '@wix/cli-app-definitions';\nimport { useExtensions } from './useExtensions.js';\nimport {\n resolveDashboardExtensionUrl,\n resolvePlatformUrl,\n useEnvConfig,\n} from './utils.js';\n\ntype PlatformLinkProps = {\n url: string;\n label: string;\n withPointer?: boolean;\n};\n\nexport const PlatformLink: FC<PlatformLinkProps> = ({\n url,\n label,\n withPointer = true,\n}) => {\n return (\n <Box>\n <Box marginRight={1}>\n {withPointer && <PointerSmallIcon />}\n <Box marginLeft={1}>\n <Link url={url}>{label}</Link>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport const PlatformViewer: FC = () => {\n const { t } = useTranslation();\n const { isPlatformExists, hasSinglePlatform, dashboardExtensions } =\n useExtensions();\n const envConfig = useEnvConfig();\n\n const getPlatformUrl = (platformType: PlatformType) =>\n resolvePlatformUrl({\n envConfig,\n platformType,\n });\n\n return (\n <>\n {hasSinglePlatform(PlatformType.Dashboard()) ? (\n <Box flexDirection=\"row\">\n <Trans i18nKey=\"general.open_preview.title_single\" />\n <PlatformLink\n withPointer={false}\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n </Box>\n ) : (\n <Box flexDirection=\"column\">\n <Trans i18nKey=\"general.open_preview.title_multiple\" />\n <Box paddingLeft={2} flexDirection=\"column\">\n {isPlatformExists(PlatformType.Site()) &&\n (envConfig.site.viewUrl ? (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Site())}\n label={t('general.platform.site')}\n />\n ) : (\n <Box marginRight={1}>\n <PointerSmallIcon />\n <Box marginLeft={1}>\n <Text skin=\"secondary\" underline>\n {t('general.platform.unpublished_site')}\n </Text>\n </Box>\n </Box>\n ))}\n {isPlatformExists(PlatformType.Editor()) && (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Editor())}\n label={t('general.platform.editor')}\n />\n )}\n {isPlatformExists(PlatformType.Dashboard()) && (\n <PlatformLink\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n )}\n </Box>\n </Box>\n )}\n </>\n );\n};\n"],"mappings":";;wTAAAA,IAOA,eAAsBC,EAAwBC,EAAuB,CACnE,IAAMC,EAAcC,EAAkBF,CAAa,EAC7CG,EAAeC,EAAmBJ,CAAa,EAErD,GAAI,CAAE,MAAMK,EAAWJ,CAAW,GAAM,CAAE,MAAMI,EAAWF,CAAY,EACrE,MAAM,IAAIG,EAAS,CACjB,KAAMC,EAAa,mBAAmB,CACxC,CAAC,CAEL,CChBAC,IAAA,OAAOC,MAAwB,QAiBxB,IAAMC,EAAsC,CAAC,CAClD,IAAAC,EACA,MAAAC,EACA,YAAAC,EAAc,EAChB,IAEIC,EAAA,cAACC,EAAA,KACCD,EAAA,cAACC,EAAA,CAAI,YAAa,GACfF,GAAeC,EAAA,cAACE,EAAA,IAAiB,EAClCF,EAAA,cAACC,EAAA,CAAI,WAAY,GACfD,EAAA,cAACG,EAAA,CAAK,IAAKN,GAAMC,CAAM,CACzB,CACF,CACF,EAISM,EAAqB,IAAM,CACtC,GAAM,CAAE,EAAAC,CAAE,EAAIC,EAAe,EACvB,CAAE,iBAAAC,EAAkB,kBAAAC,EAAmB,oBAAAC,CAAoB,EAC/DC,EAAc,EACVC,EAAYC,EAAa,EAEzBC,EAAkBC,GACtBC,EAAmB,CACjB,UAAAJ,EACA,aAAAG,CACF,CAAC,EAEH,OACEd,EAAA,cAAAA,EAAA,cACGQ,EAAkBQ,EAAa,UAAU,CAAC,EACzChB,EAAA,cAACC,EAAA,CAAI,cAAc,OACjBD,EAAA,cAACiB,EAAA,CAAM,QAAQ,oCAAoC,EACnDjB,EAAA,cAACJ,EAAA,CACC,YAAa,GACb,IAAKsB,EAA6B,CAChC,UAAAP,EACA,UAAWF,EAAoB,CAAC,CAClC,CAAC,EACD,MAAOJ,EAAE,4BAA4B,EACvC,CACF,EAEAL,EAAA,cAACC,EAAA,CAAI,cAAc,UACjBD,EAAA,cAACiB,EAAA,CAAM,QAAQ,sCAAsC,EACrDjB,EAAA,cAACC,EAAA,CAAI,YAAa,EAAG,cAAc,UAChCM,EAAiBS,EAAa,KAAK,CAAC,IAClCL,EAAU,KAAK,QACdX,EAAA,cAACJ,EAAA,CACC,IAAKiB,EAAeG,EAAa,KAAK,CAAC,EACvC,MAAOX,EAAE,uBAAuB,EAClC,EAEAL,EAAA,cAACC,EAAA,CAAI,YAAa,GAChBD,EAAA,cAACE,EAAA,IAAiB,EAClBF,EAAA,cAACC,EAAA,CAAI,WAAY,GACfD,EAAA,cAACmB,EAAA,CAAK,KAAK,YAAY,UAAS,IAC7Bd,EAAE,mCAAmC,CACxC,CACF,CACF,GAEHE,EAAiBS,EAAa,OAAO,CAAC,GACrChB,EAAA,cAACJ,EAAA,CACC,IAAKiB,EAAeG,EAAa,OAAO,CAAC,EACzC,MAAOX,EAAE,yBAAyB,EACpC,EAEDE,EAAiBS,EAAa,UAAU,CAAC,GACxChB,EAAA,cAACJ,EAAA,CACC,IAAKsB,EAA6B,CAChC,UAAAP,EACA,UAAWF,EAAoB,CAAC,CAClC,CAAC,EACD,MAAOJ,EAAE,4BAA4B,EACvC,CAEJ,CACF,CAEJ,CAEJ","names":["init_esm_shims","assertBuildOutputExists","projectFolder","buildFolder","getAppBuildFolder","manifestPath","getAppManifestPath","pathExists","CliError","CliErrorCode","init_esm_shims","React","PlatformLink","url","label","withPointer","React","Box_default","PointerSmallIcon","Link","PlatformViewer","t","useTranslation","isPlatformExists","hasSinglePlatform","dashboardExtensions","useExtensions","envConfig","useEnvConfig","getPlatformUrl","platformType","resolvePlatformUrl","PlatformType","Trans","resolveDashboardExtensionUrl","Text"]}