smartrte-core 1.0.0-beta.9 → 1.1.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/CHANGELOG.md +8 -0
- package/dist/foundation/block/schema.js +10 -1
- package/dist/foundation/surface/renderer.js +21 -0
- package/package.json +8 -7
- package/LICENSE +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
- Add `backgroundColor`, `textColor`, and `borderLeft` attrs to `blockquote` (the last a single composed CSS shorthand, since a blockquote only ever shows one visible border side, unlike `table_cell`'s 4-sided borders) — rendered as real CSS in the same change, alongside the existing `align`/`indentLevel`/`lineHeight` block attrs. See `docs/bugs/blockquote-styling-context-menu.md`.
|
|
6
|
+
|
|
7
|
+
## 1.0.0
|
|
8
|
+
|
|
9
|
+
General availability of the canonical/foundation architecture introduced in `1.0.0-beta.1` — promoted from the `beta` npm dist-tag to `latest`. No functional changes beyond the `1.0.0-beta.2`–`beta.9` entries below; see those for the full list of changes across the beta cycle.
|
|
10
|
+
|
|
3
11
|
## 1.0.0-beta.9
|
|
4
12
|
|
|
5
13
|
- Fix converting a paragraph sitting directly after an existing list into a list of the same kind always creating a second, independently-numbered list instead of continuing the existing one — e.g. typing after exiting a numbered list (Enter twice) and clicking "Numbered list" again now correctly appends as the next item rather than restarting at "1." next to it. See `docs/bugs/list-creation-ignores-adjacent-identical-list.md`.
|
|
@@ -18,7 +18,16 @@ const blockAttrs = { align: alignmentAttr, indentLevel: indentLevelAttr, lineHei
|
|
|
18
18
|
export const blockNodeSpecs = [
|
|
19
19
|
{ type: "paragraph", group: "block", content: "inline*", attributes: blockAttrs },
|
|
20
20
|
{ type: "heading", group: "block", content: "inline*", attributes: { ...blockAttrs, level: { required: true, default: 1, validate: (v) => Number.isInteger(v) && Number(v) >= 1 && Number(v) <= 6 } } },
|
|
21
|
-
{
|
|
21
|
+
{
|
|
22
|
+
type: "blockquote", group: "block", content: "block+", defining: true,
|
|
23
|
+
// backgroundColor/textColor are plain CSS colour values, matching
|
|
24
|
+
// table_cell's own background/textColor attrs. borderLeft stores one
|
|
25
|
+
// composed CSS shorthand ("4px solid #0284c7") rather than separate
|
|
26
|
+
// width/style/colour attrs - blockquote only ever shows a single
|
|
27
|
+
// visible border side, so there's no per-side independence to
|
|
28
|
+
// preserve the way table_cell's 4-sided borders need.
|
|
29
|
+
attributes: { ...blockAttrs, backgroundColor: stringAttr, textColor: stringAttr, borderLeft: stringAttr },
|
|
30
|
+
},
|
|
22
31
|
{ type: "code_block", group: "block", content: "text*", marks: "", attributes: { ...blockAttrs, language: stringAttr }, defining: true },
|
|
23
32
|
];
|
|
24
33
|
export const blockToolDeclarations = [
|
|
@@ -140,6 +140,27 @@ export class FoundationSubtreeRenderer {
|
|
|
140
140
|
element.style.lineHeight = String(node.attrs.lineHeight);
|
|
141
141
|
else if (element.style.lineHeight)
|
|
142
142
|
element.style.removeProperty("line-height");
|
|
143
|
+
if (node.type === "blockquote") {
|
|
144
|
+
// Inline styles always beat theme.ts's own `.srte-editor
|
|
145
|
+
// [contenteditable] blockquote { border-left: ...; background: ...;
|
|
146
|
+
// color: ...; }` rule regardless of selector specificity, so
|
|
147
|
+
// clearing an attr here lets that default show through again
|
|
148
|
+
// automatically - same pattern as align/indentLevel/lineHeight
|
|
149
|
+
// above, just scoped to this one node type since these three are
|
|
150
|
+
// blockquote-only, not shared block attrs.
|
|
151
|
+
if (node.attrs?.backgroundColor)
|
|
152
|
+
element.style.background = String(node.attrs.backgroundColor);
|
|
153
|
+
else
|
|
154
|
+
element.style.removeProperty("background");
|
|
155
|
+
if (node.attrs?.textColor)
|
|
156
|
+
element.style.color = String(node.attrs.textColor);
|
|
157
|
+
else
|
|
158
|
+
element.style.removeProperty("color");
|
|
159
|
+
if (node.attrs?.borderLeft)
|
|
160
|
+
element.style.borderLeft = String(node.attrs.borderLeft);
|
|
161
|
+
else
|
|
162
|
+
element.style.removeProperty("border-left");
|
|
163
|
+
}
|
|
143
164
|
if (node.type === "code_block") {
|
|
144
165
|
const language = typeof node.attrs?.language === "string" && node.attrs.language.trim()
|
|
145
166
|
? node.attrs.language.trim()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smartrte-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Framework-agnostic document model and editing primitives for Smart RTE",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"README.md",
|
|
37
37
|
"CHANGELOG.md"
|
|
38
38
|
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
41
|
+
"prepublishOnly": "npm run build",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
44
|
+
},
|
|
39
45
|
"publishConfig": {
|
|
40
46
|
"access": "public"
|
|
41
47
|
},
|
|
@@ -57,10 +63,5 @@
|
|
|
57
63
|
"devDependencies": {
|
|
58
64
|
"typescript": "^5.6.2",
|
|
59
65
|
"vitest": "^2.1.4"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
63
|
-
"test": "vitest run",
|
|
64
|
-
"lint": "tsc -p tsconfig.json --noEmit"
|
|
65
66
|
}
|
|
66
|
-
}
|
|
67
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Smart RTE Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|