@neurodyn/react-ai-try-on 0.0.4 → 0.0.5

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 (2) hide show
  1. package/dist/index.js +28 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -935,6 +935,10 @@ var __webpack_modules__ = {
935
935
  height: auto;
936
936
  }
937
937
 
938
+ .h-dvh {
939
+ height: 100dvh;
940
+ }
941
+
938
942
  .h-full {
939
943
  height: 100%;
940
944
  }
@@ -943,10 +947,6 @@ var __webpack_modules__ = {
943
947
  height: 1px;
944
948
  }
945
949
 
946
- .h-svh {
947
- height: 100svh;
948
- }
949
-
950
950
  .max-h-\\(--radix-select-content-available-height\\) {
951
951
  max-height: var(--radix-select-content-available-height);
952
952
  }
@@ -955,12 +955,12 @@ var __webpack_modules__ = {
955
955
  max-height: calc(var(--spacing) * 179);
956
956
  }
957
957
 
958
- .max-h-none {
959
- max-height: none;
958
+ .max-h-dvh {
959
+ max-height: 100dvh;
960
960
  }
961
961
 
962
- .max-h-svh {
963
- max-height: 100svh;
962
+ .max-h-none {
963
+ max-height: none;
964
964
  }
965
965
 
966
966
  .min-h-0 {
@@ -10389,18 +10389,28 @@ function createAiTryOnI18n(language) {
10389
10389
  return instance;
10390
10390
  }
10391
10391
  const PROPERTY_BLOCK_RE = /@property\s+(--[^{\s]+)\s*\{([^}]*)\}/g;
10392
- const INITIAL_VALUE_RE = /initial-value:([^;\n]+);/i;
10392
+ const INITIAL_VALUE_RE = /initial-value:([^;}]+)/i;
10393
+ const NON_INHERITING_RE = /inherits:\s*false(?:\s*;|\s*$)/i;
10393
10394
  const ROOT_TO_HOST_SELECTOR_RE = /:root\s*,\s*:host|:root/g;
10394
10395
  function createShadowRootCssText(cssText) {
10395
10396
  const cssForHost = cssText.replace(ROOT_TO_HOST_SELECTOR_RE, ':host');
10396
10397
  const propertyBlocks = Array.from(cssText.matchAll(PROPERTY_BLOCK_RE));
10397
10398
  const propertyDefaults = propertyBlocks.map(([, name, body])=>{
10398
- const match = body.match(INITIAL_VALUE_RE);
10399
- if (!match) return null;
10400
- const initialValue = match[1].trim();
10401
- return ` ${name}: ${initialValue};`;
10399
+ if (!NON_INHERITING_RE.test(body)) return null;
10400
+ const initialValue = body.match(INITIAL_VALUE_RE)?.[1].trim() ?? 'initial';
10401
+ return ` ${name}: ${initialValue};`;
10402
10402
  }).filter((value)=>null !== value).join('\n');
10403
- return propertyDefaults ? `:host {\n${propertyDefaults}\n}\n\n${cssForHost}` : cssForHost;
10403
+ if (!propertyDefaults) return cssForHost;
10404
+ return `${cssForHost}\n\n@layer base {
10405
+ :host,
10406
+ *,
10407
+ ::before,
10408
+ ::after,
10409
+ ::backdrop,
10410
+ ::file-selector-button {
10411
+ ${propertyDefaults}
10412
+ }
10413
+ }`;
10404
10414
  }
10405
10415
  var styleinline = __webpack_require__("./src/style.css?inline");
10406
10416
  const shadowRootCssText = createShadowRootCssText(styleinline.A);
@@ -18197,7 +18207,7 @@ function ComparisonDialog({ onAddToCart, onClose, onDeleteResult, onSaveResult,
18197
18207
  open: true,
18198
18208
  onOpenChange: (open)=>!open && onClose(),
18199
18209
  children: /*#__PURE__*/ jsxs(DialogContent, {
18200
- className: `dark fixed inset-0 left-0 top-0 flex h-svh max-h-none w-svw max-w-none translate-x-0 translate-y-0 flex-col rounded-none ${COMPARISON_DIALOG_BACKGROUND_CLASS_NAME} p-0 text-text-dark duration-200 sm:max-w-none sm:p-0`,
18210
+ className: `dark fixed inset-0 left-0 top-0 flex h-dvh max-h-none w-svw max-w-none translate-x-0 translate-y-0 flex-col rounded-none ${COMPARISON_DIALOG_BACKGROUND_CLASS_NAME} p-0 text-text-dark duration-200 sm:max-w-none sm:p-0`,
18201
18211
  portalContainer: portalContainer,
18202
18212
  showCloseButton: false,
18203
18213
  children: [
@@ -18392,7 +18402,7 @@ function Badge({ className, variant, size, asChild = false, ...props }) {
18392
18402
  }
18393
18403
  function TryOnShell({ className, ...props }) {
18394
18404
  return /*#__PURE__*/ jsx_runtime_jsx("div", {
18395
- className: utils_cn('flex max-h-svh w-svw flex-col overflow-hidden rounded-t-3xl rounded-b-none bg-background-containers text-foreground shadow-2xl sm:max-h-[min(calc(100svh-var(--spacing)*8),--spacing(176))] sm:w-120 sm:rounded-3xl', className),
18405
+ className: utils_cn('flex max-h-dvh w-svw flex-col overflow-hidden rounded-t-3xl rounded-b-none bg-background-containers text-foreground shadow-2xl sm:max-h-[min(calc(100svh-var(--spacing)*8),--spacing(176))] sm:w-120 sm:rounded-3xl', className),
18396
18406
  ...props
18397
18407
  });
18398
18408
  }
@@ -20697,7 +20707,7 @@ function AiTryOnRoot({ dialogPortalContainer, language, onClose, processPhoto, p
20697
20707
  ]
20698
20708
  }) : null;
20699
20709
  return /*#__PURE__*/ jsxs(TryOnShell, {
20700
- className: isMyFitsActive ? 'h-svh max-h-svh sm:h-230 sm:max-h-[calc(100svh-var(--spacing)*8)]' : void 0,
20710
+ className: isMyFitsActive ? 'h-dvh max-h-dvh sm:h-230 sm:max-h-[calc(100svh-var(--spacing)*8)]' : void 0,
20701
20711
  "data-ai-try-on-stage": stage,
20702
20712
  children: [
20703
20713
  /*#__PURE__*/ jsx_runtime_jsx(TryOnHeader, {
@@ -20869,7 +20879,7 @@ function AiTryOnDialogContent({ language, onRequestClose, portalContainer, produ
20869
20879
  return /*#__PURE__*/ jsx_runtime_jsx(Dialog, {
20870
20880
  ...props,
20871
20881
  children: /*#__PURE__*/ jsxs(DialogContent, {
20872
- className: "inset-x-0 bottom-0 top-auto block max-h-svh w-svw max-w-none translate-x-0 translate-y-0 gap-0 overflow-hidden rounded-t-3xl rounded-b-none p-0 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:left-auto sm:max-h-230 sm:w-120 sm:max-w-120 sm:rounded-3xl sm:p-0",
20882
+ className: "inset-x-0 bottom-0 top-auto block max-h-dvh w-svw max-w-none translate-x-0 translate-y-0 gap-0 overflow-hidden rounded-t-3xl rounded-b-none p-0 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:left-auto sm:max-h-230 sm:w-120 sm:max-w-120 sm:rounded-3xl sm:p-0",
20873
20883
  contentInsideOverlay: true,
20874
20884
  portalContainer: portalContainer,
20875
20885
  showCloseButton: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neurodyn/react-ai-try-on",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },