tess_edit 0.4.0 → 0.4.1
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/javascript/tess_edit/controllers/editor_controller.js +4 -2
- data/lib/tess_edit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34a34ebde5272be05d2110672f0de3a54f5d0b1dd3092b0d4af19677376eef0d
|
|
4
|
+
data.tar.gz: 709b9b602cee9c5b3c217e8a78d84a25f99358794ba539517587829350ac4de0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ccce363718a5d6739d3ce383569cdc1806e244664ad5ed1ca34ac65df38def903d11ee2051c4af8704be49ad033de93dd8a3a2d9f4d1515b9e7b0dce8e756bc
|
|
7
|
+
data.tar.gz: a154489406d7669ae43ba0d4bd776b8040663ab8f77541a4b11027feaf3360afa119b5552a653f515a9b1a90ed66e4df6cfbbd2f933520b0382f39231665f457
|
data/README.md
CHANGED
|
@@ -89,6 +89,8 @@ The editor loads the document from the `jsonInput` (or from `data-tess-edit-docu
|
|
|
89
89
|
|
|
90
90
|
`data-tess-edit-panels-value` sets the default panel layout: `split` (Blocks and Layers on the left, Inspect on the right, the default), `left` or `right` (Blocks, Layers and Inspect as tabs in one sidebar on that side). People can switch with the buttons in the top bar; their choice is remembered in the browser. When the editor is narrower than 1000px, it puts all panels on the left so the canvas keeps its room, and goes back to the chosen layout when it is wide enough again.
|
|
91
91
|
|
|
92
|
+
The editor has a border with rounded corners. A page that frames it itself, such as a card it fills, turns it off with `data-tess-edit-frame-value="false"`.
|
|
93
|
+
|
|
92
94
|
Every change updates the inputs and dispatches `tess-edit:change` with `{ json, mjml, html, errors, document }` in `event.detail`. When the MJML can't be compiled, `html` is empty and `errors` says why; the editor shows the reason under the canvas. The controller instance is available as `element.tessEdit`, with `getDocument()`, `setDocument(json)` and `export()`.
|
|
93
95
|
|
|
94
96
|
### What gets stored
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// registered (see core/registry.js)
|
|
6
6
|
// document JSON of the document to load (falls back to the json input, then a sample)
|
|
7
7
|
// sample load the sample document when there is nothing else (default true)
|
|
8
|
+
// frame a border with rounded corners around the editor (default true); a
|
|
9
|
+
// host that frames it itself, such as a card it fills, turns it off
|
|
8
10
|
// panels "split" (Blocks and Layers left, Inspect right), "left" or "right" (all panels
|
|
9
11
|
// as tabs on one side). The default; a choice made in the editor's
|
|
10
12
|
// top bar is remembered per browser. Below NARROW_WIDTH the editor
|
|
@@ -66,7 +68,7 @@ const TRANSLATION_LOCALE_KEY = "tess_edit:translation_locale"
|
|
|
66
68
|
const NARROW_WIDTH = 1000
|
|
67
69
|
|
|
68
70
|
export default class extends Controller {
|
|
69
|
-
static values = { kit: { type: String, default: DEFAULT_KIT }, document: String, sample: { type: Boolean, default: true }, panels: { type: String, default: "split" }, compileUrl: { type: String, default: COMPILE_URL }, mediaUrl: String, variablesUrl: String, translationsUrl: String, lock: String, blocks: String, options: String }
|
|
71
|
+
static values = { kit: { type: String, default: DEFAULT_KIT }, document: String, sample: { type: Boolean, default: true }, frame: { type: Boolean, default: true }, panels: { type: String, default: "split" }, compileUrl: { type: String, default: COMPILE_URL }, mediaUrl: String, variablesUrl: String, translationsUrl: String, lock: String, blocks: String, options: String }
|
|
70
72
|
static targets = ["jsonInput", "mjmlInput", "htmlInput"]
|
|
71
73
|
|
|
72
74
|
connect() {
|
|
@@ -357,7 +359,7 @@ export default class extends Controller {
|
|
|
357
359
|
|
|
358
360
|
this.root = h(
|
|
359
361
|
"div",
|
|
360
|
-
{ class:
|
|
362
|
+
{ class: `tess-edit relative flex flex-col h-full min-h-[560px] overflow-hidden ${this.frameValue ? "rounded-lg border border-gray-200 dark:border-gray-700 " : ""}bg-gray-50 dark:bg-gray-900 text-sm text-gray-800 dark:text-gray-200 antialiased dark:[color-scheme:dark]`, tabindex: "-1", onkeydown: (event) => this.onKeydown(event) },
|
|
361
363
|
this.topBar,
|
|
362
364
|
this.body
|
|
363
365
|
)
|
data/lib/tess_edit/version.rb
CHANGED