@stackframe/stack 2.4.20 → 2.4.21

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/providers/stack-provider-client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { StackClientApp, StackClientAppJson, stackAppInternalsSymbol } from \"../lib/stack-app\";\nimport React from \"react\";\nimport { UserJson } from \"@stackframe/stack-shared\";\nimport { useStackApp } from \"..\";\nimport { globalVar } from \"@stackframe/stack-shared/src/utils/globals\";\n\nexport const StackContext = React.createContext<null | {\n app: StackClientApp<true>,\n}>(null);\n\nexport function StackProviderClient(props: {\n appJson: StackClientAppJson<true, string>,\n children?: React.ReactNode,\n}) {\n const appJson = props.appJson;\n const app = StackClientApp[stackAppInternalsSymbol].fromClientJson(appJson);\n\n if (process.env.NODE_ENV === \"development\") {\n globalVar.stackApp = app;\n }\n \n return (\n <StackContext.Provider value={{ app }}>\n {props.children}\n </StackContext.Provider>\n );\n}\n\nexport function UserSetter(props: { userJsonPromise: Promise<UserJson | null> }) {\n const app = useStackApp();\n useEffect(() => {\n const promise = (async () => await props.userJsonPromise)(); // there is a Next.js bug where Promises passed by server components return `undefined` as their `then` value, so wrap it in a normal promise\n app[stackAppInternalsSymbol].setCurrentUser(promise);\n }, []);\n return null;\n}\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B,SAAS,gBAAoC,+BAA+B;AAC5E,OAAO,WAAW;AAElB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAkBtB;AAhBG,IAAM,eAAe,MAAM,cAE/B,IAAI;AAEA,SAAS,oBAAoB,OAGjC;AACD,QAAM,UAAU,MAAM;AACtB,QAAM,MAAM,eAAe,uBAAuB,EAAE,eAAe,OAAO;AAE1E,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAU,WAAW;AAAA,EACvB;AAEA,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,IAAI,GACjC,gBAAM,UACT;AAEJ;AAEO,SAAS,WAAW,OAAsD;AAC/E,QAAM,MAAM,YAAY;AACxB,YAAU,MAAM;AACd,UAAM,WAAW,YAAY,MAAM,MAAM,iBAAiB;AAC1D,QAAI,uBAAuB,EAAE,eAAe,OAAO;AAAA,EACrD,GAAG,CAAC,CAAC;AACL,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/providers/stack-provider-client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { StackClientApp, StackClientAppJson, stackAppInternalsSymbol } from \"../lib/stack-app\";\nimport React from \"react\";\nimport { UserJson } from \"@stackframe/stack-shared\";\nimport { useStackApp } from \"..\";\nimport { globalVar } from \"@stackframe/stack-shared/dist/utils/globals\";\n\nexport const StackContext = React.createContext<null | {\n app: StackClientApp<true>,\n}>(null);\n\nexport function StackProviderClient(props: {\n appJson: StackClientAppJson<true, string>,\n children?: React.ReactNode,\n}) {\n const appJson = props.appJson;\n const app = StackClientApp[stackAppInternalsSymbol].fromClientJson(appJson);\n\n if (process.env.NODE_ENV === \"development\") {\n globalVar.stackApp = app;\n }\n \n return (\n <StackContext.Provider value={{ app }}>\n {props.children}\n </StackContext.Provider>\n );\n}\n\nexport function UserSetter(props: { userJsonPromise: Promise<UserJson | null> }) {\n const app = useStackApp();\n useEffect(() => {\n const promise = (async () => await props.userJsonPromise)(); // there is a Next.js bug where Promises passed by server components return `undefined` as their `then` value, so wrap it in a normal promise\n app[stackAppInternalsSymbol].setCurrentUser(promise);\n }, []);\n return null;\n}\n"],"mappings":";;;AAEA,SAAS,iBAAiB;AAC1B,SAAS,gBAAoC,+BAA+B;AAC5E,OAAO,WAAW;AAElB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAkBtB;AAhBG,IAAM,eAAe,MAAM,cAE/B,IAAI;AAEA,SAAS,oBAAoB,OAGjC;AACD,QAAM,UAAU,MAAM;AACtB,QAAM,MAAM,eAAe,uBAAuB,EAAE,eAAe,OAAO;AAE1E,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAU,WAAW;AAAA,EACvB;AAEA,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,IAAI,GACjC,gBAAM,UACT;AAEJ;AAEO,SAAS,WAAW,OAAsD;AAC/E,QAAM,MAAM,YAAY;AACxB,YAAU,MAAM;AACd,UAAM,WAAW,YAAY,MAAM,MAAM,iBAAiB;AAC1D,QAAI,uBAAuB,EAAE,eAAe,OAAO;AAAA,EACrD,GAAG,CAAC,CAAC;AACL,SAAO;AACT;","names":[]}
@@ -5,7 +5,7 @@
5
5
  import { useState } from "react";
6
6
  import { useServerInsertedHTML } from "next/navigation";
7
7
  import { ServerStyleSheet, StyleSheetManager } from "styled-components";
8
- import { isBrowserLike } from "@stackframe/stack-shared/src/utils/env";
8
+ import { isBrowserLike } from "@stackframe/stack-shared/dist/utils/env";
9
9
  import { Fragment, jsx } from "react/jsx-runtime";
10
10
  function StyledComponentsRegistry({
11
11
  children
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/providers/styled-components-registry.tsx"],"sourcesContent":["'use client';\n \nimport React, { useState } from 'react';\nimport { useServerInsertedHTML } from 'next/navigation';\nimport { ServerStyleSheet, StyleSheetManager } from 'styled-components';\nimport { isBrowserLike } from '@stackframe/stack-shared/src/utils/env';\n \nexport default function StyledComponentsRegistry({\n children,\n}: {\n children: React.ReactNode,\n}) {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());\n \n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement();\n styledComponentsStyleSheet.instance.clearTag();\n return <>{styles}</>;\n });\n \n if (isBrowserLike()) return <>{children}</>;\n \n return (\n <StyleSheetManager sheet={styledComponentsStyleSheet.instance}>\n {children}\n </StyleSheetManager>\n );\n}\n"],"mappings":";;;AAEA,SAAgB,gBAAgB;AAChC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,qBAAqB;AAcnB;AAZI,SAAR,yBAA0C;AAAA,EAC/C;AACF,GAEG;AAGD,QAAM,CAAC,0BAA0B,IAAI,SAAS,MAAM,IAAI,iBAAiB,CAAC;AAE1E,wBAAsB,MAAM;AAC1B,UAAM,SAAS,2BAA2B,gBAAgB;AAC1D,+BAA2B,SAAS,SAAS;AAC7C,WAAO,gCAAG,kBAAO;AAAA,EACnB,CAAC;AAED,MAAI,cAAc;AAAG,WAAO,gCAAG,UAAS;AAExC,SACE,oBAAC,qBAAkB,OAAO,2BAA2B,UAClD,UACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/providers/styled-components-registry.tsx"],"sourcesContent":["'use client';\n \nimport React, { useState } from 'react';\nimport { useServerInsertedHTML } from 'next/navigation';\nimport { ServerStyleSheet, StyleSheetManager } from 'styled-components';\nimport { isBrowserLike } from '@stackframe/stack-shared/dist/utils/env';\n \nexport default function StyledComponentsRegistry({\n children,\n}: {\n children: React.ReactNode,\n}) {\n // Only create stylesheet once with lazy initial state\n // x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state\n const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());\n \n useServerInsertedHTML(() => {\n const styles = styledComponentsStyleSheet.getStyleElement();\n styledComponentsStyleSheet.instance.clearTag();\n return <>{styles}</>;\n });\n \n if (isBrowserLike()) return <>{children}</>;\n \n return (\n <StyleSheetManager sheet={styledComponentsStyleSheet.instance}>\n {children}\n </StyleSheetManager>\n );\n}\n"],"mappings":";;;AAEA,SAAgB,gBAAgB;AAChC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,qBAAqB;AAcnB;AAZI,SAAR,yBAA0C;AAAA,EAC/C;AACF,GAEG;AAGD,QAAM,CAAC,0BAA0B,IAAI,SAAS,MAAM,IAAI,iBAAiB,CAAC;AAE1E,wBAAsB,MAAM;AAC1B,UAAM,SAAS,2BAA2B,gBAAgB;AAC1D,+BAA2B,SAAS,SAAS;AAC7C,WAAO,gCAAG,kBAAO;AAAA,EACnB,CAAC;AAED,MAAI,cAAc;AAAG,WAAO,gCAAG,UAAS;AAExC,SACE,oBAAC,qBAAkB,OAAO,2BAA2B,UAClD,UACH;AAEJ;","names":[]}
@@ -45,7 +45,7 @@ var import_results = require("@stackframe/stack-shared/dist/utils/results");
45
45
  var import_react2 = require("@stackframe/stack-shared/dist/utils/react");
46
46
  var import_stores = require("@stackframe/stack-shared/dist/utils/stores");
47
47
  var import_clientInterface = require("@stackframe/stack-shared/dist/interface/clientInterface");
48
- var import_env = require("@stackframe/stack-shared/src/utils/env");
48
+ var import_env = require("@stackframe/stack-shared/dist/utils/env");
49
49
  var import_auth = require("./auth");
50
50
  var NextNavigationUnscrambled = __toESM(require("next/navigation"));
51
51
  var import_url = require("../utils/url");
@@ -59,7 +59,7 @@ var cookie = __toESM(require("cookie"));
59
59
  var import_sessions = require("@stackframe/stack-shared/dist/sessions");
60
60
  var import_use_trigger = require("@stackframe/stack-shared/dist/hooks/use-trigger");
61
61
  var NextNavigation = (0, import_compile_time.scrambleDuringCompileTime)(NextNavigationUnscrambled);
62
- var clientVersion = "js @stackframe/stack@2.4.20";
62
+ var clientVersion = "js @stackframe/stack@2.4.21";
63
63
  function permissionDefinitionScopeToType(scope) {
64
64
  return { "any-team": "team", "specific-team": "team", "global": "global" }[scope.type];
65
65
  }