@fragmentsx/render-react 1.1.0 → 1.1.2

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.cjs.js CHANGED
@@ -2670,12 +2670,17 @@ const useReadVariable = (variableKey) => {
2670
2670
  layer: null
2671
2671
  };
2672
2672
  }
2673
- const instanceScope = scopes.findLast(
2673
+ let instanceScope = scopes.findLast(
2674
2674
  (scope) => {
2675
2675
  var _a2;
2676
2676
  return (scope == null ? void 0 : scope.type) === index.scopeTypes.InstanceScope && !!((_a2 = scope.documentManager) == null ? void 0 : _a2.resolve(variableKey2));
2677
2677
  }
2678
2678
  );
2679
+ if (!instanceScope) {
2680
+ instanceScope = scopes.find(
2681
+ (scope) => (scope == null ? void 0 : scope.type) === index.scopeTypes.InstanceScope
2682
+ );
2683
+ }
2679
2684
  const variableLayer = resolveVariableLayer(
2680
2685
  instanceScope == null ? void 0 : instanceScope.documentManager,
2681
2686
  variableKey2
@@ -3099,8 +3104,8 @@ const useLayerStyles = (layerKey) => {
3099
3104
  ...layout,
3100
3105
  ...layerSize,
3101
3106
  ...textStyles,
3102
- display,
3103
- "user-select": "none"
3107
+ display
3108
+ // "user-select": "none",
3104
3109
  // ...cssOverride,
3105
3110
  };
3106
3111
  } catch (e2) {
@@ -3550,6 +3555,10 @@ const useArea = (options2) => {
3550
3555
  options2 == null ? void 0 : options2.globalManager
3551
3556
  );
3552
3557
  const [areaData, setAreaData] = require$$0.useState(queryArea(options2.areaCode));
3558
+ const resultProps = require$$0.useMemo(
3559
+ () => ({ ...(areaData == null ? void 0 : areaData.props) ?? {}, ...(options2 == null ? void 0 : options2.props) ?? [] }),
3560
+ [areaData, options2]
3561
+ );
3553
3562
  require$$0.useEffect(() => {
3554
3563
  (async () => {
3555
3564
  const response = await queryArea(options2.areaCode);
@@ -3560,6 +3569,7 @@ const useArea = (options2) => {
3560
3569
  }, []);
3561
3570
  return {
3562
3571
  ...areaData,
3572
+ props: resultProps,
3563
3573
  globalManager: resultGlobalManager
3564
3574
  };
3565
3575
  };
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import require$$0, { createContext, useState, useEffect, useContext, useRef, useCallback, useMemo, Suspense } from "react";
2
+ import require$$0, { createContext, useState, useMemo, useEffect, useContext, useRef, useCallback, Suspense } from "react";
3
3
  import { definition } from "@fragmentsx/definition";
4
4
  import { isPartialKey, keyOfEntity, entityOfKey, isLinkKey } from "@graph-state/core";
5
5
  const collectStyles = (globalManager) => {
@@ -2668,12 +2668,17 @@ const useReadVariable = (variableKey) => {
2668
2668
  layer: null
2669
2669
  };
2670
2670
  }
2671
- const instanceScope = scopes.findLast(
2671
+ let instanceScope = scopes.findLast(
2672
2672
  (scope) => {
2673
2673
  var _a2;
2674
2674
  return (scope == null ? void 0 : scope.type) === index.scopeTypes.InstanceScope && !!((_a2 = scope.documentManager) == null ? void 0 : _a2.resolve(variableKey2));
2675
2675
  }
2676
2676
  );
2677
+ if (!instanceScope) {
2678
+ instanceScope = scopes.find(
2679
+ (scope) => (scope == null ? void 0 : scope.type) === index.scopeTypes.InstanceScope
2680
+ );
2681
+ }
2677
2682
  const variableLayer = resolveVariableLayer(
2678
2683
  instanceScope == null ? void 0 : instanceScope.documentManager,
2679
2684
  variableKey2
@@ -3097,8 +3102,8 @@ const useLayerStyles = (layerKey) => {
3097
3102
  ...layout,
3098
3103
  ...layerSize,
3099
3104
  ...textStyles,
3100
- display,
3101
- "user-select": "none"
3105
+ display
3106
+ // "user-select": "none",
3102
3107
  // ...cssOverride,
3103
3108
  };
3104
3109
  } catch (e2) {
@@ -3548,6 +3553,10 @@ const useArea = (options2) => {
3548
3553
  options2 == null ? void 0 : options2.globalManager
3549
3554
  );
3550
3555
  const [areaData, setAreaData] = useState(queryArea(options2.areaCode));
3556
+ const resultProps = useMemo(
3557
+ () => ({ ...(areaData == null ? void 0 : areaData.props) ?? {}, ...(options2 == null ? void 0 : options2.props) ?? [] }),
3558
+ [areaData, options2]
3559
+ );
3551
3560
  useEffect(() => {
3552
3561
  (async () => {
3553
3562
  const response = await queryArea(options2.areaCode);
@@ -3558,6 +3567,7 @@ const useArea = (options2) => {
3558
3567
  }, []);
3559
3568
  return {
3560
3569
  ...areaData,
3570
+ props: resultProps,
3561
3571
  globalManager: resultGlobalManager
3562
3572
  };
3563
3573
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fragmentsx/render-react",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.1.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -38,7 +38,7 @@
38
38
  "vite": "^6.1.0",
39
39
  "vite-plugin-css-injected-by-js": "^3.5.2",
40
40
  "vite-plugin-dts": "^4.5.0",
41
- "@fragmentsx/render-core": "0.1.0"
41
+ "@fragmentsx/render-core": "0.1.1"
42
42
  },
43
43
  "scripts": {
44
44
  "clear": "rm -r -f ./dist",