@tideworthy/tidysites-platform 0.10.13 → 0.10.15
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/editor/TidyEditor.astro +17 -3
- package/src/lib/frame.ts +2 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.14
|
|
4
|
+
|
|
5
|
+
- Editor bar: Edit, Done and Sign in to edit show a spinner and what they are doing until the page comes back.
|
|
6
|
+
|
|
3
7
|
## 0.10.13
|
|
4
8
|
|
|
5
9
|
- Editor: the request panel opens at once; who is signed in is read when the page loads and the greeting fills in. The middleware keeps only the noindex header; robots.txt and the sitemap for staging are the control plane's.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tideworthy/tidysites-platform",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.15",
|
|
4
4
|
"description": "The Tidysites platform integration for EmDash sites: bootstrap, sessions, maintenance, health, and publish hooks under /_tidy/*.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,12 +57,23 @@ const htmlClass = !signedIn ? (signInUrl ? "tidy-has-bar tidy-idle" : "") : !act
|
|
|
57
57
|
<div class="tidy-bar" id="tidy-bar" role="region" aria-label="Site editing">
|
|
58
58
|
<span class="tidy-bar-label"><span class="tidy-bar-dot" aria-hidden="true"></span>{label} website<span class="tidy-bar-note">A private copy to see working changes on the website, not publicly accessible.</span></span>
|
|
59
59
|
<div class="tidy-bar-actions" id="tidy-bar-actions">
|
|
60
|
-
{!signedIn && <a class="tidy-btn tidy-btn-primary" href={signInUrl!}>Sign in to edit</a>}
|
|
61
|
-
{signedIn && !active && <a class="tidy-btn" href={toggle(true)}>Edit</a>}
|
|
62
|
-
{signedIn && active && !editable && <a class="tidy-btn" href={toggle(false)}>Done</a>}
|
|
60
|
+
{!signedIn && <a class="tidy-btn tidy-btn-primary" href={signInUrl!} data-tidy-busy="Signing in">Sign in to edit</a>}
|
|
61
|
+
{signedIn && !active && <a class="tidy-btn" href={toggle(true)} data-tidy-busy="Opening the editor">Edit</a>}
|
|
62
|
+
{signedIn && active && !editable && <a class="tidy-btn" href={toggle(false)} data-tidy-busy="Closing the editor">Done</a>}
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
65
|
<script is:inline define:vars={{ htmlClass }}>document.documentElement.className += " " + htmlClass;</script>
|
|
66
|
+
<script is:inline>
|
|
67
|
+
// A bar button that reloads the page shows it is working until the new page arrives.
|
|
68
|
+
document.querySelectorAll("#tidy-bar a[data-tidy-busy]").forEach((a) => {
|
|
69
|
+
a.addEventListener("click", () => {
|
|
70
|
+
if (a.classList.contains("tidy-busy")) return;
|
|
71
|
+
a.classList.add("tidy-busy");
|
|
72
|
+
a.setAttribute("aria-busy", "true");
|
|
73
|
+
a.innerHTML = '<span class="tidy-spinner" aria-hidden="true"></span>' + a.getAttribute("data-tidy-busy");
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
66
77
|
{signedIn && <script src="./revisions.ts"></script>}
|
|
67
78
|
{signedIn && <script src="./request.ts"></script>}
|
|
68
79
|
</>
|
|
@@ -110,6 +121,9 @@ const htmlClass = !signedIn ? (signInUrl ? "tidy-has-bar tidy-idle" : "") : !act
|
|
|
110
121
|
.tidy-btn-primary { background: #2b7fd1; border-color: #2b7fd1; color: #fff; }
|
|
111
122
|
.tidy-btn-primary:hover { background: #2470bd; }
|
|
112
123
|
.tidy-btn-danger:hover { background: #b3261e; border-color: #b3261e; }
|
|
124
|
+
.tidy-busy { pointer-events: none; opacity: .85; display: inline-flex; align-items: center; gap: 8px; }
|
|
125
|
+
.tidy-spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: tidy-spin .7s linear infinite; }
|
|
126
|
+
@keyframes tidy-spin { to { transform: rotate(360deg); } }
|
|
113
127
|
.tidy-btn-go { background: #1f9d55; border-color: #1f9d55; color: #fff; }
|
|
114
128
|
.tidy-btn-go:hover { background: #1a8a4a; }
|
|
115
129
|
.tidy-btn-sm { padding: 3px 8px; font-size: 12px; }
|
package/src/lib/frame.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* get a `frame-ancestors` policy naming them instead. Nothing changes without
|
|
7
7
|
* the variable.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
/** An https origin, or a local dev page (http://localhost, any port) for the brand preview. */
|
|
10
|
+
const ORIGIN = /^(?:https:\/\/[a-z0-9.-]+(?::\d+)?|http:\/\/localhost(?::(?:\d+|\*))?)$/i;
|
|
10
11
|
|
|
11
12
|
/** The origins allowed to frame the site, from the variable's value; invalid entries are dropped. */
|
|
12
13
|
export function frameAncestors(value: unknown): string[] {
|
package/src/version.ts
CHANGED