hyperclayjs 1.7.0 → 1.9.0
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/README.md +25 -21
- package/package.json +17 -25
- package/src/communication/live-sync.js +396 -0
- package/{communication → src/communication}/sendMessage.js +2 -8
- package/src/core/adminContenteditable.js +51 -0
- package/{core → src/core}/adminInputs.js +29 -8
- package/src/core/adminOnClick.js +54 -0
- package/{core → src/core}/adminResources.js +25 -5
- package/{core → src/core}/autosave.js +6 -17
- package/src/core/enablePersistentFormInputValues.js +67 -0
- package/{core → src/core}/optionVisibility.js +7 -35
- package/{core → src/core}/savePage.js +1 -1
- package/src/core/savePageCore.js +256 -0
- package/src/core/snapshot.js +203 -0
- package/src/core/unsavedWarning.js +26 -0
- package/{custom-attributes → src/custom-attributes}/ajaxElements.js +3 -10
- package/{custom-attributes → src/custom-attributes}/domHelpers.js +17 -4
- package/{custom-attributes → src/custom-attributes}/events.js +2 -0
- package/{custom-attributes → src/custom-attributes}/onaftersave.js +5 -8
- package/src/custom-attributes/onmutation.js +90 -0
- package/src/custom-attributes/onpagemutation.js +32 -0
- package/{custom-attributes → src/custom-attributes}/sortable.js +16 -1
- package/{dom-utilities → src/dom-utilities}/All.js +22 -0
- package/src/dom-utilities/insertStyleTag.js +61 -0
- package/{hyperclay.js → src/hyperclay.js} +20 -3
- package/{module-dependency-graph.json → src/module-dependency-graph.json} +121 -34
- package/{ui → src/ui}/prompts.js +13 -18
- package/{ui → src/ui}/theModal.js +103 -0
- package/{ui → src/ui}/toast.js +4 -3
- package/src/utilities/cacheBust.js +19 -0
- package/{vendor → src/vendor}/idiomorph.min.js +1 -0
- package/core/adminContenteditable.js +0 -36
- package/core/adminOnClick.js +0 -31
- package/core/enablePersistentFormInputValues.js +0 -72
- package/core/savePageCore.js +0 -245
- package/custom-attributes/onpagemutation.js +0 -20
- package/dom-utilities/insertStyleTag.js +0 -38
- /package/{communication → src/communication}/behaviorCollector.js +0 -0
- /package/{communication → src/communication}/uploadFile.js +0 -0
- /package/{core → src/core}/adminSystem.js +0 -0
- /package/{core → src/core}/editmode.js +0 -0
- /package/{core → src/core}/editmodeSystem.js +0 -0
- /package/{core → src/core}/exportToWindow.js +0 -0
- /package/{core → src/core}/isAdminOfCurrentResource.js +0 -0
- /package/{core → src/core}/saveToast.js +0 -0
- /package/{core → src/core}/setPageTypeOnDocumentElement.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/autosize.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/inputHelpers.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/onclickaway.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/onclone.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/onrender.js +0 -0
- /package/{custom-attributes → src/custom-attributes}/preventEnter.js +0 -0
- /package/{dom-utilities → src/dom-utilities}/getDataFromForm.js +0 -0
- /package/{dom-utilities → src/dom-utilities}/onDomReady.js +0 -0
- /package/{dom-utilities → src/dom-utilities}/onLoad.js +0 -0
- /package/{string-utilities → src/string-utilities}/copy-to-clipboard.js +0 -0
- /package/{string-utilities → src/string-utilities}/query.js +0 -0
- /package/{string-utilities → src/string-utilities}/slugify.js +0 -0
- /package/{ui → src/ui}/toast-hyperclay.js +0 -0
- /package/{utilities → src/utilities}/cookie.js +0 -0
- /package/{utilities → src/utilities}/debounce.js +0 -0
- /package/{utilities → src/utilities}/loadVendorScript.js +0 -0
- /package/{utilities → src/utilities}/mutation.js +0 -0
- /package/{utilities → src/utilities}/nearest.js +0 -0
- /package/{utilities → src/utilities}/pipe.js +0 -0
- /package/{utilities → src/utilities}/throttle.js +0 -0
- /package/{vendor → src/vendor}/Sortable.vendor.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HyperclayJS v1.
|
|
2
|
+
* HyperclayJS v1.9.0 - Minimal Browser-Native Loader
|
|
3
3
|
*
|
|
4
4
|
* Modules auto-init when imported (no separate init call needed).
|
|
5
5
|
* Include `export-to-window` feature to export to window.hyperclay.
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* <script type="module">
|
|
10
10
|
* // With window.hyperclay (default presets include export-to-window):
|
|
11
|
-
* await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/hyperclay.js?preset=minimal');
|
|
11
|
+
* await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/src/hyperclay.js?preset=minimal');
|
|
12
12
|
* const { toast, savePage } = window.hyperclay;
|
|
13
13
|
*
|
|
14
14
|
* // ES modules only (exclude export-to-window):
|
|
15
|
-
* const hyperclay = await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/hyperclay.js?preset=minimal&exclude=export-to-window');
|
|
15
|
+
* const hyperclay = await import('https://cdn.jsdelivr.net/npm/hyperclayjs@1/src/hyperclay.js?preset=minimal&exclude=export-to-window');
|
|
16
16
|
* const modules = window.hyperclayModules;
|
|
17
17
|
* </script>
|
|
18
18
|
*
|
|
@@ -28,9 +28,11 @@ const MODULE_PATHS = {
|
|
|
28
28
|
"save-core": "./core/savePageCore.js",
|
|
29
29
|
"save-system": "./core/savePage.js",
|
|
30
30
|
"autosave": "./core/autosave.js",
|
|
31
|
+
"unsaved-warning": "./core/unsavedWarning.js",
|
|
31
32
|
"save-toast": "./core/saveToast.js",
|
|
32
33
|
"edit-mode-helpers": "./core/adminSystem.js",
|
|
33
34
|
"persist": "./core/enablePersistentFormInputValues.js",
|
|
35
|
+
"snapshot": "./core/snapshot.js",
|
|
34
36
|
"option-visibility": "./core/optionVisibility.js",
|
|
35
37
|
"edit-mode": "./core/editmodeSystem.js",
|
|
36
38
|
"event-attrs": "./custom-attributes/events.js",
|
|
@@ -48,6 +50,7 @@ const MODULE_PATHS = {
|
|
|
48
50
|
"cookie": "./utilities/cookie.js",
|
|
49
51
|
"throttle": "./utilities/throttle.js",
|
|
50
52
|
"debounce": "./utilities/debounce.js",
|
|
53
|
+
"cache-bust": "./utilities/cacheBust.js",
|
|
51
54
|
"dom-ready": "./dom-utilities/onDomReady.js",
|
|
52
55
|
"window-load": "./dom-utilities/onLoad.js",
|
|
53
56
|
"all-js": "./dom-utilities/All.js",
|
|
@@ -60,6 +63,7 @@ const MODULE_PATHS = {
|
|
|
60
63
|
"behavior-collector": "./communication/behaviorCollector.js",
|
|
61
64
|
"send-message": "./communication/sendMessage.js",
|
|
62
65
|
"file-upload": "./communication/uploadFile.js",
|
|
66
|
+
"live-sync": "./communication/live-sync.js",
|
|
63
67
|
"export-to-window": "./core/exportToWindow.js"
|
|
64
68
|
};
|
|
65
69
|
const PRESETS = {
|
|
@@ -98,9 +102,11 @@ const PRESETS = {
|
|
|
98
102
|
"save-core",
|
|
99
103
|
"save-system",
|
|
100
104
|
"autosave",
|
|
105
|
+
"unsaved-warning",
|
|
101
106
|
"save-toast",
|
|
102
107
|
"edit-mode-helpers",
|
|
103
108
|
"persist",
|
|
109
|
+
"snapshot",
|
|
104
110
|
"option-visibility",
|
|
105
111
|
"edit-mode",
|
|
106
112
|
"event-attrs",
|
|
@@ -118,6 +124,7 @@ const PRESETS = {
|
|
|
118
124
|
"cookie",
|
|
119
125
|
"throttle",
|
|
120
126
|
"debounce",
|
|
127
|
+
"cache-bust",
|
|
121
128
|
"dom-ready",
|
|
122
129
|
"window-load",
|
|
123
130
|
"all-js",
|
|
@@ -130,6 +137,7 @@ const PRESETS = {
|
|
|
130
137
|
"behavior-collector",
|
|
131
138
|
"send-message",
|
|
132
139
|
"file-upload",
|
|
140
|
+
"live-sync",
|
|
133
141
|
"export-to-window"
|
|
134
142
|
]
|
|
135
143
|
}
|
|
@@ -205,6 +213,12 @@ export const savePage = window.hyperclayModules['save-core']?.savePage ?? window
|
|
|
205
213
|
export const beforeSave = window.hyperclayModules['save-system']?.beforeSave ?? window.hyperclayModules['save-system']?.default;
|
|
206
214
|
export const savePageThrottled = window.hyperclayModules['save-system']?.savePageThrottled ?? window.hyperclayModules['save-system']?.default;
|
|
207
215
|
export const replacePageWith = window.hyperclayModules['save-system']?.replacePageWith ?? window.hyperclayModules['save-system']?.default;
|
|
216
|
+
export const captureSnapshot = window.hyperclayModules['snapshot']?.captureSnapshot ?? window.hyperclayModules['snapshot']?.default;
|
|
217
|
+
export const captureForSave = window.hyperclayModules['snapshot']?.captureForSave ?? window.hyperclayModules['snapshot']?.default;
|
|
218
|
+
export const captureBodyForSync = window.hyperclayModules['snapshot']?.captureBodyForSync ?? window.hyperclayModules['snapshot']?.default;
|
|
219
|
+
export const onSnapshot = window.hyperclayModules['snapshot']?.onSnapshot ?? window.hyperclayModules['snapshot']?.default;
|
|
220
|
+
export const onPrepareForSave = window.hyperclayModules['snapshot']?.onPrepareForSave ?? window.hyperclayModules['snapshot']?.default;
|
|
221
|
+
export const getPageContents = window.hyperclayModules['snapshot']?.getPageContents ?? window.hyperclayModules['snapshot']?.default;
|
|
208
222
|
export const toggleEditMode = window.hyperclayModules['edit-mode']?.toggleEditMode ?? window.hyperclayModules['edit-mode']?.default;
|
|
209
223
|
export const isEditMode = window.hyperclayModules['edit-mode']?.isEditMode ?? window.hyperclayModules['edit-mode']?.default;
|
|
210
224
|
export const isOwner = window.hyperclayModules['edit-mode']?.isOwner ?? window.hyperclayModules['edit-mode']?.default;
|
|
@@ -220,9 +234,11 @@ export const nearest = window.hyperclayModules['nearest']?.nearest ?? window.hyp
|
|
|
220
234
|
export const cookie = window.hyperclayModules['cookie']?.cookie ?? window.hyperclayModules['cookie']?.default;
|
|
221
235
|
export const throttle = window.hyperclayModules['throttle']?.throttle ?? window.hyperclayModules['throttle']?.default;
|
|
222
236
|
export const debounce = window.hyperclayModules['debounce']?.debounce ?? window.hyperclayModules['debounce']?.default;
|
|
237
|
+
export const cacheBust = window.hyperclayModules['cache-bust']?.cacheBust ?? window.hyperclayModules['cache-bust']?.default;
|
|
223
238
|
export const onDomReady = window.hyperclayModules['dom-ready']?.onDomReady ?? window.hyperclayModules['dom-ready']?.default;
|
|
224
239
|
export const onLoad = window.hyperclayModules['window-load']?.onLoad ?? window.hyperclayModules['window-load']?.default;
|
|
225
240
|
export const All = window.hyperclayModules['all-js']?.All ?? window.hyperclayModules['all-js']?.default;
|
|
241
|
+
export const insertStyles = window.hyperclayModules['style-injection']?.insertStyles ?? window.hyperclayModules['style-injection']?.default;
|
|
226
242
|
export const insertStyleTag = window.hyperclayModules['style-injection']?.insertStyleTag ?? window.hyperclayModules['style-injection']?.default;
|
|
227
243
|
export const getDataFromForm = window.hyperclayModules['form-data']?.getDataFromForm ?? window.hyperclayModules['form-data']?.default;
|
|
228
244
|
export const Idiomorph = window.hyperclayModules['idiomorph']?.Idiomorph ?? window.hyperclayModules['idiomorph']?.default;
|
|
@@ -234,3 +250,4 @@ export const sendMessage = window.hyperclayModules['send-message']?.sendMessage
|
|
|
234
250
|
export const uploadFile = window.hyperclayModules['file-upload']?.uploadFile ?? window.hyperclayModules['file-upload']?.default;
|
|
235
251
|
export const createFile = window.hyperclayModules['file-upload']?.createFile ?? window.hyperclayModules['file-upload']?.default;
|
|
236
252
|
export const uploadFileBasic = window.hyperclayModules['file-upload']?.uploadFileBasic ?? window.hyperclayModules['file-upload']?.default;
|
|
253
|
+
export const liveSync = window.hyperclayModules['live-sync']?.liveSync ?? window.hyperclayModules['live-sync']?.default;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"rawDependencies": {
|
|
3
|
-
"__tests__/All.test.js": [
|
|
4
|
-
"dom-utilities/All.js"
|
|
5
|
-
],
|
|
6
|
-
"babel.config.js": [],
|
|
7
|
-
"build/build-loader.js": [],
|
|
8
|
-
"build/generate-dependency-graph.js": [],
|
|
9
|
-
"build/generate-load-jsdelivr.js": [],
|
|
10
|
-
"build/generate-readme.js": [],
|
|
11
|
-
"build/hyperclay.template.js": [],
|
|
12
|
-
"build/update-index-url.js": [],
|
|
13
3
|
"communication/behaviorCollector.js": [],
|
|
4
|
+
"communication/live-sync.js": [],
|
|
14
5
|
"communication/sendMessage.js": [
|
|
15
6
|
"communication/behaviorCollector.js",
|
|
16
7
|
"dom-utilities/getDataFromForm.js",
|
|
@@ -61,7 +52,7 @@
|
|
|
61
52
|
"core/setPageTypeOnDocumentElement.js"
|
|
62
53
|
],
|
|
63
54
|
"core/enablePersistentFormInputValues.js": [
|
|
64
|
-
"core/
|
|
55
|
+
"core/snapshot.js"
|
|
65
56
|
],
|
|
66
57
|
"core/exportToWindow.js": [],
|
|
67
58
|
"core/isAdminOfCurrentResource.js": [
|
|
@@ -69,6 +60,7 @@
|
|
|
69
60
|
"utilities/cookie.js"
|
|
70
61
|
],
|
|
71
62
|
"core/optionVisibility.js": [
|
|
63
|
+
"dom-utilities/insertStyleTag.js",
|
|
72
64
|
"utilities/mutation.js"
|
|
73
65
|
],
|
|
74
66
|
"core/savePage.js": [
|
|
@@ -78,6 +70,7 @@
|
|
|
78
70
|
],
|
|
79
71
|
"core/savePageCore.js": [
|
|
80
72
|
"core/isAdminOfCurrentResource.js",
|
|
73
|
+
"core/snapshot.js",
|
|
81
74
|
"utilities/cookie.js"
|
|
82
75
|
],
|
|
83
76
|
"core/saveToast.js": [
|
|
@@ -89,9 +82,11 @@
|
|
|
89
82
|
"core/savePage.js",
|
|
90
83
|
"dom-utilities/onDomReady.js"
|
|
91
84
|
],
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
85
|
+
"core/snapshot.js": [],
|
|
86
|
+
"core/unsavedWarning.js": [
|
|
87
|
+
"core/isAdminOfCurrentResource.js",
|
|
88
|
+
"core/savePage.js"
|
|
89
|
+
],
|
|
95
90
|
"custom-attributes/ajaxElements.js": [
|
|
96
91
|
"dom-utilities/getDataFromForm.js"
|
|
97
92
|
],
|
|
@@ -103,6 +98,7 @@
|
|
|
103
98
|
"custom-attributes/events.js": [
|
|
104
99
|
"custom-attributes/onclickaway.js",
|
|
105
100
|
"custom-attributes/onclone.js",
|
|
101
|
+
"custom-attributes/onmutation.js",
|
|
106
102
|
"custom-attributes/onpagemutation.js",
|
|
107
103
|
"custom-attributes/onrender.js"
|
|
108
104
|
],
|
|
@@ -113,6 +109,9 @@
|
|
|
113
109
|
"custom-attributes/onaftersave.js": [],
|
|
114
110
|
"custom-attributes/onclickaway.js": [],
|
|
115
111
|
"custom-attributes/onclone.js": [],
|
|
112
|
+
"custom-attributes/onmutation.js": [
|
|
113
|
+
"utilities/mutation.js"
|
|
114
|
+
],
|
|
116
115
|
"custom-attributes/onpagemutation.js": [
|
|
117
116
|
"utilities/mutation.js"
|
|
118
117
|
],
|
|
@@ -132,7 +131,6 @@
|
|
|
132
131
|
"dom-utilities/onDomReady.js": [],
|
|
133
132
|
"dom-utilities/onLoad.js": [],
|
|
134
133
|
"hyperclay.js": [],
|
|
135
|
-
"jest.config.js": [],
|
|
136
134
|
"string-utilities/copy-to-clipboard.js": [],
|
|
137
135
|
"string-utilities/query.js": [],
|
|
138
136
|
"string-utilities/slugify.js": [],
|
|
@@ -147,6 +145,7 @@
|
|
|
147
145
|
"ui/toast.js"
|
|
148
146
|
],
|
|
149
147
|
"ui/toast.js": [],
|
|
148
|
+
"utilities/cacheBust.js": [],
|
|
150
149
|
"utilities/cookie.js": [],
|
|
151
150
|
"utilities/debounce.js": [],
|
|
152
151
|
"utilities/loadVendorScript.js": [],
|
|
@@ -161,7 +160,7 @@
|
|
|
161
160
|
"save-core": {
|
|
162
161
|
"name": "save-core",
|
|
163
162
|
"category": "core",
|
|
164
|
-
"size": 6.
|
|
163
|
+
"size": 6.8,
|
|
165
164
|
"files": [
|
|
166
165
|
"core/savePageCore.js"
|
|
167
166
|
],
|
|
@@ -198,11 +197,21 @@
|
|
|
198
197
|
"autosave": {
|
|
199
198
|
"name": "autosave",
|
|
200
199
|
"category": "core",
|
|
201
|
-
"size":
|
|
200
|
+
"size": 0.9,
|
|
202
201
|
"files": [
|
|
203
202
|
"core/autosave.js"
|
|
204
203
|
],
|
|
205
|
-
"description": "Auto-save on DOM changes
|
|
204
|
+
"description": "Auto-save on DOM changes",
|
|
205
|
+
"exports": {}
|
|
206
|
+
},
|
|
207
|
+
"unsaved-warning": {
|
|
208
|
+
"name": "unsaved-warning",
|
|
209
|
+
"category": "core",
|
|
210
|
+
"size": 0.8,
|
|
211
|
+
"files": [
|
|
212
|
+
"core/unsavedWarning.js"
|
|
213
|
+
],
|
|
214
|
+
"description": "Warn before leaving page with unsaved changes",
|
|
206
215
|
"exports": {}
|
|
207
216
|
},
|
|
208
217
|
"save-toast": {
|
|
@@ -218,7 +227,7 @@
|
|
|
218
227
|
"edit-mode-helpers": {
|
|
219
228
|
"name": "edit-mode-helpers",
|
|
220
229
|
"category": "core",
|
|
221
|
-
"size":
|
|
230
|
+
"size": 7.500000000000001,
|
|
222
231
|
"files": [
|
|
223
232
|
"core/adminSystem.js",
|
|
224
233
|
"core/adminContenteditable.js",
|
|
@@ -232,17 +241,49 @@
|
|
|
232
241
|
"persist": {
|
|
233
242
|
"name": "persist",
|
|
234
243
|
"category": "core",
|
|
235
|
-
"size": 2.
|
|
244
|
+
"size": 2.4,
|
|
236
245
|
"files": [
|
|
237
246
|
"core/enablePersistentFormInputValues.js"
|
|
238
247
|
],
|
|
239
248
|
"description": "Persist input/select/textarea values to the DOM with [persist] attribute",
|
|
240
249
|
"exports": {}
|
|
241
250
|
},
|
|
251
|
+
"snapshot": {
|
|
252
|
+
"name": "snapshot",
|
|
253
|
+
"category": "core",
|
|
254
|
+
"size": 7.5,
|
|
255
|
+
"files": [
|
|
256
|
+
"core/snapshot.js"
|
|
257
|
+
],
|
|
258
|
+
"description": "Source of truth for page state - captures DOM snapshots for save and sync",
|
|
259
|
+
"exports": {
|
|
260
|
+
"captureSnapshot": [
|
|
261
|
+
"hyperclay"
|
|
262
|
+
],
|
|
263
|
+
"captureForSave": [
|
|
264
|
+
"hyperclay"
|
|
265
|
+
],
|
|
266
|
+
"captureBodyForSync": [
|
|
267
|
+
"hyperclay"
|
|
268
|
+
],
|
|
269
|
+
"onSnapshot": [
|
|
270
|
+
"hyperclay"
|
|
271
|
+
],
|
|
272
|
+
"onPrepareForSave": [
|
|
273
|
+
"hyperclay"
|
|
274
|
+
],
|
|
275
|
+
"beforeSave": [
|
|
276
|
+
"hyperclay"
|
|
277
|
+
],
|
|
278
|
+
"getPageContents": [
|
|
279
|
+
"hyperclay"
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
},
|
|
242
283
|
"option-visibility": {
|
|
243
284
|
"name": "option-visibility",
|
|
244
285
|
"category": "core",
|
|
245
|
-
"size": 5.
|
|
286
|
+
"size": 5.3,
|
|
246
287
|
"files": [
|
|
247
288
|
"core/optionVisibility.js"
|
|
248
289
|
],
|
|
@@ -274,7 +315,7 @@
|
|
|
274
315
|
"event-attrs": {
|
|
275
316
|
"name": "event-attrs",
|
|
276
317
|
"category": "custom-attributes",
|
|
277
|
-
"size":
|
|
318
|
+
"size": 4.1000000000000005,
|
|
278
319
|
"files": [
|
|
279
320
|
"custom-attributes/events.js",
|
|
280
321
|
"custom-attributes/onclickaway.js",
|
|
@@ -288,7 +329,7 @@
|
|
|
288
329
|
"ajax-elements": {
|
|
289
330
|
"name": "ajax-elements",
|
|
290
331
|
"category": "custom-attributes",
|
|
291
|
-
"size": 2.
|
|
332
|
+
"size": 2.6,
|
|
292
333
|
"files": [
|
|
293
334
|
"custom-attributes/ajaxElements.js"
|
|
294
335
|
],
|
|
@@ -298,7 +339,7 @@
|
|
|
298
339
|
"sortable": {
|
|
299
340
|
"name": "sortable",
|
|
300
341
|
"category": "custom-attributes",
|
|
301
|
-
"size":
|
|
342
|
+
"size": 3.4,
|
|
302
343
|
"files": [
|
|
303
344
|
"custom-attributes/sortable.js"
|
|
304
345
|
],
|
|
@@ -308,7 +349,7 @@
|
|
|
308
349
|
"dom-helpers": {
|
|
309
350
|
"name": "dom-helpers",
|
|
310
351
|
"category": "custom-attributes",
|
|
311
|
-
"size":
|
|
352
|
+
"size": 6.2,
|
|
312
353
|
"files": [
|
|
313
354
|
"custom-attributes/domHelpers.js"
|
|
314
355
|
],
|
|
@@ -330,7 +371,7 @@
|
|
|
330
371
|
"onaftersave": {
|
|
331
372
|
"name": "onaftersave",
|
|
332
373
|
"category": "custom-attributes",
|
|
333
|
-
"size": 1
|
|
374
|
+
"size": 1,
|
|
334
375
|
"files": [
|
|
335
376
|
"custom-attributes/onaftersave.js"
|
|
336
377
|
],
|
|
@@ -340,7 +381,7 @@
|
|
|
340
381
|
"dialogs": {
|
|
341
382
|
"name": "dialogs",
|
|
342
383
|
"category": "ui",
|
|
343
|
-
"size":
|
|
384
|
+
"size": 7.7,
|
|
344
385
|
"files": [
|
|
345
386
|
"ui/prompts.js"
|
|
346
387
|
],
|
|
@@ -359,6 +400,7 @@
|
|
|
359
400
|
"hyperclay"
|
|
360
401
|
],
|
|
361
402
|
"snippet": [
|
|
403
|
+
"window",
|
|
362
404
|
"hyperclay"
|
|
363
405
|
]
|
|
364
406
|
}
|
|
@@ -396,7 +438,7 @@
|
|
|
396
438
|
"the-modal": {
|
|
397
439
|
"name": "the-modal",
|
|
398
440
|
"category": "ui",
|
|
399
|
-
"size":
|
|
441
|
+
"size": 21.8,
|
|
400
442
|
"files": [
|
|
401
443
|
"ui/theModal.js"
|
|
402
444
|
],
|
|
@@ -481,6 +523,21 @@
|
|
|
481
523
|
]
|
|
482
524
|
}
|
|
483
525
|
},
|
|
526
|
+
"cache-bust": {
|
|
527
|
+
"name": "cache-bust",
|
|
528
|
+
"category": "utilities",
|
|
529
|
+
"size": 0.6,
|
|
530
|
+
"files": [
|
|
531
|
+
"utilities/cacheBust.js"
|
|
532
|
+
],
|
|
533
|
+
"description": "Cache-bust href/src attributes",
|
|
534
|
+
"exports": {
|
|
535
|
+
"cacheBust": [
|
|
536
|
+
"window",
|
|
537
|
+
"hyperclay"
|
|
538
|
+
]
|
|
539
|
+
}
|
|
540
|
+
},
|
|
484
541
|
"dom-ready": {
|
|
485
542
|
"name": "dom-ready",
|
|
486
543
|
"category": "dom-utilities",
|
|
@@ -512,7 +569,7 @@
|
|
|
512
569
|
"all-js": {
|
|
513
570
|
"name": "all-js",
|
|
514
571
|
"category": "dom-utilities",
|
|
515
|
-
"size": 14,
|
|
572
|
+
"size": 14.4,
|
|
516
573
|
"files": [
|
|
517
574
|
"dom-utilities/All.js"
|
|
518
575
|
],
|
|
@@ -527,12 +584,16 @@
|
|
|
527
584
|
"style-injection": {
|
|
528
585
|
"name": "style-injection",
|
|
529
586
|
"category": "dom-utilities",
|
|
530
|
-
"size": 1.
|
|
587
|
+
"size": 1.9,
|
|
531
588
|
"files": [
|
|
532
589
|
"dom-utilities/insertStyleTag.js"
|
|
533
590
|
],
|
|
534
591
|
"description": "Dynamic stylesheet injection",
|
|
535
592
|
"exports": {
|
|
593
|
+
"insertStyles": [
|
|
594
|
+
"window",
|
|
595
|
+
"hyperclay"
|
|
596
|
+
],
|
|
536
597
|
"insertStyleTag": [
|
|
537
598
|
"window",
|
|
538
599
|
"hyperclay"
|
|
@@ -557,7 +618,7 @@
|
|
|
557
618
|
"idiomorph": {
|
|
558
619
|
"name": "idiomorph",
|
|
559
620
|
"category": "vendor",
|
|
560
|
-
"size": 8.
|
|
621
|
+
"size": 8.3,
|
|
561
622
|
"files": [
|
|
562
623
|
"vendor/idiomorph.min.js"
|
|
563
624
|
],
|
|
@@ -629,7 +690,7 @@
|
|
|
629
690
|
"send-message": {
|
|
630
691
|
"name": "send-message",
|
|
631
692
|
"category": "communication",
|
|
632
|
-
"size": 1.
|
|
693
|
+
"size": 1.3,
|
|
633
694
|
"files": [
|
|
634
695
|
"communication/sendMessage.js"
|
|
635
696
|
],
|
|
@@ -660,6 +721,20 @@
|
|
|
660
721
|
]
|
|
661
722
|
}
|
|
662
723
|
},
|
|
724
|
+
"live-sync": {
|
|
725
|
+
"name": "live-sync",
|
|
726
|
+
"category": "communication",
|
|
727
|
+
"size": 12,
|
|
728
|
+
"files": [
|
|
729
|
+
"communication/live-sync.js"
|
|
730
|
+
],
|
|
731
|
+
"description": "Real-time DOM sync across browsers and with file system",
|
|
732
|
+
"exports": {
|
|
733
|
+
"liveSync": [
|
|
734
|
+
"hyperclay"
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
},
|
|
663
738
|
"export-to-window": {
|
|
664
739
|
"name": "export-to-window",
|
|
665
740
|
"category": "core",
|
|
@@ -675,9 +750,11 @@
|
|
|
675
750
|
"save-core": "./core/savePageCore.js",
|
|
676
751
|
"save-system": "./core/savePage.js",
|
|
677
752
|
"autosave": "./core/autosave.js",
|
|
753
|
+
"unsaved-warning": "./core/unsavedWarning.js",
|
|
678
754
|
"save-toast": "./core/saveToast.js",
|
|
679
755
|
"edit-mode-helpers": "./core/adminSystem.js",
|
|
680
756
|
"persist": "./core/enablePersistentFormInputValues.js",
|
|
757
|
+
"snapshot": "./core/snapshot.js",
|
|
681
758
|
"option-visibility": "./core/optionVisibility.js",
|
|
682
759
|
"edit-mode": "./core/editmodeSystem.js",
|
|
683
760
|
"event-attrs": "./custom-attributes/events.js",
|
|
@@ -695,6 +772,7 @@
|
|
|
695
772
|
"cookie": "./utilities/cookie.js",
|
|
696
773
|
"throttle": "./utilities/throttle.js",
|
|
697
774
|
"debounce": "./utilities/debounce.js",
|
|
775
|
+
"cache-bust": "./utilities/cacheBust.js",
|
|
698
776
|
"dom-ready": "./dom-utilities/onDomReady.js",
|
|
699
777
|
"window-load": "./dom-utilities/onLoad.js",
|
|
700
778
|
"all-js": "./dom-utilities/All.js",
|
|
@@ -707,6 +785,7 @@
|
|
|
707
785
|
"behavior-collector": "./communication/behaviorCollector.js",
|
|
708
786
|
"send-message": "./communication/sendMessage.js",
|
|
709
787
|
"file-upload": "./communication/uploadFile.js",
|
|
788
|
+
"live-sync": "./communication/live-sync.js",
|
|
710
789
|
"export-to-window": "./core/exportToWindow.js"
|
|
711
790
|
},
|
|
712
791
|
"categories": {
|
|
@@ -717,9 +796,11 @@
|
|
|
717
796
|
"save-core",
|
|
718
797
|
"save-system",
|
|
719
798
|
"autosave",
|
|
799
|
+
"unsaved-warning",
|
|
720
800
|
"save-toast",
|
|
721
801
|
"edit-mode-helpers",
|
|
722
802
|
"persist",
|
|
803
|
+
"snapshot",
|
|
723
804
|
"option-visibility",
|
|
724
805
|
"edit-mode"
|
|
725
806
|
]
|
|
@@ -753,7 +834,8 @@
|
|
|
753
834
|
"nearest",
|
|
754
835
|
"cookie",
|
|
755
836
|
"throttle",
|
|
756
|
-
"debounce"
|
|
837
|
+
"debounce",
|
|
838
|
+
"cache-bust"
|
|
757
839
|
]
|
|
758
840
|
},
|
|
759
841
|
"dom-utilities": {
|
|
@@ -780,7 +862,8 @@
|
|
|
780
862
|
"description": "File handling and messaging",
|
|
781
863
|
"modules": [
|
|
782
864
|
"send-message",
|
|
783
|
-
"file-upload"
|
|
865
|
+
"file-upload",
|
|
866
|
+
"live-sync"
|
|
784
867
|
]
|
|
785
868
|
},
|
|
786
869
|
"vendor": {
|
|
@@ -827,9 +910,11 @@
|
|
|
827
910
|
"save-core",
|
|
828
911
|
"save-system",
|
|
829
912
|
"autosave",
|
|
913
|
+
"unsaved-warning",
|
|
830
914
|
"save-toast",
|
|
831
915
|
"edit-mode-helpers",
|
|
832
916
|
"persist",
|
|
917
|
+
"snapshot",
|
|
833
918
|
"option-visibility",
|
|
834
919
|
"edit-mode",
|
|
835
920
|
"event-attrs",
|
|
@@ -847,6 +932,7 @@
|
|
|
847
932
|
"cookie",
|
|
848
933
|
"throttle",
|
|
849
934
|
"debounce",
|
|
935
|
+
"cache-bust",
|
|
850
936
|
"dom-ready",
|
|
851
937
|
"window-load",
|
|
852
938
|
"all-js",
|
|
@@ -859,6 +945,7 @@
|
|
|
859
945
|
"behavior-collector",
|
|
860
946
|
"send-message",
|
|
861
947
|
"file-upload",
|
|
948
|
+
"live-sync",
|
|
862
949
|
"export-to-window"
|
|
863
950
|
]
|
|
864
951
|
}
|
package/{ui → src/ui}/prompts.js
RENAMED
|
@@ -3,7 +3,7 @@ import onDomReady from "../dom-utilities/onDomReady.js";
|
|
|
3
3
|
import toast from "./toast.js";
|
|
4
4
|
import copyToClipboard from "../string-utilities/copy-to-clipboard.js";
|
|
5
5
|
|
|
6
|
-
const CLOSE_BUTTON_SVG = `<svg
|
|
6
|
+
const CLOSE_BUTTON_SVG = `<svg viewBox="0 0 134 134" fill="none" xmlns="http://www.w3.org/2000/svg"><path class="micromodal__close-bg" d="M132 132.5 1 1.5h131v131Z" /><path class="micromodal__close-x" fill-rule="evenodd" clip-rule="evenodd" d="M0 0h3v1.5h1.5V3H6v1.5h1.5V6H9v1.5h1.5V9H12v1.5h1.5V12H15v1.5h1.5V15H18v1.5h1.5V18H21v1.5h1.5V21H24v1.5h1.5V24H27v1.5h1.5V27H30v1.5h1.5V30H33v1.5h1.5V33H36v1.5h1.5V36H39v1.5h1.5V39H42v1.5h1.5V42H45v1.5h1.5V45H48v1.5h1.5V48H51v1.5h1.5V51H54v1.5h1.5V54H57v1.5h1.5V57H60v1.5h1.5V60H63v1.5h1.5V63H66v1.5h1.5V66H69v1.5h1.5V69H72v1.5h1.5V72H75v1.5h1.5V75H78v1.5h1.5V78H81v1.5h1.5V81H84v1.5h1.5V84H87v1.5h1.5V87H90v1.5h1.5V90H93v1.5h1.5V93H96v1.5h1.5V96H99v1.5h1.5V99h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v1.5h1.5v3h-3V132H129v-1.5h-1.5V129H126v-1.5h-1.5V126H123v-1.5h-1.5V123H120v-1.5h-1.5V120H117v-1.5h-1.5V117H114v-1.5h-1.5V114H111v-1.5h-1.5V111H108v-1.5h-1.5V108H105v-1.5h-1.5V105H102v-1.5h-1.5V102H99v-1.5h-1.5V99H96v-1.5h-1.5V96H93v-1.5h-1.5V93H90v-1.5h-1.5V90H87v-1.5h-1.5V87H84v-1.5h-1.5V84H81v-1.5h-1.5V81H78v-1.5h-1.5V78H75v-1.5h-1.5V75H72v-1.5h-1.5V72H69v-1.5h-1.5V69H66v-1.5h-1.5V66H63v-1.5h-1.5V63H60v-1.5h-1.5V60H57v-1.5h-1.5V57H54v-1.5h-1.5V54H51v-1.5h-1.5V51H48v-1.5h-1.5V48H45v-1.5h-1.5V45H42v-1.5h-1.5V42H39v-1.5h-1.5V39H36v-1.5h-1.5V36H33v-1.5h-1.5V33H30v-1.5h-1.5V30H27v-1.5h-1.5V27H24v-1.5h-1.5V24H21v-1.5h-1.5V21H18v-1.5h-1.5V18H15v-1.5h-1.5V15H12v-1.5h-1.5V12H9v-1.5H7.5V9H6V7.5H4.5V6H3V4.5H1.5V3H0V0ZM108.8 22h5.2v5.1h-2.6v2.6H109v2.6h-2.6v2.6h-2.6v2.5h-2.6v5.2h2.6V45h2.6v2.6h2.6v2.6h2.5v2.6h2.6V58h-5.1v-2.6h-2.6V53h-2.6v-2.6h-2.6v-2.6h-2.5v-2.6h-5.2v2.6H91v2.6h-2.6v2.6h-2.6v2.5h-2.6V58H78v-5.1h2.6v-2.6H83v-2.6h2.6v-2.6h2.6v-2.5h2.6v-5.2h-2.6V35h-2.6v-2.6h-2.6v-2.6h-2.5v-2.6H78V22h5.2v2.6h2.5V27h2.6v2.6h2.6v2.6h2.5v2.6h5.2v-2.6h2.5v-2.6h2.6v-2.6h2.6v-2.5h2.5V22Z" /></svg>`;
|
|
7
7
|
const CONFIRM_BUTTON_SVG = `<div style="width: 28px;"><svg viewBox="0 0 60 33" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M34.5 0.75H43.5V5.25H49V9.75H54.5V14.25H60V18.75H54.5V23.25H49V27.75H43.5V32.25H34.5V27.75H40V23.25H45.5V18.75H0V14.25H45.5V9.75H40V5.25H34.5V0.75Z" fill="white"/></svg></div>`;
|
|
8
8
|
|
|
9
9
|
function createModal(promptText, yesCallback, extraContent = "", includeInput = false, defaultValue = "") {
|
|
@@ -70,11 +70,11 @@ export function consent(promptText, yesCallback, extraContent = "") {
|
|
|
70
70
|
*/
|
|
71
71
|
export function tell(promptText, ...content) {
|
|
72
72
|
const contentHtml = content.length > 0
|
|
73
|
-
? content.map(c => `<div class="
|
|
73
|
+
? content.map(c => `<div class="micromodal__tell-content">${c}</div>`).join("")
|
|
74
74
|
: "";
|
|
75
75
|
|
|
76
|
-
themodal.html = `<div class="
|
|
77
|
-
<div class="
|
|
76
|
+
themodal.html = `<div class="micromodal__tell">
|
|
77
|
+
<div class="micromodal__tell-title">${promptText}</div>
|
|
78
78
|
${contentHtml}
|
|
79
79
|
</div>`;
|
|
80
80
|
themodal.closeHtml = CLOSE_BUTTON_SVG;
|
|
@@ -98,27 +98,22 @@ export function tell(promptText, ...content) {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Display a modal with a code snippet and copy functionality
|
|
101
|
-
*
|
|
101
|
+
* @param {string} title - The modal heading
|
|
102
|
+
* @param {string} content - The code to display
|
|
103
|
+
* @param {string} extraContent - Optional warning/info text below the copy button
|
|
102
104
|
*/
|
|
103
|
-
export function snippet(title, content,
|
|
104
|
-
const {
|
|
105
|
-
extraContent = 'Save this, it won\'t be shown again. Expires in 1 year.'
|
|
106
|
-
} = options;
|
|
105
|
+
export function snippet(title, content, extraContent = '') {
|
|
107
106
|
|
|
108
107
|
// Create the modal content with copy button
|
|
109
108
|
const modalContent = `
|
|
110
|
-
<div class="
|
|
111
|
-
<
|
|
112
|
-
<pre class="text-white font-mono text-sm whitespace-nowrap">${content}</pre>
|
|
113
|
-
</div>
|
|
109
|
+
<div class="snippet-code-block">
|
|
110
|
+
<pre>${content}</pre>
|
|
114
111
|
</div>
|
|
115
112
|
|
|
116
|
-
<button type="button" class="
|
|
117
|
-
<span class="whitespace-nowrap select-none inline-block group-active:translate-x-[1.5px] group-active:translate-y-[1.5px]">copy</span>
|
|
118
|
-
</button>
|
|
113
|
+
<button type="button" class="micromodal__secondary-btn copy-snippet-btn" style="margin-bottom: 14px;">copy</button>
|
|
119
114
|
|
|
120
115
|
${extraContent ? `
|
|
121
|
-
<div class="
|
|
116
|
+
<div class="snippet-warning">
|
|
122
117
|
${extraContent}
|
|
123
118
|
</div>
|
|
124
119
|
` : ''}
|
|
@@ -131,7 +126,7 @@ export function snippet(title, content, options = {}) {
|
|
|
131
126
|
</div>`;
|
|
132
127
|
|
|
133
128
|
themodal.closeHtml = CLOSE_BUTTON_SVG;
|
|
134
|
-
themodal.yes =
|
|
129
|
+
themodal.yes = '';
|
|
135
130
|
|
|
136
131
|
const promise = new Promise((resolve) => {
|
|
137
132
|
// Local copy function
|