@riebeckite/plugin-excalidraw 0.0.5 → 0.0.7

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 CHANGED
@@ -85,6 +85,6 @@ fenced code block is extracted and supports both `json` and lz-string
85
85
 
86
86
  ## See also
87
87
 
88
- - [Plugin guide](../../docs/plugins_en.md)
89
- - [`@riebeckite/plugin-obsidian-markdown`](../plugin-obsidian-markdown/README.md)
90
- - [`@riebeckite/plugin-attachment`](../plugin-attachment/README.md)
88
+ - [Plugin guide](../../../docs/en/plugin-system.md)
89
+ - [`@riebeckite/plugin-obsidian-markdown`](../obsidian-markdown/README.md)
90
+ - [`@riebeckite/plugin-attachment`](../attachment/README.md)
package/dist/index.js CHANGED
@@ -100,7 +100,11 @@ function extractEmbeddedFiles(markdown) {
100
100
  }
101
101
 
102
102
  // src/render.ts
103
- import { escapeHtml, escapeHtmlAttribute } from "@riebeckite/core";
103
+ import {
104
+ escapeHtml,
105
+ escapeHtmlAttribute,
106
+ escapeScriptJson
107
+ } from "@riebeckite/core";
104
108
  function renderExcalidrawPlaceholder(input) {
105
109
  const style = renderSizeStyle(input.size);
106
110
  const error = input.error ? `<p class="rr-excalidraw__error">${escapeHtml(input.error)}</p>` : "";
@@ -129,9 +133,6 @@ function renderSizeStyle(size) {
129
133
  ].filter(Boolean);
130
134
  return ` style="${declarations.join(";")}"`;
131
135
  }
132
- function escapeScriptJson(value) {
133
- return value.replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026");
134
- }
135
136
 
136
137
  // index.ts
137
138
  var PLUGIN_NAME = "excalidraw";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-excalidraw",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "@excalidraw/excalidraw": "^0.18.0",
25
25
  "lz-string": "^1.5.0",
26
26
  "unist-util-visit": "^5.0.0",
27
- "@riebeckite/core": "0.0.5"
27
+ "@riebeckite/core": "0.0.7"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/mdast": "^4.0.4"
package/style.css CHANGED
@@ -1,50 +1,50 @@
1
- .rr-excalidraw {
2
- --rr-excalidraw-paper: var(--rb-color-paper, #ffffff);
3
- --rr-excalidraw-ink: var(--rb-color-ink, #000000);
4
- --rr-excalidraw-muted: var(--rb-color-muted, #69645c);
5
- --rr-excalidraw-rule: var(
6
- --rb-color-border,
7
- color-mix(in srgb, var(--rr-excalidraw-ink) 18%, transparent)
8
- );
9
- box-sizing: border-box;
10
- width: min(100%, var(--rr-excalidraw-width, 100%));
11
- max-width: 100%;
12
- margin: 2rem 0;
13
- border: 1px solid var(--rr-excalidraw-rule);
14
- background: var(--rr-excalidraw-paper);
15
- color: var(--rr-excalidraw-ink);
16
- }
17
-
18
- .rr-excalidraw__canvas {
19
- display: grid;
20
- min-height: min(var(--rr-excalidraw-height, 18rem), 70vh);
21
- overflow: auto;
22
- place-items: center;
23
- padding: 1rem;
24
- }
25
-
26
- .rr-excalidraw__canvas > svg {
27
- display: block;
28
- width: 100%;
29
- max-width: 100%;
30
- height: var(--rr-excalidraw-height, auto);
31
- }
32
-
33
- .rr-excalidraw__error {
34
- margin: 0;
35
- padding: 0 1rem 1rem;
36
- color: var(--rr-excalidraw-muted);
37
- font-size: 0.875rem;
38
- }
39
-
40
- .rr-excalidraw[data-excalidraw="pending"] .rr-excalidraw__canvas:empty::before,
41
- .rr-excalidraw[data-excalidraw="error"] .rr-excalidraw__canvas:empty::before {
42
- content: "Drawing could not be rendered.";
43
- color: var(--rr-excalidraw-muted);
44
- }
45
-
46
- html[data-theme="dark"] .rr-excalidraw,
47
- html.dark .rr-excalidraw {
48
- --rr-excalidraw-paper: var(--rb-color-ink, #000000);
49
- --rr-excalidraw-ink: var(--rb-color-paper, #ffffff);
50
- }
1
+ .rr-excalidraw {
2
+ --rr-excalidraw-paper: var(--rb-color-paper, #ffffff);
3
+ --rr-excalidraw-ink: var(--rb-color-ink, #000000);
4
+ --rr-excalidraw-muted: var(--rb-color-muted, #69645c);
5
+ --rr-excalidraw-rule: var(
6
+ --rb-color-border,
7
+ color-mix(in srgb, var(--rr-excalidraw-ink) 18%, transparent)
8
+ );
9
+ box-sizing: border-box;
10
+ width: min(100%, var(--rr-excalidraw-width, 100%));
11
+ max-width: 100%;
12
+ margin: 2rem 0;
13
+ border: 1px solid var(--rr-excalidraw-rule);
14
+ background: var(--rr-excalidraw-paper);
15
+ color: var(--rr-excalidraw-ink);
16
+ }
17
+
18
+ .rr-excalidraw__canvas {
19
+ display: grid;
20
+ min-height: min(var(--rr-excalidraw-height, 18rem), 70vh);
21
+ overflow: auto;
22
+ place-items: center;
23
+ padding: 1rem;
24
+ }
25
+
26
+ .rr-excalidraw__canvas > svg {
27
+ display: block;
28
+ width: 100%;
29
+ max-width: 100%;
30
+ height: var(--rr-excalidraw-height, auto);
31
+ }
32
+
33
+ .rr-excalidraw__error {
34
+ margin: 0;
35
+ padding: 0 1rem 1rem;
36
+ color: var(--rr-excalidraw-muted);
37
+ font-size: 0.875rem;
38
+ }
39
+
40
+ .rr-excalidraw[data-excalidraw="pending"] .rr-excalidraw__canvas:empty::before,
41
+ .rr-excalidraw[data-excalidraw="error"] .rr-excalidraw__canvas:empty::before {
42
+ content: "Drawing could not be rendered.";
43
+ color: var(--rr-excalidraw-muted);
44
+ }
45
+
46
+ html[data-theme="dark"] .rr-excalidraw,
47
+ html.dark .rr-excalidraw {
48
+ --rr-excalidraw-paper: var(--rb-color-ink, #000000);
49
+ --rr-excalidraw-ink: var(--rb-color-paper, #ffffff);
50
+ }