@xyo-network/react-pixel 4.1.8 → 4.1.9
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface PixelProviderProps {
|
|
4
4
|
id: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const PixelProvider: React.FC<
|
|
6
|
+
export declare const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>>;
|
|
7
7
|
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/Provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/Provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;CACX;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAgBzE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/Pixel/Context.ts","../../src/contexts/Pixel/Provider.tsx","../../src/contexts/Pixel/use.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { PixelContextState } from './State.ts'\n\nexport const PixelContext = createContextEx<PixelContextState>()\n","import { XyPixel } from '@xylabs/pixel'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/Pixel/Context.ts","../../src/contexts/Pixel/Provider.tsx","../../src/contexts/Pixel/use.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { PixelContextState } from './State.ts'\n\nexport const PixelContext = createContextEx<PixelContextState>()\n","import { XyPixel } from '@xylabs/pixel'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nimport { PixelContext } from './Context.ts'\n\nexport interface PixelProviderProps {\n id: string\n}\n\nexport const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>> = (props) => {\n const { children, id } = props\n XyPixel.init(id)\n\n const value = useMemo(() => ({\n pixel: XyPixel.instance,\n provided: true,\n }), [XyPixel.instance])\n\n return (\n <PixelContext.Provider\n value={value}\n >\n {children}\n </PixelContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { PixelContext } from './Context.ts'\n\nexport const usePixel = (required = true) => {\n const { pixel } = useContextEx(PixelContext, 'Pixel', required)\n return pixel\n}\n"],"mappings":";;;;AAAA,SAASA,uBAAuB;AAIzB,IAAMC,eAAeD,gBAAAA;;;ACJ5B,SAASE,eAAe;AAExB,OAAOC,SAASC,eAAe;AAQxB,IAAMC,gBAAiE,wBAACC,UAAAA;AAC7E,QAAM,EAAEC,UAAUC,GAAE,IAAKF;AACzBG,UAAQC,KAAKF,EAAAA;AAEb,QAAMG,QAAQC,QAAQ,OAAO;IAC3BC,OAAOJ,QAAQK;IACfC,UAAU;EACZ,IAAI;IAACN,QAAQK;GAAS;AAEtB,SACE,sBAAA,cAACE,aAAaC,UAAQ;IACpBN;KAECJ,QAAAA;AAGP,GAhB8E;;;ACV9E,SAASW,oBAAoB;AAItB,IAAMC,WAAW,wBAACC,WAAW,SAAI;AACtC,QAAM,EAAEC,MAAK,IAAKC,aAAaC,cAAc,SAASH,QAAAA;AACtD,SAAOC;AACT,GAHwB;","names":["createContextEx","PixelContext","XyPixel","React","useMemo","PixelProvider","props","children","id","XyPixel","init","value","useMemo","pixel","instance","provided","PixelContext","Provider","useContextEx","usePixel","required","pixel","useContextEx","PixelContext"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-pixel",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.9",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@xylabs/pixel": "^2.0.6",
|
|
47
|
-
"@
|
|
48
|
-
"@xyo-network/react-shared": "^4.1.8"
|
|
47
|
+
"@xyo-network/react-shared": "^4.1.9"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@mui/icons-material": "^6.1.5",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyPixel } from '@xylabs/pixel'
|
|
2
|
-
import type {
|
|
2
|
+
import type { PropsWithChildren } from 'react'
|
|
3
3
|
import React, { useMemo } from 'react'
|
|
4
4
|
|
|
5
5
|
import { PixelContext } from './Context.ts'
|
|
@@ -8,7 +8,7 @@ export interface PixelProviderProps {
|
|
|
8
8
|
id: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const PixelProvider: React.FC<
|
|
11
|
+
export const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>> = (props) => {
|
|
12
12
|
const { children, id } = props
|
|
13
13
|
XyPixel.init(id)
|
|
14
14
|
|