@formicoidea/labre-core 0.42.0 → 0.43.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.
Files changed (124) hide show
  1. package/dist/_pkgs/affine-block-data-view/configs/tooltips.js +1 -1
  2. package/dist/_pkgs/affine-block-database/configs/tooltips.js +1 -1
  3. package/dist/_pkgs/affine-block-edgeless-text/edgeless-text-block.js +4 -2
  4. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.d.ts +39 -0
  5. package/dist/_pkgs/affine-block-embed/common/iframe-sandbox.js +39 -0
  6. package/dist/_pkgs/affine-block-embed/embed-figma-block/embed-figma-block.js +2 -0
  7. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.d.ts +14 -1
  8. package/dist/_pkgs/affine-block-embed/embed-iframe-block/components/embed-iframe-error-card.js +21 -2
  9. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.d.ts +0 -2
  10. package/dist/_pkgs/affine-block-embed/embed-iframe-block/consts.js +2 -5
  11. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.d.ts +1 -1
  12. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +14 -6
  13. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.d.ts +16 -0
  14. package/dist/_pkgs/affine-block-embed/embed-iframe-block/types.js +17 -1
  15. package/dist/_pkgs/affine-block-embed/embed-loom-block/embed-loom-block.js +2 -0
  16. package/dist/_pkgs/affine-block-embed/embed-youtube-block/embed-youtube-block.js +2 -0
  17. package/dist/_pkgs/affine-block-embed/index.d.ts +1 -0
  18. package/dist/_pkgs/affine-block-embed/index.js +1 -0
  19. package/dist/_pkgs/affine-block-embed/translations.d.ts +8 -0
  20. package/dist/_pkgs/affine-block-embed/translations.js +28 -0
  21. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -2
  22. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -2
  23. package/dist/_pkgs/affine-block-frame/frame-manager.js +5 -2
  24. package/dist/_pkgs/affine-block-list/utils/get-list-icon.js +3 -1
  25. package/dist/_pkgs/affine-block-note/configs/tooltips.js +1 -1
  26. package/dist/_pkgs/affine-block-root/adapters/html.js +2 -2
  27. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.d.ts +2 -0
  28. package/dist/_pkgs/affine-block-root/commands/copy-link-commands.js +155 -0
  29. package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
  30. package/dist/_pkgs/affine-block-root/index.js +1 -0
  31. package/dist/_pkgs/affine-block-root/view.js +2 -0
  32. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +13 -1
  33. package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +8 -0
  34. package/dist/_pkgs/affine-block-surface/extensions/legend.js +59 -3
  35. package/dist/_pkgs/affine-block-surface/extensions/morph-toolbar.js +4 -0
  36. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +3 -0
  37. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +23 -0
  38. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +1 -1
  39. package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +12 -4
  40. package/dist/_pkgs/affine-block-surface/framework-background/background-view.js +1 -1
  41. package/dist/_pkgs/affine-block-surface/framework-background/fit.d.ts +36 -0
  42. package/dist/_pkgs/affine-block-surface/framework-background/fit.js +30 -0
  43. package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
  44. package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
  45. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +2 -7
  46. package/dist/_pkgs/affine-block-surface-ref/configs/tooltips.js +2 -2
  47. package/dist/_pkgs/affine-components/color-picker/palette-carousel.js +5 -0
  48. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  49. package/dist/_pkgs/affine-components/context-menu/button.js +3 -1
  50. package/dist/_pkgs/affine-components/icons/ai.js +3 -3
  51. package/dist/_pkgs/affine-components/icons/list.js +7 -1
  52. package/dist/_pkgs/affine-components/size-dropdown-menu/dropdown-menu.js +6 -1
  53. package/dist/_pkgs/affine-components/toolbar/index.d.ts +1 -1
  54. package/dist/_pkgs/affine-components/toolbar/index.js +1 -1
  55. package/dist/_pkgs/affine-components/toolbar/menu-button.d.ts +7 -0
  56. package/dist/_pkgs/affine-components/toolbar/menu-button.js +30 -0
  57. package/dist/_pkgs/affine-components/toolbar/picker-menu.d.ts +16 -1
  58. package/dist/_pkgs/affine-components/toolbar/picker-menu.js +2 -2
  59. package/dist/_pkgs/affine-components/toolbar/toolbar.d.ts +1 -0
  60. package/dist/_pkgs/affine-components/toolbar/toolbar.js +67 -0
  61. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +1 -1
  62. package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +1 -1
  63. package/dist/_pkgs/affine-gfx-brush/toolbar/components/eraser/icons.js +1 -1
  64. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.d.ts +11 -2
  65. package/dist/_pkgs/affine-gfx-connector/direction/direction-reveal.js +11 -2
  66. package/dist/_pkgs/affine-gfx-connector/text/edgeless-connector-label-editor.js +3 -2
  67. package/dist/_pkgs/affine-gfx-connector/toolbar/config.js +23 -7
  68. package/dist/_pkgs/affine-gfx-connector/translations.d.ts +3 -0
  69. package/dist/_pkgs/affine-gfx-connector/translations.js +23 -0
  70. package/dist/_pkgs/affine-gfx-mindmap/indicator-overlay/index.js +6 -2
  71. package/dist/_pkgs/affine-gfx-mindmap/toolbar/config.js +4 -2
  72. package/dist/_pkgs/affine-gfx-mindmap/translations.d.ts +6 -0
  73. package/dist/_pkgs/affine-gfx-mindmap/translations.js +10 -0
  74. package/dist/_pkgs/affine-gfx-shape/toolbar/config.js +4 -2
  75. package/dist/_pkgs/affine-gfx-shape/translations.d.ts +7 -0
  76. package/dist/_pkgs/affine-gfx-shape/translations.js +11 -0
  77. package/dist/_pkgs/affine-gfx-template/builtin/other.js +13 -7
  78. package/dist/_pkgs/affine-gfx-template/toolbar/template-loading.js +1 -1
  79. package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
  80. package/dist/_pkgs/affine-gfx-template/translations.js +38 -0
  81. package/dist/_pkgs/affine-gfx-text/edgeless-text-editor.js +3 -2
  82. package/dist/_pkgs/affine-gfx-text/toolbar/actions.js +3 -1
  83. package/dist/_pkgs/affine-gfx-text/translations.d.ts +8 -0
  84. package/dist/_pkgs/affine-gfx-text/translations.js +12 -0
  85. package/dist/_pkgs/affine-inline-latex/latex-node/latex-editor-menu.js +2 -1
  86. package/dist/_pkgs/affine-model/consts/text.d.ts +15 -2
  87. package/dist/_pkgs/affine-model/consts/text.js +25 -1
  88. package/dist/_pkgs/affine-shared/services/font-loader/config.d.ts +13 -2
  89. package/dist/_pkgs/affine-shared/services/font-loader/config.js +43 -54
  90. package/dist/_pkgs/affine-shared/services/theme-service.d.ts +19 -0
  91. package/dist/_pkgs/affine-shared/services/theme-service.js +24 -0
  92. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +20 -0
  93. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +81 -0
  94. package/dist/_pkgs/affine-widget-edgeless-dragging-area/edgeless-dragging-area-rect.js +2 -2
  95. package/dist/_pkgs/affine-widget-edgeless-selected-rect/utils.js +5 -1
  96. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/types.d.ts +15 -0
  97. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.d.ts +1 -1
  98. package/dist/_pkgs/affine-widget-edgeless-toolbar/config/utils.js +7 -2
  99. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.d.ts +18 -0
  100. package/dist/_pkgs/affine-widget-edgeless-toolbar/panel/font-family-panel.js +52 -6
  101. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.d.ts +6 -0
  102. package/dist/_pkgs/affine-widget-edgeless-toolbar/translations.js +10 -0
  103. package/dist/_pkgs/affine-widget-frame-title/edgeless-frame-title-editor.js +2 -1
  104. package/dist/_pkgs/affine-widget-slash-menu/translations.d.ts +16 -0
  105. package/dist/_pkgs/affine-widget-slash-menu/translations.js +23 -1
  106. package/dist/_pkgs/affine-widget-toolbar/utils.js +57 -14
  107. package/dist/_pkgs/data-view/core/detail/field.js +2 -1
  108. package/dist/_pkgs/data-view/core/filter/literal/define.js +3 -1
  109. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +1 -1
  110. package/dist/_pkgs/data-view/property-presets/checkbox/cell-renderer.js +8 -2
  111. package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +1 -1
  112. package/dist/_pkgs/data-view/view-presets/kanban/pc/controller/drag.js +2 -1
  113. package/dist/_pkgs/data-view/view-presets/table/pc/controller/drag.js +2 -1
  114. package/dist/_pkgs/data-view/view-presets/table/pc/controller/selection.js +1 -1
  115. package/dist/_pkgs/data-view/view-presets/table/pc/header/vertical-indicator.js +2 -1
  116. package/dist/_pkgs/data-view/view-presets/table/pc/row/row-select-checkbox.js +3 -1
  117. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/drag.js +2 -1
  118. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/selection.js +1 -1
  119. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/header/vertical-indicator.js +2 -1
  120. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/row-header.js +3 -1
  121. package/dist/_pkgs/std/gfx/model/surface/role.d.ts +10 -5
  122. package/dist/commands.js +2 -1
  123. package/dist/translations.js +5 -0
  124. package/package.json +5 -1
@@ -156,7 +156,7 @@ let KanbanCell = (() => {
156
156
  ? '1px solid var(--affine-primary-color)'
157
157
  : '';
158
158
  this.style.boxShadow = this.isEditing$.value
159
- ? '0px 0px 0px 2px rgba(30, 150, 235, 0.30)'
159
+ ? '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)'
160
160
  : '';
161
161
  return html ` ${this.renderIcon()}
162
162
  ${renderUniLit(view, props, {
@@ -172,7 +172,8 @@ const createDropPreview = () => {
172
172
  div.style.height = '2px';
173
173
  div.style.borderRadius = '1px';
174
174
  div.style.backgroundColor = 'var(--affine-primary-color)';
175
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
175
+ div.style.boxShadow =
176
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
176
177
  return {
177
178
  display(group, self, card) {
178
179
  const target = card ?? group.querySelector('.add-card');
@@ -156,7 +156,8 @@ const createDropPreview = () => {
156
156
  div.style.height = '2px';
157
157
  div.style.borderRadius = '1px';
158
158
  div.style.backgroundColor = 'var(--affine-primary-color)';
159
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
159
+ div.style.boxShadow =
160
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
160
161
  return {
161
162
  display(x, y, width) {
162
163
  document.body.append(div);
@@ -967,7 +967,7 @@ let SelectionElement = (() => {
967
967
  ? 'dashed'
968
968
  : 'solid';
969
969
  div.style.boxShadow = isEditing
970
- ? '0px 0px 0px 2px rgba(30, 150, 235, 0.30)'
970
+ ? '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)'
971
971
  : 'unset';
972
972
  div.style.display = 'block';
973
973
  dragToFill.style.left = `${x + w}px`;
@@ -101,7 +101,8 @@ let TableVerticalIndicator = (() => {
101
101
  }
102
102
 
103
103
  .with-shadow.vertical-indicator::after {
104
- box-shadow: 0px 0px 8px 0px rgba(30, 150, 235, 0.35);
104
+ box-shadow: 0px 0px 8px 0px
105
+ color-mix(in srgb, var(--affine-primary-color) 35%, transparent);
105
106
  }
106
107
  `; }
107
108
  render() {
@@ -122,7 +122,9 @@ let RowSelectCheckbox = (() => {
122
122
  return html `
123
123
  <div class="${classString}">
124
124
  ${this.isSelected$.value
125
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
125
+ ? CheckBoxCheckSolidIcon({
126
+ style: `color:var(--affine-primary-color)`,
127
+ })
126
128
  : CheckBoxUnIcon()}
127
129
  </div>
128
130
  `;
@@ -177,7 +177,8 @@ const createDropPreview = () => {
177
177
  div.style.height = '2px';
178
178
  div.style.borderRadius = '1px';
179
179
  div.style.backgroundColor = 'var(--affine-primary-color)';
180
- div.style.boxShadow = '0px 0px 8px 0px rgba(30, 150, 235, 0.35)';
180
+ div.style.boxShadow =
181
+ '0px 0px 8px 0px color-mix(in srgb, var(--affine-primary-color) 35%, transparent)';
181
182
  return {
182
183
  display(x, y, width) {
183
184
  document.body.append(div);
@@ -859,7 +859,7 @@ let SelectionElement = (() => {
859
859
  height: `${focus.height}px`,
860
860
  display: 'block',
861
861
  boxShadow: focus.editing
862
- ? '0px 0px 0px 2px rgba(30, 150, 235, 0.30)'
862
+ ? '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)'
863
863
  : 'unset',
864
864
  })
865
865
  : undefined;
@@ -101,7 +101,8 @@ let TableVerticalIndicator = (() => {
101
101
  }
102
102
 
103
103
  .with-shadow.vertical-indicator::after {
104
- box-shadow: 0px 0px 8px 0px rgba(30, 150, 235, 0.35);
104
+ box-shadow: 0px 0px 8px 0px
105
+ color-mix(in srgb, var(--affine-primary-color) 35%, transparent);
105
106
  }
106
107
  `; }
107
108
  render() {
@@ -138,7 +138,9 @@ let TableRowHeader = (() => {
138
138
  <div @click=${this.selectRow} class="${styles.checkboxWrapper}">
139
139
  <div class="${classString}">
140
140
  ${this.rowSelected$.value
141
- ? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
141
+ ? CheckBoxCheckSolidIcon({
142
+ style: `color:var(--affine-primary-color)`,
143
+ })
142
144
  : CheckBoxUnIcon()}
143
145
  </div>
144
146
  </div>
@@ -77,12 +77,17 @@ export interface EdgeDirectionDef {
77
77
  gestureHintFallback?: string;
78
78
  /**
79
79
  * CSS colour of the chip the reveal draws this verb in (M2). Absent — which
80
- * is every role but one — keeps the house affordance blue the mechanism has
81
- * always used, so declaring nothing repaints nothing.
80
+ * is every role today — leaves the chip on the chrome's accent token, so
81
+ * every typed edge of every framework wears one blue and follows a host
82
+ * re-skin with the rest of the chrome.
82
83
  *
83
- * A colour belongs to the ROLE rather than to the widget because the chip is
84
- * per-relation: the PO may want one framework's central relation to stand out
85
- * without every other framework's edges changing with it. The chip's text is
84
+ * An extension point, deliberately unused. One role took it (PR #203) so its
85
+ * framework's central relation would stand out, and the result on a map
86
+ * carrying two typed relations was two different blues, with nothing
87
+ * comparing them. Reversed on the PO recette of 23/09/2026; the field stays
88
+ * because a framework may one day have a real reason to claim its own, and
89
+ * `affine/all/src/__tests__/direction-chip-accent.unit.spec.ts` is what makes
90
+ * that a reviewed decision rather than a silent one. The chip's text is
86
91
  * white, so a colour declared here must be dark enough to carry it.
87
92
  */
88
93
  chipColor?: string;
package/dist/commands.js CHANGED
@@ -1,4 +1,4 @@
1
- import { coreCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
1
+ import { copyLinkCommands, coreCommands, pivotCommands, readingCommands, tagCommands, } from './_pkgs/affine-block-root/index.js';
2
2
  import { auditCommands, exportSvgCommands, mapQualityCommands, } from './_pkgs/affine-block-surface/index.js';
3
3
  import { edgeDirectionCommands } from './_pkgs/affine-gfx-connector/index.js';
4
4
  import { shapeCommands } from './_pkgs/affine-gfx-shape/index.js';
@@ -47,6 +47,7 @@ export function buildCommandRegistry(core, groups, flags) {
47
47
  export function getCommands(flags) {
48
48
  return buildCommandRegistry([
49
49
  ...coreCommands,
50
+ ...copyLinkCommands,
50
51
  ...pivotCommands,
51
52
  ...tagCommands,
52
53
  ...readingCommands,
@@ -219,6 +219,11 @@ const CHROME_KEYS = [
219
219
  // and would leave every new format silently untranslated.
220
220
  ['com.labre.interchange.import.done', 'file imported'],
221
221
  ['com.labre.interchange.import.failed', 'This file could not be imported'],
222
+ // The name an imported sheet takes when neither the file nor the source
223
+ // document carries one. Resolved at the creation site (`interchange-import`,
224
+ // which has `std`); the pure readers keep the same English text as their own
225
+ // last-resort default, so the two can never drift (#390).
226
+ ['com.labre.interchange.import.default-name', 'Imported diagram'],
222
227
  // Rights lost WHILE the file was being read — the import's own sentence,
223
228
  // because nothing is wrong with the file. It rides under the same "could not
224
229
  // be imported" headline as a reader's refusal, which is what it is to the
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-core",
3
3
  "description": "Labre editor — the full BlockSuite-derived editor as one package.",
4
- "version": "0.42.0",
4
+ "version": "0.43.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -854,6 +854,10 @@
854
854
  "types": "./dist/foundation/view.d.ts",
855
855
  "import": "./dist/foundation/view.js"
856
856
  },
857
+ "./_pkgs/affine-block-surface": {
858
+ "types": "./dist/_pkgs/affine-block-surface/index.d.ts",
859
+ "import": "./dist/_pkgs/affine-block-surface/index.js"
860
+ },
857
861
  "./_pkgs/affine-widget-edgeless-toolbar": {
858
862
  "types": "./dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts",
859
863
  "import": "./dist/_pkgs/affine-widget-edgeless-toolbar/index.js"