lexxy 0.9.21 → 0.9.22

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: 9a161b79f6c66266f236c0bae71c3ea540237a2a403fb2e047d43828e395bfda
4
- data.tar.gz: '030840a6e183bc84837825ff7b8f646ebfb74fdd2d582c93c3475b38b88e633e'
3
+ metadata.gz: 3dd84ec12b2544306275e4c55775e2ef95770e6e9de65adb028663f51bd099e6
4
+ data.tar.gz: c3bc7b9f5834a80f1e40de9e2c82fec32ce590aba1cb2022eb13c320303dd92d
5
5
  SHA512:
6
- metadata.gz: 1c03106f2eed700e7521b00a937ace2b854459633b99ee93f6ef99eb323fd017d95fd9d348d174decc8a5e9e3b028fe9b470f5943066563b3ba6a55d03871c2b
7
- data.tar.gz: b1d3121c8bc34f2b560192523f0e9a5ec885d869df2b9bdf56da88bd16829b8a5b9c0b0e99fa95507c06b65a1ca381665678df5f74dca94501b81937c658189a
6
+ metadata.gz: 3a29b71559385f62b6b084731cc77baea92c67ebe10b0f588610de8d5d9cecba54403f7201c8bbc1143a0122402195b356d7c0b45bac6d176136dbefcb016b02
7
+ data.tar.gz: 05cac4466fc4374f1cfbe3e547a462e2cdceed094b2eb043e6a713ff165ff852ec39f08d8f15aed0ae4e24634376243cced2ca36e37e5657bb87faaac4991f8b
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A modern rich text editor for Rails.
4
4
 
5
- **[Try it out!](https://basecamp.github.io/lexxy/try-it)**
5
+ [Documentation](https://basecamp.github.io/lexxy/docs/) | <mark>[Try it out!](https://basecamp.github.io/lexxy/sandbox/)</mark>
6
6
 
7
7
  ## Features
8
8
 
@@ -15,24 +15,7 @@ A modern rich text editor for Rails.
15
15
  - Preview attachments like PDFs and Videos in the editor.
16
16
  - Works seamlessly with Action Text, generating the same canonical HTML format it expects for attachments.
17
17
 
18
- ![Lexxy editor screenshot](docs/images/home.screenshot.png)
19
-
20
- ## Documentation
21
-
22
- Visit the **[documentation site](https://basecamp.github.io/lexxy)**.
23
-
24
- ## Roadmap
25
-
26
- This is a beta. Here's what's coming next:
27
-
28
- - [x] Configurable editors in Action Text: Choose your editor like you choose your database.
29
- - [x] More editing features:
30
- - [x] Tables
31
- - [x] Text highlighting
32
- - [x] Configuration hooks.
33
- - [x] Standalone JS package: to use in non-Rails environments.
34
- - [x] Image galleries: The only remaining feature for full Action Text compatibility
35
- - [ ] Install task that generates the necessary JS and adds stylesheets.
18
+ ![Lexxy editor screenshot](home/docs/images/home.screenshot.png)
36
19
 
37
20
  ## Contributing
38
21
 
@@ -13469,6 +13469,26 @@ function $getAllProvisionalParagraphs(rootNode = Zo()) {
13469
13469
  return Ht$3(rootNode.getChildren(), $isProvisionalParagraphNode)
13470
13470
  }
13471
13471
 
13472
+ // Registers code highlighting through the extension system so its node
13473
+ // transforms exist before the initial editor state is applied. Registering
13474
+ // after editor creation misses code blocks loaded from the initial value:
13475
+ // their transform pass has already run, and Lexical's catch-up dirtying
13476
+ // only sees the committed (still empty) state.
13477
+ class CodeHighlightingExtension extends LexxyExtension {
13478
+ get enabled() {
13479
+ return this.editorElement.supportsRichText
13480
+ }
13481
+
13482
+ get lexicalExtension() {
13483
+ return dc({
13484
+ name: "lexxy/code-highlighting",
13485
+ register(editor) {
13486
+ return L$1(editor)
13487
+ }
13488
+ })
13489
+ }
13490
+ }
13491
+
13472
13492
  const TRIX_LANGUAGE_ATTR = "language";
13473
13493
 
13474
13494
  class TrixContentExtension extends LexxyExtension {
@@ -14989,6 +15009,7 @@ class LexicalEditorElement extends HTMLElement {
14989
15009
  get baseExtensions() {
14990
15010
  return [
14991
15011
  ProvisionalParagraphExtension,
15012
+ CodeHighlightingExtension,
14992
15013
  HighlightExtension,
14993
15014
  TrixContentExtension,
14994
15015
  TablesExtension,
@@ -15396,7 +15417,7 @@ class LexicalEditorElement extends HTMLElement {
15396
15417
  Ie$2(this.editor)
15397
15418
  );
15398
15419
  this.#registerTableComponents();
15399
- this.#registerCodeHiglightingComponents();
15420
+ this.#registerCodeLanguagePicker();
15400
15421
  if (this.supportsMarkdown) {
15401
15422
  const transformers = [ ...te, HORIZONTAL_DIVIDER ];
15402
15423
  registered.push(
@@ -15418,8 +15439,7 @@ class LexicalEditorElement extends HTMLElement {
15418
15439
  this.#disposables.push(tableTools);
15419
15440
  }
15420
15441
 
15421
- #registerCodeHiglightingComponents() {
15422
- L$1(this.editor);
15442
+ #registerCodeLanguagePicker() {
15423
15443
  let codeLanguagePicker = this.querySelector("lexxy-code-language-picker");
15424
15444
  codeLanguagePicker ??= createElement("lexxy-code-language-picker");
15425
15445
  this.append(codeLanguagePicker);
Binary file
Binary file