@emdash-cms/cloudflare 0.0.2 → 0.0.3
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.
|
@@ -40,7 +40,7 @@ function renderPlaygroundToolbar(config) {
|
|
|
40
40
|
<svg class="ec-pg-icon" id="ec-pg-reset-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
|
41
41
|
</button>
|
|
42
42
|
|
|
43
|
-
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://
|
|
43
|
+
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://github.com/emdash-cms/emdash" target="_blank" rel="noopener">
|
|
44
44
|
Deploy your own
|
|
45
45
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
|
46
46
|
</a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emdash-cms/cloudflare",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Cloudflare adapters for EmDash - D1, R2, Access, and Worker Loader sandbox",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"jose": "^6.1.3",
|
|
67
67
|
"kysely-d1": "^0.4.0",
|
|
68
68
|
"ulidx": "^2.4.1",
|
|
69
|
-
"emdash": "0.0.
|
|
69
|
+
"emdash": "0.0.3"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@cloudflare/workers-types": ">=4.0.0",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export interface PlaygroundToolbarConfig {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
/** When the playground was created (ISO string) */
|
|
15
|
+
createdAt: string;
|
|
16
|
+
/** TTL in seconds */
|
|
17
|
+
ttl: number;
|
|
18
|
+
/** Whether edit mode is currently active */
|
|
19
|
+
editMode: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const RE_AMP = /&/g;
|
|
@@ -25,9 +25,9 @@ const RE_LT = /</g;
|
|
|
25
25
|
const RE_GT = />/g;
|
|
26
26
|
|
|
27
27
|
export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string {
|
|
28
|
-
|
|
28
|
+
const { createdAt, ttl, editMode } = config;
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
return `
|
|
31
31
|
<!-- EmDash Playground Toolbar -->
|
|
32
32
|
<div id="emdash-playground-toolbar" data-created-at="${escapeAttr(createdAt)}" data-ttl="${ttl}" data-edit-mode="${editMode}">
|
|
33
33
|
<div class="ec-pg-inner">
|
|
@@ -53,7 +53,7 @@ export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string
|
|
|
53
53
|
<svg class="ec-pg-icon" id="ec-pg-reset-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
|
54
54
|
</button>
|
|
55
55
|
|
|
56
|
-
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://
|
|
56
|
+
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://github.com/emdash-cms/emdash" target="_blank" rel="noopener">
|
|
57
57
|
Deploy your own
|
|
58
58
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
|
59
59
|
</a>
|
|
@@ -333,9 +333,9 @@ export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
function escapeAttr(str: string): string {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
return str
|
|
337
|
+
.replace(RE_AMP, "&")
|
|
338
|
+
.replace(RE_QUOT, """)
|
|
339
|
+
.replace(RE_LT, "<")
|
|
340
|
+
.replace(RE_GT, ">");
|
|
341
341
|
}
|