@datawheel/bespoke 0.3.11 → 0.3.12

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.js CHANGED
@@ -1935,7 +1935,8 @@ var init_statusSlice = __esm({
1935
1935
  tools: true,
1936
1936
  settings: false,
1937
1937
  reportEditor: false
1938
- }
1938
+ },
1939
+ isCMS: false
1939
1940
  };
1940
1941
  statusSlice = createSlice({
1941
1942
  name: "status",
@@ -7289,10 +7290,13 @@ var guessResponse = (response) => {
7289
7290
  function DataTab(props) {
7290
7291
  const { section } = props;
7291
7292
  const readMemberFn = useReadMemberFn();
7292
- const locale = useAppSelector((state2) => state2.status.currentLocale);
7293
+ const router = useRouter();
7294
+ const isCMS = useAppSelector((state2) => state2.status.isCMS);
7295
+ const statusLocale = useAppSelector((state2) => state2.status.currentLocale);
7296
+ const routerLocale = router.locale;
7297
+ const locale = isCMS ? statusLocale : routerLocale;
7293
7298
  const PREVIEW_SIZE = 50;
7294
7299
  const formatterFunctions = useFormatterFunctionsForLocale(locale);
7295
- const router = useRouter();
7296
7300
  const optionsTranslations = useBespokeTranslations("options");
7297
7301
  const translations = { ...DEFAULT_TRANSLATIONS2, ...optionsTranslations["data_tab"] };
7298
7302
  const [sourcesOptions, setSourcesOptions] = useState([]);
@@ -15780,6 +15784,8 @@ function UsersEditor() {
15780
15784
  // views/BespokeManager.tsx
15781
15785
  init_ErrorBoundary();
15782
15786
  init_envvars();
15787
+ init_statusSlice();
15788
+ init_store2();
15783
15789
  function BespokeManager(options) {
15784
15790
  const {
15785
15791
  title = "Bespoke CMS",
@@ -15969,6 +15975,10 @@ function BespokeManagerShell(props) {
15969
15975
  }
15970
15976
  return /* @__PURE__ */ jsx(NotFoundView, {});
15971
15977
  }, [location, user]);
15978
+ const dispatch = useAppDispatch();
15979
+ useEffect(() => {
15980
+ dispatch(statusActions.setStatus({ isCMS: true }));
15981
+ }, []);
15972
15982
  return /* @__PURE__ */ jsx(AppShell, { styles: {
15973
15983
  main: {
15974
15984
  background: "#f8f9fa",
package/dist/server.js CHANGED
@@ -4998,7 +4998,8 @@ var initialState = {
4998
4998
  tools: true,
4999
4999
  settings: false,
5000
5000
  reportEditor: false
5001
- }
5001
+ },
5002
+ isCMS: false
5002
5003
  };
5003
5004
  var statusSlice = createSlice({
5004
5005
  name: "status",
@@ -5750,7 +5751,9 @@ function BespokeManagerServerSideProps(options) {
5750
5751
  dispatch(readEntity("report", {
5751
5752
  id: parseReportId(ctx.query[pathSegmentsKey]),
5752
5753
  include: true
5753
- }))
5754
+ })),
5755
+ // Mark the status as CMS environment
5756
+ dispatch(statusActions.setStatus({ isCMS: true }))
5754
5757
  ]);
5755
5758
  const postResult = await postResolve(store, ctx);
5756
5759
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawheel/bespoke",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Content management system for creating automated data reports",
5
5
  "exports": {
6
6
  ".": {