@xyo-network/react-pixel 5.3.0 → 5.3.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.
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/contexts/Pixel/Context.ts
5
- import { createContextEx } from "@xyo-network/react-shared";
5
+ import { createContextEx } from "@xylabs/react-shared";
6
6
  var PixelContext = createContextEx();
7
7
 
8
8
  // src/contexts/Pixel/Provider.tsx
@@ -23,7 +23,7 @@ var PixelProvider = /* @__PURE__ */ __name((props) => {
23
23
  }, "PixelProvider");
24
24
 
25
25
  // src/contexts/Pixel/use.ts
26
- import { useContextEx } from "@xyo-network/react-shared";
26
+ import { useContextEx } from "@xylabs/react-shared";
27
27
  var usePixel = /* @__PURE__ */ __name((required = true) => {
28
28
  const { pixel } = useContextEx(PixelContext, "Pixel", required);
29
29
  return pixel;
@@ -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\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"]}
1
+ {"version":3,"sources":["../../src/contexts/Pixel/Context.ts","../../src/contexts/Pixel/Provider.tsx","../../src/contexts/Pixel/use.ts"],"sourcesContent":["import { createContextEx } from '@xylabs/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'\nimport type { PixelContextState } from './State.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: PixelContextState = 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 '@xylabs/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;AASxB,IAAMC,gBAAiE,wBAACC,UAAAA;AAC7E,QAAM,EAAEC,UAAUC,GAAE,IAAKF;AACzBG,UAAQC,KAAKF,EAAAA;AAEb,QAAMG,QAA2BC,QAAQ,OAAO;IAC9CC,OAAOJ,QAAQK;IACfC,UAAU;EACZ,IAAI;IAACN,QAAQK;GAAS;AAEtB,SACE,sBAAA,cAACE,cAAAA;IACCL;KAECJ,QAAAA;AAGP,GAhB8E;;;ACX9E,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"]}
@@ -1,3 +1,6 @@
1
- import type { PixelContextState } from './State.ts';
2
- export declare const PixelContext: import("react").Context<PixelContextState & import("@xyo-network/react-shared").ContextExState>;
1
+ export declare const PixelContext: import("react").Context<{
2
+ pixel?: import("@xylabs/pixel").XyPixel;
3
+ } & {
4
+ provided: true;
5
+ }>;
3
6
  //# sourceMappingURL=Context.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/Pixel/Context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;EAAuC,CAAA"}
@@ -1 +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"}
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;AAKtC,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,6 +1,6 @@
1
1
  import type { XyPixel } from '@xylabs/pixel';
2
- import type { ContextExState } from '@xyo-network/react-shared';
3
- export interface PixelContextState extends ContextExState {
2
+ import type { ContextExState } from '@xylabs/react-shared';
3
+ export type PixelContextState = ContextExState<{
4
4
  pixel?: XyPixel;
5
- }
5
+ }>;
6
6
  //# sourceMappingURL=State.d.ts.map
@@ -1 +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"}
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,sBAAsB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-pixel",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -40,7 +40,7 @@
40
40
  "types": "dist/types/index.d.ts",
41
41
  "dependencies": {
42
42
  "@xylabs/pixel": "^4.9.15",
43
- "@xyo-network/react-shared": "^5.3.0"
43
+ "@xylabs/react-shared": "^6.3.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@mui/icons-material": "^7.1.0",
@@ -1,4 +1,4 @@
1
- import { createContextEx } from '@xyo-network/react-shared'
1
+ import { createContextEx } from '@xylabs/react-shared'
2
2
 
3
3
  import type { PixelContextState } from './State.ts'
4
4
 
@@ -3,6 +3,7 @@ import type { PropsWithChildren } from 'react'
3
3
  import React, { useMemo } from 'react'
4
4
 
5
5
  import { PixelContext } from './Context.ts'
6
+ import type { PixelContextState } from './State.ts'
6
7
 
7
8
  export interface PixelProviderProps {
8
9
  id: string
@@ -12,7 +13,7 @@ export const PixelProvider: React.FC<PropsWithChildren<PixelProviderProps>> = (p
12
13
  const { children, id } = props
13
14
  XyPixel.init(id)
14
15
 
15
- const value = useMemo(() => ({
16
+ const value: PixelContextState = useMemo(() => ({
16
17
  pixel: XyPixel.instance,
17
18
  provided: true,
18
19
  }), [XyPixel.instance])
@@ -1,6 +1,6 @@
1
1
  import type { XyPixel } from '@xylabs/pixel'
2
- import type { ContextExState } from '@xyo-network/react-shared'
2
+ import type { ContextExState } from '@xylabs/react-shared'
3
3
 
4
- export interface PixelContextState extends ContextExState {
4
+ export type PixelContextState = ContextExState<{
5
5
  pixel?: XyPixel
6
- }
6
+ }>
@@ -1,4 +1,4 @@
1
- import { useContextEx } from '@xyo-network/react-shared'
1
+ import { useContextEx } from '@xylabs/react-shared'
2
2
 
3
3
  import { PixelContext } from './Context.ts'
4
4