@ubnt/store.core 9.37.0-beta.0 → 9.37.0-beta.1

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 (63) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/lib/assets/attention.svg +5 -5
  3. package/lib/assets/attention2.svg +5 -5
  4. package/lib/assets/minus4.svg +8 -8
  5. package/lib/assets/minus5.svg +8 -8
  6. package/lib/assets/plus5.svg +9 -9
  7. package/lib/assets/plus6.svg +9 -9
  8. package/lib/assets/udmPro.jpg +0 -0
  9. package/lib/assets/udmPro2.jpg +0 -0
  10. package/lib/assets/udmProMax.jpg +0 -0
  11. package/lib/assets/udmProMax2.jpg +0 -0
  12. package/lib/assets/udmProSpecial.jpg +0 -0
  13. package/lib/assets/udmProSpecial2.jpg +0 -0
  14. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  15. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  16. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  17. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  18. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  19. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  20. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  21. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  22. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  23. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  24. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  25. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  26. package/lib/components/ModelCompareV3/data/CloudGateways.js +9 -9
  27. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +6 -6
  28. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  29. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  30. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  31. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  32. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  33. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  34. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  35. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  36. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  37. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  38. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  39. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  40. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  41. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  42. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  43. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  44. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  45. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  46. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  47. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  48. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  49. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  50. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  51. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  52. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  53. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  54. package/lib/utils/nextjs/patch.js +1 -1
  55. package/lib/utils/nextjs/patch.js.map +1 -1
  56. package/lib/utils/nextjs/patch.mjs +1 -1
  57. package/lib/utils/nextjs/patch.mjs.map +1 -1
  58. package/lib/utils/nextjs/plugin.d.ts +7 -1
  59. package/lib/utils/nextjs/plugin.js +8 -5
  60. package/lib/utils/nextjs/plugin.js.map +1 -1
  61. package/lib/utils/nextjs/plugin.mjs +8 -5
  62. package/lib/utils/nextjs/plugin.mjs.map +1 -1
  63. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,9 +6,13 @@
6
6
 
7
7
  ## Releases
8
8
 
9
+ ### 9.37.0-beta.1
10
+
11
+ - [fix] Fix `withUbntLibraries` issues
12
+
9
13
  ### 9.37.0-beta.0
10
14
 
11
- - Add SSR next-patch
15
+ - [Feat] Add `withUbntLibraries`
12
16
 
13
17
  > Upstream master
14
18
 
@@ -1,6 +1,6 @@
1
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="9" cy="9" r="9" fill="#F7D55E"/>
3
- <path d="M9.73071 4.64062C9.40595 4.07813 8.59405 4.07812 8.26929 4.64062L4.37218 11.3906C4.04742 11.9531 4.45336 12.6562 5.10288 12.6562H12.8971C13.5466 12.6562 13.9526 11.9531 13.6278 11.3906L9.73071 4.64062Z" stroke="white" stroke-width="0.5625"/>
4
- <path d="M9.22274 9.12833L9.48295 7.30685C9.52494 7.01295 9.29688 6.75 9 6.75C8.70312 6.75 8.47506 7.01295 8.51705 7.30685L8.77726 9.12833C8.81406 9.3859 9.18594 9.3859 9.22274 9.12833Z" fill="white"/>
5
- <circle cx="9" cy="10.6875" r="0.5625" fill="#F7D55E"/>
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="8" cy="8" r="8" fill="#A4A7B5"/>
3
+ <path d="M12.1136 10.125L8.64952 4.125C8.36084 3.625 7.63916 3.625 7.35048 4.125L3.88638 10.125C3.5977 10.625 3.95855 11.25 4.5359 11.25H11.4641C12.0415 11.25 12.4023 10.625 12.1136 10.125Z" stroke="white" stroke-width="0.5"/>
4
+ <path d="M8.19799 8.11407L8.42929 6.49497C8.46661 6.23373 8.2639 6 8 6C7.7361 6 7.53339 6.23373 7.57071 6.49497L7.80201 8.11407C7.83472 8.34302 8.16528 8.34303 8.19799 8.11407Z" fill="white"/>
5
+ <circle cx="8" cy="9.5" r="0.5" fill="white"/>
6
6
  </svg>
@@ -1,6 +1,6 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="8" cy="8" r="8" fill="#A4A7B5"/>
3
- <path d="M12.1136 10.125L8.64952 4.125C8.36084 3.625 7.63916 3.625 7.35048 4.125L3.88638 10.125C3.5977 10.625 3.95855 11.25 4.5359 11.25H11.4641C12.0415 11.25 12.4023 10.625 12.1136 10.125Z" stroke="white" stroke-width="0.5"/>
4
- <path d="M8.19799 8.11407L8.42929 6.49497C8.46661 6.23373 8.2639 6 8 6C7.7361 6 7.53339 6.23373 7.57071 6.49497L7.80201 8.11407C7.83472 8.34302 8.16528 8.34303 8.19799 8.11407Z" fill="white"/>
5
- <circle cx="8" cy="9.5" r="0.5" fill="white"/>
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="9" cy="9" r="9" fill="#F7D55E"/>
3
+ <path d="M9.73071 4.64062C9.40595 4.07813 8.59405 4.07812 8.26929 4.64062L4.37218 11.3906C4.04742 11.9531 4.45336 12.6562 5.10288 12.6562H12.8971C13.5466 12.6562 13.9526 11.9531 13.6278 11.3906L9.73071 4.64062Z" stroke="white" stroke-width="0.5625"/>
4
+ <path d="M9.22274 9.12833L9.48295 7.30685C9.52494 7.01295 9.29688 6.75 9 6.75C8.70312 6.75 8.47506 7.01295 8.51705 7.30685L8.77726 9.12833C8.81406 9.3859 9.18594 9.3859 9.22274 9.12833Z" fill="white"/>
5
+ <circle cx="9" cy="10.6875" r="0.5625" fill="#F7D55E"/>
6
6
  </svg>
@@ -1,15 +1,15 @@
1
- <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
- <g clip-path="url(#clip0_658_406)">
4
- <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15898)">
4
+ <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_658_406)">
8
- <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
7
+ <g mask="url(#mask0_426_15898)">
8
+ <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_658_406">
12
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
11
+ <clipPath id="clip0_426_15898">
12
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,15 +1,15 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15898)">
4
- <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
1
+ <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
+ <g clip-path="url(#clip0_658_406)">
4
+ <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_426_15898)">
8
- <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
7
+ <g mask="url(#mask0_658_406)">
8
+ <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_426_15898">
12
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
11
+ <clipPath id="clip0_658_406">
12
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,16 +1,16 @@
1
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
- <g clip-path="url(#clip0_658_411)">
4
- <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
- <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15903)">
4
+ <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
+ <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_658_411)">
9
- <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
8
+ <g mask="url(#mask0_426_15903)">
9
+ <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_658_411">
13
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
12
+ <clipPath id="clip0_426_15903">
13
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
@@ -1,16 +1,16 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15903)">
4
- <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
- <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
1
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
+ <g clip-path="url(#clip0_658_411)">
4
+ <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
+ <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_426_15903)">
9
- <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
8
+ <g mask="url(#mask0_658_411)">
9
+ <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_426_15903">
13
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
12
+ <clipPath id="clip0_658_411">
13
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_pESvYnSE = require("../../../../../assets/udmPro.jpg");
6
+ var _externalAssets_CCo8CEpV = require("../../../../../assets/udmPro2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_pESvYnSE__default = /*#__PURE__*/_interopDefault(_externalAssets_pESvYnSE);
12
+ var _externalAssets_CCo8CEpV__default = /*#__PURE__*/_interopDefault(_externalAssets_CCo8CEpV);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_pESvYnSE__default["default"];
16
+ return _externalAssets_CCo8CEpV__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_pESvYnSE).forEach(function (k) {
19
+ Object.keys(_externalAssets_CCo8CEpV).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_pESvYnSE[k];
23
+ return _externalAssets_CCo8CEpV[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/udmPro.jpg";
2
- export { default } from "../../../../../assets/udmPro.jpg";
1
+ export * from "../../../../../assets/udmPro2.jpg";
2
+ export { default } from "../../../../../assets/udmPro2.jpg";
3
3
  //# sourceMappingURL=udmPro.jpg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_CmLfPohF = require("../../../../../assets/udmProMax.jpg");
6
+ var _externalAssets_CMbJW0VT = require("../../../../../assets/udmProMax2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_CmLfPohF__default = /*#__PURE__*/_interopDefault(_externalAssets_CmLfPohF);
12
+ var _externalAssets_CMbJW0VT__default = /*#__PURE__*/_interopDefault(_externalAssets_CMbJW0VT);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_CmLfPohF__default["default"];
16
+ return _externalAssets_CMbJW0VT__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_CmLfPohF).forEach(function (k) {
19
+ Object.keys(_externalAssets_CMbJW0VT).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_CmLfPohF[k];
23
+ return _externalAssets_CMbJW0VT[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/udmProMax.jpg";
2
- export { default } from "../../../../../assets/udmProMax.jpg";
1
+ export * from "../../../../../assets/udmProMax2.jpg";
2
+ export { default } from "../../../../../assets/udmProMax2.jpg";
3
3
  //# sourceMappingURL=udmProMax.jpg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_BUotdZNw = require("../../../../../assets/udmProSpecial.jpg");
6
+ var _externalAssets_CBGnWxM$ = require("../../../../../assets/udmProSpecial2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_BUotdZNw__default = /*#__PURE__*/_interopDefault(_externalAssets_BUotdZNw);
12
+ var _externalAssets_CBGnWxM$__default = /*#__PURE__*/_interopDefault(_externalAssets_CBGnWxM$);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_BUotdZNw__default["default"];
16
+ return _externalAssets_CBGnWxM$__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_BUotdZNw).forEach(function (k) {
19
+ Object.keys(_externalAssets_CBGnWxM$).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_BUotdZNw[k];
23
+ return _externalAssets_CBGnWxM$[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/udmProSpecial.jpg";
2
- export { default } from "../../../../../assets/udmProSpecial.jpg";
1
+ export * from "../../../../../assets/udmProSpecial2.jpg";
2
+ export { default } from "../../../../../assets/udmProSpecial2.jpg";
3
3
  //# sourceMappingURL=udmProSpecial.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/udmPro2.jpg");
6
+ var image = require("../../../../assets/udmPro.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/udmPro2.jpg";
2
- export { default } from "../../../../assets/udmPro2.jpg";
1
+ export * from "../../../../assets/udmPro.jpg";
2
+ export { default } from "../../../../assets/udmPro.jpg";
3
3
  //# sourceMappingURL=udmPro.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/udmProMax2.jpg");
6
+ var image = require("../../../../assets/udmProMax.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/udmProMax2.jpg";
2
- export { default } from "../../../../assets/udmProMax2.jpg";
1
+ export * from "../../../../assets/udmProMax.jpg";
2
+ export { default } from "../../../../assets/udmProMax.jpg";
3
3
  //# sourceMappingURL=udmProMax.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/udmProSpecial2.jpg");
6
+ var image = require("../../../../assets/udmProSpecial.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/udmProSpecial2.jpg";
2
- export { default } from "../../../../assets/udmProSpecial2.jpg";
1
+ export * from "../../../../assets/udmProSpecial.jpg";
2
+ export { default } from "../../../../assets/udmProSpecial.jpg";
3
3
  //# sourceMappingURL=udmProSpecial.jpg.mjs.map
@@ -22,9 +22,9 @@ var throughput = require('./properties/throughput.js');
22
22
  var unifiAppSuite = require('./properties/unifiAppSuite.js');
23
23
  var unifiDevices = require('./properties/unifiDevices.js');
24
24
  var wanPorts = require('./properties/wanPorts.js');
25
- var _externalAssets_CmLfPohF = require("../../../assets/udmProMax.jpg");
26
- var _externalAssets_pESvYnSE = require("../../../assets/udmPro.jpg");
27
- var _externalAssets_BUotdZNw = require("../../../assets/udmProSpecial.jpg");
25
+ var _externalAssets_CMbJW0VT = require("../../../assets/udmProMax2.jpg");
26
+ var _externalAssets_CCo8CEpV = require("../../../assets/udmPro2.jpg");
27
+ var _externalAssets_CBGnWxM$ = require("../../../assets/udmProSpecial2.jpg");
28
28
  var image = require("../../../assets/udw2.jpg");
29
29
  var _externalAssets_ReJhRoVe = require("../../../assets/ucgMax2.jpg");
30
30
  var _externalAssets_sWF40Ihh = require("../../../assets/ucgUltra2.jpg");
@@ -36,9 +36,9 @@ function _interopDefault(e) {
36
36
  default: e
37
37
  };
38
38
  }
39
- var _externalAssets_CmLfPohF__default = /*#__PURE__*/_interopDefault(_externalAssets_CmLfPohF);
40
- var _externalAssets_pESvYnSE__default = /*#__PURE__*/_interopDefault(_externalAssets_pESvYnSE);
41
- var _externalAssets_BUotdZNw__default = /*#__PURE__*/_interopDefault(_externalAssets_BUotdZNw);
39
+ var _externalAssets_CMbJW0VT__default = /*#__PURE__*/_interopDefault(_externalAssets_CMbJW0VT);
40
+ var _externalAssets_CCo8CEpV__default = /*#__PURE__*/_interopDefault(_externalAssets_CCo8CEpV);
41
+ var _externalAssets_CBGnWxM$__default = /*#__PURE__*/_interopDefault(_externalAssets_CBGnWxM$);
42
42
  var image__default = /*#__PURE__*/_interopDefault(image);
43
43
  var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
44
44
  var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
@@ -56,18 +56,18 @@ const efg = {
56
56
  const udmProMax = {
57
57
  ...udmProMax$1.udmProMax,
58
58
  description: "udmProMax.customDescription",
59
- image: getImage(_externalAssets_CmLfPohF__default["default"])
59
+ image: getImage(_externalAssets_CMbJW0VT__default["default"])
60
60
  };
61
61
  const udmPro = {
62
62
  ...udmPro$1.udmPro,
63
63
  description: "udmPro.customDescription",
64
- image: getImage(_externalAssets_pESvYnSE__default["default"])
64
+ image: getImage(_externalAssets_CCo8CEpV__default["default"])
65
65
  };
66
66
  const udmProSpecial = {
67
67
  ...udmProSpecial$1.udmProSpecial,
68
68
  title: "udmProSpecial.customTitle",
69
69
  description: "udmProSpecial.customDescription",
70
- image: getImage(_externalAssets_BUotdZNw__default["default"])
70
+ image: getImage(_externalAssets_CBGnWxM$__default["default"])
71
71
  };
72
72
  const udw = {
73
73
  ...udw$1.udw,
@@ -20,9 +20,9 @@ import { throughput } from './properties/throughput.mjs';
20
20
  import { unifiAppSuite } from './properties/unifiAppSuite.mjs';
21
21
  import { unifiDevices } from './properties/unifiDevices.mjs';
22
22
  import { wanPorts } from './properties/wanPorts.mjs';
23
- import _externalAssets_CmLfPohF__default from "../../../assets/udmProMax.jpg";
24
- import _externalAssets_pESvYnSE__default from "../../../assets/udmPro.jpg";
25
- import _externalAssets_BUotdZNw__default from "../../../assets/udmProSpecial.jpg";
23
+ import _externalAssets_CMbJW0VT__default from "../../../assets/udmProMax2.jpg";
24
+ import _externalAssets_CCo8CEpV__default from "../../../assets/udmPro2.jpg";
25
+ import _externalAssets_CBGnWxM$__default from "../../../assets/udmProSpecial2.jpg";
26
26
  import image__default from "../../../assets/udw2.jpg";
27
27
  import _externalAssets_ReJhRoVe__default from "../../../assets/ucgMax2.jpg";
28
28
  import _externalAssets_sWF40Ihh__default from "../../../assets/ucgUltra2.jpg";
@@ -41,18 +41,18 @@ const efg = {
41
41
  const udmProMax = {
42
42
  ...udmProMax$1,
43
43
  description: "udmProMax.customDescription",
44
- image: getImage(_externalAssets_CmLfPohF__default)
44
+ image: getImage(_externalAssets_CMbJW0VT__default)
45
45
  };
46
46
  const udmPro = {
47
47
  ...udmPro$1,
48
48
  description: "udmPro.customDescription",
49
- image: getImage(_externalAssets_pESvYnSE__default)
49
+ image: getImage(_externalAssets_CCo8CEpV__default)
50
50
  };
51
51
  const udmProSpecial = {
52
52
  ...udmProSpecial$1,
53
53
  title: "udmProSpecial.customTitle",
54
54
  description: "udmProSpecial.customDescription",
55
- image: getImage(_externalAssets_BUotdZNw__default)
55
+ image: getImage(_externalAssets_CBGnWxM$__default)
56
56
  };
57
57
  const udw = {
58
58
  ...udw$1,
@@ -20,7 +20,7 @@ var unifiAppSuite = require('../properties/unifiAppSuite.js');
20
20
  var unifiDevices = require('../properties/unifiDevices.js');
21
21
  var unifiPowerBackup = require('../properties/unifiPowerBackup.js');
22
22
  var wanPorts = require('../properties/wanPorts.js');
23
- var image = require("../../../../assets/udmPro2.jpg");
23
+ var image = require("../../../../assets/udmPro.jpg");
24
24
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
25
25
  var applications = require("../../../../assets/applications.svg");
26
26
  var nextAiInspection = require('../properties/nextAiInspection.js');
@@ -18,7 +18,7 @@ import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
18
18
  import { unifiDevices } from '../properties/unifiDevices.mjs';
19
19
  import { unifiPowerBackup } from '../properties/unifiPowerBackup.mjs';
20
20
  import { wanPorts } from '../properties/wanPorts.mjs';
21
- import image__default from "../../../../assets/udmPro2.jpg";
21
+ import image__default from "../../../../assets/udmPro.jpg";
22
22
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
23
23
  import applications__default from "../../../../assets/applications.svg";
24
24
  import { nextAiInspection } from '../properties/nextAiInspection.mjs';
@@ -8,7 +8,7 @@ require('../../../StyleableSvgImage/index.js');
8
8
  require('../../assets/applications.svg.js');
9
9
  require('../../assets/Consoles/udmProMax.jpg.js');
10
10
  require('../properties/index.js');
11
- var image = require("../../../../assets/udmProMax2.jpg");
11
+ var image = require("../../../../assets/udmProMax.jpg");
12
12
  var unifiAppSuite = require('../properties/unifiAppSuite.js');
13
13
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
14
14
  var applications = require("../../../../assets/applications.svg");
@@ -6,7 +6,7 @@ import '../../../StyleableSvgImage/index.mjs';
6
6
  import '../../assets/applications.svg.mjs';
7
7
  import '../../assets/Consoles/udmProMax.jpg.mjs';
8
8
  import '../properties/index.mjs';
9
- import image__default from "../../../../assets/udmProMax2.jpg";
9
+ import image__default from "../../../../assets/udmProMax.jpg";
10
10
  import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
11
11
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
12
12
  import applications__default from "../../../../assets/applications.svg";
@@ -20,7 +20,7 @@ var unifiAppSuite = require('../properties/unifiAppSuite.js');
20
20
  var unifiDevices = require('../properties/unifiDevices.js');
21
21
  var unifiPowerBackup = require('../properties/unifiPowerBackup.js');
22
22
  var wanPorts = require('../properties/wanPorts.js');
23
- var image = require("../../../../assets/udmProSpecial2.jpg");
23
+ var image = require("../../../../assets/udmProSpecial.jpg");
24
24
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
25
25
  var applications = require("../../../../assets/applications.svg");
26
26
  var nextAiInspection = require('../properties/nextAiInspection.js');
@@ -18,7 +18,7 @@ import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
18
18
  import { unifiDevices } from '../properties/unifiDevices.mjs';
19
19
  import { unifiPowerBackup } from '../properties/unifiPowerBackup.mjs';
20
20
  import { wanPorts } from '../properties/wanPorts.mjs';
21
- import image__default from "../../../../assets/udmProSpecial2.jpg";
21
+ import image__default from "../../../../assets/udmProSpecial.jpg";
22
22
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
23
23
  import applications__default from "../../../../assets/applications.svg";
24
24
  import { nextAiInspection } from '../properties/nextAiInspection.mjs';
@@ -12,7 +12,7 @@ require('./assets/attention.svg.js');
12
12
  var InputCard_styles = require('./InputCard.styles.js');
13
13
  require('./InputSections/index.js');
14
14
  var CustomImage = require('../../../../CustomImage/CustomImage.js');
15
- var attentionIcon = require("../../../../../assets/attention2.svg");
15
+ var attentionIcon = require("../../../../../assets/attention.svg");
16
16
  var OptionSelectSection = require('./InputSections/OptionSelectSection.js');
17
17
  var SliderSection = require('./InputSections/SliderSection.js');
18
18
  var CounterSection = require('./InputSections/CounterSection.js');
@@ -10,7 +10,7 @@ import './assets/attention.svg.mjs';
10
10
  import { Card, Header, HeaderHeadingSection, HeadingIcon, HeadingTitle, HeaderActionSection, SubduedInfo, OverlayFilter, NotAvailableNoteWrap, NotAvailableNoteIcon, InputBody, InputSectionSpacing, Footer, FooterContent, FooterNote } from './InputCard.styles.mjs';
11
11
  import './InputSections/index.mjs';
12
12
  import { CustomImage } from '../../../../CustomImage/CustomImage.mjs';
13
- import attentionIcon__default from "../../../../../assets/attention2.svg";
13
+ import attentionIcon__default from "../../../../../assets/attention.svg";
14
14
  import { OptionSelectSection } from './InputSections/OptionSelectSection.mjs';
15
15
  import { SliderSection } from './InputSections/SliderSection.mjs';
16
16
  import { CounterSection } from './InputSections/CounterSection.mjs';
@@ -11,8 +11,8 @@ require('../assets/plus.svg.js');
11
11
  var Layout_styles = require('./Layout.styles.js');
12
12
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
13
13
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
14
- var MinusIcon = require("../../../../../../assets/minus4.svg");
15
- var PlusIcon = require("../../../../../../assets/plus5.svg");
14
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
15
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
16
16
  function _interopDefault(e) {
17
17
  return e && e.__esModule ? e : {
18
18
  default: e
@@ -9,8 +9,8 @@ import '../assets/plus.svg.mjs';
9
9
  import { InputWrapper, Label, InputFlexWrapper } from './Layout.styles.mjs';
10
10
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
11
11
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
12
- import MinusIcon__default from "../../../../../../assets/minus4.svg";
13
- import PlusIcon__default from "../../../../../../assets/plus5.svg";
12
+ import MinusIcon__default from "../../../../../../assets/minus5.svg";
13
+ import PlusIcon__default from "../../../../../../assets/plus6.svg";
14
14
  "use strict";
15
15
  const CounterSection = ({
16
16
  value,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var attentionIcon = require("../../../../../../assets/attention2.svg");
6
+ var attentionIcon = require("../../../../../../assets/attention.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/attention2.svg";
2
- export { default } from "../../../../../../assets/attention2.svg";
1
+ export * from "../../../../../../assets/attention.svg";
2
+ export { default } from "../../../../../../assets/attention.svg";
3
3
  //# sourceMappingURL=attention.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus4.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus4.svg";
2
- export { default } from "../../../../../../assets/minus4.svg";
1
+ export * from "../../../../../../assets/minus5.svg";
2
+ export { default } from "../../../../../../assets/minus5.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus5.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus5.svg";
2
- export { default } from "../../../../../../assets/plus5.svg";
1
+ export * from "../../../../../../assets/plus6.svg";
2
+ export { default } from "../../../../../../assets/plus6.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -6,7 +6,7 @@ var asset = require('../../../../../utils/asset.js');
6
6
  require('./assets/attention.svg.js');
7
7
  var Part = require('./Part.js');
8
8
  var ProgressBarChart_styles = require('./ProgressBarChart.styles.js');
9
- var attentionIcon = require("../../../../../assets/attention.svg");
9
+ var attentionIcon = require("../../../../../assets/attention2.svg");
10
10
  function _interopDefault(e) {
11
11
  return e && e.__esModule ? e : {
12
12
  default: e
@@ -4,7 +4,7 @@ import { imageSrc } from '../../../../../utils/asset.mjs';
4
4
  import './assets/attention.svg.mjs';
5
5
  import { PART_GAP_PX, PART_WIDTH_PX, Part } from './Part.mjs';
6
6
  import { ProgressBarChartContainer, ProgressBarChartHeader, ProgressBarChartTitle, ProgressBarWrapper, ProgressBarPartsContainer, ProgressBarAttentionLabel, ProgressBarAttentionLabelIcon } from './ProgressBarChart.styles.mjs';
7
- import attentionIcon__default from "../../../../../assets/attention.svg";
7
+ import attentionIcon__default from "../../../../../assets/attention2.svg";
8
8
  "use strict";
9
9
  const ProgressBarChart = ({
10
10
  title,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var attentionIcon = require("../../../../../../assets/attention.svg");
6
+ var attentionIcon = require("../../../../../../assets/attention2.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/attention.svg";
2
- export { default } from "../../../../../../assets/attention.svg";
1
+ export * from "../../../../../../assets/attention2.svg";
2
+ export { default } from "../../../../../../assets/attention2.svg";
3
3
  //# sourceMappingURL=attention.svg.mjs.map
@@ -19,8 +19,8 @@ var ComputeResourceCalculator_types = require('../../../../ComputeResourceCalcul
19
19
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
20
20
  var SearchIcon = require("../../../../../../assets/search2.svg");
21
21
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
22
- var MinusIcon = require("../../../../../../assets/minus5.svg");
23
- var PlusIcon = require("../../../../../../assets/plus6.svg");
22
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
23
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
24
24
  function _interopDefault(e) {
25
25
  return e && e.__esModule ? e : {
26
26
  default: e
@@ -17,8 +17,8 @@ import { isMessageFormatted } from '../../../../ComputeResourceCalculator/Comput
17
17
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
18
18
  import SearchIcon__default from "../../../../../../assets/search2.svg";
19
19
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
20
- import MinusIcon__default from "../../../../../../assets/minus5.svg";
21
- import PlusIcon__default from "../../../../../../assets/plus6.svg";
20
+ import MinusIcon__default from "../../../../../../assets/minus4.svg";
21
+ import PlusIcon__default from "../../../../../../assets/plus5.svg";
22
22
  "use strict";
23
23
  const NoopPlaceholder = () => /* @__PURE__ */jsx(Fragment, {});
24
24
  const PoeConsumerSelectModal = ({
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus5.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus5.svg";
2
- export { default } from "../../../../../../assets/minus5.svg";
1
+ export * from "../../../../../../assets/minus4.svg";
2
+ export { default } from "../../../../../../assets/minus4.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus6.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus6.svg";
2
- export { default } from "../../../../../../assets/plus6.svg";
1
+ export * from "../../../../../../assets/plus5.svg";
2
+ export { default } from "../../../../../../assets/plus5.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -18,7 +18,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
18
18
  "use strict";
19
19
  function patchUiComponentsAndIcons() {
20
20
  const uiComponentsPath = path__default["default"].resolve(__dirname, "../node_modules/@ubnt/ui-components");
21
- const ourStyleInjectPath = path__default["default"].resolve(__dirname, "./src/style-inject.mjs");
21
+ const ourStyleInjectPath = path__default["default"].resolve(__dirname, "./ssr/style-inject.mjs");
22
22
  const originalStyleInjectPath = path__default["default"].resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
23
23
  fs__default["default"].copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
24
24
  const files = glob.sync("**/*.module.css.js", {
@@ -1 +1 @@
1
- {"version":3,"file":"patch.js","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./src/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,aAAA,CAAA,SAAA,CAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,WAAAA,CAAAA,SAAAA,CAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,UAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,WAAAA,CAAAA,SAAAA,CAAG,CAAAQ,YAAA,CAAab,wBAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,mBAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAAA,CAAAA,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,WAAA,CAAA,SAAA,CAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
1
+ {"version":3,"file":"patch.js","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,aAAA,CAAA,SAAA,CAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,WAAAA,CAAAA,SAAAA,CAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,UAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,WAAAA,CAAAA,SAAAA,CAAG,CAAAQ,YAAA,CAAab,wBAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,mBAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAAA,CAAAA,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,WAAA,CAAA,SAAA,CAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -6,7 +6,7 @@ import { transformCssModule } from './ssr/transform-css-module.mjs';
6
6
  "use strict";
7
7
  function patchUiComponentsAndIcons() {
8
8
  const uiComponentsPath = path.resolve(__dirname, "../node_modules/@ubnt/ui-components");
9
- const ourStyleInjectPath = path.resolve(__dirname, "./src/style-inject.mjs");
9
+ const ourStyleInjectPath = path.resolve(__dirname, "./ssr/style-inject.mjs");
10
10
  const originalStyleInjectPath = path.resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
11
11
  fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
12
12
  const files = sync("**/*.module.css.js", {
@@ -1 +1 @@
1
- {"version":3,"file":"patch.mjs","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./src/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,IAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,IAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,IAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,EAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,KAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,EAAG,CAAAQ,YAAA,CAAab,IAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,cAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,EAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
1
+ {"version":3,"file":"patch.mjs","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,IAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,IAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,IAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,EAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,KAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,EAAG,CAAAQ,YAAA,CAAab,IAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,cAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,EAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -1,8 +1,14 @@
1
1
  import type { NextConfig } from "next";
2
+ export type WithUbntLibrariesConfig = {
3
+ /**
4
+ * ESM Modules to transpile
5
+ */
6
+ transpilePackages?: string[];
7
+ };
2
8
  /**
3
9
  * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common
4
10
  * patterns for next.js projects
5
11
  *
6
12
  * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!
7
13
  */
8
- export declare function withUbntLibraries(): (nextConfig: NextConfig) => NextConfig;
14
+ export declare function withUbntLibraries(options?: WithUbntLibrariesConfig): (nextConfig: NextConfig) => NextConfig;
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var array = require('../array.js');
3
4
  var patch = require('./patch.js');
4
5
  "use strict";
5
- function withUbntLibraries() {
6
+ function withUbntLibraries(options) {
6
7
  patch["default"]();
7
8
  const transpilePackages = [
9
+ // Extra libs
10
+ ...(options?.transpilePackages ?? []),
8
11
  // Core repos
9
12
  "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
10
13
  // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
@@ -13,13 +16,13 @@ function withUbntLibraries() {
13
16
  if (!nextConfig.experimental) {
14
17
  nextConfig.experimental = {};
15
18
  }
16
- nextConfig.experimental.optimizePackageImports = [...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages];
17
- nextConfig.transpilePackages = [...(nextConfig.transpilePackages ?? []), ...transpilePackages];
19
+ nextConfig.experimental.optimizePackageImports = array.dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
20
+ nextConfig.transpilePackages = array.dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
18
21
  nextConfig.experimental.esmExternals = "loose";
19
22
  const oldWebpackFn = nextConfig.webpack;
20
- nextConfig.webpack = (webpackConfig, options) => {
23
+ nextConfig.webpack = (webpackConfig, options2) => {
21
24
  if (oldWebpackFn) {
22
- webpackConfig = oldWebpackFn(webpackConfig, options);
25
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
23
26
  }
24
27
  const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
25
28
  const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport patchUiComponentsAndIcons from \"./patch\";\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(/* placeholder for future, options */) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = [\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ];\n nextConfig.transpilePackages = [\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ];\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","esmExternals","oldWebpackFn","webpack","webpackConfig","options","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;AAUO,SAASA,iBAAyDA,CAAA,EAAA;EAI7CC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACAD,UAAA,CAAWC,aAAaC,sBAAyB,GAAA,CAC/C,IAAIF,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACL;IACAC,UAAA,CAAWD,iBAAoB,GAAA,CAC7B,IAAIC,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACL;IAWAC,UAAA,CAAWC,aAAaE,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeJ,UAAW,CAAAK,OAAA;IACrBL,UAAA,CAAAK,OAAA,GAAU,CAACC,aAAA,EAAeC,OAAY,KAAA;MAC/C,IAAIH,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeC,OAAO,CAAA;MACrD;MAEA,MAAMC,UAAa,GAAAF,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAN,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAN,aAAA;IAAA,CACT;IAEO,OAAAN,UAAA;EAAA,CACT;AACF;"}
1
+ {"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,YAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,YAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
@@ -1,8 +1,11 @@
1
+ import { dedupe } from '../array.mjs';
1
2
  import patchUiComponentsAndIcons from './patch.mjs';
2
3
  "use strict";
3
- function withUbntLibraries() {
4
+ function withUbntLibraries(options) {
4
5
  patchUiComponentsAndIcons();
5
6
  const transpilePackages = [
7
+ // Extra libs
8
+ ...(options?.transpilePackages ?? []),
6
9
  // Core repos
7
10
  "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
8
11
  // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
@@ -11,13 +14,13 @@ function withUbntLibraries() {
11
14
  if (!nextConfig.experimental) {
12
15
  nextConfig.experimental = {};
13
16
  }
14
- nextConfig.experimental.optimizePackageImports = [...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages];
15
- nextConfig.transpilePackages = [...(nextConfig.transpilePackages ?? []), ...transpilePackages];
17
+ nextConfig.experimental.optimizePackageImports = dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
18
+ nextConfig.transpilePackages = dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
16
19
  nextConfig.experimental.esmExternals = "loose";
17
20
  const oldWebpackFn = nextConfig.webpack;
18
- nextConfig.webpack = (webpackConfig, options) => {
21
+ nextConfig.webpack = (webpackConfig, options2) => {
19
22
  if (oldWebpackFn) {
20
- webpackConfig = oldWebpackFn(webpackConfig, options);
23
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
21
24
  }
22
25
  const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
23
26
  const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport patchUiComponentsAndIcons from \"./patch\";\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(/* placeholder for future, options */) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = [\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ];\n nextConfig.transpilePackages = [\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ];\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","esmExternals","oldWebpackFn","webpack","webpackConfig","options","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;AAUO,SAASA,iBAAyDA,CAAA,EAAA;EAI7CC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACAD,UAAA,CAAWC,aAAaC,sBAAyB,GAAA,CAC/C,IAAIF,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACL;IACAC,UAAA,CAAWD,iBAAoB,GAAA,CAC7B,IAAIC,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACL;IAWAC,UAAA,CAAWC,aAAaE,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeJ,UAAW,CAAAK,OAAA;IACrBL,UAAA,CAAAK,OAAA,GAAU,CAACC,aAAA,EAAeC,OAAY,KAAA;MAC/C,IAAIH,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeC,OAAO,CAAA;MACrD;MAEA,MAAMC,UAAa,GAAAF,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAN,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAN,aAAA;IAAA,CACT;IAEO,OAAAN,UAAA;EAAA,CACT;AACF;"}
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,MAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,MAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "9.37.0-beta.0",
3
+ "version": "9.37.0-beta.1",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {