@panphora/hyper-cms 0.7.1 → 0.8.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 +5 -1
- package/dist/hypercms.min.js +55 -13
- package/package.json +3 -3
- package/src/events.js +149 -34
- package/src/form-builder.js +25 -20
- package/src/form-rules.js +1 -1
- package/src/hypercms.js +4 -0
- package/src/platform.js +58 -7
- package/src/templates.js +68 -18
- package/src/theme/pixel-quiet.overrides.css +42 -0
- package/src/theme.generated.css +42 -0
package/README.md
CHANGED
|
@@ -176,7 +176,11 @@ Use it for: tags, keywords, badge lists — short repeated values where a full r
|
|
|
176
176
|
|
|
177
177
|
Selected automatically for `@src` rules; forced anywhere else with `data-hcms-component="image"` on the page element — e.g. a logo URL stored in a `data-icon` attribute, where the suffix can't be inferred.
|
|
178
178
|
|
|
179
|
-
An "Upload image" button (`accept="image/*"`) sends the file
|
|
179
|
+
An "Upload image" button (`accept="image/*"`) sends the file to the host (`clay.upload`, or `window.hyperclay.uploadFileBasic` on an older client) and writes the served URL into the page's `img src`; the field shows a thumbnail with an × that clears it, and a progress bar while the bytes are in flight.
|
|
180
|
+
|
|
181
|
+
A host that does not store files is not a failure. Standalone, or on any host that has not announced the upload capability, the file is embedded in the page as a `data:` URL instead, which is the right answer when nobody is serving the file. A host that *would* store it but not for this account (`payment-required`) also embeds, and says so in the field. A file the host actively refused, for size or type, writes nothing at all: embedding that one is what puts a two-megabyte photo in every future save.
|
|
182
|
+
|
|
183
|
+
Upload errors render inline in the field and fire `hcms:error`; closing the editor mid-upload aborts the request.
|
|
180
184
|
|
|
181
185
|
**Crop on upload:** add `data-hcms-crop` to the page element and the picked image routes through [quickcrop](https://github.com/panphora/quickcrop) (`window.hyperclay.quickcrop`, bundled in hyperclayjs's `smooth-sailing`/`everything` presets) before uploading. Values: `"1:1"`, `"16:9"` (any `W:H`), or `"free"` for an unconstrained crop. Cancelling the crop aborts the upload. Output is webp, longest edge capped at 2048px. Without quickcrop on the page the file uploads uncropped — the attribute never blocks.
|
|
182
186
|
|