@neurodyn/react-model-viewer 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -29,7 +29,15 @@ declare type ModelViewerBackground = 'default' | 'transparent';
29
29
 
30
30
  export declare function ModelViewerDialog({ tinuuid, apiKey, apiBaseUrl, legacyApiBaseUrl, initialWidgetSessionToken, handoffUrl, hid, sizeType, dimensionAxes, ...props }: ModelViewerDialogProps): JSX.Element;
31
31
 
32
- declare interface ModelViewerDialogProps extends Pick<ModelViewerRootProps, 'apiBaseUrl' | 'apiKey' | 'dimensionAxes' | 'handoffUrl' | 'hid' | 'initialWidgetSessionToken' | 'legacyApiBaseUrl' | 'sizeType' | 'tinuuid'>, Omit<DialogProps, 'children'> {
32
+ declare interface ModelViewerDialogProps extends Pick<ModelViewerRootProps, 'apiBaseUrl' | 'apiKey' | 'dimensionAxes' | 'handoffUrl' | 'hid' | 'initialWidgetSessionToken' | 'legacyApiBaseUrl' | 'sizeType' | 'tinuuid'>, Omit<DialogProps, 'children' | 'open' | 'defaultOpen' | 'onOpenChange' | 'modal'> {
33
+ /** The controlled open state of the dialog. Use with `onOpenChange`. */
34
+ open?: DialogProps['open'];
35
+ /** The initial open state when the dialog is uncontrolled. */
36
+ defaultOpen?: DialogProps['defaultOpen'];
37
+ /** Called when the dialog's open state changes. */
38
+ onOpenChange?: DialogProps['onOpenChange'];
39
+ /** Whether interaction outside the dialog is disabled. Defaults to `true`. */
40
+ modal?: DialogProps['modal'];
33
41
  }
34
42
 
35
43
  export declare type ModelViewerLanguage = 'en' | 'ru';
@@ -42,7 +50,6 @@ export declare interface ModelViewerProps extends Omit<ModelViewerRootProps, 'sh
42
50
  declare interface ModelViewerRootProps {
43
51
  /** The unique identifier of a Vizbl object. */
44
52
  tinuuid: string;
45
- /** Public API key. Without it, the viewer uses the legacy `/obj/Fetch` API. */
46
53
  apiKey?: string | null;
47
54
  /** App Clip bundle used by automatic Advanced AR handoffs. */
48
55
  appClipBundleId?: string;
package/dist/index.js CHANGED
@@ -1859,6 +1859,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
1859
1859
  padding-bottom: 5px;
1860
1860
  }
1861
1861
 
1862
+ .pl-2 {
1863
+ padding-left: calc(var(--spacing) * 2);
1864
+ }
1865
+
1862
1866
  .pl-3 {
1863
1867
  padding-left: calc(var(--spacing) * 3);
1864
1868
  }
@@ -4262,6 +4266,10 @@ button, input:where([type="button"], [type="reset"], [type="submit"]) {
4262
4266
  color: var(--v-text-dark);
4263
4267
  }
4264
4268
 
4269
+ .data-\\[variant\\=destructive\\]\\:\\[\\&_svg\\:not\\(\\[class\\*\\=text-\\]\\)\\]\\:text-inherit[data-variant="destructive"] svg:not([class*="text-"]) {
4270
+ color: inherit;
4271
+ }
4272
+
4265
4273
  .\\[\\&_tr\\]\\:border-b tr {
4266
4274
  border-bottom-style: var(--tw-border-style);
4267
4275
  border-bottom-width: 1px;
@@ -5731,6 +5739,7 @@ const PROPERTY_BLOCK_RE = /@property\s+(--[^{\s]+)\s*\{([^}]*)\}/g;
5731
5739
  const INITIAL_VALUE_RE = /initial-value:([^;}]+)/i;
5732
5740
  const NON_INHERITING_RE = /inherits:\s*false(?:\s*;|\s*$)/i;
5733
5741
  const ROOT_TO_HOST_SELECTOR_RE = /:root\s*,\s*:host|:root/g;
5742
+ const SHADOW_HOST_VISIBILITY_CSS = ':host{display:block!important;visibility:visible!important}';
5734
5743
  function createShadowRootCssText(cssText) {
5735
5744
  const cssForHost = cssText.replace(ROOT_TO_HOST_SELECTOR_RE, ':host');
5736
5745
  const propertyBlocks = Array.from(cssText.matchAll(PROPERTY_BLOCK_RE));
@@ -7031,6 +7040,9 @@ function resolveDirectArExperience(mode, arExperience) {
7031
7040
  if ('advanced-ar-view' === mode || 'ar-viewer' === mode || 'embedded-3d-viewer' === mode) return 'advanced';
7032
7041
  if ('qr-code' === mode) return arExperience;
7033
7042
  }
7043
+ function shouldAutoLaunchDirectAr(mode) {
7044
+ return 'ar-viewer' !== mode && 'embedded-3d-viewer' !== mode;
7045
+ }
7034
7046
  function getUserAgent() {
7035
7047
  if ("u" < typeof navigator) return '';
7036
7048
  return navigator.userAgent || navigator.vendor || '';
@@ -7183,7 +7195,7 @@ function AR({ disabled, onClick, onBeforeActivateAr, size = 'lg', ...props }) {
7183
7195
  widgetSessionToken
7184
7196
  ]);
7185
7197
  useEffect(()=>{
7186
- if (!directArLaunchOptions || isLoading || !isMobileArDevice()) return;
7198
+ if (!directArLaunchOptions || isLoading || !shouldAutoLaunchDirectAr(mode) || !isMobileArDevice()) return;
7187
7199
  const launchKey = [
7188
7200
  widgetSessionSid ?? 'legacy',
7189
7201
  directArLaunchOptions.tinuuid,
@@ -7210,6 +7222,7 @@ function AR({ disabled, onClick, onBeforeActivateAr, size = 'lg', ...props }) {
7210
7222
  isLoading,
7211
7223
  launchAr,
7212
7224
  material?.hid,
7225
+ mode,
7213
7226
  trackEvent,
7214
7227
  widgetSessionSid
7215
7228
  ]);
@@ -7218,11 +7231,6 @@ function AR({ disabled, onClick, onBeforeActivateAr, size = 'lg', ...props }) {
7218
7231
  if (await launchArOverride(launchAr, arTarget)) return void onBeforeActivateAr?.();
7219
7232
  if (directArLaunchOptions && isMobileArDevice()) {
7220
7233
  onBeforeActivateAr?.();
7221
- if ('advanced' === directArLaunchOptions.experience && isSupportedAppClipDevice()) {
7222
- launchDirectAr(directArLaunchOptions, true);
7223
- trackEvent('ar_launched');
7224
- return;
7225
- }
7226
7234
  await flushWidgetEvent(trackEvent('ar_launched'));
7227
7235
  launchDirectAr(directArLaunchOptions);
7228
7236
  } else if (modelViewerEl.canActivateAR) {
@@ -8092,6 +8100,9 @@ function ModelViewerDialog({ tinuuid, apiKey, apiBaseUrl, legacyApiBaseUrl, init
8092
8100
  zIndex: 2147483647
8093
8101
  },
8094
8102
  children: [
8103
+ /*#__PURE__*/ jsx("style", {
8104
+ children: SHADOW_HOST_VISIBILITY_CSS
8105
+ }),
8095
8106
  /*#__PURE__*/ jsx("style", {
8096
8107
  children: shadowRootCssText
8097
8108
  }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neurodyn/react-model-viewer",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },