@noya-app/noya-multiplayer-react 0.1.85 → 0.1.86

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/dist/index.mjs CHANGED
@@ -7764,9 +7764,16 @@ function getSyncAdapter(params) {
7764
7764
  debug,
7765
7765
  policyAuthContext,
7766
7766
  serverScripts,
7767
- git
7767
+ git,
7768
+ parentOrigin,
7769
+ enableDocumentAI
7768
7770
  } = params ?? {};
7769
- return isEmbeddedApp() ? parentFrameSync({ debug, policyAuthContext }) : multiplayerUrl ? webSocketSync({ url: multiplayerUrl, debug }) : offlineStorageKey ? localStorageSync({
7771
+ return isEmbeddedApp() ? parentFrameSync({
7772
+ debug,
7773
+ policyAuthContext,
7774
+ origin: parentOrigin,
7775
+ enableDocumentAI
7776
+ }) : multiplayerUrl ? webSocketSync({ url: multiplayerUrl, debug }) : offlineStorageKey ? localStorageSync({
7770
7777
  key: offlineStorageKey,
7771
7778
  ...serverScripts ? { serverScripts } : {},
7772
7779
  ...git ? { git } : {}
@@ -7783,7 +7790,9 @@ function useNoyaStateInternal(...args) {
7783
7790
  viewType,
7784
7791
  userId,
7785
7792
  isDemo,
7786
- access
7793
+ access,
7794
+ parentOrigin,
7795
+ enableDocumentAI
7787
7796
  }
7788
7797
  ] = useState4(() => {
7789
7798
  return getAppData(initialState, options?.schema, {
@@ -7808,7 +7817,9 @@ function useNoyaStateInternal(...args) {
7808
7817
  debug: options?.debug,
7809
7818
  policyAuthContext: basePolicyAuthContext,
7810
7819
  serverScripts: options?.serverScripts,
7811
- git: options?.git
7820
+ git: options?.git,
7821
+ parentOrigin,
7822
+ enableDocumentAI
7812
7823
  });
7813
7824
  }, [
7814
7825
  multiplayerUrl,
@@ -7816,10 +7827,15 @@ function useNoyaStateInternal(...args) {
7816
7827
  options?.debug,
7817
7828
  basePolicyAuthContext,
7818
7829
  options?.serverScripts,
7819
- options?.git
7830
+ options?.git,
7831
+ parentOrigin,
7832
+ enableDocumentAI
7820
7833
  ]);
7821
7834
  const [noyaManager] = useState4(
7822
- () => new NoyaManager3(noyaAppInitialState, options)
7835
+ () => new NoyaManager3(noyaAppInitialState, {
7836
+ ...options,
7837
+ resourceUrlBase: options?.resourceUrlBase ?? parentOrigin ?? (typeof globalThis.location === "undefined" ? void 0 : globalThis.location.origin === "null" ? void 0 : globalThis.location.origin)
7838
+ })
7823
7839
  );
7824
7840
  useEffect5(() => {
7825
7841
  if (!userId) return;
@@ -7878,7 +7894,10 @@ function initializeNoyaSingleton(options) {
7878
7894
  } : void 0;
7879
7895
  noyaManagerSingleton = new NoyaManager4(
7880
7896
  appData.initialState,
7881
- managerOptions
7897
+ {
7898
+ ...managerOptions,
7899
+ resourceUrlBase: managerOptions.resourceUrlBase ?? appData.parentOrigin ?? (typeof globalThis.location === "undefined" ? void 0 : globalThis.location.origin === "null" ? void 0 : globalThis.location.origin)
7900
+ }
7882
7901
  );
7883
7902
  if (appData.userId) {
7884
7903
  noyaManagerSingleton.sharedConnectionDataManager.setCurrentConnectionId(
@@ -7893,7 +7912,9 @@ function initializeNoyaSingleton(options) {
7893
7912
  debug: managerOptions?.debug,
7894
7913
  serverScripts: managerOptions?.serverScripts,
7895
7914
  git: managerOptions?.git,
7896
- policyAuthContext
7915
+ policyAuthContext,
7916
+ parentOrigin: appData.parentOrigin,
7917
+ enableDocumentAI: appData.enableDocumentAI
7897
7918
  });
7898
7919
  try {
7899
7920
  resolvedSync({ noyaManager: noyaManagerSingleton });