hyperclayjs 1.4.0 → 1.6.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/LICENSE +0 -5
- package/README.md +11 -12
- package/core/autosave.js +2 -4
- package/core/savePage.js +92 -13
- package/core/savePageCore.js +15 -2
- package/core/saveToast.js +37 -0
- package/custom-attributes/onaftersave.js +41 -0
- package/hyperclay.js +7 -3
- package/module-dependency-graph.json +39 -28
- package/package.json +1 -1
- package/vendor/tailwind-base.css +0 -1471
- package/vendor/tailwind-play.js +0 -23
- package/vendor/tailwind-play.vendor.js +0 -169
package/LICENSE
CHANGED
|
@@ -31,11 +31,6 @@ This project includes the following third-party libraries:
|
|
|
31
31
|
- License: 0BSD (Zero-Clause BSD)
|
|
32
32
|
- https://github.com/bigskysoftware/idiomorph
|
|
33
33
|
|
|
34
|
-
### Tailwind CSS
|
|
35
|
-
- Copyright (c) Tailwind Labs, Inc.
|
|
36
|
-
- License: MIT
|
|
37
|
-
- https://github.com/tailwindlabs/tailwindcss
|
|
38
|
-
|
|
39
34
|
### Sortable.js
|
|
40
35
|
- Copyright (c) All contributors to Sortable
|
|
41
36
|
- License: MIT
|
package/README.md
CHANGED
|
@@ -57,13 +57,14 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
57
57
|
|
|
58
58
|
| Module | Size | Description |
|
|
59
59
|
|--------|------|-------------|
|
|
60
|
-
| autosave | 1.
|
|
60
|
+
| autosave | 1.1KB | Auto-save on DOM changes, unsaved changes warning |
|
|
61
61
|
| edit-mode | 1.8KB | Toggle edit mode on hyperclay on/off |
|
|
62
62
|
| edit-mode-helpers | 5.4KB | Admin-only functionality: [edit-mode-input], [edit-mode-resource], [edit-mode-onclick] |
|
|
63
63
|
| option-visibility | 4.7KB | Dynamic show/hide based on ancestor state with option:attribute="value" |
|
|
64
64
|
| persist | 2.5KB | Persist input/select/textarea values to the DOM with [persist] attribute |
|
|
65
|
-
| save-core |
|
|
66
|
-
| save-system |
|
|
65
|
+
| save-core | 6.3KB | Basic save function only - hyperclay.savePage() |
|
|
66
|
+
| save-system | 7.1KB | Manual save: keyboard shortcut (CMD+S), save button, change tracking |
|
|
67
|
+
| save-toast | 0.9KB | Toast notifications for save events |
|
|
67
68
|
|
|
68
69
|
### Custom Attributes (HTML enhancements)
|
|
69
70
|
|
|
@@ -73,6 +74,7 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
73
74
|
| dom-helpers | 5.7KB | el.nearest, el.val, el.text, el.exec, el.cycle |
|
|
74
75
|
| event-attrs | 3.6KB | [onclickaway], [onclone], [onpagemutation], [onrender] |
|
|
75
76
|
| input-helpers | 1.2KB | [prevent-enter], [autosize] for textareas |
|
|
77
|
+
| onaftersave | 1.2KB | [onaftersave] attribute - run JS when save status changes |
|
|
76
78
|
| sortable | 2.8KB | Drag-drop sorting with [sortable], lazy-loads ~118KB Sortable.js in edit mode |
|
|
77
79
|
|
|
78
80
|
### UI Components (User interface elements)
|
|
@@ -80,7 +82,6 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
80
82
|
| Module | Size | Description |
|
|
81
83
|
|--------|------|-------------|
|
|
82
84
|
| dialogs | 8.4KB | ask(), consent(), tell(), snippet() dialog functions |
|
|
83
|
-
| tailwind-play | 0.7KB | Live Tailwind CSS editing, lazy-loads ~370KB script in edit mode only |
|
|
84
85
|
| the-modal | 19.8KB | Full modal window creation system - window.theModal |
|
|
85
86
|
| toast | 7.7KB | Success/error message notifications, toast(msg, msgType) |
|
|
86
87
|
|
|
@@ -126,17 +127,17 @@ import 'hyperclayjs/presets/standard.js';
|
|
|
126
127
|
|
|
127
128
|
## Presets
|
|
128
129
|
|
|
129
|
-
### Minimal (~
|
|
130
|
+
### Minimal (~27.8KB)
|
|
130
131
|
Essential features for basic editing
|
|
131
132
|
|
|
132
|
-
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `toast`, `export-to-window`
|
|
133
|
+
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
133
134
|
|
|
134
|
-
### Standard (~
|
|
135
|
+
### Standard (~44.3KB)
|
|
135
136
|
Standard feature set for most use cases
|
|
136
137
|
|
|
137
|
-
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `export-to-window`
|
|
138
|
+
**Modules:** `save-core`, `save-system`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `save-toast`, `export-to-window`
|
|
138
139
|
|
|
139
|
-
### Everything (~
|
|
140
|
+
### Everything (~149KB)
|
|
140
141
|
All available features
|
|
141
142
|
|
|
142
143
|
Includes all available modules across all categories.
|
|
@@ -148,7 +149,6 @@ Some modules with large vendor dependencies are **lazy-loaded** to optimize page
|
|
|
148
149
|
| Module | Wrapper Size | Vendor Size | Loaded When |
|
|
149
150
|
|--------|-------------|-------------|-------------|
|
|
150
151
|
| `sortable` | ~3KB | ~118KB | Edit mode only |
|
|
151
|
-
| `tailwind-play` | ~1KB | ~370KB | Edit mode only |
|
|
152
152
|
|
|
153
153
|
**How it works:**
|
|
154
154
|
- The wrapper module checks if the page is in edit mode (`isEditMode`)
|
|
@@ -158,7 +158,7 @@ Some modules with large vendor dependencies are **lazy-loaded** to optimize page
|
|
|
158
158
|
|
|
159
159
|
This means:
|
|
160
160
|
- **Editors** get full functionality when needed
|
|
161
|
-
- **Viewers** never download
|
|
161
|
+
- **Viewers** never download the heavy vendor scripts
|
|
162
162
|
- **Saved pages** stay clean with no leftover script tags
|
|
163
163
|
|
|
164
164
|
## Visual Configurator
|
|
@@ -367,7 +367,6 @@ MIT © Hyperclay
|
|
|
367
367
|
This project includes the following open-source libraries:
|
|
368
368
|
|
|
369
369
|
- **[Idiomorph](https://github.com/bigskysoftware/idiomorph)** - DOM morphing library by Big Sky Software (0BSD)
|
|
370
|
-
- **[Tailwind CSS](https://github.com/tailwindlabs/tailwindcss)** - Utility-first CSS framework by Tailwind Labs (MIT)
|
|
371
370
|
- **[Sortable.js](https://github.com/SortableJS/Sortable)** - Drag-and-drop library (MIT)
|
|
372
371
|
|
|
373
372
|
## Links
|
package/core/autosave.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Warns before leaving page with unsaved changes.
|
|
6
6
|
*
|
|
7
7
|
* Requires the 'save-system' module to be loaded first.
|
|
8
|
+
* For toast notifications, also load the 'save-toast' module.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import toast from "../ui/toast.js";
|
|
11
11
|
import Mutation from "../utilities/mutation.js";
|
|
12
12
|
import { isEditMode, isOwner } from "./isAdminOfCurrentResource.js";
|
|
13
13
|
import {
|
|
@@ -24,9 +24,7 @@ function initSavePageOnChange() {
|
|
|
24
24
|
debounce: 3333,
|
|
25
25
|
omitChangeDetails: true
|
|
26
26
|
}, () => {
|
|
27
|
-
savePageThrottled(
|
|
28
|
-
if (msg) toast(msg, msgType);
|
|
29
|
-
});
|
|
27
|
+
savePageThrottled();
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
|
package/core/savePage.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Save system for Hyperclay
|
|
3
3
|
*
|
|
4
|
-
* Manual save with change detection,
|
|
4
|
+
* Manual save with change detection, state management,
|
|
5
5
|
* keyboard shortcuts, and save button support.
|
|
6
6
|
*
|
|
7
7
|
* For auto-save on DOM changes, also load the 'autosave' module.
|
|
8
|
+
* For toast notifications, also load the 'save-toast' module.
|
|
8
9
|
*
|
|
9
10
|
* Built on top of savePageCore.js
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
|
-
import toast from "../ui/toast.js";
|
|
13
13
|
import throttle from "../utilities/throttle.js";
|
|
14
14
|
import { isEditMode, isOwner } from "./isAdminOfCurrentResource.js";
|
|
15
15
|
import {
|
|
@@ -19,6 +19,69 @@ import {
|
|
|
19
19
|
beforeSave
|
|
20
20
|
} from "./savePageCore.js";
|
|
21
21
|
|
|
22
|
+
// ============================================
|
|
23
|
+
// SAVE STATE MANAGEMENT
|
|
24
|
+
// ============================================
|
|
25
|
+
|
|
26
|
+
let savingTimeout = null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Sets the save status on <html> and dispatches an event.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} state - One of: 'saving', 'saved', 'offline', 'error'
|
|
32
|
+
* @param {string} msg - Optional message (e.g., error details)
|
|
33
|
+
*/
|
|
34
|
+
function setSaveState(state, msg = '') {
|
|
35
|
+
if (savingTimeout) {
|
|
36
|
+
clearTimeout(savingTimeout);
|
|
37
|
+
savingTimeout = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
document.documentElement.setAttribute('savestatus', state);
|
|
41
|
+
|
|
42
|
+
const event = new CustomEvent(`hyperclay:save-${state}`, {
|
|
43
|
+
detail: { msg, timestamp: Date.now() }
|
|
44
|
+
});
|
|
45
|
+
document.dispatchEvent(event);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sets DOM state to 'offline' immediately, but does NOT fire an event.
|
|
50
|
+
* Used for instant UI feedback before we know the final state.
|
|
51
|
+
*/
|
|
52
|
+
function setOfflineStateQuiet() {
|
|
53
|
+
if (savingTimeout) {
|
|
54
|
+
clearTimeout(savingTimeout);
|
|
55
|
+
savingTimeout = null;
|
|
56
|
+
}
|
|
57
|
+
document.documentElement.setAttribute('savestatus', 'offline');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Starts a debounced 'saving' state.
|
|
62
|
+
* Only shows 'saving' if the save takes longer than 500ms.
|
|
63
|
+
* This prevents UI flicker on fast saves.
|
|
64
|
+
*/
|
|
65
|
+
function setSavingState() {
|
|
66
|
+
savingTimeout = setTimeout(() => {
|
|
67
|
+
setSaveState('saving');
|
|
68
|
+
}, 500);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ============================================
|
|
72
|
+
// OFFLINE DETECTION
|
|
73
|
+
// ============================================
|
|
74
|
+
|
|
75
|
+
window.addEventListener('offline', () => {
|
|
76
|
+
setOfflineStateQuiet();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
window.addEventListener('online', () => {
|
|
80
|
+
if (document.documentElement.getAttribute('savestatus') === 'offline') {
|
|
81
|
+
savePage();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
22
85
|
// Re-export from core for backward compatibility
|
|
23
86
|
export { beforeSave, getPageContents };
|
|
24
87
|
|
|
@@ -37,11 +100,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
37
100
|
if (isEditMode) {
|
|
38
101
|
// Capture initial state immediately for comparison
|
|
39
102
|
lastSavedContents = getPageContents();
|
|
103
|
+
// Set initial save status to 'saved'
|
|
104
|
+
document.documentElement.setAttribute('savestatus', 'saved');
|
|
40
105
|
}
|
|
41
106
|
});
|
|
42
107
|
|
|
43
108
|
/**
|
|
44
|
-
* Save the current page with change detection and
|
|
109
|
+
* Save the current page with change detection and state management
|
|
45
110
|
*
|
|
46
111
|
* @param {Function} callback - Optional callback for custom handling
|
|
47
112
|
*/
|
|
@@ -50,6 +115,13 @@ export function savePage(callback = () => {}) {
|
|
|
50
115
|
return;
|
|
51
116
|
}
|
|
52
117
|
|
|
118
|
+
// Check if offline - set DOM state immediately for UI feedback
|
|
119
|
+
// but still try the fetch (navigator.onLine can be wrong)
|
|
120
|
+
const wasOffline = !navigator.onLine;
|
|
121
|
+
if (wasOffline) {
|
|
122
|
+
setOfflineStateQuiet();
|
|
123
|
+
}
|
|
124
|
+
|
|
53
125
|
const currentContents = getPageContents();
|
|
54
126
|
|
|
55
127
|
// Track whether there are unsaved changes
|
|
@@ -60,11 +132,22 @@ export function savePage(callback = () => {}) {
|
|
|
60
132
|
return;
|
|
61
133
|
}
|
|
62
134
|
|
|
135
|
+
// Start debounced 'saving' state (only shows if save takes >500ms)
|
|
136
|
+
setSavingState();
|
|
137
|
+
|
|
63
138
|
savePageCore(({msg, msgType}) => {
|
|
64
|
-
// Update tracking on success
|
|
65
139
|
if (msgType !== 'error') {
|
|
140
|
+
// SUCCESS
|
|
66
141
|
lastSavedContents = currentContents;
|
|
67
142
|
unsavedChanges = false;
|
|
143
|
+
setSaveState('saved', msg);
|
|
144
|
+
} else {
|
|
145
|
+
// FAILED - determine if it's offline or server error
|
|
146
|
+
if (!navigator.onLine) {
|
|
147
|
+
setSaveState('offline', msg);
|
|
148
|
+
} else {
|
|
149
|
+
setSaveState('error', msg);
|
|
150
|
+
}
|
|
68
151
|
}
|
|
69
152
|
|
|
70
153
|
// Call user callback if provided
|
|
@@ -76,7 +159,7 @@ export function savePage(callback = () => {}) {
|
|
|
76
159
|
|
|
77
160
|
/**
|
|
78
161
|
* Fetch HTML from a URL and save it, then reload
|
|
79
|
-
*
|
|
162
|
+
* Emits error event if save fails
|
|
80
163
|
*
|
|
81
164
|
* @param {string} url - URL to fetch from
|
|
82
165
|
*/
|
|
@@ -87,8 +170,8 @@ export function replacePageWith(url) {
|
|
|
87
170
|
|
|
88
171
|
replacePageWithCore(url, (err, data) => {
|
|
89
172
|
if (err) {
|
|
90
|
-
//
|
|
91
|
-
|
|
173
|
+
// Emit error event (save-toast will show toast if loaded)
|
|
174
|
+
setSaveState('error', err.message || "Failed to save template");
|
|
92
175
|
} else {
|
|
93
176
|
// Only reload if save was successful
|
|
94
177
|
window.location.reload();
|
|
@@ -138,9 +221,7 @@ export function initSaveKeyboardShortcut() {
|
|
|
138
221
|
let metaKeyPressed = isMac ? event.metaKey : event.ctrlKey;
|
|
139
222
|
if (metaKeyPressed && event.keyCode == 83) {
|
|
140
223
|
event.preventDefault();
|
|
141
|
-
savePage(
|
|
142
|
-
if (msg) toast(msg, msgType);
|
|
143
|
-
});
|
|
224
|
+
savePage();
|
|
144
225
|
}
|
|
145
226
|
});
|
|
146
227
|
}
|
|
@@ -152,9 +233,7 @@ export function initSaveKeyboardShortcut() {
|
|
|
152
233
|
export function initHyperclaySaveButton() {
|
|
153
234
|
document.addEventListener("click", event => {
|
|
154
235
|
if (event.target.closest("[trigger-save]")) {
|
|
155
|
-
savePage(
|
|
156
|
-
if (msg) toast(msg, msgType);
|
|
157
|
-
});
|
|
236
|
+
savePage();
|
|
158
237
|
}
|
|
159
238
|
});
|
|
160
239
|
}
|
package/core/savePageCore.js
CHANGED
|
@@ -91,12 +91,18 @@ export function savePage(callback = () => {}) {
|
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
// Add timeout - abort if server doesn't respond within 5 seconds
|
|
95
|
+
const controller = new AbortController();
|
|
96
|
+
const timeoutId = setTimeout(() => controller.abort(), 5000);
|
|
97
|
+
|
|
94
98
|
fetch(saveEndpoint, {
|
|
95
99
|
method: 'POST',
|
|
96
100
|
credentials: 'include',
|
|
97
|
-
body: currentContents
|
|
101
|
+
body: currentContents,
|
|
102
|
+
signal: controller.signal
|
|
98
103
|
})
|
|
99
104
|
.then(res => {
|
|
105
|
+
clearTimeout(timeoutId);
|
|
100
106
|
return res.json().then(data => {
|
|
101
107
|
if (!res.ok) {
|
|
102
108
|
throw new Error(data.msg || data.error || `HTTP ${res.status}: ${res.statusText}`);
|
|
@@ -110,12 +116,19 @@ export function savePage(callback = () => {}) {
|
|
|
110
116
|
}
|
|
111
117
|
})
|
|
112
118
|
.catch(err => {
|
|
119
|
+
clearTimeout(timeoutId);
|
|
113
120
|
console.error('Failed to save page:', err);
|
|
121
|
+
|
|
122
|
+
const msg = err.name === 'AbortError'
|
|
123
|
+
? 'Server not responding'
|
|
124
|
+
: (err.message || 'Failed to save');
|
|
125
|
+
|
|
114
126
|
if (typeof callback === 'function') {
|
|
115
|
-
callback({msg
|
|
127
|
+
callback({msg, msgType: "error"});
|
|
116
128
|
}
|
|
117
129
|
})
|
|
118
130
|
.finally(() => {
|
|
131
|
+
clearTimeout(timeoutId);
|
|
119
132
|
saveInProgress = false;
|
|
120
133
|
});
|
|
121
134
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Save Toast Module
|
|
3
|
+
*
|
|
4
|
+
* Listens for save lifecycle events and shows toast notifications.
|
|
5
|
+
* This is opt-in - only included if you want toast notifications.
|
|
6
|
+
*
|
|
7
|
+
* Events handled:
|
|
8
|
+
* - hyperclay:save-saved → success toast
|
|
9
|
+
* - hyperclay:save-error → error toast
|
|
10
|
+
* - hyperclay:save-offline → error toast (treated as error for notifications)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import toast from "../ui/toast.js";
|
|
14
|
+
import { isEditMode } from "./isAdminOfCurrentResource.js";
|
|
15
|
+
|
|
16
|
+
function init() {
|
|
17
|
+
if (!isEditMode) return;
|
|
18
|
+
|
|
19
|
+
document.addEventListener('hyperclay:save-saved', (e) => {
|
|
20
|
+
const msg = e.detail?.msg || 'Saved';
|
|
21
|
+
toast(msg, 'success');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
document.addEventListener('hyperclay:save-error', (e) => {
|
|
25
|
+
const msg = e.detail?.msg || 'Failed to save';
|
|
26
|
+
toast(msg, 'error');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
document.addEventListener('hyperclay:save-offline', (e) => {
|
|
30
|
+
const msg = e.detail?.msg || 'No internet connection';
|
|
31
|
+
toast(msg, 'error');
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
init();
|
|
36
|
+
|
|
37
|
+
export default init;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [onaftersave] Custom Attribute
|
|
3
|
+
*
|
|
4
|
+
* Runs inline JavaScript when save status changes.
|
|
5
|
+
* Pairs with the existing [onbeforesave] attribute.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* <span onaftersave="this.innerText = event.detail.msg"></span>
|
|
9
|
+
* <div onaftersave="console.log('Status:', event.detail.status)"></div>
|
|
10
|
+
*
|
|
11
|
+
* The event.detail object contains:
|
|
12
|
+
* - status: 'saving' | 'saved' | 'offline' | 'error'
|
|
13
|
+
* - msg: string (e.g., 'Saved' or error message)
|
|
14
|
+
* - timestamp: number (Date.now())
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function broadcast(e) {
|
|
18
|
+
const status = e.type.replace('hyperclay:save-', '');
|
|
19
|
+
const detail = { ...e.detail, status };
|
|
20
|
+
|
|
21
|
+
document.querySelectorAll('[onaftersave]').forEach(el => {
|
|
22
|
+
try {
|
|
23
|
+
const event = new CustomEvent('aftersave', { detail });
|
|
24
|
+
const handler = new Function('event', el.getAttribute('onaftersave'));
|
|
25
|
+
handler.call(el, event);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error('[onaftersave] Error in handler:', err);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function init() {
|
|
33
|
+
document.addEventListener('hyperclay:save-saving', broadcast);
|
|
34
|
+
document.addEventListener('hyperclay:save-saved', broadcast);
|
|
35
|
+
document.addEventListener('hyperclay:save-offline', broadcast);
|
|
36
|
+
document.addEventListener('hyperclay:save-error', broadcast);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
init();
|
|
40
|
+
|
|
41
|
+
export default init;
|
package/hyperclay.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HyperclayJS v1.
|
|
2
|
+
* HyperclayJS v1.6.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.
|
|
@@ -28,6 +28,7 @@ const MODULE_PATHS = {
|
|
|
28
28
|
"save-core": "./core/savePageCore.js",
|
|
29
29
|
"save-system": "./core/savePage.js",
|
|
30
30
|
"autosave": "./core/autosave.js",
|
|
31
|
+
"save-toast": "./core/saveToast.js",
|
|
31
32
|
"edit-mode-helpers": "./core/adminSystem.js",
|
|
32
33
|
"persist": "./core/enablePersistentFormInputValues.js",
|
|
33
34
|
"option-visibility": "./core/optionVisibilityRuleGenerator.js",
|
|
@@ -37,11 +38,11 @@ const MODULE_PATHS = {
|
|
|
37
38
|
"sortable": "./custom-attributes/sortable.js",
|
|
38
39
|
"dom-helpers": "./custom-attributes/domHelpers.js",
|
|
39
40
|
"input-helpers": "./custom-attributes/inputHelpers.js",
|
|
41
|
+
"onaftersave": "./custom-attributes/onaftersave.js",
|
|
40
42
|
"dialogs": "./ui/prompts.js",
|
|
41
43
|
"toast": "./ui/toast.js",
|
|
42
44
|
"toast-hyperclay": "./ui/toast-hyperclay.js",
|
|
43
45
|
"the-modal": "./ui/theModal.js",
|
|
44
|
-
"tailwind-play": "./vendor/tailwind-play.js",
|
|
45
46
|
"mutation": "./utilities/mutation.js",
|
|
46
47
|
"nearest": "./utilities/nearest.js",
|
|
47
48
|
"cookie": "./utilities/cookie.js",
|
|
@@ -70,6 +71,7 @@ const PRESETS = {
|
|
|
70
71
|
"save-system",
|
|
71
72
|
"edit-mode-helpers",
|
|
72
73
|
"toast",
|
|
74
|
+
"save-toast",
|
|
73
75
|
"export-to-window"
|
|
74
76
|
]
|
|
75
77
|
},
|
|
@@ -85,6 +87,7 @@ const PRESETS = {
|
|
|
85
87
|
"event-attrs",
|
|
86
88
|
"dom-helpers",
|
|
87
89
|
"toast",
|
|
90
|
+
"save-toast",
|
|
88
91
|
"export-to-window"
|
|
89
92
|
]
|
|
90
93
|
},
|
|
@@ -95,6 +98,7 @@ const PRESETS = {
|
|
|
95
98
|
"save-core",
|
|
96
99
|
"save-system",
|
|
97
100
|
"autosave",
|
|
101
|
+
"save-toast",
|
|
98
102
|
"edit-mode-helpers",
|
|
99
103
|
"persist",
|
|
100
104
|
"option-visibility",
|
|
@@ -104,11 +108,11 @@ const PRESETS = {
|
|
|
104
108
|
"sortable",
|
|
105
109
|
"dom-helpers",
|
|
106
110
|
"input-helpers",
|
|
111
|
+
"onaftersave",
|
|
107
112
|
"dialogs",
|
|
108
113
|
"toast",
|
|
109
114
|
"toast-hyperclay",
|
|
110
115
|
"the-modal",
|
|
111
|
-
"tailwind-play",
|
|
112
116
|
"mutation",
|
|
113
117
|
"nearest",
|
|
114
118
|
"cookie",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"core/autosave.js": [
|
|
51
51
|
"core/isAdminOfCurrentResource.js",
|
|
52
52
|
"core/savePage.js",
|
|
53
|
-
"ui/toast.js",
|
|
54
53
|
"utilities/mutation.js"
|
|
55
54
|
],
|
|
56
55
|
"core/editmode.js": [
|
|
@@ -75,13 +74,16 @@
|
|
|
75
74
|
"core/savePage.js": [
|
|
76
75
|
"core/isAdminOfCurrentResource.js",
|
|
77
76
|
"core/savePageCore.js",
|
|
78
|
-
"ui/toast.js",
|
|
79
77
|
"utilities/throttle.js"
|
|
80
78
|
],
|
|
81
79
|
"core/savePageCore.js": [
|
|
82
80
|
"core/isAdminOfCurrentResource.js",
|
|
83
81
|
"utilities/cookie.js"
|
|
84
82
|
],
|
|
83
|
+
"core/saveToast.js": [
|
|
84
|
+
"core/isAdminOfCurrentResource.js",
|
|
85
|
+
"ui/toast.js"
|
|
86
|
+
],
|
|
85
87
|
"core/setPageTypeOnDocumentElement.js": [
|
|
86
88
|
"core/isAdminOfCurrentResource.js",
|
|
87
89
|
"core/savePage.js",
|
|
@@ -108,6 +110,7 @@
|
|
|
108
110
|
"custom-attributes/autosize.js",
|
|
109
111
|
"custom-attributes/preventEnter.js"
|
|
110
112
|
],
|
|
113
|
+
"custom-attributes/onaftersave.js": [],
|
|
111
114
|
"custom-attributes/onclickaway.js": [],
|
|
112
115
|
"custom-attributes/onclone.js": [],
|
|
113
116
|
"custom-attributes/onpagemutation.js": [
|
|
@@ -152,20 +155,13 @@
|
|
|
152
155
|
"utilities/pipe.js": [],
|
|
153
156
|
"utilities/throttle.js": [],
|
|
154
157
|
"vendor/Sortable.vendor.js": [],
|
|
155
|
-
"vendor/idiomorph.min.js": []
|
|
156
|
-
"vendor/tailwind-play.js": [
|
|
157
|
-
"core/isAdminOfCurrentResource.js",
|
|
158
|
-
"utilities/loadVendorScript.js"
|
|
159
|
-
],
|
|
160
|
-
"vendor/tailwind-play.vendor.js": [
|
|
161
|
-
"dom-utilities/insertStyleTag.js"
|
|
162
|
-
]
|
|
158
|
+
"vendor/idiomorph.min.js": []
|
|
163
159
|
},
|
|
164
160
|
"modules": {
|
|
165
161
|
"save-core": {
|
|
166
162
|
"name": "save-core",
|
|
167
163
|
"category": "core",
|
|
168
|
-
"size":
|
|
164
|
+
"size": 6.3,
|
|
169
165
|
"files": [
|
|
170
166
|
"core/savePageCore.js"
|
|
171
167
|
],
|
|
@@ -179,7 +175,7 @@
|
|
|
179
175
|
"save-system": {
|
|
180
176
|
"name": "save-system",
|
|
181
177
|
"category": "core",
|
|
182
|
-
"size":
|
|
178
|
+
"size": 7.1,
|
|
183
179
|
"files": [
|
|
184
180
|
"core/savePage.js"
|
|
185
181
|
],
|
|
@@ -202,13 +198,23 @@
|
|
|
202
198
|
"autosave": {
|
|
203
199
|
"name": "autosave",
|
|
204
200
|
"category": "core",
|
|
205
|
-
"size": 1.
|
|
201
|
+
"size": 1.1,
|
|
206
202
|
"files": [
|
|
207
203
|
"core/autosave.js"
|
|
208
204
|
],
|
|
209
205
|
"description": "Auto-save on DOM changes, unsaved changes warning",
|
|
210
206
|
"exports": {}
|
|
211
207
|
},
|
|
208
|
+
"save-toast": {
|
|
209
|
+
"name": "save-toast",
|
|
210
|
+
"category": "core",
|
|
211
|
+
"size": 0.9,
|
|
212
|
+
"files": [
|
|
213
|
+
"core/saveToast.js"
|
|
214
|
+
],
|
|
215
|
+
"description": "Toast notifications for save events",
|
|
216
|
+
"exports": {}
|
|
217
|
+
},
|
|
212
218
|
"edit-mode-helpers": {
|
|
213
219
|
"name": "edit-mode-helpers",
|
|
214
220
|
"category": "core",
|
|
@@ -321,6 +327,16 @@
|
|
|
321
327
|
"description": "[prevent-enter], [autosize] for textareas",
|
|
322
328
|
"exports": {}
|
|
323
329
|
},
|
|
330
|
+
"onaftersave": {
|
|
331
|
+
"name": "onaftersave",
|
|
332
|
+
"category": "custom-attributes",
|
|
333
|
+
"size": 1.2,
|
|
334
|
+
"files": [
|
|
335
|
+
"custom-attributes/onaftersave.js"
|
|
336
|
+
],
|
|
337
|
+
"description": "[onaftersave] attribute - run JS when save status changes",
|
|
338
|
+
"exports": {}
|
|
339
|
+
},
|
|
324
340
|
"dialogs": {
|
|
325
341
|
"name": "dialogs",
|
|
326
342
|
"category": "ui",
|
|
@@ -392,16 +408,6 @@
|
|
|
392
408
|
]
|
|
393
409
|
}
|
|
394
410
|
},
|
|
395
|
-
"tailwind-play": {
|
|
396
|
-
"name": "tailwind-play",
|
|
397
|
-
"category": "ui",
|
|
398
|
-
"size": 0.7,
|
|
399
|
-
"files": [
|
|
400
|
-
"vendor/tailwind-play.js"
|
|
401
|
-
],
|
|
402
|
-
"description": "Live Tailwind CSS editing, lazy-loads ~370KB script in edit mode only",
|
|
403
|
-
"exports": {}
|
|
404
|
-
},
|
|
405
411
|
"mutation": {
|
|
406
412
|
"name": "mutation",
|
|
407
413
|
"category": "utilities",
|
|
@@ -669,6 +675,7 @@
|
|
|
669
675
|
"save-core": "./core/savePageCore.js",
|
|
670
676
|
"save-system": "./core/savePage.js",
|
|
671
677
|
"autosave": "./core/autosave.js",
|
|
678
|
+
"save-toast": "./core/saveToast.js",
|
|
672
679
|
"edit-mode-helpers": "./core/adminSystem.js",
|
|
673
680
|
"persist": "./core/enablePersistentFormInputValues.js",
|
|
674
681
|
"option-visibility": "./core/optionVisibilityRuleGenerator.js",
|
|
@@ -678,11 +685,11 @@
|
|
|
678
685
|
"sortable": "./custom-attributes/sortable.js",
|
|
679
686
|
"dom-helpers": "./custom-attributes/domHelpers.js",
|
|
680
687
|
"input-helpers": "./custom-attributes/inputHelpers.js",
|
|
688
|
+
"onaftersave": "./custom-attributes/onaftersave.js",
|
|
681
689
|
"dialogs": "./ui/prompts.js",
|
|
682
690
|
"toast": "./ui/toast.js",
|
|
683
691
|
"toast-hyperclay": "./ui/toast-hyperclay.js",
|
|
684
692
|
"the-modal": "./ui/theModal.js",
|
|
685
|
-
"tailwind-play": "./vendor/tailwind-play.js",
|
|
686
693
|
"mutation": "./utilities/mutation.js",
|
|
687
694
|
"nearest": "./utilities/nearest.js",
|
|
688
695
|
"cookie": "./utilities/cookie.js",
|
|
@@ -710,6 +717,7 @@
|
|
|
710
717
|
"save-core",
|
|
711
718
|
"save-system",
|
|
712
719
|
"autosave",
|
|
720
|
+
"save-toast",
|
|
713
721
|
"edit-mode-helpers",
|
|
714
722
|
"persist",
|
|
715
723
|
"option-visibility",
|
|
@@ -724,7 +732,8 @@
|
|
|
724
732
|
"ajax-elements",
|
|
725
733
|
"sortable",
|
|
726
734
|
"dom-helpers",
|
|
727
|
-
"input-helpers"
|
|
735
|
+
"input-helpers",
|
|
736
|
+
"onaftersave"
|
|
728
737
|
]
|
|
729
738
|
},
|
|
730
739
|
"ui": {
|
|
@@ -733,8 +742,7 @@
|
|
|
733
742
|
"modules": [
|
|
734
743
|
"dialogs",
|
|
735
744
|
"toast",
|
|
736
|
-
"the-modal"
|
|
737
|
-
"tailwind-play"
|
|
745
|
+
"the-modal"
|
|
738
746
|
]
|
|
739
747
|
},
|
|
740
748
|
"utilities": {
|
|
@@ -792,6 +800,7 @@
|
|
|
792
800
|
"save-system",
|
|
793
801
|
"edit-mode-helpers",
|
|
794
802
|
"toast",
|
|
803
|
+
"save-toast",
|
|
795
804
|
"export-to-window"
|
|
796
805
|
]
|
|
797
806
|
},
|
|
@@ -807,6 +816,7 @@
|
|
|
807
816
|
"event-attrs",
|
|
808
817
|
"dom-helpers",
|
|
809
818
|
"toast",
|
|
819
|
+
"save-toast",
|
|
810
820
|
"export-to-window"
|
|
811
821
|
]
|
|
812
822
|
},
|
|
@@ -817,6 +827,7 @@
|
|
|
817
827
|
"save-core",
|
|
818
828
|
"save-system",
|
|
819
829
|
"autosave",
|
|
830
|
+
"save-toast",
|
|
820
831
|
"edit-mode-helpers",
|
|
821
832
|
"persist",
|
|
822
833
|
"option-visibility",
|
|
@@ -826,11 +837,11 @@
|
|
|
826
837
|
"sortable",
|
|
827
838
|
"dom-helpers",
|
|
828
839
|
"input-helpers",
|
|
840
|
+
"onaftersave",
|
|
829
841
|
"dialogs",
|
|
830
842
|
"toast",
|
|
831
843
|
"toast-hyperclay",
|
|
832
844
|
"the-modal",
|
|
833
|
-
"tailwind-play",
|
|
834
845
|
"mutation",
|
|
835
846
|
"nearest",
|
|
836
847
|
"cookie",
|