@blinkk/root-cms 1.0.0-beta.56 → 1.0.0-beta.57

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.
Files changed (2) hide show
  1. package/dist/ui/ui.js +31 -26
  2. package/package.json +3 -3
package/dist/ui/ui.js CHANGED
@@ -39182,7 +39182,6 @@ ${this.customData.serverResponse}`;
39182
39182
  localeSet.delete(locale);
39183
39183
  }
39184
39184
  }
39185
- localeSet.add("en");
39186
39185
  const newLocales = Array.from(localeSet.values()).sort();
39187
39186
  updateEnabledLocales(newLocales);
39188
39187
  }
@@ -39213,30 +39212,23 @@ ${this.customData.serverResponse}`;
39213
39212
  ] }),
39214
39213
  /* @__PURE__ */ o4(Stack, { spacing: 40, children: Object.keys(localeGroups).map((groupId) => {
39215
39214
  const group = localeGroups[groupId];
39216
- const enabledLocales2 = enabledLocalesFor(groupId);
39215
+ const groupEnabledLocales = enabledLocalesFor(groupId);
39217
39216
  return /* @__PURE__ */ o4(
39218
39217
  LocalizationModal.LocaleGroup,
39219
39218
  {
39220
39219
  group,
39221
- enabledLocales: enabledLocales2,
39220
+ groupEnabledLocales,
39221
+ allEnabledLocales: enabledLocales,
39222
39222
  onChange: (locales) => setGroupEnabledLocales(groupId, locales)
39223
39223
  }
39224
39224
  );
39225
39225
  }) })
39226
39226
  ] }) });
39227
39227
  };
39228
- function getLocaleLabel(locale) {
39229
- const langNames = new Intl.DisplayNames(["en"], {
39230
- type: "language"
39231
- });
39232
- const parts = locale.split("_");
39233
- const langCode = parts[0];
39234
- const langName = langNames.of(langCode) || locale;
39235
- return `${langName} (${locale})`;
39236
- }
39237
39228
  LocalizationModal.LocaleGroup = (props) => {
39238
- const enabledLocales = props.enabledLocales || [];
39229
+ const enabledLocales = props.groupEnabledLocales || [];
39239
39230
  const groupLocales = props.group.locales || [];
39231
+ const allEnabledLocales = props.allEnabledLocales || [];
39240
39232
  function setEnabledLocales(locales) {
39241
39233
  if (props.onChange) {
39242
39234
  props.onChange(locales);
@@ -39262,17 +39254,21 @@ ${this.customData.serverResponse}`;
39262
39254
  }
39263
39255
  )
39264
39256
  ] }),
39265
- /* @__PURE__ */ o4(Group, { children: groupLocales.map((locale) => /* @__PURE__ */ o4(
39266
- Checkbox,
39267
- {
39268
- value: locale,
39269
- checked: enabledLocales.includes(locale) || locale === "en",
39270
- disabled: locale === "en",
39271
- label: getLocaleLabel(locale),
39272
- onChange: () => toggleLocale(locale),
39273
- size: "xs"
39274
- }
39275
- )) })
39257
+ /* @__PURE__ */ o4(Group, { children: groupLocales.map((locale) => {
39258
+ const checked = enabledLocales.includes(locale);
39259
+ const disabled = allEnabledLocales.length <= 1 && checked;
39260
+ return /* @__PURE__ */ o4(
39261
+ Checkbox,
39262
+ {
39263
+ value: locale,
39264
+ checked,
39265
+ disabled,
39266
+ label: getLocaleLabel(locale),
39267
+ onChange: () => toggleLocale(locale),
39268
+ size: "xs"
39269
+ }
39270
+ );
39271
+ }) })
39276
39272
  ] });
39277
39273
  };
39278
39274
  LocalizationModal.AllNoneButtons = (props) => {
@@ -39633,6 +39629,15 @@ ${this.customData.serverResponse}`;
39633
39629
  }
39634
39630
  );
39635
39631
  }
39632
+ function getLocaleLabel(locale) {
39633
+ const langNames = new Intl.DisplayNames(["en"], {
39634
+ type: "language"
39635
+ });
39636
+ const parts = locale.split("_");
39637
+ const langCode = parts[0];
39638
+ const langName = langNames.of(langCode) || locale;
39639
+ return `${langName} (${locale})`;
39640
+ }
39636
39641
 
39637
39642
  // ui/components/PublishDocModal/PublishDocModal.tsx
39638
39643
  var MODAL_ID4 = "PublishDocModal";
@@ -39854,7 +39859,7 @@ ${this.customData.serverResponse}`;
39854
39859
  // package.json
39855
39860
  var package_default = {
39856
39861
  name: "@blinkk/root-cms",
39857
- version: "1.0.0-beta.56",
39862
+ version: "1.0.0-beta.57",
39858
39863
  author: "s@blinkk.com",
39859
39864
  license: "MIT",
39860
39865
  engines: {
@@ -39957,7 +39962,7 @@ ${this.customData.serverResponse}`;
39957
39962
  vitest: "^0.18.1"
39958
39963
  },
39959
39964
  peerDependencies: {
39960
- "@blinkk/root": "1.0.0-beta.56",
39965
+ "@blinkk/root": "1.0.0-beta.57",
39961
39966
  "firebase-admin": ">=11",
39962
39967
  "firebase-functions": ">=4",
39963
39968
  preact: "10.x",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkk/root-cms",
3
- "version": "1.0.0-beta.56",
3
+ "version": "1.0.0-beta.57",
4
4
  "author": "s@blinkk.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -56,7 +56,7 @@
56
56
  "//": "NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",
57
57
  "devDependencies": {
58
58
  "@babel/core": "^7.17.9",
59
- "@blinkk/root": "1.0.0-beta.56",
59
+ "@blinkk/root": "1.0.0-beta.57",
60
60
  "@emotion/react": "^11.10.5",
61
61
  "@firebase/app-compat": "^0.1.33",
62
62
  "@firebase/app-types": "^0.7.0",
@@ -90,7 +90,7 @@
90
90
  "vitest": "^0.18.1"
91
91
  },
92
92
  "peerDependencies": {
93
- "@blinkk/root": "1.0.0-beta.56",
93
+ "@blinkk/root": "1.0.0-beta.57",
94
94
  "firebase-admin": ">=11",
95
95
  "firebase-functions": ">=4",
96
96
  "preact": "10.x",