@emailmaker/emailmaker 1.1.85-dev.2 → 1.1.85-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/{emailmaker-core.aebc6ea7.js → emailmaker-core.273a13d0.js} +8 -8
- package/emailmaker-esm.js +10 -10
- package/{emailmaker-po.aebc6ea7.js → emailmaker-po.273a13d0.js} +1 -1
- package/emailmaker.js +11 -11
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/{discussHandlers.kGLogf6J.js → discussHandlers.Cn70h-Yt.js} +2 -2
- package/iframe/js/iframe-eblock.body.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.body.js +2 -2
- package/iframe/js/iframe.js +1 -1
- package/node_modules/@emailmaker/ui-kit/package.json +1 -1
- package/package.json +2 -2
- package/runtime/react/index.js +1 -1
- package/static/core/{60ec410f.js → 1655f40f.js} +1 -1
- package/static/core/{cebcf9a5.js → 2e39454c.js} +1 -1
- package/static/core/{fbccd907.js → 4138a1b9.js} +3 -3
- package/static/core/{c2e6de6c.js → 4598405b.js} +1 -1
- package/static/core/{a42770c7.js → 47e97e35.js} +1 -1
- package/static/core/{98a65bf6.js → 5c7e24b5.js} +1 -1
- package/static/core/{50109143.js → 72a579ec.js} +1 -1
- package/static/core/{1de56f23.js → 7b7c0c8c.js} +1 -1
- package/static/core/{6748af4b.js → 9a285b6a.js} +1 -1
- package/static/core/{44829f84.js → a215213f.js} +1 -1
- package/static/core/{613d8a7a.js → a6fed2cf.js} +6 -6
- package/static/core/{65870018.js → b73e046e.js} +1 -1
- package/static/core/{d1b67ebe.js → b9758690.js} +1 -1
- package/static/core/{56d131f3.js → bf9d8272.js} +1 -1
- package/static/core/{17461e5e.js → cc50fc65.js} +1 -1
- package/static/core/{649bbe61.js → d2342090.js} +1 -1
- package/static/core/{dea46f93.js → de611927.js} +1 -1
- package/static/core/{a984d7cb.js → e2f501f0.js} +1 -1
- package/static/core/{9388c451.js → e9fd7972.js} +1 -1
- package/static/core/{ddf40214.js → ebeee027.js} +1 -1
- package/static/core/{88f21f92.js → f0fb869f.js} +1 -1
- package/static/core/{bf8b37be.js → f4a519b0.js} +1 -1
- package/static/core/{c7d949de.js → fabc717f.js} +1 -1
- package/static/umd-runtime/runtime.js +1 -1
- package/vite/index.cjs +100 -5
- package/vite/index.js +100 -5
- package/webpack/index.cjs +93 -0
- package/webpack/index.js +93 -0
- /package/iframe/{iframe-eblock.aebc6ea7.html → iframe-eblock.273a13d0.html} +0 -0
- /package/iframe/{iframe.aebc6ea7.html → iframe.273a13d0.html} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/
|
|
1
|
+
__emailmaker__.define("static/core/f4a519b0.js",["require","exports","module","static/core/5dc34752.js","static/core/8ca96066.js"],function(n,p,g){const $=n("./5dc34752.js"),u=n("./8ca96066.js");var d={items_per_page:"na stronę",jump_to:"Idź do",jump_to_confirm:"potwierdź",page:"",prev_page:"Poprzednia strona",next_page:"Następna strona",prev_5:"Poprzednie 5 stron",next_5:"Następne 5 stron",prev_3:"Poprzednie 3 strony",next_3:"Następne 3 strony",page_size:"rozmiar strony"};function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(a)}function l(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter(function(j){return Object.getOwnPropertyDescriptor(a,j).enumerable})),t.push.apply(t,i)}return t}function s(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?l(Object(t),!0).forEach(function(i){y(a,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(t,i))})}return a}function y(a,e,t){return e=b(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function b(a){var e=w(a,"string");return o(e)=="symbol"?e:String(e)}function w(a,e){if(o(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var i=t.call(a,e||"default");if(o(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var z=s(s({},u.commonLocale),{},{locale:"pl_PL",today:"Dzisiaj",now:"Teraz",backToToday:"Ustaw dzisiaj",ok:"OK",clear:"Wyczyść",week:"Tydzień",month:"Miesiąc",year:"Rok",timeSelect:"Ustaw czas",dateSelect:"Ustaw datę",monthSelect:"Wybierz miesiąc",yearSelect:"Wybierz rok",decadeSelect:"Wybierz dekadę",previousMonth:"Poprzedni miesiąc (PageUp)",nextMonth:"Następny miesiąc (PageDown)",previousYear:"Ostatni rok (Ctrl + left)",nextYear:"Następny rok (Ctrl + right)",previousDecade:"Ostatnia dekada",nextDecade:"Następna dekada",previousCentury:"Ostatni wiek",nextCentury:"Następny wiek"}),c={placeholder:"Wybierz godzinę",rangePlaceholder:["Czas rozpoczęcia","Czas zakończenia"]},m={lang:{placeholder:"Wybierz datę",rangePlaceholder:["Data początkowa","Data końcowa"],yearFormat:"YYYY",monthFormat:"MMMM",monthBeforeYear:!0,shortWeekDays:["Niedz","Pon","Wt","Śr","Czw","Pt","Sob"],shortMonths:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],...z},timePickerLocale:{...c}},f=m,r="${label} nie posiada poprawnej wartości dla typu ${type}",k={locale:"pl",Pagination:d,DatePicker:m,TimePicker:c,Calendar:f,global:{placeholder:"Wybierz",close:"Zamknij"},Table:{filterTitle:"Menu filtra",filterConfirm:"OK",filterReset:"Usuń filtry",filterEmptyText:"Brak filtrów",filterCheckAll:"Wybierz wszystkie elementy",filterSearchPlaceholder:"Szukaj w filtrach",emptyText:"Brak danych",selectAll:"Zaznacz bieżącą stronę",selectInvert:"Odwróć zaznaczenie",selectNone:"Wyczyść",selectionAll:"Wybierz wszystkie",sortTitle:"Sortowanie",expand:"Rozwiń wiersz",collapse:"Zwiń wiersz",triggerDesc:"Sortuj malejąco",triggerAsc:"Sortuj rosnąco",cancelSort:"Usuń sortowanie"},Tour:{Next:"Dalej",Previous:"Wróć",Finish:"Zakończ"},Modal:{okText:"OK",cancelText:"Anuluj",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Anuluj"},Transfer:{titles:["",""],searchPlaceholder:"Szukaj",itemUnit:"obiekt",itemsUnit:"obiekty",remove:"Usuń",selectCurrent:"Wybierz aktualną stronę",removeCurrent:"Usuń aktualną stronę",selectAll:"Wybierz wszystkie",removeAll:"Usuń wszystkie",selectInvert:"Odwróć wybór"},Upload:{uploading:"Wysyłanie...",removeFile:"Usuń plik",uploadError:"Błąd wysyłania",previewFile:"Podejrzyj plik",downloadFile:"Pobieranie pliku"},Empty:{description:"Brak danych"},Icon:{icon:"Ikona"},Text:{edit:"Edytuj",copy:"Kopiuj",copied:"Skopiowany",expand:"Rozwiń"},Form:{optional:"(opcjonalne)",defaultValidateMessages:{default:"Błąd walidacji dla pola ${label}",required:"Pole ${label} jest wymagane",enum:"Pole ${label} musi posiadać wartość z listy: [${enum}]",whitespace:"Pole ${label} nie może być puste",date:{format:"${label} posiada zły format daty",parse:"${label} nie może zostać zinterpretowane jako data",invalid:"${label} jest niepoprawną datą"},types:{string:r,method:r,array:r,object:r,number:r,date:r,boolean:r,integer:r,float:r,regexp:r,email:r,url:r,hex:r},string:{len:"${label} musi posiadać ${len} znaków",min:"${label} musi posiadać co namniej ${min} znaków",max:"${label} musi posiadać maksymalnie ${max} znaków",range:"${label} musi posiadać między ${min} a ${max} znaków"},number:{len:"${label} musi mieć wartość o długości ${len}",min:"${label} musi mieć wartość większą lub równą ${min}",max:"${label} musi mieć wartość mniejszą lub równą ${max}",range:"${label} musi mieć wartość pomiędzy ${min} a ${max}"},array:{len:"${label} musi posiadać ${len} elementów",min:"${label} musi posiadać co najmniej ${min} elementów",max:"${label} musi posiadać maksymalnie ${max} elementów",range:"${label} musi posiadać między ${min} a ${max} elementów"},pattern:{mismatch:"${label} nie posiada wartości zgodnej ze wzorem ${pattern}"}}}};p.default=k});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/
|
|
1
|
+
__emailmaker__.define("static/core/fabc717f.js",["require","exports","module","static/core/5dc34752.js","static/core/8ca96066.js"],function(i,m,S){const x=i("./5dc34752.js"),u=i("./8ca96066.js");var d={items_per_page:"/ página",jump_to:"Ir a",jump_to_confirm:"confirmar",page:"Página",prev_page:"Página anterior",next_page:"Página siguiente",prev_5:"5 páginas previas",next_5:"5 páginas siguientes",prev_3:"3 páginas previas",next_3:"3 páginas siguientes",page_size:"tamaño de página"};function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(r)}function l(r,e){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function($){return Object.getOwnPropertyDescriptor(r,$).enumerable})),a.push.apply(a,n)}return a}function c(r){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(n){b(r,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(a,n))})}return r}function b(r,e,a){return e=g(e),e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function g(r){var e=f(r,"string");return o(e)=="symbol"?e:String(e)}function f(r,e){if(o(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var n=a.call(r,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var v=c(c({},u.commonLocale),{},{locale:"es_ES",today:"Hoy",now:"Ahora",backToToday:"Volver a hoy",ok:"Aceptar",clear:"Limpiar",week:"Semana",month:"Mes",year:"Año",timeSelect:"Seleccionar hora",dateSelect:"Seleccionar fecha",monthSelect:"Elegir un mes",yearSelect:"Elegir un año",decadeSelect:"Elegir una década",previousMonth:"Mes anterior (PageUp)",nextMonth:"Mes siguiente (PageDown)",previousYear:"Año anterior (Control + left)",nextYear:"Año siguiente (Control + right)",previousDecade:"Década anterior",nextDecade:"Década siguiente",previousCentury:"Siglo anterior",nextCentury:"Siglo siguiente"}),s={placeholder:"Seleccionar hora",rangePlaceholder:["Hora de inicio","Hora de fin"]},p={lang:{placeholder:"Seleccionar fecha",rangePlaceholder:["Fecha inicial","Fecha final"],shortWeekDays:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],...v},timePickerLocale:{...s}},y=p,t="${label} no es un ${type} válido",h={locale:"es",Pagination:d,DatePicker:p,TimePicker:s,Calendar:y,global:{placeholder:"Seleccione",close:"Cerrar"},Table:{filterTitle:"Filtrar menú",filterConfirm:"Aceptar",filterReset:"Reiniciar",filterEmptyText:"Sin filtros",filterCheckAll:"Seleccionar todo",filterSearchPlaceholder:"Buscar en filtros",emptyText:"Sin datos",selectAll:"Seleccionar todo",selectInvert:"Invertir selección",selectNone:"Vacíe todo",selectionAll:"Seleccionar todos los datos",sortTitle:"Ordenar",expand:"Expandir fila",collapse:"Colapsar fila",triggerDesc:"Click para ordenar en orden descendente",triggerAsc:"Click para ordenar en orden ascendente",cancelSort:"Click para cancelar ordenamiento"},Tour:{Next:"Siguiente",Previous:"Anterior",Finish:"Finalizar"},Modal:{okText:"Aceptar",cancelText:"Cancelar",justOkText:"Aceptar"},Popconfirm:{okText:"Aceptar",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Buscar aquí",itemUnit:"elemento",itemsUnit:"elementos",remove:"Eliminar",selectCurrent:"Seleccionar página actual",removeCurrent:"Eliminar página actual",selectAll:"Seleccionar todos los datos",removeAll:"Eliminar todos los datos",selectInvert:"Invertir página actual"},Upload:{uploading:"Subiendo...",removeFile:"Eliminar archivo",uploadError:"Error al subir el archivo",previewFile:"Vista previa",downloadFile:"Descargar archivo"},Empty:{description:"No hay datos"},Icon:{icon:"ícono"},Text:{edit:"Editar",copy:"Copiar",copied:"Copiado",expand:"Expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Error de validación del campo ${label}",required:"Por favor, rellena ${label}",enum:"${label} debe ser uno de [${enum}]",whitespace:"${label} no puede ser un carácter en blanco",date:{format:"El formato de fecha de ${label} es inválido",parse:"${label} no se puede convertir a una fecha",invalid:"${label} es una fecha inválida"},types:{string:t,method:t,array:t,object:t,number:t,date:t,boolean:t,integer:t,float:t,regexp:t,email:t,url:t,hex:t},string:{len:"${label} debe tener ${len} caracteres",min:"${label} debe tener al menos ${min} caracteres",max:"${label} debe tener hasta ${max} caracteres",range:"${label} debe tener entre ${min}-${max} caracteres"},number:{len:"${label} debe ser igual a ${len}",min:"${label} valor mínimo es ${min}",max:"${label} valor máximo es ${max}",range:"${label} debe ser entre ${min}-${max}"},array:{len:"Debe ser ${len} ${label}",min:"Al menos ${min} ${label}",max:"Como máximo ${max} ${label}",range:"El valor de ${label} debe estar entre ${min}-${max}"},pattern:{mismatch:"${label} no coincide con el patrón ${pattern}"}}}};m.default=h});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define(`static/umd-runtime/runtime.js`,[`require`,`exports`,`module`,`static/umd-runtime/BWsm4pjU.js`,`static/umd-runtime/-HpwEpwH.js`,`static/umd-runtime/BFxYqYWf.js`],function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=e("./BWsm4pjU.js"),i=e("./-HpwEpwH.js"),a=e("./BFxYqYWf.js");var o=r.r(i.w(),1),s=typeof o.default==`function`?(...e)=>(0,o.default)(...e):{...o.default};for(let e of Object.keys(o.default||{}))e!=="default"&&(s[e]=o.default[e]);var c=r.n({Activity:()=>ee,Children:()=>te,Component:()=>ne,Fragment:()=>re,Profiler:()=>ie,PureComponent:()=>ae,StrictMode:()=>oe,Suspense:()=>se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>ce,__COMPILER_RUNTIME:()=>le,cache:()=>ue,cacheSignal:()=>de,cloneElement:()=>d,createContext:()=>f,createElement:()=>p,createRef:()=>m,default:()=>u,forwardRef:()=>h,isValidElement:()=>g,lazy:()=>_,memo:()=>v,startTransition:()=>y,unstable_useCacheRefresh:()=>b,use:()=>x,useActionState:()=>S,useCallback:()=>C,useContext:()=>w,useDebugValue:()=>T,useDeferredValue:()=>E,useEffect:()=>D,useEffectEvent:()=>O,useId:()=>k,useImperativeHandle:()=>A,useInsertionEffect:()=>j,useLayoutEffect:()=>M,useMemo:()=>N,useOptimistic:()=>P,useReducer:()=>F,useRef:()=>I,useState:()=>L,useSyncExternalStore:()=>R,useTransition:()=>z,version:()=>B}),l=r.r(a.Z(),1),u=l.default&&l.default.default?l.default.default:l.default,{Activity:ee,Children:te,Component:ne,Fragment:re,Profiler:ie,PureComponent:ae,StrictMode:oe,Suspense:se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ce,__COMPILER_RUNTIME:le,cache:ue,cacheSignal:de,cloneElement:d,createContext:f,createElement:p,createRef:m,forwardRef:h,isValidElement:g,lazy:_,memo:v,startTransition:y,unstable_useCacheRefresh:b,use:x,useActionState:S,useCallback:C,useContext:w,useDebugValue:T,useDeferredValue:E,useEffect:D,useEffectEvent:O,useId:k,useImperativeHandle:A,useInsertionEffect:j,useLayoutEffect:M,useMemo:N,useOptimistic:P,useReducer:F,useRef:I,useState:L,useSyncExternalStore:R,useTransition:z,version:B}=l.default;try{var V=Symbol.for(`editor-runtime.react.copies`),H=globalThis[V];H||(H=[],globalThis[V]=H);for(var U=!1,W=0;W<H.length;W++){var G=H[W];G&&G.react===l.default&&G.package===`@emailmaker/emailmaker`&&G.version===`1.1.85-dev.
|
|
1
|
+
__emailmaker__.define(`static/umd-runtime/runtime.js`,[`require`,`exports`,`module`,`static/umd-runtime/BWsm4pjU.js`,`static/umd-runtime/-HpwEpwH.js`,`static/umd-runtime/BFxYqYWf.js`],function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=e("./BWsm4pjU.js"),i=e("./-HpwEpwH.js"),a=e("./BFxYqYWf.js");var o=r.r(i.w(),1),s=typeof o.default==`function`?(...e)=>(0,o.default)(...e):{...o.default};for(let e of Object.keys(o.default||{}))e!=="default"&&(s[e]=o.default[e]);var c=r.n({Activity:()=>ee,Children:()=>te,Component:()=>ne,Fragment:()=>re,Profiler:()=>ie,PureComponent:()=>ae,StrictMode:()=>oe,Suspense:()=>se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>ce,__COMPILER_RUNTIME:()=>le,cache:()=>ue,cacheSignal:()=>de,cloneElement:()=>d,createContext:()=>f,createElement:()=>p,createRef:()=>m,default:()=>u,forwardRef:()=>h,isValidElement:()=>g,lazy:()=>_,memo:()=>v,startTransition:()=>y,unstable_useCacheRefresh:()=>b,use:()=>x,useActionState:()=>S,useCallback:()=>C,useContext:()=>w,useDebugValue:()=>T,useDeferredValue:()=>E,useEffect:()=>D,useEffectEvent:()=>O,useId:()=>k,useImperativeHandle:()=>A,useInsertionEffect:()=>j,useLayoutEffect:()=>M,useMemo:()=>N,useOptimistic:()=>P,useReducer:()=>F,useRef:()=>I,useState:()=>L,useSyncExternalStore:()=>R,useTransition:()=>z,version:()=>B}),l=r.r(a.Z(),1),u=l.default&&l.default.default?l.default.default:l.default,{Activity:ee,Children:te,Component:ne,Fragment:re,Profiler:ie,PureComponent:ae,StrictMode:oe,Suspense:se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ce,__COMPILER_RUNTIME:le,cache:ue,cacheSignal:de,cloneElement:d,createContext:f,createElement:p,createRef:m,forwardRef:h,isValidElement:g,lazy:_,memo:v,startTransition:y,unstable_useCacheRefresh:b,use:x,useActionState:S,useCallback:C,useContext:w,useDebugValue:T,useDeferredValue:E,useEffect:D,useEffectEvent:O,useId:k,useImperativeHandle:A,useInsertionEffect:j,useLayoutEffect:M,useMemo:N,useOptimistic:P,useReducer:F,useRef:I,useState:L,useSyncExternalStore:R,useTransition:z,version:B}=l.default;try{var V=Symbol.for(`editor-runtime.react.copies`),H=globalThis[V];H||(H=[],globalThis[V]=H);for(var U=!1,W=0;W<H.length;W++){var G=H[W];G&&G.react===l.default&&G.package===`@emailmaker/emailmaker`&&G.version===`1.1.85-dev.4`&&(U=!0)}U||H.push({package:`@emailmaker/emailmaker`,version:`1.1.85-dev.4`,react:l.default})}catch{}var fe=r.n({__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>me,createPortal:()=>he,default:()=>pe,flushSync:()=>ge,preconnect:()=>_e,prefetchDNS:()=>ve,preinit:()=>ye,preinitModule:()=>be,preload:()=>xe,preloadModule:()=>Se,requestFormReset:()=>Ce,unstable_batchedUpdates:()=>we,useFormState:()=>Te,useFormStatus:()=>Ee,version:()=>De}),K=r.r(a.X(),1),pe=K.default&&K.default.default?K.default.default:K.default,{__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:me,createPortal:he,flushSync:ge,preconnect:_e,prefetchDNS:ve,preinit:ye,preinitModule:be,preload:xe,preloadModule:Se,requestFormReset:Ce,unstable_batchedUpdates:we,useFormState:Te,useFormStatus:Ee,version:De}=K.default,Oe=r.n({createRoot:()=>Ae,default:()=>ke,hydrateRoot:()=>je,version:()=>Me}),q=r.r(a.Y(),1),ke=q.default&&q.default.default?q.default.default:q.default,{createRoot:Ae,hydrateRoot:je,version:Me}=q.default,Ne=r.n({Fragment:()=>J,jsx:()=>Y,jsxs:()=>X}),{Fragment:J,jsx:Y,jsxs:X}=r.r(a.J(),1),Pe=r.n({Fragment:()=>J,jsx:()=>Y,jsxDEV:()=>Y,jsxs:()=>X}),Fe=r.n({default:()=>a.t});let Z=/url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;function Ie(e,t){let n=10**(t+1),r=Math.floor(e*n);return Math.round(r/10)*10/n}let Le=(e={})=>{let{rootValue:t=16,precision:n=5,mediaQuery:r=!1}=e,a=(e,r)=>{if(!r)return e;let i=parseFloat(r);return i<=1?e:`${Ie(i/t,n)}rem`};return{visit:e=>{let t={...e};return Object.entries(e).forEach(([e,n])=>{if(typeof n==`string`&&n.includes(`px`)){let r=n.replace(Z,a);t[e]=r}!i.f[e]&&typeof n==`number`&&n!==0&&(t[e]=`${n}px`.replace(Z,a));let o=e.trim();if(o.startsWith(`@`)&&o.includes(`px`)&&r){let n=e.replace(Z,a);t[n]=t[e],delete t[e]}}),t}}};var Re=r.n({Keyframes:()=>i.i,NaNLinter:()=>i.l,StyleContext:()=>i.b,StyleProvider:()=>i.x,Theme:()=>i.v,_experimental:()=>i.n,autoPrefixTransformer:()=>i.C,createCache:()=>i.S,createTheme:()=>i._,extractStyle:()=>i.a,genCalc:()=>i.y,getComputedToken:()=>i.p,legacyLogicalPropertiesTransformer:()=>i.r,legacyNotSelectorLinter:()=>i.d,logicalPropertiesLinter:()=>i.u,parentSelectorLinter:()=>i.c,px2remTransformer:()=>Le,token2CSSVar:()=>i.h,unit:()=>i.g,useCSSVarRegister:()=>i.o,useCacheToken:()=>i.m,useStyleRegister:()=>i.s}),Q=r.n({Ls:()=>Ge,default:()=>ze,en:()=>We,extend:()=>Be,isDayjs:()=>He,locale:()=>Ve,p:()=>Ke,unix:()=>Ue}),$=r.r(i.t(),1),ze=$.default&&$.default.default?$.default.default:$.default,{extend:Be,locale:Ve,isDayjs:He,unix:Ue,en:We,Ls:Ge,p:Ke}=$.default;let qe=(function(){var t,n=function(){return t||=Promise.resolve().then(()=>e("./V5NCqAWA.js"))};return{then:function(e,t){return n().then(e,t)},catch:function(e){return n().catch(e)},finally:function(e){return n().finally(e)}}})(),Je=(function(){var t,n=function(){return t||=Promise.resolve().then(()=>e("./DK72AzBY.js"))};return{then:function(e,t){return n().then(e,t)},catch:function(e){return n().catch(e)},finally:function(e){return n().finally(e)}}})();Object.defineProperty(t,"AntDesignCssinjs",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(t,"AntDesignIconBase",{enumerable:!0,get:function(){return Fe}}),t.AntDesignIcons=Je,t.Antd=qe,t.Classnames=s,Object.defineProperty(t,"Dayjs",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(t,"React",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"ReactDom",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(t,"ReactDomClient",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(t,"ReactJsxDevRuntime",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(t,"ReactJsxRuntime",{enumerable:!0,get:function(){return Ne}})});
|
package/vite/index.cjs
CHANGED
|
@@ -749,6 +749,81 @@ function checkHostReactVersion(projectRoot) {
|
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
751
|
//#endregion
|
|
752
|
+
//#region src/vite/pinVendoredReact.ts
|
|
753
|
+
/**
|
|
754
|
+
* Pinned React: inside the package `react` always means the copy the package ships.
|
|
755
|
+
*
|
|
756
|
+
* The product never imports `react` by its bare name, but the vendored tree does — antd and its
|
|
757
|
+
* relatives, and the `runtime/react` subpath itself, which is a re-export of `import … from 'react'`.
|
|
758
|
+
* Those bare names are exactly what a host build is free to redirect, and four mechanisms do it:
|
|
759
|
+
* `resolve.dedupe`, Module Federation `shared: { react: { singleton: true } }`, webpack
|
|
760
|
+
* `resolve.alias` and `resolve.modules`. None of them is sabotage — they are the recommended cure for
|
|
761
|
+
* duplicate React — but they silently hand the editor whichever React the host happens to have. At
|
|
762
|
+
* campaigns that was React 18 against an editor built for 19.
|
|
763
|
+
*
|
|
764
|
+
* So imports are pinned by their importer: a request coming from a file inside the package resolves
|
|
765
|
+
* to the vendored copy, and nothing else is touched. Aliases run before any plugin, so the order of
|
|
766
|
+
* the host's own configuration does not matter. `sharedReact` is the one way to opt out — then the
|
|
767
|
+
* editor runs on the host's React on purpose.
|
|
768
|
+
*/
|
|
769
|
+
/** Bare names the vendored tree imports directly; the same set `sharedReact` sends to the host. */
|
|
770
|
+
var PINNED_BARE_NAMES = [
|
|
771
|
+
"react",
|
|
772
|
+
"react-dom",
|
|
773
|
+
"react-dom/client",
|
|
774
|
+
"react/jsx-runtime",
|
|
775
|
+
"react/jsx-dev-runtime"
|
|
776
|
+
];
|
|
777
|
+
function normalize(value) {
|
|
778
|
+
return value.replace(/\\/g, "/");
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Real path, with symlinks resolved. With pnpm the package is a link into `.pnpm/…`, and the
|
|
782
|
+
* importer arrives already resolved: comparing the visible path against it never matches, and the
|
|
783
|
+
* pinning would quietly do nothing. The measurement notes in DELIVERY_BOUNDARIES.md warn about the
|
|
784
|
+
* same trap from the other side.
|
|
785
|
+
*/
|
|
786
|
+
function realPath(value) {
|
|
787
|
+
try {
|
|
788
|
+
return fs.default.realpathSync(value);
|
|
789
|
+
} catch {
|
|
790
|
+
return value;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
/** Is the importing file part of the published package (its own files or its vendored tree). */
|
|
794
|
+
function isInsidePackage(importer, packageRoot) {
|
|
795
|
+
const root = normalize(realPath(packageRoot)).replace(/\/$/, "");
|
|
796
|
+
return normalize(realPath(importer)).startsWith(`${root}/`);
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Where the package's own copy of that module lives. Resolved from the package manifest, so pnpm's
|
|
800
|
+
* `.pnpm/…` layout and a plain `node_modules` tree both land on the vendored files.
|
|
801
|
+
*/
|
|
802
|
+
function resolveVendoredModule(packageRoot, specifier) {
|
|
803
|
+
try {
|
|
804
|
+
return (0, module$1.createRequire)(path.default.join(packageRoot, "package.json")).resolve(specifier);
|
|
805
|
+
} catch {
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Aliases that pin React for the package's own graph. Empty when the package ships no copy: then
|
|
811
|
+
* there is nothing to pin to, and redirecting would break the build instead of protecting it.
|
|
812
|
+
*/
|
|
813
|
+
function buildPinnedReactAliases(packageRoot, onPin) {
|
|
814
|
+
if (resolveVendoredModule(packageRoot, "react") === void 0) return [];
|
|
815
|
+
return PINNED_BARE_NAMES.map((name) => ({
|
|
816
|
+
find: new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\/]/gu, "\\$&")}$`, "u"),
|
|
817
|
+
replacement: name,
|
|
818
|
+
customResolver: (source, importer) => {
|
|
819
|
+
if (!importer || !isInsidePackage(importer, packageRoot)) return null;
|
|
820
|
+
const vendored = resolveVendoredModule(packageRoot, source);
|
|
821
|
+
if (vendored && onPin) onPin(source);
|
|
822
|
+
return vendored ?? null;
|
|
823
|
+
}
|
|
824
|
+
}));
|
|
825
|
+
}
|
|
826
|
+
//#endregion
|
|
752
827
|
//#region src/shared/reactDuplicateDetector.ts
|
|
753
828
|
/**
|
|
754
829
|
* Детектор дублированных runtime-копий React/antd в Vite-prebundle integrator'а.
|
|
@@ -883,6 +958,25 @@ var APP_CORE_OPTIMIZED_DEP_RE = createAppCoreOptimizedDepRe(BUNDLER_DEFAULT_APP_
|
|
|
883
958
|
var DEFAULT_OUTPUT_FOLDER = `/${BUNDLER_DEFAULT_APP_NAME}`;
|
|
884
959
|
var DEFAULT_MODULES_PATH = "node_modules";
|
|
885
960
|
var DEFAULT_STARTUP_PREFETCH_MODE = "idle";
|
|
961
|
+
/**
|
|
962
|
+
* Как разрешать React в графе партнёра.
|
|
963
|
+
*
|
|
964
|
+
* По умолчанию — пришиваем свою копию: импорт из файла внутри пакета уходит в неё, чужие импорты не
|
|
965
|
+
* трогаются. `sharedReact` — обратный случай: интегратор просит редактор жить на его React, и тогда
|
|
966
|
+
* наши подпути уводятся к хосту.
|
|
967
|
+
*/
|
|
968
|
+
function reactResolveConfig(root, options) {
|
|
969
|
+
if (options.sharedReact) return { resolve: { alias: buildSharedReactAliases(BUNDLER_DEFAULT_PACKAGE_NAME) } };
|
|
970
|
+
const packageRoot = resolvePublishedPackageRoot(BUNDLER_DEFAULT_PACKAGE_NAME, options.modulesPath || DEFAULT_MODULES_PATH, root ? path.default.resolve(root) : process.cwd());
|
|
971
|
+
const pinned = /* @__PURE__ */ new Set();
|
|
972
|
+
const alias = buildPinnedReactAliases(packageRoot, (source) => {
|
|
973
|
+
if (!pinned.has(source)) {
|
|
974
|
+
pinned.add(source);
|
|
975
|
+
console.log(`[${PLUGIN_NAME}] pinnedReact: "${source}" внутри пакета → своя копия`);
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
return alias.length > 0 ? { resolve: { alias } } : void 0;
|
|
979
|
+
}
|
|
886
980
|
function outputFolderFsSegment(folder, appName) {
|
|
887
981
|
return (folder != null && folder !== "" ? String(folder) : `/${appName}`).replace(/^\/+/, "") || appName;
|
|
888
982
|
}
|
|
@@ -991,6 +1085,9 @@ var ViteServePlugin = (options) => {
|
|
|
991
1085
|
name: `${PLUGIN_NAME}-serve`,
|
|
992
1086
|
enforce: "pre",
|
|
993
1087
|
apply: "serve",
|
|
1088
|
+
config(config) {
|
|
1089
|
+
return reactResolveConfig(config.root, options);
|
|
1090
|
+
},
|
|
994
1091
|
configResolved(config) {
|
|
995
1092
|
projectRoot = config.root;
|
|
996
1093
|
destPath = path.default.normalize(path.default.join(projectRoot, mountSeg));
|
|
@@ -1144,14 +1241,12 @@ var ViteBuildPlugin = (options) => {
|
|
|
1144
1241
|
name: `${PLUGIN_NAME}-build`,
|
|
1145
1242
|
enforce: "pre",
|
|
1146
1243
|
apply: "build",
|
|
1147
|
-
config() {
|
|
1148
|
-
|
|
1149
|
-
return { resolve: { alias: buildSharedReactAliases(BUNDLER_DEFAULT_PACKAGE_NAME) } };
|
|
1244
|
+
config(config) {
|
|
1245
|
+
return reactResolveConfig(config.root, options);
|
|
1150
1246
|
},
|
|
1151
1247
|
resolveId(source, importer) {
|
|
1152
1248
|
if (!options.sharedReact || !importer || !resolvedConfig || !isSharedReactSpecifier(source)) return null;
|
|
1153
|
-
|
|
1154
|
-
if (!normalizePath(importer).startsWith(`${normalizePath(packageRoot)}/`)) return null;
|
|
1249
|
+
if (!isInsidePackage(importer, resolvePublishedPackageRoot(BUNDLER_DEFAULT_PACKAGE_NAME, options.modulesPath || DEFAULT_MODULES_PATH, resolvedConfig.root))) return null;
|
|
1155
1250
|
return resolveHostReactModule(resolvedConfig.root, source) ?? null;
|
|
1156
1251
|
},
|
|
1157
1252
|
transform(code, id) {
|
package/vite/index.js
CHANGED
|
@@ -720,6 +720,81 @@ function checkHostReactVersion(projectRoot) {
|
|
|
720
720
|
};
|
|
721
721
|
}
|
|
722
722
|
//#endregion
|
|
723
|
+
//#region src/vite/pinVendoredReact.ts
|
|
724
|
+
/**
|
|
725
|
+
* Pinned React: inside the package `react` always means the copy the package ships.
|
|
726
|
+
*
|
|
727
|
+
* The product never imports `react` by its bare name, but the vendored tree does — antd and its
|
|
728
|
+
* relatives, and the `runtime/react` subpath itself, which is a re-export of `import … from 'react'`.
|
|
729
|
+
* Those bare names are exactly what a host build is free to redirect, and four mechanisms do it:
|
|
730
|
+
* `resolve.dedupe`, Module Federation `shared: { react: { singleton: true } }`, webpack
|
|
731
|
+
* `resolve.alias` and `resolve.modules`. None of them is sabotage — they are the recommended cure for
|
|
732
|
+
* duplicate React — but they silently hand the editor whichever React the host happens to have. At
|
|
733
|
+
* campaigns that was React 18 against an editor built for 19.
|
|
734
|
+
*
|
|
735
|
+
* So imports are pinned by their importer: a request coming from a file inside the package resolves
|
|
736
|
+
* to the vendored copy, and nothing else is touched. Aliases run before any plugin, so the order of
|
|
737
|
+
* the host's own configuration does not matter. `sharedReact` is the one way to opt out — then the
|
|
738
|
+
* editor runs on the host's React on purpose.
|
|
739
|
+
*/
|
|
740
|
+
/** Bare names the vendored tree imports directly; the same set `sharedReact` sends to the host. */
|
|
741
|
+
var PINNED_BARE_NAMES = [
|
|
742
|
+
"react",
|
|
743
|
+
"react-dom",
|
|
744
|
+
"react-dom/client",
|
|
745
|
+
"react/jsx-runtime",
|
|
746
|
+
"react/jsx-dev-runtime"
|
|
747
|
+
];
|
|
748
|
+
function normalize(value) {
|
|
749
|
+
return value.replace(/\\/g, "/");
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Real path, with symlinks resolved. With pnpm the package is a link into `.pnpm/…`, and the
|
|
753
|
+
* importer arrives already resolved: comparing the visible path against it never matches, and the
|
|
754
|
+
* pinning would quietly do nothing. The measurement notes in DELIVERY_BOUNDARIES.md warn about the
|
|
755
|
+
* same trap from the other side.
|
|
756
|
+
*/
|
|
757
|
+
function realPath(value) {
|
|
758
|
+
try {
|
|
759
|
+
return fs.realpathSync(value);
|
|
760
|
+
} catch {
|
|
761
|
+
return value;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
/** Is the importing file part of the published package (its own files or its vendored tree). */
|
|
765
|
+
function isInsidePackage(importer, packageRoot) {
|
|
766
|
+
const root = normalize(realPath(packageRoot)).replace(/\/$/, "");
|
|
767
|
+
return normalize(realPath(importer)).startsWith(`${root}/`);
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Where the package's own copy of that module lives. Resolved from the package manifest, so pnpm's
|
|
771
|
+
* `.pnpm/…` layout and a plain `node_modules` tree both land on the vendored files.
|
|
772
|
+
*/
|
|
773
|
+
function resolveVendoredModule(packageRoot, specifier) {
|
|
774
|
+
try {
|
|
775
|
+
return createRequire(path.join(packageRoot, "package.json")).resolve(specifier);
|
|
776
|
+
} catch {
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Aliases that pin React for the package's own graph. Empty when the package ships no copy: then
|
|
782
|
+
* there is nothing to pin to, and redirecting would break the build instead of protecting it.
|
|
783
|
+
*/
|
|
784
|
+
function buildPinnedReactAliases(packageRoot, onPin) {
|
|
785
|
+
if (resolveVendoredModule(packageRoot, "react") === void 0) return [];
|
|
786
|
+
return PINNED_BARE_NAMES.map((name) => ({
|
|
787
|
+
find: new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\/]/gu, "\\$&")}$`, "u"),
|
|
788
|
+
replacement: name,
|
|
789
|
+
customResolver: (source, importer) => {
|
|
790
|
+
if (!importer || !isInsidePackage(importer, packageRoot)) return null;
|
|
791
|
+
const vendored = resolveVendoredModule(packageRoot, source);
|
|
792
|
+
if (vendored && onPin) onPin(source);
|
|
793
|
+
return vendored ?? null;
|
|
794
|
+
}
|
|
795
|
+
}));
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
723
798
|
//#region src/shared/reactDuplicateDetector.ts
|
|
724
799
|
/**
|
|
725
800
|
* Детектор дублированных runtime-копий React/antd в Vite-prebundle integrator'а.
|
|
@@ -854,6 +929,25 @@ var APP_CORE_OPTIMIZED_DEP_RE = createAppCoreOptimizedDepRe(BUNDLER_DEFAULT_APP_
|
|
|
854
929
|
var DEFAULT_OUTPUT_FOLDER = `/${BUNDLER_DEFAULT_APP_NAME}`;
|
|
855
930
|
var DEFAULT_MODULES_PATH = "node_modules";
|
|
856
931
|
var DEFAULT_STARTUP_PREFETCH_MODE = "idle";
|
|
932
|
+
/**
|
|
933
|
+
* Как разрешать React в графе партнёра.
|
|
934
|
+
*
|
|
935
|
+
* По умолчанию — пришиваем свою копию: импорт из файла внутри пакета уходит в неё, чужие импорты не
|
|
936
|
+
* трогаются. `sharedReact` — обратный случай: интегратор просит редактор жить на его React, и тогда
|
|
937
|
+
* наши подпути уводятся к хосту.
|
|
938
|
+
*/
|
|
939
|
+
function reactResolveConfig(root, options) {
|
|
940
|
+
if (options.sharedReact) return { resolve: { alias: buildSharedReactAliases(BUNDLER_DEFAULT_PACKAGE_NAME) } };
|
|
941
|
+
const packageRoot = resolvePublishedPackageRoot(BUNDLER_DEFAULT_PACKAGE_NAME, options.modulesPath || DEFAULT_MODULES_PATH, root ? path.resolve(root) : process.cwd());
|
|
942
|
+
const pinned = /* @__PURE__ */ new Set();
|
|
943
|
+
const alias = buildPinnedReactAliases(packageRoot, (source) => {
|
|
944
|
+
if (!pinned.has(source)) {
|
|
945
|
+
pinned.add(source);
|
|
946
|
+
console.log(`[${PLUGIN_NAME}] pinnedReact: "${source}" внутри пакета → своя копия`);
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
return alias.length > 0 ? { resolve: { alias } } : void 0;
|
|
950
|
+
}
|
|
857
951
|
function outputFolderFsSegment(folder, appName) {
|
|
858
952
|
return (folder != null && folder !== "" ? String(folder) : `/${appName}`).replace(/^\/+/, "") || appName;
|
|
859
953
|
}
|
|
@@ -962,6 +1056,9 @@ var ViteServePlugin = (options) => {
|
|
|
962
1056
|
name: `${PLUGIN_NAME}-serve`,
|
|
963
1057
|
enforce: "pre",
|
|
964
1058
|
apply: "serve",
|
|
1059
|
+
config(config) {
|
|
1060
|
+
return reactResolveConfig(config.root, options);
|
|
1061
|
+
},
|
|
965
1062
|
configResolved(config) {
|
|
966
1063
|
projectRoot = config.root;
|
|
967
1064
|
destPath = path.normalize(path.join(projectRoot, mountSeg));
|
|
@@ -1115,14 +1212,12 @@ var ViteBuildPlugin = (options) => {
|
|
|
1115
1212
|
name: `${PLUGIN_NAME}-build`,
|
|
1116
1213
|
enforce: "pre",
|
|
1117
1214
|
apply: "build",
|
|
1118
|
-
config() {
|
|
1119
|
-
|
|
1120
|
-
return { resolve: { alias: buildSharedReactAliases(BUNDLER_DEFAULT_PACKAGE_NAME) } };
|
|
1215
|
+
config(config) {
|
|
1216
|
+
return reactResolveConfig(config.root, options);
|
|
1121
1217
|
},
|
|
1122
1218
|
resolveId(source, importer) {
|
|
1123
1219
|
if (!options.sharedReact || !importer || !resolvedConfig || !isSharedReactSpecifier(source)) return null;
|
|
1124
|
-
|
|
1125
|
-
if (!normalizePath(importer).startsWith(`${normalizePath(packageRoot)}/`)) return null;
|
|
1220
|
+
if (!isInsidePackage(importer, resolvePublishedPackageRoot(BUNDLER_DEFAULT_PACKAGE_NAME, options.modulesPath || DEFAULT_MODULES_PATH, resolvedConfig.root))) return null;
|
|
1126
1221
|
return resolveHostReactModule(resolvedConfig.root, source) ?? null;
|
|
1127
1222
|
},
|
|
1128
1223
|
transform(code, id) {
|
package/webpack/index.cjs
CHANGED
|
@@ -549,6 +549,81 @@ function applySharedReactAliases(compiler, mainPackage, logger) {
|
|
|
549
549
|
logger.info(`sharedReact: ${mapped} module(s) mapped onto the host React${version.version ? ` ${version.version}` : ""}`);
|
|
550
550
|
}
|
|
551
551
|
//#endregion
|
|
552
|
+
//#region src/vite/pinVendoredReact.ts
|
|
553
|
+
/**
|
|
554
|
+
* Pinned React: inside the package `react` always means the copy the package ships.
|
|
555
|
+
*
|
|
556
|
+
* The product never imports `react` by its bare name, but the vendored tree does — antd and its
|
|
557
|
+
* relatives, and the `runtime/react` subpath itself, which is a re-export of `import … from 'react'`.
|
|
558
|
+
* Those bare names are exactly what a host build is free to redirect, and four mechanisms do it:
|
|
559
|
+
* `resolve.dedupe`, Module Federation `shared: { react: { singleton: true } }`, webpack
|
|
560
|
+
* `resolve.alias` and `resolve.modules`. None of them is sabotage — they are the recommended cure for
|
|
561
|
+
* duplicate React — but they silently hand the editor whichever React the host happens to have. At
|
|
562
|
+
* campaigns that was React 18 against an editor built for 19.
|
|
563
|
+
*
|
|
564
|
+
* So imports are pinned by their importer: a request coming from a file inside the package resolves
|
|
565
|
+
* to the vendored copy, and nothing else is touched. Aliases run before any plugin, so the order of
|
|
566
|
+
* the host's own configuration does not matter. `sharedReact` is the one way to opt out — then the
|
|
567
|
+
* editor runs on the host's React on purpose.
|
|
568
|
+
*/
|
|
569
|
+
/** Bare names the vendored tree imports directly; the same set `sharedReact` sends to the host. */
|
|
570
|
+
var PINNED_BARE_NAMES = [
|
|
571
|
+
"react",
|
|
572
|
+
"react-dom",
|
|
573
|
+
"react-dom/client",
|
|
574
|
+
"react/jsx-runtime",
|
|
575
|
+
"react/jsx-dev-runtime"
|
|
576
|
+
];
|
|
577
|
+
function normalize(value) {
|
|
578
|
+
return value.replace(/\\/g, "/");
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Real path, with symlinks resolved. With pnpm the package is a link into `.pnpm/…`, and the
|
|
582
|
+
* importer arrives already resolved: comparing the visible path against it never matches, and the
|
|
583
|
+
* pinning would quietly do nothing. The measurement notes in DELIVERY_BOUNDARIES.md warn about the
|
|
584
|
+
* same trap from the other side.
|
|
585
|
+
*/
|
|
586
|
+
function realPath(value) {
|
|
587
|
+
try {
|
|
588
|
+
return fs.default.realpathSync(value);
|
|
589
|
+
} catch {
|
|
590
|
+
return value;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/** Is the importing file part of the published package (its own files or its vendored tree). */
|
|
594
|
+
function isInsidePackage(importer, packageRoot) {
|
|
595
|
+
const root = normalize(realPath(packageRoot)).replace(/\/$/, "");
|
|
596
|
+
return normalize(realPath(importer)).startsWith(`${root}/`);
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Where the package's own copy of that module lives. Resolved from the package manifest, so pnpm's
|
|
600
|
+
* `.pnpm/…` layout and a plain `node_modules` tree both land on the vendored files.
|
|
601
|
+
*/
|
|
602
|
+
function resolveVendoredModule(packageRoot, specifier) {
|
|
603
|
+
try {
|
|
604
|
+
return (0, module$1.createRequire)(path.default.join(packageRoot, "package.json")).resolve(specifier);
|
|
605
|
+
} catch {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Aliases that pin React for the package's own graph. Empty when the package ships no copy: then
|
|
611
|
+
* there is nothing to pin to, and redirecting would break the build instead of protecting it.
|
|
612
|
+
*/
|
|
613
|
+
function buildPinnedReactAliases(packageRoot, onPin) {
|
|
614
|
+
if (resolveVendoredModule(packageRoot, "react") === void 0) return [];
|
|
615
|
+
return PINNED_BARE_NAMES.map((name) => ({
|
|
616
|
+
find: new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\/]/gu, "\\$&")}$`, "u"),
|
|
617
|
+
replacement: name,
|
|
618
|
+
customResolver: (source, importer) => {
|
|
619
|
+
if (!importer || !isInsidePackage(importer, packageRoot)) return null;
|
|
620
|
+
const vendored = resolveVendoredModule(packageRoot, source);
|
|
621
|
+
if (vendored && onPin) onPin(source);
|
|
622
|
+
return vendored ?? null;
|
|
623
|
+
}
|
|
624
|
+
}));
|
|
625
|
+
}
|
|
626
|
+
//#endregion
|
|
552
627
|
//#region src/shared/resolvePublishedPackage.ts
|
|
553
628
|
/**
|
|
554
629
|
* Resolve the on-disk root of the published main package (handles pnpm hoisting / symlinks).
|
|
@@ -587,6 +662,23 @@ function assertCoreChunkInCompilationAssets(assetNames, appName, outputFolder) {
|
|
|
587
662
|
})) throw new Error(`[host-plugin] No "${appName}-core.*.js" asset was emitted under "${folderPrefix || "(output)"}" after copy. The published package may be incomplete or IGNORED_PATTERNS filtered the core chunk.`);
|
|
588
663
|
}
|
|
589
664
|
//#endregion
|
|
665
|
+
//#region src/webpack/pinVendoredReact.ts
|
|
666
|
+
function applyPinnedReact(compiler, mainPackage, modulesPath, logger) {
|
|
667
|
+
const packageRoot = resolvePublishedPackageRoot(mainPackage, modulesPath, compiler.context);
|
|
668
|
+
if (buildPinnedReactAliases(packageRoot).length === 0) return;
|
|
669
|
+
const { NormalModuleReplacementPlugin } = compiler.webpack ?? {};
|
|
670
|
+
if (!NormalModuleReplacementPlugin) {
|
|
671
|
+
logger.warn("pinnedReact: webpack.NormalModuleReplacementPlugin is unavailable — React stays on the host resolve");
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
new NormalModuleReplacementPlugin(/^react(-dom)?(\/.*)?$/u, (resource) => {
|
|
675
|
+
if (!resource.context || !isInsidePackage(resource.context, packageRoot)) return;
|
|
676
|
+
const vendored = resolveVendoredModule(packageRoot, resource.request);
|
|
677
|
+
if (vendored) resource.request = vendored;
|
|
678
|
+
}).apply(compiler);
|
|
679
|
+
logger.info("pinnedReact: the editor runs on the React shipped inside the package");
|
|
680
|
+
}
|
|
681
|
+
//#endregion
|
|
590
682
|
//#region src/shared/branding.ts
|
|
591
683
|
/**
|
|
592
684
|
* Чтение `process.env.REACT_APP_*` — как в основном приложении.
|
|
@@ -738,6 +830,7 @@ var WebpackPlugin = class {
|
|
|
738
830
|
logger.info(`Host plugin active (package=${BUNDLER_DEFAULT_PACKAGE_NAME}, namespace=${ENVIRONMENT_VARIABLE}, publicPath=${normalizedPublicPath}, strict=${this._strict})`);
|
|
739
831
|
if (isPackageExternalized(compiler.options.externals, "@emailmaker/emailmaker")) logger.warn(`${BUNDLER_DEFAULT_PACKAGE_NAME} is listed in webpack externals — the product facade may be absent from the bundle and host bootstrap cannot be injected.`);
|
|
740
832
|
if (this._sharedReact) applySharedReactAliases(compiler, BUNDLER_DEFAULT_PACKAGE_NAME, logger);
|
|
833
|
+
else applyPinnedReact(compiler, BUNDLER_DEFAULT_PACKAGE_NAME, this._modulesPath, logger);
|
|
741
834
|
compiler.hooks.afterCompile?.tap(PLUGIN_NAME, (compilation) => {
|
|
742
835
|
if (!compilation.modules || !compilation.moduleGraph) return;
|
|
743
836
|
const edges = [];
|
package/webpack/index.js
CHANGED
|
@@ -525,6 +525,81 @@ function applySharedReactAliases(compiler, mainPackage, logger) {
|
|
|
525
525
|
logger.info(`sharedReact: ${mapped} module(s) mapped onto the host React${version.version ? ` ${version.version}` : ""}`);
|
|
526
526
|
}
|
|
527
527
|
//#endregion
|
|
528
|
+
//#region src/vite/pinVendoredReact.ts
|
|
529
|
+
/**
|
|
530
|
+
* Pinned React: inside the package `react` always means the copy the package ships.
|
|
531
|
+
*
|
|
532
|
+
* The product never imports `react` by its bare name, but the vendored tree does — antd and its
|
|
533
|
+
* relatives, and the `runtime/react` subpath itself, which is a re-export of `import … from 'react'`.
|
|
534
|
+
* Those bare names are exactly what a host build is free to redirect, and four mechanisms do it:
|
|
535
|
+
* `resolve.dedupe`, Module Federation `shared: { react: { singleton: true } }`, webpack
|
|
536
|
+
* `resolve.alias` and `resolve.modules`. None of them is sabotage — they are the recommended cure for
|
|
537
|
+
* duplicate React — but they silently hand the editor whichever React the host happens to have. At
|
|
538
|
+
* campaigns that was React 18 against an editor built for 19.
|
|
539
|
+
*
|
|
540
|
+
* So imports are pinned by their importer: a request coming from a file inside the package resolves
|
|
541
|
+
* to the vendored copy, and nothing else is touched. Aliases run before any plugin, so the order of
|
|
542
|
+
* the host's own configuration does not matter. `sharedReact` is the one way to opt out — then the
|
|
543
|
+
* editor runs on the host's React on purpose.
|
|
544
|
+
*/
|
|
545
|
+
/** Bare names the vendored tree imports directly; the same set `sharedReact` sends to the host. */
|
|
546
|
+
var PINNED_BARE_NAMES = [
|
|
547
|
+
"react",
|
|
548
|
+
"react-dom",
|
|
549
|
+
"react-dom/client",
|
|
550
|
+
"react/jsx-runtime",
|
|
551
|
+
"react/jsx-dev-runtime"
|
|
552
|
+
];
|
|
553
|
+
function normalize(value) {
|
|
554
|
+
return value.replace(/\\/g, "/");
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Real path, with symlinks resolved. With pnpm the package is a link into `.pnpm/…`, and the
|
|
558
|
+
* importer arrives already resolved: comparing the visible path against it never matches, and the
|
|
559
|
+
* pinning would quietly do nothing. The measurement notes in DELIVERY_BOUNDARIES.md warn about the
|
|
560
|
+
* same trap from the other side.
|
|
561
|
+
*/
|
|
562
|
+
function realPath(value) {
|
|
563
|
+
try {
|
|
564
|
+
return fs.realpathSync(value);
|
|
565
|
+
} catch {
|
|
566
|
+
return value;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
/** Is the importing file part of the published package (its own files or its vendored tree). */
|
|
570
|
+
function isInsidePackage(importer, packageRoot) {
|
|
571
|
+
const root = normalize(realPath(packageRoot)).replace(/\/$/, "");
|
|
572
|
+
return normalize(realPath(importer)).startsWith(`${root}/`);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Where the package's own copy of that module lives. Resolved from the package manifest, so pnpm's
|
|
576
|
+
* `.pnpm/…` layout and a plain `node_modules` tree both land on the vendored files.
|
|
577
|
+
*/
|
|
578
|
+
function resolveVendoredModule(packageRoot, specifier) {
|
|
579
|
+
try {
|
|
580
|
+
return createRequire(path.join(packageRoot, "package.json")).resolve(specifier);
|
|
581
|
+
} catch {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Aliases that pin React for the package's own graph. Empty when the package ships no copy: then
|
|
587
|
+
* there is nothing to pin to, and redirecting would break the build instead of protecting it.
|
|
588
|
+
*/
|
|
589
|
+
function buildPinnedReactAliases(packageRoot, onPin) {
|
|
590
|
+
if (resolveVendoredModule(packageRoot, "react") === void 0) return [];
|
|
591
|
+
return PINNED_BARE_NAMES.map((name) => ({
|
|
592
|
+
find: new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\/]/gu, "\\$&")}$`, "u"),
|
|
593
|
+
replacement: name,
|
|
594
|
+
customResolver: (source, importer) => {
|
|
595
|
+
if (!importer || !isInsidePackage(importer, packageRoot)) return null;
|
|
596
|
+
const vendored = resolveVendoredModule(packageRoot, source);
|
|
597
|
+
if (vendored && onPin) onPin(source);
|
|
598
|
+
return vendored ?? null;
|
|
599
|
+
}
|
|
600
|
+
}));
|
|
601
|
+
}
|
|
602
|
+
//#endregion
|
|
528
603
|
//#region src/shared/resolvePublishedPackage.ts
|
|
529
604
|
/**
|
|
530
605
|
* Resolve the on-disk root of the published main package (handles pnpm hoisting / symlinks).
|
|
@@ -563,6 +638,23 @@ function assertCoreChunkInCompilationAssets(assetNames, appName, outputFolder) {
|
|
|
563
638
|
})) throw new Error(`[host-plugin] No "${appName}-core.*.js" asset was emitted under "${folderPrefix || "(output)"}" after copy. The published package may be incomplete or IGNORED_PATTERNS filtered the core chunk.`);
|
|
564
639
|
}
|
|
565
640
|
//#endregion
|
|
641
|
+
//#region src/webpack/pinVendoredReact.ts
|
|
642
|
+
function applyPinnedReact(compiler, mainPackage, modulesPath, logger) {
|
|
643
|
+
const packageRoot = resolvePublishedPackageRoot(mainPackage, modulesPath, compiler.context);
|
|
644
|
+
if (buildPinnedReactAliases(packageRoot).length === 0) return;
|
|
645
|
+
const { NormalModuleReplacementPlugin } = compiler.webpack ?? {};
|
|
646
|
+
if (!NormalModuleReplacementPlugin) {
|
|
647
|
+
logger.warn("pinnedReact: webpack.NormalModuleReplacementPlugin is unavailable — React stays on the host resolve");
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
new NormalModuleReplacementPlugin(/^react(-dom)?(\/.*)?$/u, (resource) => {
|
|
651
|
+
if (!resource.context || !isInsidePackage(resource.context, packageRoot)) return;
|
|
652
|
+
const vendored = resolveVendoredModule(packageRoot, resource.request);
|
|
653
|
+
if (vendored) resource.request = vendored;
|
|
654
|
+
}).apply(compiler);
|
|
655
|
+
logger.info("pinnedReact: the editor runs on the React shipped inside the package");
|
|
656
|
+
}
|
|
657
|
+
//#endregion
|
|
566
658
|
//#region src/shared/branding.ts
|
|
567
659
|
/**
|
|
568
660
|
* Чтение `process.env.REACT_APP_*` — как в основном приложении.
|
|
@@ -714,6 +806,7 @@ var WebpackPlugin = class {
|
|
|
714
806
|
logger.info(`Host plugin active (package=${BUNDLER_DEFAULT_PACKAGE_NAME}, namespace=${ENVIRONMENT_VARIABLE}, publicPath=${normalizedPublicPath}, strict=${this._strict})`);
|
|
715
807
|
if (isPackageExternalized(compiler.options.externals, "@emailmaker/emailmaker")) logger.warn(`${BUNDLER_DEFAULT_PACKAGE_NAME} is listed in webpack externals — the product facade may be absent from the bundle and host bootstrap cannot be injected.`);
|
|
716
808
|
if (this._sharedReact) applySharedReactAliases(compiler, BUNDLER_DEFAULT_PACKAGE_NAME, logger);
|
|
809
|
+
else applyPinnedReact(compiler, BUNDLER_DEFAULT_PACKAGE_NAME, this._modulesPath, logger);
|
|
717
810
|
compiler.hooks.afterCompile?.tap(PLUGIN_NAME, (compilation) => {
|
|
718
811
|
if (!compilation.modules || !compilation.moduleGraph) return;
|
|
719
812
|
const edges = [];
|
|
File without changes
|
|
File without changes
|