@fragmentsx/render-react 1.1.1 → 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 +5 -0
- package/dist/index.es.js +6 -1
- package/package.json +2 -2
- package/dist/components/Area/index.d.ts +0 -3
- package/dist/components/Area/index.d.ts.map +0 -1
- package/dist/components/Collection/index.d.ts +0 -7
- package/dist/components/Collection/index.d.ts.map +0 -1
- package/dist/components/Fragment/index.d.ts +0 -2
- package/dist/components/Fragment/index.d.ts.map +0 -1
- package/dist/components/Frame/index.d.ts +0 -15
- package/dist/components/Frame/index.d.ts.map +0 -1
- package/dist/components/GlobalManager/index.d.ts +0 -2
- package/dist/components/GlobalManager/index.d.ts.map +0 -1
- package/dist/components/Instance/index.d.ts +0 -18
- package/dist/components/Instance/index.d.ts.map +0 -1
- package/dist/components/Text/index.d.ts +0 -10
- package/dist/components/Text/index.d.ts.map +0 -1
- package/dist/helpers/collectStyles.d.ts +0 -3
- package/dist/helpers/collectStyles.d.ts.map +0 -1
- package/dist/helpers/hydration.d.ts +0 -3
- package/dist/helpers/hydration.d.ts.map +0 -1
- package/dist/helpers/isBrowser.d.ts +0 -2
- package/dist/helpers/isBrowser.d.ts.map +0 -1
- package/dist/helpers/loadFragmentManager.d.ts +0 -3
- package/dist/helpers/loadFragmentManager.d.ts.map +0 -1
- package/dist/hocs/reactCSRAdapter.d.ts +0 -2
- package/dist/hocs/reactCSRAdapter.d.ts.map +0 -1
- package/dist/hocs/reactSSRAdapter.d.ts +0 -3
- package/dist/hocs/reactSSRAdapter.d.ts.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/providers/Scope.d.ts +0 -10
- package/dist/providers/Scope.d.ts.map +0 -1
- package/dist/reactAdapter.d.ts +0 -2
- package/dist/reactAdapter.d.ts.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3555,6 +3555,10 @@ const useArea = (options2) => {
|
|
|
3555
3555
|
options2 == null ? void 0 : options2.globalManager
|
|
3556
3556
|
);
|
|
3557
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
|
+
);
|
|
3558
3562
|
require$$0.useEffect(() => {
|
|
3559
3563
|
(async () => {
|
|
3560
3564
|
const response = await queryArea(options2.areaCode);
|
|
@@ -3565,6 +3569,7 @@ const useArea = (options2) => {
|
|
|
3565
3569
|
}, []);
|
|
3566
3570
|
return {
|
|
3567
3571
|
...areaData,
|
|
3572
|
+
props: resultProps,
|
|
3568
3573
|
globalManager: resultGlobalManager
|
|
3569
3574
|
};
|
|
3570
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,
|
|
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) => {
|
|
@@ -3553,6 +3553,10 @@ const useArea = (options2) => {
|
|
|
3553
3553
|
options2 == null ? void 0 : options2.globalManager
|
|
3554
3554
|
);
|
|
3555
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
|
+
);
|
|
3556
3560
|
useEffect(() => {
|
|
3557
3561
|
(async () => {
|
|
3558
3562
|
const response = await queryArea(options2.areaCode);
|
|
@@ -3563,6 +3567,7 @@ const useArea = (options2) => {
|
|
|
3563
3567
|
}, []);
|
|
3564
3568
|
return {
|
|
3565
3569
|
...areaData,
|
|
3570
|
+
props: resultProps,
|
|
3566
3571
|
globalManager: resultGlobalManager
|
|
3567
3572
|
};
|
|
3568
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.
|
|
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.
|
|
41
|
+
"@fragmentsx/render-core": "0.1.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"clear": "rm -r -f ./dist",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Area/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAIV,MAAM,yBAAyB,CAAC;AA6BjC,eAAO,MAAM,IAAI,UAAW,SAAS,4CAYpC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Collection/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAGxC,UAAU,eAAgB,SAAQ,UAAU;CAAG;AAE/C,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA+D1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Fragment/index.tsx"],"names":[],"mappings":"AAgFA,eAAO,MAAM,QAAQ,yDAuBpB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ElementType, FC } from 'react';
|
|
2
|
-
import { LinkKey } from '@graph-state/core';
|
|
3
|
-
import { UseFrameOptions } from '@fragmentsx/render-core/dist/components/Frame/hooks/useFrame';
|
|
4
|
-
export interface FrameProps extends UseFrameOptions {
|
|
5
|
-
TextElement?: ElementType;
|
|
6
|
-
InstanceElement?: ElementType;
|
|
7
|
-
FrameElement?: ElementType;
|
|
8
|
-
CollectionElement?: ElementType;
|
|
9
|
-
styles?: boolean;
|
|
10
|
-
hidden?: boolean;
|
|
11
|
-
interactive?: boolean;
|
|
12
|
-
layerKey: LinkKey;
|
|
13
|
-
}
|
|
14
|
-
export declare const Frame: FC<FrameProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Frame/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAG/F,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAwDhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GlobalManager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
-
import { LinkKey } from '@graph-state/core';
|
|
3
|
-
interface InstanceOptions {
|
|
4
|
-
ssr?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface InstanceProps extends ComponentPropsWithoutRef<"div"> {
|
|
7
|
-
FrameElement?: ElementType;
|
|
8
|
-
layerKey?: LinkKey;
|
|
9
|
-
fragmentId?: string;
|
|
10
|
-
interactive?: boolean;
|
|
11
|
-
props?: Record<string, unknown>;
|
|
12
|
-
options?: InstanceOptions;
|
|
13
|
-
globalManager?: unknown;
|
|
14
|
-
Tag?: string | ElementType;
|
|
15
|
-
}
|
|
16
|
-
export declare const Instance: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Instance/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAgB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAW5C,UAAU,eAAe;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAc,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACpE,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC5B;AAoFD,eAAO,MAAM,QAAQ,yDAYpB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { LinkKey } from '@graph-state/core';
|
|
2
|
-
import { ComponentPropsWithoutRef, ElementType, FC } from 'react';
|
|
3
|
-
import { UseTextAttributes } from '@fragmentsx/render-core/dist/components/Text/hooks/useTextAttributes';
|
|
4
|
-
interface TextProps extends ComponentPropsWithoutRef<"div">, UseTextAttributes {
|
|
5
|
-
Tag?: string | ElementType;
|
|
6
|
-
layerKey: LinkKey;
|
|
7
|
-
}
|
|
8
|
-
export declare const Text: FC<TextProps>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAEzG,UAAU,SAAU,SAAQ,wBAAwB,CAAC,KAAK,CAAC,EAAE,iBAAiB;IAC5E,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAgB9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/collectStyles.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,aAAa,kBAAmB,UAAU,qDA4CtD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../src/helpers/hydration.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,UAGtC;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,OAYzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isBrowser.d.ts","sourceRoot":"","sources":["../../src/helpers/isBrowser.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAAgC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadFragmentManager.d.ts","sourceRoot":"","sources":["../../src/helpers/loadFragmentManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,mBAAmB,kBACf,UAAU,cACb,MAAM,iBAmBnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactCSRAdapter.d.ts","sourceRoot":"","sources":["../../src/hocs/reactCSRAdapter.tsx"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,eAAe,EAAE,GAAG,WACX,GAAG,6CAgD3C"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function createResource(resourceCache: any, key: string, fetcher: () => Promise<any>): any;
|
|
2
|
-
export declare function reactSSRAdapter(PreactComponent: any): (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=reactSSRAdapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactSSRAdapter.d.ts","sourceRoot":"","sources":["../../src/hocs/reactSSRAdapter.tsx"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAC5B,aAAa,KAAA,EACb,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,OA2B5B;AAED,wBAAgB,eAAe,CAAC,eAAe,EAAE,GAAG,WACF,GAAG,6CA4BpD"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { collectStyles } from './helpers/collectStyles';
|
|
2
|
-
export { Instance } from './components/Instance';
|
|
3
|
-
export { Area } from './components/Area';
|
|
4
|
-
export { Text } from './components/Text';
|
|
5
|
-
export { Frame } from './components/Frame';
|
|
6
|
-
export { Fragment } from './components/Fragment';
|
|
7
|
-
export { Collection } from './components/Collection';
|
|
8
|
-
export { Scope } from './providers/Scope';
|
|
9
|
-
export * from '@fragmentsx/render-core';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { GraphState, LinkKey } from '@graph-state/core';
|
|
3
|
-
interface ScopeProps extends PropsWithChildren {
|
|
4
|
-
fragmentManager: GraphState;
|
|
5
|
-
layerKey: LinkKey;
|
|
6
|
-
value: unknown;
|
|
7
|
-
}
|
|
8
|
-
export declare const Scope: FC<ScopeProps>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=Scope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/providers/Scope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAExD,UAAU,UAAW,SAAQ,iBAAiB;IAC5C,eAAe,EAAE,UAAU,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAchC,CAAC"}
|
package/dist/reactAdapter.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactAdapter.d.ts","sourceRoot":"","sources":["../src/reactAdapter.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,GAAG,2DAMxD"}
|