@neurodyn/react-room-viewer 0.0.12 → 0.0.13

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 +15 -5
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -6834,17 +6834,27 @@ roomViewerI18n.use(i18next_browser_languagedetector).use(initReactI18next).init(
6834
6834
  });
6835
6835
  const PROPERTY_BLOCK_RE = /@property\s+(--[^{\s]+)\s*\{([^}]*)\}/g;
6836
6836
  const INITIAL_VALUE_RE = /initial-value:([^;\n]+);/i;
6837
+ const NON_INHERITING_RE = /inherits:\s*false(?:\s*;|\s*$)/i;
6837
6838
  const ROOT_TO_HOST_SELECTOR_RE = /:root\s*,\s*:host|:root/g;
6838
6839
  function createShadowRootCssText(cssText) {
6839
6840
  const cssForHost = cssText.replace(ROOT_TO_HOST_SELECTOR_RE, ':host');
6840
6841
  const propertyBlocks = Array.from(cssText.matchAll(PROPERTY_BLOCK_RE));
6841
6842
  const propertyDefaults = propertyBlocks.map(([, name, body])=>{
6842
- const match = body.match(INITIAL_VALUE_RE);
6843
- if (!match) return null;
6844
- const initialValue = match[1].trim();
6845
- return ` ${name}: ${initialValue};`;
6843
+ if (!NON_INHERITING_RE.test(body)) return null;
6844
+ const initialValue = body.match(INITIAL_VALUE_RE)?.[1].trim() ?? 'initial';
6845
+ return ` ${name}: ${initialValue};`;
6846
6846
  }).filter((value)=>null !== value).join('\n');
6847
- return propertyDefaults ? `:host {\n${propertyDefaults}\n}\n\n${cssForHost}` : cssForHost;
6847
+ if (!propertyDefaults) return cssForHost;
6848
+ return `${cssForHost}\n\n@layer base {
6849
+ :host,
6850
+ *,
6851
+ ::before,
6852
+ ::after,
6853
+ ::backdrop,
6854
+ ::file-selector-button {
6855
+ ${propertyDefaults}
6856
+ }
6857
+ }`;
6848
6858
  }
6849
6859
  var styleinline = __webpack_require__("./src/style.css?inline");
6850
6860
  const shadowRootCssText = createShadowRootCssText(styleinline.A);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neurodyn/react-room-viewer",
3
3
  "type": "module",
4
- "version": "0.0.12",
4
+ "version": "0.0.13",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -70,7 +70,8 @@
70
70
  "scripts": {
71
71
  "dev": "rsbuild dev",
72
72
  "build": "rslib build",
73
- "test": "vitest run",
73
+ "test": "vitest run src",
74
+ "test:e2e": "playwright test e2e",
74
75
  "typecheck": "tsc --noEmit",
75
76
  "lint": "eslint .",
76
77
  "lint:fix": "eslint . --fix",