@textbus/xnote 0.2.3 → 0.2.4

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.
@@ -4984,6 +4984,10 @@ function UndoTool() {
4984
4984
  }
4985
4985
 
4986
4986
  const cellAlignAttr = new Attribute('cellAlign', {
4987
+ onlySelf: true,
4988
+ checkHost(host) {
4989
+ return host.parent instanceof TableComponent;
4990
+ },
4987
4991
  render(node, formatValue) {
4988
4992
  node.styles.set('verticalAlign', formatValue);
4989
4993
  }
@@ -5112,6 +5116,10 @@ function CellAlignTool() {
5112
5116
  }
5113
5117
 
5114
5118
  const cellBackgroundAttr = new Attribute('cellBackground', {
5119
+ onlySelf: true,
5120
+ checkHost(host) {
5121
+ return host.parent instanceof TableComponent;
5122
+ },
5115
5123
  render(node, formatValue) {
5116
5124
  const rgba = parseCss(formatValue);
5117
5125
  if (rgba) {
@@ -5158,7 +5166,9 @@ function CellBackgroundTool() {
5158
5166
  }).flat().forEach(slot => {
5159
5167
  const rgba = picker.rgba;
5160
5168
  if (rgba) {
5161
- slot.setAttribute(cellBackgroundAttr, `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`);
5169
+ slot.setAttribute(cellBackgroundAttr, `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`, s => {
5170
+ return slot === s;
5171
+ });
5162
5172
  }
5163
5173
  else {
5164
5174
  slot.removeAttribute(cellBackgroundAttr);
package/bundles/index.js CHANGED
@@ -4986,6 +4986,10 @@ function UndoTool() {
4986
4986
  }
4987
4987
 
4988
4988
  const cellAlignAttr = new core$1.Attribute('cellAlign', {
4989
+ onlySelf: true,
4990
+ checkHost(host) {
4991
+ return host.parent instanceof TableComponent;
4992
+ },
4989
4993
  render(node, formatValue) {
4990
4994
  node.styles.set('verticalAlign', formatValue);
4991
4995
  }
@@ -5114,6 +5118,10 @@ function CellAlignTool() {
5114
5118
  }
5115
5119
 
5116
5120
  const cellBackgroundAttr = new core$1.Attribute('cellBackground', {
5121
+ onlySelf: true,
5122
+ checkHost(host) {
5123
+ return host.parent instanceof TableComponent;
5124
+ },
5117
5125
  render(node, formatValue) {
5118
5126
  const rgba = color.parseCss(formatValue);
5119
5127
  if (rgba) {
@@ -5160,7 +5168,9 @@ function CellBackgroundTool() {
5160
5168
  }).flat().forEach(slot => {
5161
5169
  const rgba = picker.rgba;
5162
5170
  if (rgba) {
5163
- slot.setAttribute(cellBackgroundAttr, `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`);
5171
+ slot.setAttribute(cellBackgroundAttr, `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`, s => {
5172
+ return slot === s;
5173
+ });
5164
5174
  }
5165
5175
  else {
5166
5176
  slot.removeAttribute(cellBackgroundAttr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/xnote",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A high-performance rich text editor that supports multiplayer online collaboration.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@tanbo/color": "^0.1.1",
30
- "@textbus/adapter-viewfly": "^4.2.5",
31
- "@textbus/collaborate": "^4.2.4",
32
- "@textbus/core": "^4.2.4",
33
- "@textbus/platform-browser": "^4.2.5",
30
+ "@textbus/adapter-viewfly": "^4.3.0",
31
+ "@textbus/collaborate": "^4.3.0",
32
+ "@textbus/core": "^4.3.0",
33
+ "@textbus/platform-browser": "^4.3.0",
34
34
  "@viewfly/core": "^1.1.1",
35
35
  "@viewfly/hooks": "^1.1.1",
36
36
  "@viewfly/platform-browser": "^1.1.1",