@blinkk/root-cms 1.0.0-beta.12 → 1.0.0-beta.14
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 +55 -1
- package/dist/ui/ui.js +72 -16
- package/package.json +4 -4
package/dist/ui/ui.css
CHANGED
|
@@ -608,9 +608,9 @@
|
|
|
608
608
|
border: 1px solid #dedede;
|
|
609
609
|
aspect-ratio: 16/9;
|
|
610
610
|
width: 100%;
|
|
611
|
-
overflow: hidden;
|
|
612
611
|
padding: 10px;
|
|
613
612
|
margin-bottom: 10px;
|
|
613
|
+
position: relative;
|
|
614
614
|
}
|
|
615
615
|
.DocEditor__ImageField__imagePreview__image img {
|
|
616
616
|
display: block;
|
|
@@ -619,6 +619,16 @@
|
|
|
619
619
|
object-fit: contain;
|
|
620
620
|
object-position: center;
|
|
621
621
|
}
|
|
622
|
+
.DocEditor__ImageField__imagePreview__dimens {
|
|
623
|
+
position: absolute;
|
|
624
|
+
top: -1px;
|
|
625
|
+
right: -1px;
|
|
626
|
+
padding: 4px 8px;
|
|
627
|
+
background: black;
|
|
628
|
+
color: white;
|
|
629
|
+
font-size: 8px;
|
|
630
|
+
font-weight: 700;
|
|
631
|
+
}
|
|
622
632
|
.DocEditor__ImageField__imagePreview__image__alt {
|
|
623
633
|
margin-top: 4px;
|
|
624
634
|
}
|
|
@@ -823,6 +833,50 @@
|
|
|
823
833
|
margin-top: 16px;
|
|
824
834
|
max-width: 70ch;
|
|
825
835
|
}
|
|
836
|
+
.ProjectPage__section {
|
|
837
|
+
margin-top: 60px;
|
|
838
|
+
}
|
|
839
|
+
.ProjectPage__section__title {
|
|
840
|
+
margin-bottom: 20px;
|
|
841
|
+
}
|
|
842
|
+
.ProjectPage__collectionList {
|
|
843
|
+
display: flex;
|
|
844
|
+
flex-direction: column;
|
|
845
|
+
justify-content: flex-start;
|
|
846
|
+
gap: 12px;
|
|
847
|
+
max-width: 580px;
|
|
848
|
+
}
|
|
849
|
+
.ProjectPage__collectionList__collection {
|
|
850
|
+
display: grid;
|
|
851
|
+
grid-template-columns: 20px 1fr;
|
|
852
|
+
align-items: center;
|
|
853
|
+
padding: 8px 12px;
|
|
854
|
+
column-gap: 12px;
|
|
855
|
+
row-gap: 4px;
|
|
856
|
+
width: 100%;
|
|
857
|
+
background: transparent;
|
|
858
|
+
border: 2px solid black;
|
|
859
|
+
border-radius: 8px;
|
|
860
|
+
cursor: pointer;
|
|
861
|
+
font-size: 14px;
|
|
862
|
+
font-weight: 500;
|
|
863
|
+
text-decoration: none;
|
|
864
|
+
transition: background-color 0.18s ease;
|
|
865
|
+
position: relative;
|
|
866
|
+
}
|
|
867
|
+
.ProjectPage__collectionList__collection:hover {
|
|
868
|
+
background-color: var(--button-background-hover);
|
|
869
|
+
}
|
|
870
|
+
.ProjectPage__collectionList__collection:active {
|
|
871
|
+
background-color: var(--button-background-active);
|
|
872
|
+
}
|
|
873
|
+
.ProjectPage__collectionList__collection__icon {
|
|
874
|
+
margin-top: 2px;
|
|
875
|
+
}
|
|
876
|
+
.ProjectPage__collectionList__collection__desc {
|
|
877
|
+
grid-column: 2 / span 1;
|
|
878
|
+
font-size: 12px;
|
|
879
|
+
}
|
|
826
880
|
|
|
827
881
|
/* ui/pages/NotFoundPage/NotFoundPage.css */
|
|
828
882
|
.NotFoundPage {
|
package/dist/ui/ui.js
CHANGED
|
@@ -39866,7 +39866,7 @@ ${content}</tr>
|
|
|
39866
39866
|
// package.json
|
|
39867
39867
|
var package_default = {
|
|
39868
39868
|
name: "@blinkk/root-cms",
|
|
39869
|
-
version: "1.0.0-beta.
|
|
39869
|
+
version: "1.0.0-beta.14",
|
|
39870
39870
|
author: "s@blinkk.com",
|
|
39871
39871
|
license: "MIT",
|
|
39872
39872
|
engines: {
|
|
@@ -39917,7 +39917,6 @@ ${content}</tr>
|
|
|
39917
39917
|
"cookie-parser": "^1.4.6",
|
|
39918
39918
|
dotenv: "^16.0.0",
|
|
39919
39919
|
"dts-dom": "^3.7.0",
|
|
39920
|
-
esbuild: "^0.17.12",
|
|
39921
39920
|
"firebase-admin": "^11.5.0",
|
|
39922
39921
|
"js-beautify": "^1.14.7",
|
|
39923
39922
|
kleur: "^4.1.5",
|
|
@@ -39944,6 +39943,7 @@ ${content}</tr>
|
|
|
39944
39943
|
"@types/marked": "^4.0.8",
|
|
39945
39944
|
"@types/node": "^18.11.8",
|
|
39946
39945
|
concurrently: "^7.6.0",
|
|
39946
|
+
esbuild: "0.17.12",
|
|
39947
39947
|
firebase: "^9.17.2",
|
|
39948
39948
|
marked: "^4.2.12",
|
|
39949
39949
|
preact: "*",
|
|
@@ -39956,7 +39956,7 @@ ${content}</tr>
|
|
|
39956
39956
|
vitest: "^0.18.1"
|
|
39957
39957
|
},
|
|
39958
39958
|
peerDependencies: {
|
|
39959
|
-
"@blinkk/root": "1.0.0-beta.
|
|
39959
|
+
"@blinkk/root": "1.0.0-beta.14",
|
|
39960
39960
|
"firebase-admin": ">=11",
|
|
39961
39961
|
preact: "*"
|
|
39962
39962
|
}
|
|
@@ -41797,7 +41797,7 @@ ${content}</tr>
|
|
|
41797
41797
|
const img2 = await uploadFileToGCS(file);
|
|
41798
41798
|
props.draft.updateKey(props.deepKey, img2);
|
|
41799
41799
|
setImg((currentImg) => {
|
|
41800
|
-
return Object.assign({}, img2, { alt: currentImg
|
|
41800
|
+
return Object.assign({}, img2, { alt: currentImg?.alt || "" });
|
|
41801
41801
|
});
|
|
41802
41802
|
setLoading(false);
|
|
41803
41803
|
} catch (err) {
|
|
@@ -41824,14 +41824,17 @@ ${content}</tr>
|
|
|
41824
41824
|
}
|
|
41825
41825
|
return /* @__PURE__ */ o4("div", { className: "DocEditor__ImageField", children: [
|
|
41826
41826
|
img && img.src ? /* @__PURE__ */ o4("div", { className: "DocEditor__ImageField__imagePreview", children: [
|
|
41827
|
-
/* @__PURE__ */ o4("div", { className: "DocEditor__ImageField__imagePreview__image", children:
|
|
41828
|
-
|
|
41829
|
-
|
|
41830
|
-
|
|
41831
|
-
|
|
41832
|
-
|
|
41833
|
-
|
|
41834
|
-
|
|
41827
|
+
/* @__PURE__ */ o4("div", { className: "DocEditor__ImageField__imagePreview__image", children: [
|
|
41828
|
+
/* @__PURE__ */ o4(
|
|
41829
|
+
"img",
|
|
41830
|
+
{
|
|
41831
|
+
src: img.gciUrl || img.src,
|
|
41832
|
+
width: img.width,
|
|
41833
|
+
height: img.height
|
|
41834
|
+
}
|
|
41835
|
+
),
|
|
41836
|
+
/* @__PURE__ */ o4("div", { className: "DocEditor__ImageField__imagePreview__dimens", children: `${img.width}x${img.height}` })
|
|
41837
|
+
] }),
|
|
41835
41838
|
/* @__PURE__ */ o4(
|
|
41836
41839
|
TextInput,
|
|
41837
41840
|
{
|
|
@@ -42459,8 +42462,10 @@ ${content}</tr>
|
|
|
42459
42462
|
if (!iframeWindow) {
|
|
42460
42463
|
return;
|
|
42461
42464
|
}
|
|
42462
|
-
|
|
42463
|
-
|
|
42465
|
+
if (!iframeWindow.location.href.startsWith("about:blank")) {
|
|
42466
|
+
const currentPath = iframeWindow.location.pathname;
|
|
42467
|
+
setIframeUrl(`${domain2}${currentPath}`);
|
|
42468
|
+
}
|
|
42464
42469
|
}
|
|
42465
42470
|
iframe.addEventListener("load", onIframeLoad);
|
|
42466
42471
|
return () => {
|
|
@@ -42596,9 +42601,37 @@ ${content}</tr>
|
|
|
42596
42601
|
return /* @__PURE__ */ o4(Layout, { children: /* @__PURE__ */ o4("div", { className: "ProjectPage", children: [
|
|
42597
42602
|
/* @__PURE__ */ o4(Heading, { size: "h1", children: "Project Home" }),
|
|
42598
42603
|
/* @__PURE__ */ o4(Text2, { as: "p", children: "This page is currently under construction, but the current idea is to have collaborative features here, such as a shared whiteboard (e.g. Notion style) that can be used to provide an overview of the project, timelines and milestones, important links (e.g. Figma), etc." }),
|
|
42599
|
-
/* @__PURE__ */ o4(Text2, { as: "p", children: "There should also be a dashboard here that shows upcoming scheduled releases, and maybe common user controls like a share box." })
|
|
42604
|
+
/* @__PURE__ */ o4(Text2, { as: "p", children: "There should also be a dashboard here that shows upcoming scheduled releases, and maybe common user controls like a share box." }),
|
|
42605
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__section", children: [
|
|
42606
|
+
/* @__PURE__ */ o4(Heading, { className: "ProjectPage__section__title", size: "h2", children: "Content" }),
|
|
42607
|
+
/* @__PURE__ */ o4(ProjectPage.CollectionList, {})
|
|
42608
|
+
] })
|
|
42600
42609
|
] }) });
|
|
42601
42610
|
}
|
|
42611
|
+
ProjectPage.CollectionList = () => {
|
|
42612
|
+
const collections = Object.keys(window.__ROOT_CTX.collections).map((id2) => {
|
|
42613
|
+
return {
|
|
42614
|
+
...window.__ROOT_CTX.collections[id2],
|
|
42615
|
+
id: id2
|
|
42616
|
+
};
|
|
42617
|
+
});
|
|
42618
|
+
return /* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList", children: [
|
|
42619
|
+
collections.map((collection) => /* @__PURE__ */ o4(
|
|
42620
|
+
"a",
|
|
42621
|
+
{
|
|
42622
|
+
className: "ProjectPage__collectionList__collection",
|
|
42623
|
+
href: `/cms/content/${collection.id}`,
|
|
42624
|
+
children: [
|
|
42625
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__icon", children: /* @__PURE__ */ o4(IconFolder, { size: 20, strokeWidth: "1.75" }) }),
|
|
42626
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__name", children: collection.name || collection.id }),
|
|
42627
|
+
/* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collection__desc", children: collection.description || "" })
|
|
42628
|
+
]
|
|
42629
|
+
},
|
|
42630
|
+
collection.id
|
|
42631
|
+
)),
|
|
42632
|
+
collections.length === 0 && /* @__PURE__ */ o4("div", { className: "ProjectPage__collectionList__collections__empty", children: "No collections match your query." })
|
|
42633
|
+
] });
|
|
42634
|
+
};
|
|
42602
42635
|
|
|
42603
42636
|
// ui/pages/NotFoundPage/NotFoundPage.tsx
|
|
42604
42637
|
function NotFoundPage() {
|
|
@@ -42889,7 +42922,7 @@ ${content}</tr>
|
|
|
42889
42922
|
function loginRedirect() {
|
|
42890
42923
|
let originalUrl = window.location.pathname;
|
|
42891
42924
|
if (window.location.search) {
|
|
42892
|
-
originalUrl =
|
|
42925
|
+
originalUrl = `${originalUrl}?${window.location.search}`;
|
|
42893
42926
|
}
|
|
42894
42927
|
const params = new URLSearchParams({ continue: originalUrl });
|
|
42895
42928
|
window.location.replace(`/cms/login?${params.toString()}`);
|
|
@@ -42907,7 +42940,30 @@ ${content}</tr>
|
|
|
42907
42940
|
const root = document.getElementById("root");
|
|
42908
42941
|
root.innerHTML = "";
|
|
42909
42942
|
P(/* @__PURE__ */ o4(App, {}), root);
|
|
42943
|
+
updateSession(user);
|
|
42910
42944
|
});
|
|
42945
|
+
async function updateSession(user) {
|
|
42946
|
+
const idToken = await user.getIdToken();
|
|
42947
|
+
const res = await fetch("/cms/login", {
|
|
42948
|
+
method: "PUT",
|
|
42949
|
+
headers: {
|
|
42950
|
+
"Content-Type": "application/json"
|
|
42951
|
+
},
|
|
42952
|
+
body: JSON.stringify({ idToken })
|
|
42953
|
+
});
|
|
42954
|
+
if (res.status !== 200) {
|
|
42955
|
+
console.error("login failed");
|
|
42956
|
+
console.log(res);
|
|
42957
|
+
return;
|
|
42958
|
+
}
|
|
42959
|
+
const data = await res.json();
|
|
42960
|
+
if (!data.success) {
|
|
42961
|
+
console.error("login failed");
|
|
42962
|
+
console.log(res);
|
|
42963
|
+
return;
|
|
42964
|
+
}
|
|
42965
|
+
console.log("updated user session");
|
|
42966
|
+
}
|
|
42911
42967
|
})();
|
|
42912
42968
|
/*! Bundled license information:
|
|
42913
42969
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkk/root-cms",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"author": "s@blinkk.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"cookie-parser": "^1.4.6",
|
|
39
39
|
"dotenv": "^16.0.0",
|
|
40
40
|
"dts-dom": "^3.7.0",
|
|
41
|
-
"esbuild": "^0.17.12",
|
|
42
41
|
"firebase-admin": "^11.5.0",
|
|
43
42
|
"js-beautify": "^1.14.7",
|
|
44
43
|
"kleur": "^4.1.5",
|
|
@@ -49,7 +48,7 @@
|
|
|
49
48
|
"//": "NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@babel/core": "^7.17.9",
|
|
52
|
-
"@blinkk/root": "1.0.0-beta.
|
|
51
|
+
"@blinkk/root": "1.0.0-beta.14",
|
|
53
52
|
"@emotion/react": "^11.10.5",
|
|
54
53
|
"@firebase/rules-unit-testing": "^2.0.3",
|
|
55
54
|
"@mantine/core": "4.2.12",
|
|
@@ -65,6 +64,7 @@
|
|
|
65
64
|
"@types/marked": "^4.0.8",
|
|
66
65
|
"@types/node": "^18.11.8",
|
|
67
66
|
"concurrently": "^7.6.0",
|
|
67
|
+
"esbuild": "0.17.12",
|
|
68
68
|
"firebase": "^9.17.2",
|
|
69
69
|
"marked": "^4.2.12",
|
|
70
70
|
"preact": "*",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"vitest": "^0.18.1"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@blinkk/root": "1.0.0-beta.
|
|
80
|
+
"@blinkk/root": "1.0.0-beta.14",
|
|
81
81
|
"firebase-admin": ">=11",
|
|
82
82
|
"preact": "*"
|
|
83
83
|
},
|