@arbidocs/react 0.4.4 → 0.4.6
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/README.md +23 -0
- package/dist/artifacts/index.cjs +458 -0
- package/dist/artifacts/index.cjs.map +1 -0
- package/dist/artifacts/index.d.cts +276 -0
- package/dist/artifacts/index.d.ts +276 -0
- package/dist/artifacts/index.js +434 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/artifacts/redline-core.cjs +20 -0
- package/dist/artifacts/redline-core.cjs.map +1 -0
- package/dist/artifacts/redline-core.d.cts +36 -0
- package/dist/artifacts/redline-core.d.ts +36 -0
- package/dist/artifacts/redline-core.js +3 -0
- package/dist/artifacts/redline-core.js.map +1 -0
- package/dist/{chunk-MIJRORQL.js → chunk-2ACHNDO6.js} +10 -304
- package/dist/chunk-2ACHNDO6.js.map +1 -0
- package/dist/chunk-CBJ3WOGD.cjs +317 -0
- package/dist/chunk-CBJ3WOGD.cjs.map +1 -0
- package/dist/{chunk-EJ2BMHYK.js → chunk-FSMIN5VX.js} +4 -3
- package/dist/chunk-FSMIN5VX.js.map +1 -0
- package/dist/{chunk-JKO3NR5L.js → chunk-HDCRPPBW.js} +5 -23
- package/dist/chunk-HDCRPPBW.js.map +1 -0
- package/dist/chunk-J4MX2W4H.js +26 -0
- package/dist/chunk-J4MX2W4H.js.map +1 -0
- package/dist/chunk-KWCHIAQ5.js +290 -0
- package/dist/chunk-KWCHIAQ5.js.map +1 -0
- package/dist/{chunk-6ALMBER7.js → chunk-N5SVBDLC.js} +4 -9
- package/dist/chunk-N5SVBDLC.js.map +1 -0
- package/dist/{chunk-RZQACYNQ.cjs → chunk-OBNTJEEO.cjs} +14 -20
- package/dist/chunk-OBNTJEEO.cjs.map +1 -0
- package/dist/chunk-OI55JRKT.cjs +334 -0
- package/dist/chunk-OI55JRKT.cjs.map +1 -0
- package/dist/{chunk-BXP6S34V.cjs → chunk-PGLV23SB.cjs} +13 -12
- package/dist/chunk-PGLV23SB.cjs.map +1 -0
- package/dist/chunk-RIHMIEXM.js +320 -0
- package/dist/chunk-RIHMIEXM.js.map +1 -0
- package/dist/chunk-RKWNX32A.js +299 -0
- package/dist/chunk-RKWNX32A.js.map +1 -0
- package/dist/chunk-S6A6FSG7.cjs +13 -0
- package/dist/chunk-S6A6FSG7.cjs.map +1 -0
- package/dist/chunk-SN5YV6FF.js +11 -0
- package/dist/chunk-SN5YV6FF.js.map +1 -0
- package/dist/{chunk-7IOCMCC5.cjs → chunk-TMPDW7J5.cjs} +3 -23
- package/dist/chunk-TMPDW7J5.cjs.map +1 -0
- package/dist/chunk-VJWAP2HJ.cjs +303 -0
- package/dist/chunk-VJWAP2HJ.cjs.map +1 -0
- package/dist/{chunk-ORKGCXG3.cjs → chunk-Z5YCRJY3.cjs} +125 -429
- package/dist/chunk-Z5YCRJY3.cjs.map +1 -0
- package/dist/chunk-ZMTLGO3K.cjs +29 -0
- package/dist/chunk-ZMTLGO3K.cjs.map +1 -0
- package/dist/index-CC6CvXEs.d.cts +1366 -0
- package/dist/index-CC6CvXEs.d.ts +1366 -0
- package/dist/index.cjs +1159 -722
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +588 -28
- package/dist/index.d.ts +588 -28
- package/dist/index.js +645 -310
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +8 -7
- package/dist/shell/index.js +3 -2
- package/dist/ui/index.cjs +158 -152
- package/dist/ui/index.d.cts +24 -1324
- package/dist/ui/index.d.ts +24 -1324
- package/dist/ui/index.js +4 -2
- package/dist/viewers/index.cjs +9 -8
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.js +3 -2
- package/dist/viewers/index.js.map +1 -1
- package/package.json +19 -3
- package/dist/chunk-6ALMBER7.js.map +0 -1
- package/dist/chunk-7IOCMCC5.cjs.map +0 -1
- package/dist/chunk-BXP6S34V.cjs.map +0 -1
- package/dist/chunk-EJ2BMHYK.js.map +0 -1
- package/dist/chunk-JKO3NR5L.js.map +0 -1
- package/dist/chunk-MIJRORQL.js.map +0 -1
- package/dist/chunk-ORKGCXG3.cjs.map +0 -1
- package/dist/chunk-RZQACYNQ.cjs.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var browser = require('@arbidocs/sdk/browser');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// src/ArbiProvider.tsx
|
|
8
|
+
var ArbiContext = react.createContext(null);
|
|
9
|
+
function ArbiProvider({ children, ...options }) {
|
|
10
|
+
const arbi = react.useMemo(
|
|
11
|
+
() => new browser.Arbi(options),
|
|
12
|
+
// Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
[options.url, options.deploymentDomain, options.credentials]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ArbiContext.Provider, { value: arbi, children });
|
|
17
|
+
}
|
|
18
|
+
function useArbi() {
|
|
19
|
+
const arbi = react.useContext(ArbiContext);
|
|
20
|
+
if (!arbi) {
|
|
21
|
+
throw new Error("useArbi() must be used within an <ArbiProvider>");
|
|
22
|
+
}
|
|
23
|
+
return arbi;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.ArbiProvider = ArbiProvider;
|
|
27
|
+
exports.useArbi = useArbi;
|
|
28
|
+
//# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
|
|
29
|
+
//# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ArbiProvider.tsx","../src/useArbi.ts"],"names":["createContext","useMemo","Arbi","useContext"],"mappings":";;;;;;;AAYO,IAAM,WAAA,GAAcA,oBAA2B,IAAI,CAAA;AAMnD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,SAAQ,EAAsB;AACxE,EAAA,MAAM,IAAA,GAAOC,aAAA;AAAA,IACX,MAAM,IAAIC,YAAA,CAAK,OAAO,CAAA;AAAA;AAAA;AAAA,IAGtB,CAAC,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,gBAAA,EAAkB,QAAQ,WAAW;AAAA,GAC7D;AAEA,EAAA,sCAAQ,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,MAAO,QAAA,EAAS,CAAA;AACtD;ACnBO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,IAAA,GAAOC,iBAAW,WAAW,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,iDAAiD,CAAA;AAAA,EACnE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-ZMTLGO3K.cjs","sourcesContent":["/**\n * ArbiProvider — React context that holds an Arbi instance.\n *\n * Usage:\n * <ArbiProvider url=\"https://arbi.mycompany.com\">\n * <App />\n * </ArbiProvider>\n */\n\nimport { createContext, useMemo, type ReactNode } from 'react'\nimport { Arbi, type ArbiOptions } from '@arbidocs/sdk/browser'\n\nexport const ArbiContext = createContext<Arbi | null>(null)\n\nexport interface ArbiProviderProps extends ArbiOptions {\n children: ReactNode\n}\n\nexport function ArbiProvider({ children, ...options }: ArbiProviderProps) {\n const arbi = useMemo(\n () => new Arbi(options),\n // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.url, options.deploymentDomain, options.credentials]\n )\n\n return <ArbiContext.Provider value={arbi}>{children}</ArbiContext.Provider>\n}\n","/**\n * Hook to access the Arbi instance from the nearest ArbiProvider.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { ArbiContext } from './ArbiProvider'\n\nexport function useArbi(): Arbi {\n const arbi = useContext(ArbiContext)\n if (!arbi) {\n throw new Error('useArbi() must be used within an <ArbiProvider>')\n }\n return arbi\n}\n"]}
|