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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7edf50f5750b4cfa068076d5bce42ba51c8ff068e3b272c1b882a27ca573fec
4
- data.tar.gz: d521a49419a260dcf5066274511588e5f602715fa6ceaf2fb5cd1fcfb3dea983
3
+ metadata.gz: 34a34ebde5272be05d2110672f0de3a54f5d0b1dd3092b0d4af19677376eef0d
4
+ data.tar.gz: 709b9b602cee9c5b3c217e8a78d84a25f99358794ba539517587829350ac4de0
5
5
  SHA512:
6
- metadata.gz: ad669b198bad3b4beb556629b880448d22c8cd54c5b45cbf5d0b7c34cbdb3513d9d9e7644fe6630b60bc8ffc93e8ffa3563ace8aae009c6c1dd327b2d0b706ba
7
- data.tar.gz: 89feda7ff43627f7d8df5ea18d0fb2d156ac8a07f91ae9d1dd64a6d8d71f801b8ff1c179eb08369e0d6522d24a3f5b829868714bb48ae919d3ec6b1761c81242
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: "tess-edit relative flex flex-col h-full min-h-[560px] overflow-hidden 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) },
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
  )
@@ -1,3 +1,3 @@
1
1
  module TessEdit
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tess_edit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt