@formicoidea/labre-core 0.33.0 → 0.34.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 (100) hide show
  1. package/dist/_pkgs/affine-block-attachment/attachment-block.js +2 -2
  2. package/dist/_pkgs/affine-block-attachment/configs/toolbar.d.ts +2 -2
  3. package/dist/_pkgs/affine-block-attachment/configs/toolbar.js +9 -7
  4. package/dist/_pkgs/affine-block-bookmark/configs/toolbar.js +12 -12
  5. package/dist/_pkgs/affine-block-code/code-block.js +2 -2
  6. package/dist/_pkgs/affine-block-code/code-toolbar/config.js +6 -0
  7. package/dist/_pkgs/affine-block-database/database-block.js +2 -2
  8. package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +3 -3
  9. package/dist/_pkgs/affine-block-embed/configs/toolbar.js +11 -11
  10. package/dist/_pkgs/affine-block-embed/embed-html-block/configs/toolbar.js +5 -5
  11. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.d.ts +7 -7
  12. package/dist/_pkgs/affine-block-embed/embed-iframe-block/configs/toolbar.js +12 -12
  13. package/dist/_pkgs/affine-block-embed/embed-iframe-block/embed-iframe-block.js +2 -2
  14. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/toolbar.js +9 -9
  15. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +4 -4
  16. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/components/embed-synced-doc-card.js +5 -4
  17. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/configs/toolbar.js +9 -9
  18. package/dist/_pkgs/affine-block-frame/frame-toolbar.js +2 -2
  19. package/dist/_pkgs/affine-block-image/configs/toolbar.js +4 -4
  20. package/dist/_pkgs/affine-block-note/configs/toolbar.js +2 -2
  21. package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +6 -4
  22. package/dist/_pkgs/affine-block-root/configs/toolbar.js +6 -6
  23. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.d.ts +10 -10
  24. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/misc.js +4 -4
  25. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.d.ts +7 -7
  26. package/dist/_pkgs/affine-block-root/edgeless/configs/toolbar/more.js +8 -8
  27. package/dist/_pkgs/affine-block-root/edgeless/edgeless-root-block.js +3 -1
  28. package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +15 -4
  29. package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +17 -0
  30. package/dist/_pkgs/affine-block-surface/extensions/spotlight.d.ts +21 -0
  31. package/dist/_pkgs/affine-block-surface/extensions/spotlight.js +17 -3
  32. package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
  33. package/dist/_pkgs/affine-block-surface/index.js +1 -0
  34. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.d.ts +17 -0
  35. package/dist/_pkgs/affine-block-surface/renderer/element-highlight-overlay.js +66 -0
  36. package/dist/_pkgs/affine-block-surface/view.js +5 -0
  37. package/dist/_pkgs/affine-block-surface-ref/configs/toolbar.js +4 -4
  38. package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
  39. package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
  40. package/dist/_pkgs/affine-components/icons/text.js +426 -426
  41. package/dist/_pkgs/affine-components/open-doc-dropdown-menu/dropdown-menu.d.ts +2 -0
  42. package/dist/_pkgs/affine-components/resource/resource.js +2 -0
  43. package/dist/_pkgs/affine-components/view-dropdown-menu/dropdown-menu.js +27 -14
  44. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +4 -4
  45. package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +6 -6
  46. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.d.ts +4 -4
  47. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +6 -6
  48. package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +61 -0
  49. package/dist/_pkgs/affine-model/elements/bpmn/pool.js +93 -0
  50. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +7 -2
  51. package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +9 -4
  52. package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +7 -2
  53. package/dist/_pkgs/affine-model/elements/edgy/board.js +9 -4
  54. package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +20 -3
  55. package/dist/_pkgs/affine-model/elements/edgy/facets.js +13 -4
  56. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +7 -2
  57. package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +9 -4
  58. package/dist/_pkgs/affine-model/elements/framework-background/background.d.ts +7 -2
  59. package/dist/_pkgs/affine-model/elements/framework-background/background.js +9 -4
  60. package/dist/_pkgs/affine-model/elements/framework-background/hit-test.d.ts +48 -0
  61. package/dist/_pkgs/affine-model/elements/framework-background/hit-test.js +55 -0
  62. package/dist/_pkgs/affine-model/elements/framework-background/index.d.ts +1 -0
  63. package/dist/_pkgs/affine-model/elements/framework-background/index.js +1 -0
  64. package/dist/_pkgs/affine-shared/services/edit-props-store.d.ts +11 -0
  65. package/dist/_pkgs/affine-shared/services/edit-props-store.js +15 -0
  66. package/dist/_pkgs/affine-shared/services/toolbar-service/action.d.ts +32 -0
  67. package/dist/_pkgs/affine-shared/services/toolbar-service/action.js +16 -0
  68. package/dist/_pkgs/affine-shared/services/toolbar-service/flags.d.ts +10 -0
  69. package/dist/_pkgs/affine-shared/services/toolbar-service/flags.js +32 -1
  70. package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +106 -0
  71. package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +201 -0
  72. package/dist/_pkgs/affine-shared/services/translation-service/index.d.ts +1 -0
  73. package/dist/_pkgs/affine-shared/services/translation-service/index.js +1 -0
  74. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.d.ts +11 -16
  75. package/dist/_pkgs/affine-widget-edgeless-toolbar/catalogue/catalogue-groups.js +11 -28
  76. package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +2 -1
  77. package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
  78. package/dist/_pkgs/affine-widget-slash-menu/config.js +2 -1
  79. package/dist/_pkgs/affine-widget-toolbar/toolbar.js +5 -0
  80. package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +19 -2
  81. package/dist/_pkgs/affine-widget-toolbar/utils.js +22 -7
  82. package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
  83. package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
  84. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
  85. package/dist/_pkgs/std/extension/command-registry.d.ts +36 -0
  86. package/dist/_pkgs/std/extension/command-registry.js +16 -0
  87. package/dist/_pkgs/std/extension/translation-manifest.d.ts +46 -1
  88. package/dist/_pkgs/std/extension/translation-manifest.js +58 -0
  89. package/dist/_pkgs/std/gfx/highlight.d.ts +84 -0
  90. package/dist/_pkgs/std/gfx/highlight.js +112 -0
  91. package/dist/_pkgs/std/gfx/index.d.ts +1 -0
  92. package/dist/_pkgs/std/gfx/index.js +1 -0
  93. package/dist/_pkgs/std/gfx/interactivity/gfx-view-event-handler.js +17 -3
  94. package/dist/_pkgs/std/scope/std-scope.d.ts +2 -1
  95. package/dist/_pkgs/std/scope/std-scope.js +2 -0
  96. package/dist/_pkgs/std/utils/gfx.js +2 -0
  97. package/dist/shortcuts.d.ts +20 -6
  98. package/dist/shortcuts.js +7 -9
  99. package/dist/translations.js +25 -18
  100. package/package.json +13 -1
package/dist/shortcuts.js CHANGED
@@ -1,19 +1,17 @@
1
- import { toShortcutDescriptor } from './_pkgs/std/index.js';
1
+ import { toShortcutManifestEntry, } from './_pkgs/std/index.js';
2
2
  import { getCommands } from './commands.js';
3
- const toEntry = (d) => ({
4
- id: d.id,
5
- labelKey: d.labelKey,
6
- defaultKeys: d.defaultKeys,
7
- scope: d.scope,
8
- owner: d.owner,
9
- });
10
3
  /**
11
4
  * The enumerable shortcut manifest for a given flag set. TOTAL over the command
12
5
  * registry: every command yields a row, keyless ones included, so Settings ›
13
6
  * Shortcuts can bind precisely the commands a user most wants to bind. The
14
7
  * panel therefore grows from ~10 rows to the full command count — that is the
15
8
  * intent, and `owner` grouping is what keeps it usable.
9
+ *
10
+ * In the BUNDLED distribution this returns core's share only: each framework
11
+ * bundle's commands are stripped out of core by `scripts/build-bundles.mjs` and
12
+ * republished as that bundle's data-only `./commands-manifest` export, which
13
+ * the host concatenates for the frameworks it enables.
16
14
  */
17
15
  export function getShortcutManifest(flags) {
18
- return getCommands(flags).map(toShortcutDescriptor).map(toEntry);
16
+ return getCommands(flags).map(toShortcutManifestEntry);
19
17
  }
@@ -1,6 +1,6 @@
1
1
  import { EXEMPTION_FALLBACK, PROVENANCE_FALLBACK, RELATION_SIDE_FALLBACK, SEVERITY_FALLBACK, } from './_pkgs/affine-block-surface/index.js';
2
- import { CATALOGUE_CATEGORY_KEY_PREFIX, humanizeCategory, } from './_pkgs/affine-widget-edgeless-toolbar/index.js';
3
- import { collectTranslationKeys, commandTranslationEntries, mergeTranslationEntries, } from './_pkgs/std/index.js';
2
+ import { CHROME_WORDINGS } from './_pkgs/affine-shared/services/index.js';
3
+ import { collectTranslationKeys, commandCategoryTranslationEntries, commandTranslationEntries, mergeTranslationEntries, } from './_pkgs/std/index.js';
4
4
  import { getCommands } from './commands.js';
5
5
  import { FRAMEWORK_DESCRIPTORS } from './frameworks.js';
6
6
  const FRAMEWORK_TRANSLATION_GROUPS = [];
@@ -32,26 +32,23 @@ const chromeTableEntries = () => CHROME_TABLES.flatMap(([prefix, table]) => Obje
32
32
  *
33
33
  * DERIVED, not restated: the categories are walked out of `getCommands()`, so a
34
34
  * framework that invents a category gets its header key in the manifest by
35
- * construction — which is the whole point on the eve of a BPMN pack that will
36
- * declare several. The fallback comes from `humanizeCategory`, the very
37
- * function the panel renders with, so the two cannot drift.
35
+ * construction. The fallback comes from `humanizeCategory`, the very function
36
+ * the panel renders with, so the two cannot drift.
38
37
  *
39
38
  * Flag-independent like the rest of the manifest: `getCommands()` with no flags
40
39
  * enumerates every command, so a catalogue built once covers a framework
41
40
  * switched on later.
41
+ *
42
+ * In the BUNDLED distribution this walks core's commands alone — the framework
43
+ * groups are stripped from this file — which is why every framework contributes
44
+ * its OWN category headers from its `…TranslationEntries` as well (#183: a
45
+ * bundled host was offered translated catalogue ENTRIES under untranslated
46
+ * headers, because "EVENTS" and "GATEWAYS" are BPMN's categories and BPMN's
47
+ * commands are not in core). The two overlap in the monorepo and
48
+ * `mergeTranslationEntries` de-duplicates them, so both assemblies produce the
49
+ * same list.
42
50
  */
43
- const catalogueCategoryEntries = () => {
44
- const categories = new Set();
45
- for (const command of getCommands()) {
46
- if (command.category)
47
- categories.add(command.category);
48
- }
49
- return [...categories].map(category => ({
50
- key: `${CATALOGUE_CATEGORY_KEY_PREFIX}${category}`,
51
- fallback: humanizeCategory(category),
52
- source: 'chrome',
53
- }));
54
- };
51
+ const catalogueCategoryEntries = () => commandCategoryTranslationEntries(getCommands());
55
52
  /**
56
53
  * Chrome wordings: the `translateKey(std, key, fallback)` literals of the
57
54
  * library's own panels and toolbars. Restated data, guarded against drift AND
@@ -192,7 +189,17 @@ const CHROME_KEYS = [
192
189
  * not filtered either.
193
190
  */
194
191
  export function getTranslationKeyManifest() {
195
- return mergeTranslationEntries(commandTranslationEntries(getCommands()), collectTranslationKeys('framework', FRAMEWORK_DESCRIPTORS), ...FRAMEWORK_TRANSLATION_GROUPS.map(group => group.entries), chromeTableEntries(), catalogueCategoryEntries(), CHROME_KEYS.map(([key, fallback]) => ({
192
+ return mergeTranslationEntries(commandTranslationEntries(getCommands()), collectTranslationKeys('framework', FRAMEWORK_DESCRIPTORS), ...FRAMEWORK_TRANSLATION_GROUPS.map(group => group.entries), chromeTableEntries(), catalogueCategoryEntries(),
193
+ // The editor's own shared vocabulary — the toasts, the toolbar verbs, the
194
+ // view switcher, the board tooltips — DECLARED in
195
+ // `@labre/affine-shared/services` beside nothing at all, and walked here
196
+ // rather than restated. Same rule as the tables above: a wording added to
197
+ // `CHROME_WORDINGS` reaches a host with no second edit.
198
+ CHROME_WORDINGS.map(([key, fallback]) => ({
199
+ key,
200
+ fallback,
201
+ source: 'chrome',
202
+ })), CHROME_KEYS.map(([key, fallback]) => ({
196
203
  key,
197
204
  fallback,
198
205
  source: 'chrome',
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.33.0",
4
+ "version": "0.34.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -853,6 +853,18 @@
853
853
  "./foundation/view": {
854
854
  "types": "./dist/foundation/view.d.ts",
855
855
  "import": "./dist/foundation/view.js"
856
+ },
857
+ "./_pkgs/affine-widget-edgeless-toolbar": {
858
+ "types": "./dist/_pkgs/affine-widget-edgeless-toolbar/index.d.ts",
859
+ "import": "./dist/_pkgs/affine-widget-edgeless-toolbar/index.js"
860
+ },
861
+ "./_pkgs/global/di": {
862
+ "types": "./dist/_pkgs/global/di/index.d.ts",
863
+ "import": "./dist/_pkgs/global/di/index.js"
864
+ },
865
+ "./_pkgs/global/utils": {
866
+ "types": "./dist/_pkgs/global/utils/index.d.ts",
867
+ "import": "./dist/_pkgs/global/utils/index.js"
856
868
  }
857
869
  },
858
870
  "files": [