@blinkk/root-cms 1.0.0-beta.35 → 1.0.0-beta.37

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/ui/ui.css CHANGED
@@ -421,6 +421,10 @@
421
421
  .SplitPanel__divider:hover::after {
422
422
  background-color: lightblue;
423
423
  }
424
+ .SplitPanel__item {
425
+ overflow: hidden;
426
+ position: relative;
427
+ }
424
428
  .SplitPanel__item.static {
425
429
  flex: 0 0 var(--panel-size, 100%);
426
430
  }
@@ -583,6 +587,7 @@
583
587
  align-items: center;
584
588
  padding: 8px 0;
585
589
  border-top: 1px solid var(--color-border);
590
+ overflow: hidden;
586
591
  }
587
592
  .CollectionPage__collection__docsList__doc__content {
588
593
  display: block;
@@ -624,8 +629,9 @@
624
629
  font-size: 24px;
625
630
  font-weight: 600;
626
631
  overflow: hidden;
627
- text-overflow: ellipsis;
628
- white-space: nowrap;
632
+ display: -webkit-box;
633
+ -webkit-box-orient: vertical;
634
+ -webkit-line-clamp: 1;
629
635
  }
630
636
  .CollectionPage__collection__docsList__doc__content__url {
631
637
  font-size: 12px;
package/dist/ui/ui.js CHANGED
@@ -37906,7 +37906,7 @@ ${this.customData.serverResponse}`;
37906
37906
  console.log(`unscheduled ${docId}`);
37907
37907
  }
37908
37908
  async function cmsCopyDoc(fromDocId, toDocId) {
37909
- const fromDocRef = getDocRef(fromDocId);
37909
+ const fromDocRef = getDraftDocRef(fromDocId);
37910
37910
  const fromDoc = await Kl(fromDocRef);
37911
37911
  if (!fromDoc.exists()) {
37912
37912
  throw new Error(`doc ${fromDocId} does not exist`);
@@ -37916,7 +37916,7 @@ ${this.customData.serverResponse}`;
37916
37916
  }
37917
37917
  async function cmsCreateDoc(docId, options2) {
37918
37918
  const [collectionId, slug] = docId.split("/");
37919
- const docRef = getDocRef(docId);
37919
+ const docRef = getDraftDocRef(docId);
37920
37920
  const doc = await Kl(docRef);
37921
37921
  if (doc.exists()) {
37922
37922
  throw new Error(`${docId} already exists`);
@@ -37935,8 +37935,7 @@ ${this.customData.serverResponse}`;
37935
37935
  };
37936
37936
  await Jl(docRef, data);
37937
37937
  }
37938
- async function cmsDocImportCsv(docId, csvData) {
37939
- const translationsDocRef = getTranslationsDocRef(docId);
37938
+ async function cmsDocImportCsv(docId, csvData, options2) {
37940
37939
  const translationsMap = {};
37941
37940
  const i18nConfig = window.__ROOT_CTX.rootConfig.i18n || {};
37942
37941
  const i18nLocales = i18nConfig.locales || ["en"];
@@ -37968,24 +37967,21 @@ ${this.customData.serverResponse}`;
37968
37967
  const hash5 = await sourceHash(translation.source);
37969
37968
  translationsMap[hash5] = translation;
37970
37969
  }
37971
- const db3 = window.firebase.db;
37972
- await lf(db3, async (transaction) => {
37973
- const translationsDoc = await transaction.get(translationsDocRef);
37974
- const currentData = translationsDoc.data() || {};
37975
- const data = { ...currentData };
37976
- data.sys = {
37977
- ...data.sys ?? {},
37978
- modifiedAt: df(),
37979
- modifiedBy: window.firebase.user.email
37980
- };
37981
- data.translations = {
37982
- ...data.translations ?? {},
37983
- ...translationsMap
37984
- };
37985
- transaction.set(translationsDocRef, data);
37986
- });
37970
+ const draftDocRef = getDraftDocRef(docId);
37971
+ const updates = {
37972
+ "sys.modifiedAt": df(),
37973
+ "sys.modifiedBy": window.firebase.user.email
37974
+ };
37975
+ if (options2?.prune) {
37976
+ updates.translations = translationsMap;
37977
+ } else {
37978
+ for (const hash5 in translationsMap) {
37979
+ updates[`translations.${hash5}`] = translationsMap[hash5];
37980
+ }
37981
+ }
37982
+ await Yl(draftDocRef, updates);
37987
37983
  }
37988
- function getDocRef(docId) {
37984
+ function getDraftDocRef(docId) {
37989
37985
  const projectId = window.__ROOT_CTX.rootConfig.projectId;
37990
37986
  const db3 = window.firebase.db;
37991
37987
  const [collectionId, slug] = docId.split("/");
@@ -37999,20 +37995,6 @@ ${this.customData.serverResponse}`;
37999
37995
  slug
38000
37996
  );
38001
37997
  }
38002
- function getTranslationsDocRef(docId) {
38003
- const projectId = window.__ROOT_CTX.rootConfig.projectId;
38004
- const db3 = window.firebase.db;
38005
- const [collectionId, slug] = docId.split("/");
38006
- return Za(
38007
- db3,
38008
- "Projects",
38009
- projectId,
38010
- "Collections",
38011
- collectionId,
38012
- "Translations",
38013
- slug
38014
- );
38015
- }
38016
37998
 
38017
37999
  // ui/utils/slug.ts
38018
38000
  function isSlugValid(slug) {
@@ -38972,9 +38954,9 @@ ${this.customData.serverResponse}`;
38972
38954
  setLocaleTranslations({});
38973
38955
  return;
38974
38956
  }
38975
- const translationsRef = getTranslationsDocRef(props.docId);
38976
- Kl(translationsRef).then((translationsDoc) => {
38977
- const data = translationsDoc.data() || {};
38957
+ const draftDocRef = getDraftDocRef(props.docId);
38958
+ Kl(draftDocRef).then((draftDoc) => {
38959
+ const data = draftDoc.data() || {};
38978
38960
  return data.translations || {};
38979
38961
  }).then((translationsMap) => {
38980
38962
  const localeTranslations2 = {};
@@ -39475,7 +39457,7 @@ ${this.customData.serverResponse}`;
39475
39457
  // package.json
39476
39458
  var package_default = {
39477
39459
  name: "@blinkk/root-cms",
39478
- version: "1.0.0-beta.35",
39460
+ version: "1.0.0-beta.37",
39479
39461
  author: "s@blinkk.com",
39480
39462
  license: "MIT",
39481
39463
  engines: {
@@ -39580,7 +39562,7 @@ ${this.customData.serverResponse}`;
39580
39562
  vitest: "^0.18.1"
39581
39563
  },
39582
39564
  peerDependencies: {
39583
- "@blinkk/root": "1.0.0-beta.35",
39565
+ "@blinkk/root": "1.0.0-beta.37",
39584
39566
  "firebase-admin": ">=11",
39585
39567
  "firebase-functions": ">=4",
39586
39568
  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.35",
3
+ "version": "1.0.0-beta.37",
4
4
  "author": "s@blinkk.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -57,7 +57,7 @@
57
57
  "//": "NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",
58
58
  "devDependencies": {
59
59
  "@babel/core": "^7.17.9",
60
- "@blinkk/root": "1.0.0-beta.35",
60
+ "@blinkk/root": "1.0.0-beta.37",
61
61
  "@emotion/react": "^11.10.5",
62
62
  "@firebase/app-compat": "^0.1.33",
63
63
  "@firebase/app-types": "^0.7.0",
@@ -92,7 +92,7 @@
92
92
  "vitest": "^0.18.1"
93
93
  },
94
94
  "peerDependencies": {
95
- "@blinkk/root": "1.0.0-beta.35",
95
+ "@blinkk/root": "1.0.0-beta.37",
96
96
  "firebase-admin": ">=11",
97
97
  "firebase-functions": ">=4",
98
98
  "preact": "10.x",