@xyo-network/react-pixel 4.4.10 → 5.0.0-rc.1

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.
@@ -17,7 +17,7 @@ var PixelProvider = /* @__PURE__ */ __name((props) => {
17
17
  }), [
18
18
  XyPixel.instance
19
19
  ]);
20
- return /* @__PURE__ */ React.createElement(PixelContext.Provider, {
20
+ return /* @__PURE__ */ React.createElement(PixelContext, {
21
21
  value
22
22
  }, children);
23
23
  }, "PixelProvider");
@@ -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 { 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"]}
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\n value={value}\n >\n {children}\n </PixelContext>\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,cAAAA;IACCL;KAECJ,QAAAA;AAGP,GAhB8E;;;ACV9E,SAASU,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","useContextEx","usePixel","required","pixel","useContextEx","PixelContext"]}
@@ -0,0 +1,3 @@
1
+ import type { PixelContextState } from './State.ts';
2
+ export declare const PixelContext: import("react").Context<PixelContextState & import("@xyo-network/react-shared").ContextExState>;
3
+ //# sourceMappingURL=Context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,eAAO,MAAM,YAAY,iGAAuC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export interface PixelProviderProps {
4
+ id: string;
5
+ }
6
+ export declare const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>>;
7
+ //# sourceMappingURL=Provider.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
1
+ import type { XyPixel } from '@xylabs/pixel';
2
+ import type { ContextExState } from '@xyo-network/react-shared';
3
+ export interface PixelContextState extends ContextExState {
4
+ pixel?: XyPixel;
5
+ }
6
+ //# sourceMappingURL=State.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB"}
@@ -0,0 +1,5 @@
1
+ export * from './Context.ts';
2
+ export * from './Provider.tsx';
3
+ export * from './State.ts';
4
+ export * from './use.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const usePixel: (required?: boolean) => import("@xylabs/pixel").XyPixel | undefined;
2
+ //# sourceMappingURL=use.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,GAAI,kBAAe,gDAGvC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './Pixel/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './contexts/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-pixel",
3
- "version": "4.4.10",
3
+ "version": "5.0.0-rc.1",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -28,10 +28,10 @@
28
28
  "exports": {
29
29
  ".": {
30
30
  "browser": {
31
- "types": "./dist/browser/index.d.ts",
31
+ "types": "./dist/types/index.d.ts",
32
32
  "default": "./dist/browser/index.mjs"
33
33
  },
34
- "types": "./dist/browser/index.d.ts",
34
+ "types": "./dist/types/index.d.ts",
35
35
  "default": "./dist/browser/index.mjs"
36
36
  },
37
37
  "./package.json": "./package.json"
@@ -44,27 +44,29 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@xylabs/pixel": "^2.0.6",
47
- "@xyo-network/react-shared": "^4.4.10"
47
+ "@xyo-network/react-shared": "^5.0.0-rc.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@mui/icons-material": "^6.4.6",
51
- "@mui/material": "^6.4.6",
52
- "@mui/styles": "^6.4.6",
53
- "@xylabs/ts-scripts-yarn3": "^5.0.25",
54
- "@xylabs/tsconfig-react": "^5.0.25",
55
- "react": "^18.3.1",
56
- "react-dom": "^18.3.1",
57
- "typescript": "^5.7.3"
50
+ "@mui/icons-material": "^6.4.7",
51
+ "@mui/material": "^6.4.7",
52
+ "@mui/styles": "^6.4.7",
53
+ "@types/react": "^19.0.10",
54
+ "@xylabs/ts-scripts-yarn3": "^6.0.3",
55
+ "@xylabs/tsconfig-react": "^6.0.3",
56
+ "react": "^19.0.0",
57
+ "react-dom": "^19.0.0",
58
+ "typescript": "^5.8.2"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "@mui/icons-material": "^6",
61
62
  "@mui/material": "^6",
62
63
  "@mui/styles": "^6",
63
- "react": "^18",
64
- "react-dom": "^18"
64
+ "react": "^19",
65
+ "react-dom": "^19"
65
66
  },
66
67
  "publishConfig": {
67
68
  "access": "public"
68
69
  },
69
- "docs": "dist/docs.json"
70
+ "docs": "dist/docs.json",
71
+ "stableVersion": "4.4.11"
70
72
  }
@@ -18,10 +18,10 @@ export const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>> = (p
18
18
  }), [XyPixel.instance])
19
19
 
20
20
  return (
21
- <PixelContext.Provider
21
+ <PixelContext
22
22
  value={value}
23
23
  >
24
24
  {children}
25
- </PixelContext.Provider>
25
+ </PixelContext>
26
26
  )
27
27
  }
@@ -1,21 +0,0 @@
1
- import * as react from 'react';
2
- import react__default, { PropsWithChildren } from 'react';
3
- import * as _xyo_network_react_shared from '@xyo-network/react-shared';
4
- import { ContextExState } from '@xyo-network/react-shared';
5
- import * as _xylabs_pixel from '@xylabs/pixel';
6
- import { XyPixel } from '@xylabs/pixel';
7
-
8
- interface PixelContextState extends ContextExState {
9
- pixel?: XyPixel;
10
- }
11
-
12
- declare const PixelContext: react.Context<PixelContextState & _xyo_network_react_shared.ContextExState>;
13
-
14
- interface PixelProviderProps {
15
- id: string;
16
- }
17
- declare const PixelProvider: react__default.FC<PropsWithChildren<PixelProviderProps>>;
18
-
19
- declare const usePixel: (required?: boolean) => _xylabs_pixel.XyPixel | undefined;
20
-
21
- export { PixelContext, type PixelContextState, PixelProvider, type PixelProviderProps, usePixel };