@xyo-network/react-pixel 3.0.1 → 3.0.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.
@@ -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 { PixelContextState } from './State.ts'\n\nexport const PixelContext = createContextEx<PixelContextState>()\n","import { XyPixel } from '@xylabs/pixel'\nimport { WithChildren } from '@xylabs/react-shared'\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<WithChildren<PixelProviderProps>> = (props) => {\n const { children, id } = props\n XyPixel.init(id)\n\n const value = useMemo(() => ({ pixel: XyPixel.instance,\n provided: true }), [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,gBAA4D,wBAACC,UAAAA;AACxE,QAAM,EAAEC,UAAUC,GAAE,IAAKF;AACzBG,UAAQC,KAAKF,EAAAA;AAEb,QAAMG,QAAQC,QAAQ,OAAO;IAAEC,OAAOJ,QAAQK;IAC5CC,UAAU;EAAK,IAAI;IAACN,QAAQK;GAAS;AAEvC,SACE,sBAAA,cAACE,aAAaC,UAAQ;IACpBN;KAECJ,QAAAA;AAGP,GAdyE;;;ACVzE,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 { WithChildren } from '@xylabs/react-shared'\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<WithChildren<PixelProviderProps>> = (props) => {\n const { children, id } = props\n XyPixel.init(id)\n\n const value = useMemo(() => ({ pixel: XyPixel.instance,\n provided: true }), [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,gBAA4D,wBAACC,UAAAA;AACxE,QAAM,EAAEC,UAAUC,GAAE,IAAKF;AACzBG,UAAQC,KAAKF,EAAAA;AAEb,QAAMG,QAAQC,QAAQ,OAAO;IAAEC,OAAOJ,QAAQK;IAC5CC,UAAU;EAAK,IAAI;IAACN,QAAQK;GAAS;AAEvC,SACE,sBAAA,cAACE,aAAaC,UAAQ;IACpBN;KAECJ,QAAAA;AAGP,GAdyE;;;ACVzE,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
@@ -7,17 +7,17 @@
7
7
  },
8
8
  "bugs": {
9
9
  "email": "support@xyo.network",
10
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
10
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
11
  },
12
12
  "dependencies": {
13
13
  "@xylabs/pixel": "^2.0.1",
14
- "@xylabs/react-shared": "^4.0.1",
15
- "@xyo-network/react-shared": "^3.0.1",
14
+ "@xylabs/react-shared": "^4.0.3",
15
+ "@xyo-network/react-shared": "^3.0.2",
16
16
  "axios": "^1.7.4"
17
17
  },
18
18
  "devDependencies": {
19
- "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
20
- "@xylabs/tsconfig-react": "^4.0.0-rc.15",
19
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
20
+ "@xylabs/tsconfig-react": "^4.0.0-rc.20",
21
21
  "typescript": "^5.5.4"
22
22
  },
23
23
  "peerDependencies": {
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "repository": {
56
56
  "type": "git",
57
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
57
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
58
58
  },
59
59
  "scripts": {
60
60
  "lint-pkg": "npmPkgJsonLint .",
@@ -62,6 +62,6 @@
62
62
  },
63
63
  "sideEffects": false,
64
64
  "types": "dist/browser/index.d.ts",
65
- "version": "3.0.1",
65
+ "version": "3.0.2",
66
66
  "type": "module"
67
67
  }
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { PixelContextState } from './State.ts'
3
+ import type { PixelContextState } from './State.ts'
4
4
 
5
5
  export const PixelContext = createContextEx<PixelContextState>()
@@ -1,5 +1,5 @@
1
1
  import { XyPixel } from '@xylabs/pixel'
2
- import { WithChildren } from '@xylabs/react-shared'
2
+ import type { WithChildren } from '@xylabs/react-shared'
3
3
  import React, { useMemo } from 'react'
4
4
 
5
5
  import { PixelContext } from './Context.ts'
@@ -1,5 +1,5 @@
1
- import { XyPixel } from '@xylabs/pixel'
2
- import { ContextExState } from '@xyo-network/react-shared'
1
+ import type { XyPixel } from '@xylabs/pixel'
2
+ import type { ContextExState } from '@xyo-network/react-shared'
3
3
 
4
4
  export interface PixelContextState extends ContextExState {
5
5
  pixel?: XyPixel
package/xy.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
1
+ import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
4
  browser: {