@formicoidea/labre-core 0.49.0 → 0.51.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/dist/_pkgs/affine-block-attachment/asset-picker.d.ts +24 -0
- package/dist/_pkgs/affine-block-attachment/asset-picker.js +87 -0
- package/dist/_pkgs/affine-block-attachment/configs/slash-menu.js +3 -20
- package/dist/_pkgs/affine-block-attachment/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-attachment/index.js +1 -0
- package/dist/_pkgs/affine-block-attachment/utils.d.ts +9 -1
- package/dist/_pkgs/affine-block-attachment/utils.js +9 -0
- package/dist/_pkgs/affine-block-bookmark/adapters/markdown/markdown.js +14 -1
- package/dist/_pkgs/affine-block-bookmark/adapters/notion-html.js +5 -1
- package/dist/_pkgs/affine-block-database/adapters/markdown.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/html.js +5 -3
- package/dist/_pkgs/affine-block-embed/common/adapters/markdown.js +11 -0
- package/dist/_pkgs/affine-block-frame/frame-template.d.ts +58 -0
- package/dist/_pkgs/affine-block-frame/frame-template.js +207 -0
- package/dist/_pkgs/affine-block-frame/frame-toolbar.js +19 -3
- package/dist/_pkgs/affine-block-frame/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-frame/index.js +1 -0
- package/dist/_pkgs/affine-block-frame/translations.d.ts +7 -0
- package/dist/_pkgs/affine-block-frame/translations.js +16 -1
- package/dist/_pkgs/affine-block-frame/view.js +6 -0
- package/dist/_pkgs/affine-block-image/asset-picker.d.ts +63 -0
- package/dist/_pkgs/affine-block-image/asset-picker.js +183 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.d.ts +5 -0
- package/dist/_pkgs/affine-block-image/commands/insert-images.js +8 -8
- package/dist/_pkgs/affine-block-image/components/page-image-block.d.ts +11 -0
- package/dist/_pkgs/affine-block-image/components/page-image-block.js +81 -12
- package/dist/_pkgs/affine-block-image/configs/replace-action.d.ts +9 -0
- package/dist/_pkgs/affine-block-image/configs/replace-action.js +27 -0
- package/dist/_pkgs/affine-block-image/configs/toolbar.js +6 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.d.ts +46 -0
- package/dist/_pkgs/affine-block-image/crop/crop-controller.js +104 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.d.ts +70 -0
- package/dist/_pkgs/affine-block-image/crop/crop-math.js +141 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.d.ts +57 -0
- package/dist/_pkgs/affine-block-image/crop/crop-overlay.js +343 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.d.ts +12 -0
- package/dist/_pkgs/affine-block-image/crop/crop-toolbar.js +78 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.d.ts +16 -0
- package/dist/_pkgs/affine-block-image/crop/write-crop.js +57 -0
- package/dist/_pkgs/affine-block-image/edgeless-clipboard-config.js +4 -1
- package/dist/_pkgs/affine-block-image/effects.js +2 -0
- package/dist/_pkgs/affine-block-image/image-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-block.js +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.d.ts +2 -0
- package/dist/_pkgs/affine-block-image/image-edgeless-block.js +36 -8
- package/dist/_pkgs/affine-block-image/image-resize-manager.js +15 -0
- package/dist/_pkgs/affine-block-image/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-image/index.js +1 -0
- package/dist/_pkgs/affine-block-image/translations.d.ts +15 -0
- package/dist/_pkgs/affine-block-image/translations.js +43 -0
- package/dist/_pkgs/affine-block-image/utils.d.ts +13 -0
- package/dist/_pkgs/affine-block-image/utils.js +10 -1
- package/dist/_pkgs/affine-block-root/clipboard/page-clipboard.js +5 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.d.ts +2 -0
- package/dist/_pkgs/affine-block-root/commands/page-export-commands.js +71 -0
- package/dist/_pkgs/affine-block-root/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-root/index.js +1 -0
- package/dist/_pkgs/affine-block-root/view.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.d.ts +30 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/capability.js +44 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.d.ts +26 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/colors.js +82 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/command.js +91 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/index.js +3 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.d.ts +50 -0
- package/dist/_pkgs/affine-block-surface/extensions/drawio-export/writer.js +732 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.d.ts +12 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/draw-image-block.js +15 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-manager/export-manager.js +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.d.ts +7 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/command.js +60 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.d.ts +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/index.js +2 -2
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.d.ts +6 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/marker-version.js +8 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.d.ts +28 -1
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +66 -6
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.d.ts +2 -7
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/svg-context.js +2 -6
- package/dist/_pkgs/affine-block-surface/extensions/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/index.js +2 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.d.ts +84 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-export.js +150 -0
- package/dist/_pkgs/affine-block-surface/extensions/interchange-import.js +24 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.d.ts +23 -2
- package/dist/_pkgs/affine-block-surface/extensions/interchange.js +4 -1
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.d.ts +18 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend-role.js +20 -0
- package/dist/_pkgs/affine-block-surface/extensions/legend.d.ts +2 -19
- package/dist/_pkgs/affine-block-surface/extensions/legend.js +2 -18
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.d.ts +67 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sanitize.js +235 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch-translations.js +9 -0
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.d.ts +17 -13
- package/dist/_pkgs/affine-block-surface/extensions/svg-sketch.js +52 -80
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.d.ts +98 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-element.js +261 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.d.ts +238 -0
- package/dist/_pkgs/affine-block-surface/extensions/xml-reader.js +570 -0
- package/dist/_pkgs/affine-block-surface/framework-background/def.js +1 -1
- package/dist/_pkgs/affine-block-surface/interchange-headless.d.ts +29 -0
- package/dist/_pkgs/affine-block-surface/interchange-headless.js +32 -0
- package/dist/_pkgs/affine-block-surface/view.js +22 -2
- package/dist/_pkgs/affine-block-table/adapters/utils.js +24 -1
- package/dist/_pkgs/affine-components/color-picker/color-panel.d.ts +11 -0
- package/dist/_pkgs/affine-components/color-picker/color-panel.js +87 -12
- package/dist/_pkgs/affine-components/color-picker/framework-palette.d.ts +8 -0
- package/dist/_pkgs/affine-components/color-picker/framework-palette.js +11 -3
- package/dist/_pkgs/affine-components/color-picker/icons.d.ts +9 -0
- package/dist/_pkgs/affine-components/color-picker/icons.js +12 -0
- package/dist/_pkgs/affine-gfx-note/toolbar/note-menu.js +5 -8
- package/dist/_pkgs/affine-gfx-template/contribute.d.ts +14 -4
- package/dist/_pkgs/affine-gfx-template/contribute.js +47 -6
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.d.ts +7 -2
- package/dist/_pkgs/affine-gfx-template/toolbar/builtin-templates.js +14 -40
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.d.ts +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/resolve-name.js +1 -1
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.d.ts +4 -4
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +9 -9
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +2 -4
- package/dist/_pkgs/affine-gfx-template/translations.d.ts +5 -0
- package/dist/_pkgs/affine-gfx-template/translations.js +9 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/inline-delta.js +6 -0
- package/dist/_pkgs/affine-inline-footnote/adapters/markdown/markdown-inline.js +7 -0
- package/dist/_pkgs/affine-inline-link/adapters/html/html-inline.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/html/inline-delta.js +3 -1
- package/dist/_pkgs/affine-inline-link/adapters/markdown/inline-delta.js +4 -1
- package/dist/_pkgs/affine-inline-link/adapters/notion-html/html-inline.js +2 -1
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.d.ts +7 -0
- package/dist/_pkgs/affine-inline-link/link-node/affine-link.js +37 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.d.ts +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/index.js +1 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.d.ts +22 -0
- package/dist/_pkgs/affine-inline-link/link-node/propose-views.js +59 -0
- package/dist/_pkgs/affine-model/blocks/database/types.d.ts +28 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.d.ts +48 -0
- package/dist/_pkgs/affine-model/blocks/image/image-crop.js +78 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.d.ts +6 -0
- package/dist/_pkgs/affine-model/blocks/image/image-model.js +2 -0
- package/dist/_pkgs/affine-model/blocks/image/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/blocks/image/index.js +1 -0
- package/dist/_pkgs/affine-model/consts/shape.d.ts +2 -0
- package/dist/_pkgs/affine-model/consts/shape.js +5 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.d.ts +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/consts.js +31 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/bpmn/pool.d.ts +0 -25
- package/dist/_pkgs/affine-model/elements/bpmn/pool.js +1 -25
- package/dist/_pkgs/affine-model/elements/shape/shape.d.ts +0 -2
- package/dist/_pkgs/affine-model/elements/shape/shape.js +1 -2
- package/dist/_pkgs/affine-model/elements/uml/consts.d.ts +133 -0
- package/dist/_pkgs/affine-model/elements/uml/consts.js +107 -0
- package/dist/_pkgs/affine-model/elements/uml/diagram.d.ts +1 -79
- package/dist/_pkgs/affine-model/elements/uml/diagram.js +1 -53
- package/dist/_pkgs/affine-model/elements/uml/fragment.d.ts +0 -15
- package/dist/_pkgs/affine-model/elements/uml/fragment.js +1 -15
- package/dist/_pkgs/affine-model/elements/uml/index.d.ts +1 -0
- package/dist/_pkgs/affine-model/elements/uml/index.js +1 -0
- package/dist/_pkgs/affine-model/elements/uml/partition.d.ts +0 -20
- package/dist/_pkgs/affine-model/elements/uml/partition.js +1 -20
- package/dist/_pkgs/affine-model/elements/uml/region.d.ts +0 -11
- package/dist/_pkgs/affine-model/elements/uml/region.js +1 -11
- package/dist/_pkgs/affine-model/headless.d.ts +19 -0
- package/dist/_pkgs/affine-model/headless.js +19 -0
- package/dist/_pkgs/affine-shared/headless.d.ts +10 -0
- package/dist/_pkgs/affine-shared/headless.js +10 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +63 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.js +20 -0
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +6 -3
- package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +83 -0
- package/dist/_pkgs/affine-shared/services/frame-template-service.js +17 -0
- package/dist/_pkgs/affine-shared/services/index.d.ts +2 -0
- package/dist/_pkgs/affine-shared/services/index.js +2 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.d.ts +6 -0
- package/dist/_pkgs/affine-shared/services/translation-service/chrome.js +10 -0
- package/dist/_pkgs/affine-widget-drag-handle/watchers/drag-event-watcher.js +8 -3
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +4 -16
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/html.js +25 -24
- package/dist/_pkgs/affine-widget-linked-doc/transformers/index.d.ts +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.d.ts +7 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/markdown.js +26 -25
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.d.ts +23 -0
- package/dist/_pkgs/affine-widget-linked-doc/transformers/utils.js +14 -0
- package/dist/_pkgs/data-view/core/common/properties.d.ts +29 -0
- package/dist/_pkgs/data-view/core/common/properties.js +110 -8
- package/dist/_pkgs/data-view/core/common/property-menu.d.ts +44 -1
- package/dist/_pkgs/data-view/core/common/property-menu.js +100 -3
- package/dist/_pkgs/data-view/core/component/tags/color-carousel.d.ts +41 -0
- package/dist/_pkgs/data-view/core/component/tags/color-carousel.js +199 -0
- package/dist/_pkgs/data-view/core/component/tags/color-menu.d.ts +49 -0
- package/dist/_pkgs/data-view/core/component/tags/color-menu.js +123 -0
- package/dist/_pkgs/data-view/core/component/tags/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/component/tags/index.js +3 -0
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +8 -1
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +21 -20
- package/dist/_pkgs/data-view/core/component/tags/softened-colors.d.ts +42 -0
- package/dist/_pkgs/data-view/core/component/tags/softened-colors.js +79 -0
- package/dist/_pkgs/data-view/core/data-view.d.ts +8 -1
- package/dist/_pkgs/data-view/core/data-view.js +18 -2
- package/dist/_pkgs/data-view/core/effect.js +2 -1
- package/dist/_pkgs/data-view/core/filter/eval.d.ts +6 -1
- package/dist/_pkgs/data-view/core/filter/eval.js +7 -2
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +3 -0
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +119 -71
- package/dist/_pkgs/data-view/core/view/color-rules.d.ts +85 -0
- package/dist/_pkgs/data-view/core/view/color-rules.js +165 -0
- package/dist/_pkgs/data-view/core/view/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/view/index.js +1 -0
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +1 -0
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +1 -0
- package/dist/_pkgs/data-view/translations.d.ts +34 -0
- package/dist/_pkgs/data-view/translations.js +80 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +7 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +6 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +6 -1
- package/dist/_pkgs/data-view/view-presets/list/list-view.js +4 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +3 -0
- package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/header/database-header-column.js +149 -175
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +6 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.d.ts +12 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/color-rules-menu.js +206 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +16 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +4 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +11 -2
- package/dist/commands.js +5 -2
- package/dist/host-panels.d.ts +21 -1
- package/dist/host-panels.js +50 -10
- package/dist/interchange.d.ts +1 -0
- package/dist/interchange.js +1 -0
- package/dist/model/headless.d.ts +1 -0
- package/dist/model/headless.js +1 -0
- package/dist/shared/headless.d.ts +1 -0
- package/dist/shared/headless.js +1 -0
- package/dist/translations.js +8 -1
- package/package.json +13 -1
|
@@ -51,5 +51,39 @@ export declare const DATA_VIEW_OPEN_IN: ChromeWording;
|
|
|
51
51
|
export declare const DATA_VIEW_OPEN_IN_SIDE: ChromeWording;
|
|
52
52
|
export declare const DATA_VIEW_OPEN_IN_CENTER: ChromeWording;
|
|
53
53
|
export declare const DATA_VIEW_OPEN_IN_FULL: ChromeWording;
|
|
54
|
+
/** The view setting, its menu title and the full page's "This view" entry. */
|
|
55
|
+
export declare const DATA_VIEW_COLOR_RULES: ChromeWording;
|
|
56
|
+
export declare const DATA_VIEW_COLOR_RULES_ADD: ChromeWording;
|
|
57
|
+
/** The title of one rule's menu: its conditions, its colour, its place. */
|
|
58
|
+
export declare const DATA_VIEW_COLOR_RULE: ChromeWording;
|
|
59
|
+
export declare const DATA_VIEW_COLOR_RULE_ADD_CONDITION: ChromeWording;
|
|
60
|
+
/** A rule's name in the list when its conditions were all removed. */
|
|
61
|
+
export declare const DATA_VIEW_COLOR_RULE_NO_CONDITION: ChromeWording;
|
|
62
|
+
/** The order decides: the first rule that matches a row colours it. */
|
|
63
|
+
export declare const DATA_VIEW_COLOR_RULE_MOVE_UP: ChromeWording;
|
|
64
|
+
export declare const DATA_VIEW_COLOR_RULE_MOVE_DOWN: ChromeWording;
|
|
65
|
+
/**
|
|
66
|
+
* The title of that list: the view options' popover and the database's side
|
|
67
|
+
* panel (`PROPERTIES_PANEL_TITLE` there is this wording). One chrome word,
|
|
68
|
+
* one key; the key keeps the panel's spelling of 0.49, which hosts already
|
|
69
|
+
* translate.
|
|
70
|
+
*/
|
|
71
|
+
export declare const DATA_VIEW_PROPERTIES: ChromeWording;
|
|
72
|
+
/**
|
|
73
|
+
* The last row of the properties list: adds a property to the source, every
|
|
74
|
+
* view at once, through the type picker, then opens its menu.
|
|
75
|
+
*/
|
|
76
|
+
export declare const DATA_VIEW_NEW_PROPERTY: ChromeWording;
|
|
77
|
+
/**
|
|
78
|
+
* A property's menu entry (the table header's and the properties list's):
|
|
79
|
+
* hides the property in this view only. Its neighbours say the toolbar's
|
|
80
|
+
* "Duplicate" and "Delete".
|
|
81
|
+
*/
|
|
82
|
+
export declare const DATA_VIEW_PROPERTY_HIDE_IN_VIEW: ChromeWording;
|
|
83
|
+
/**
|
|
84
|
+
* The title of that type picker, and of the "Type" sub-menu of a
|
|
85
|
+
* property's menu.
|
|
86
|
+
*/
|
|
87
|
+
export declare const DATA_VIEW_PROPERTY_TYPE: ChromeWording;
|
|
54
88
|
/** Walked by `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. */
|
|
55
89
|
export declare const DATA_VIEW_WORDINGS: readonly ChromeWording[];
|
|
@@ -149,6 +149,75 @@ export const DATA_VIEW_OPEN_IN_FULL = [
|
|
|
149
149
|
'com.labre.data-view.open-in.full',
|
|
150
150
|
'Full page',
|
|
151
151
|
];
|
|
152
|
+
/* ── Conditional colours of a view (ADR 0036) ───────────────────────── */
|
|
153
|
+
/** The view setting, its menu title and the full page's "This view" entry. */
|
|
154
|
+
export const DATA_VIEW_COLOR_RULES = [
|
|
155
|
+
'com.labre.data-view.color-rules',
|
|
156
|
+
'Conditional colors',
|
|
157
|
+
];
|
|
158
|
+
export const DATA_VIEW_COLOR_RULES_ADD = [
|
|
159
|
+
'com.labre.data-view.color-rules.add',
|
|
160
|
+
'Add a color rule',
|
|
161
|
+
];
|
|
162
|
+
/** The title of one rule's menu: its conditions, its colour, its place. */
|
|
163
|
+
export const DATA_VIEW_COLOR_RULE = [
|
|
164
|
+
'com.labre.data-view.color-rules.rule',
|
|
165
|
+
'Color rule',
|
|
166
|
+
];
|
|
167
|
+
export const DATA_VIEW_COLOR_RULE_ADD_CONDITION = [
|
|
168
|
+
'com.labre.data-view.color-rules.add-condition',
|
|
169
|
+
'Add a condition',
|
|
170
|
+
];
|
|
171
|
+
/** A rule's name in the list when its conditions were all removed. */
|
|
172
|
+
export const DATA_VIEW_COLOR_RULE_NO_CONDITION = [
|
|
173
|
+
'com.labre.data-view.color-rules.no-condition',
|
|
174
|
+
'No condition',
|
|
175
|
+
];
|
|
176
|
+
/** The order decides: the first rule that matches a row colours it. */
|
|
177
|
+
export const DATA_VIEW_COLOR_RULE_MOVE_UP = [
|
|
178
|
+
'com.labre.data-view.color-rules.move-up',
|
|
179
|
+
'Move up',
|
|
180
|
+
];
|
|
181
|
+
export const DATA_VIEW_COLOR_RULE_MOVE_DOWN = [
|
|
182
|
+
'com.labre.data-view.color-rules.move-down',
|
|
183
|
+
'Move down',
|
|
184
|
+
];
|
|
185
|
+
/* ── A view's properties list (view options, side panel) ─────────────── */
|
|
186
|
+
/**
|
|
187
|
+
* The title of that list: the view options' popover and the database's side
|
|
188
|
+
* panel (`PROPERTIES_PANEL_TITLE` there is this wording). One chrome word,
|
|
189
|
+
* one key; the key keeps the panel's spelling of 0.49, which hosts already
|
|
190
|
+
* translate.
|
|
191
|
+
*/
|
|
192
|
+
export const DATA_VIEW_PROPERTIES = [
|
|
193
|
+
'com.labre.database.properties-panel.title',
|
|
194
|
+
'Properties',
|
|
195
|
+
];
|
|
196
|
+
/**
|
|
197
|
+
* The last row of the properties list: adds a property to the source, every
|
|
198
|
+
* view at once, through the type picker, then opens its menu.
|
|
199
|
+
*/
|
|
200
|
+
export const DATA_VIEW_NEW_PROPERTY = [
|
|
201
|
+
'com.labre.data-view.properties.new',
|
|
202
|
+
'New property',
|
|
203
|
+
];
|
|
204
|
+
/**
|
|
205
|
+
* A property's menu entry (the table header's and the properties list's):
|
|
206
|
+
* hides the property in this view only. Its neighbours say the toolbar's
|
|
207
|
+
* "Duplicate" and "Delete".
|
|
208
|
+
*/
|
|
209
|
+
export const DATA_VIEW_PROPERTY_HIDE_IN_VIEW = [
|
|
210
|
+
'com.labre.data-view.property.hide-in-view',
|
|
211
|
+
'Hide In View',
|
|
212
|
+
];
|
|
213
|
+
/**
|
|
214
|
+
* The title of that type picker, and of the "Type" sub-menu of a
|
|
215
|
+
* property's menu.
|
|
216
|
+
*/
|
|
217
|
+
export const DATA_VIEW_PROPERTY_TYPE = [
|
|
218
|
+
'com.labre.data-view.property.type',
|
|
219
|
+
'Property type',
|
|
220
|
+
];
|
|
152
221
|
/** Walked by `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. */
|
|
153
222
|
export const DATA_VIEW_WORDINGS = [
|
|
154
223
|
VIEW_SHOWN_AS_TABLE,
|
|
@@ -178,4 +247,15 @@ export const DATA_VIEW_WORDINGS = [
|
|
|
178
247
|
DATA_VIEW_OPEN_IN_SIDE,
|
|
179
248
|
DATA_VIEW_OPEN_IN_CENTER,
|
|
180
249
|
DATA_VIEW_OPEN_IN_FULL,
|
|
250
|
+
DATA_VIEW_COLOR_RULES,
|
|
251
|
+
DATA_VIEW_COLOR_RULES_ADD,
|
|
252
|
+
DATA_VIEW_COLOR_RULE,
|
|
253
|
+
DATA_VIEW_COLOR_RULE_ADD_CONDITION,
|
|
254
|
+
DATA_VIEW_COLOR_RULE_NO_CONDITION,
|
|
255
|
+
DATA_VIEW_COLOR_RULE_MOVE_UP,
|
|
256
|
+
DATA_VIEW_COLOR_RULE_MOVE_DOWN,
|
|
257
|
+
DATA_VIEW_PROPERTIES,
|
|
258
|
+
DATA_VIEW_NEW_PROPERTY,
|
|
259
|
+
DATA_VIEW_PROPERTY_TYPE,
|
|
260
|
+
DATA_VIEW_PROPERTY_HIDE_IN_VIEW,
|
|
181
261
|
];
|
|
@@ -2,8 +2,10 @@ import { PlusIcon } from '@blocksuite/icons/lit';
|
|
|
2
2
|
import { cssVarV2 } from '@toeverything/theme/v2';
|
|
3
3
|
import { css, html, nothing, unsafeCSS } from 'lit';
|
|
4
4
|
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
6
|
import { groupToggleStyles } from '../../core/group-by/group-visibility.js';
|
|
6
7
|
import { createUniComponentFromWebComponent } from '../../core/utils/uni-component/uni-component.js';
|
|
8
|
+
import { ROW_COLOR_PROPERTY, rowColorStyle, viewRowColor, } from '../../core/view/color-rules.js';
|
|
7
9
|
import { DATA_VIEW_NEW_PAGE } from '../../translations.js';
|
|
8
10
|
import { flatGroupStyles, flatOpenButtonStyles, FlatViewUI, FlatViewUILogic, } from '../flat/flat-view-ui.js';
|
|
9
11
|
/**
|
|
@@ -50,7 +52,10 @@ export class GalleryViewUI extends FlatViewUI {
|
|
|
50
52
|
box-sizing: border-box;
|
|
51
53
|
border: 1px solid ${unsafeCSS(cssVarV2.layer.insideBorder.border)};
|
|
52
54
|
border-radius: 8px;
|
|
53
|
-
background-color: var(
|
|
55
|
+
background-color: var(
|
|
56
|
+
${unsafeCSS(ROW_COLOR_PROPERTY)},
|
|
57
|
+
var(--affine-background-primary-color)
|
|
58
|
+
);
|
|
54
59
|
cursor: pointer;
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -141,6 +146,7 @@ export class GalleryViewUI extends FlatViewUI {
|
|
|
141
146
|
class="dv-gallery-card"
|
|
142
147
|
data-testid="dv-gallery-card"
|
|
143
148
|
data-row-id="${rowId}"
|
|
149
|
+
style=${styleMap(rowColorStyle(viewRowColor(view, rowId)))}
|
|
144
150
|
@click="${this.onRowClick}"
|
|
145
151
|
>
|
|
146
152
|
${title
|
|
@@ -43,6 +43,7 @@ import { property, state } from 'lit/decorators.js';
|
|
|
43
43
|
import { classMap } from 'lit/directives/class-map.js';
|
|
44
44
|
import { repeat } from 'lit/directives/repeat.js';
|
|
45
45
|
import { html } from 'lit/static-html.js';
|
|
46
|
+
import { paintRowColor, ROW_COLOR_PROPERTY, viewRowColor, } from '../../../core/view/color-rules.js';
|
|
46
47
|
import { popCardMenu } from './menu.js';
|
|
47
48
|
const styles = css `
|
|
48
49
|
mobile-kanban-card {
|
|
@@ -52,7 +53,10 @@ const styles = css `
|
|
|
52
53
|
border: 0.5px solid ${unsafeCSS(cssVarV2.layer.insideBorder.border)};
|
|
53
54
|
box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.05);
|
|
54
55
|
border-radius: 8px;
|
|
55
|
-
background-color: var(
|
|
56
|
+
background-color: var(
|
|
57
|
+
${unsafeCSS(ROW_COLOR_PROPERTY)},
|
|
58
|
+
var(--affine-background-kanban-card-color)
|
|
59
|
+
);
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
.mobile-card-header {
|
|
@@ -225,6 +229,7 @@ let MobileKanbanCard = (() => {
|
|
|
225
229
|
}
|
|
226
230
|
render() {
|
|
227
231
|
const columns = this.view.properties$.value.filter(v => !this.view.isInHeader(v.id));
|
|
232
|
+
paintRowColor(this, viewRowColor(this.view, this.cardId));
|
|
228
233
|
return html `
|
|
229
234
|
${this.renderHeader(columns)} ${this.renderBody(columns)}
|
|
230
235
|
${this.renderOps()}
|
|
@@ -44,6 +44,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
44
44
|
import { repeat } from 'lit/directives/repeat.js';
|
|
45
45
|
import { html } from 'lit/static-html.js';
|
|
46
46
|
import { isNewTabClick } from '../../../core/utils/new-tab-click.js';
|
|
47
|
+
import { paintRowColor, ROW_COLOR_PROPERTY, viewRowColor, } from '../../../core/view/color-rules.js';
|
|
47
48
|
import { openDetail, popCardMenu } from './menu.js';
|
|
48
49
|
const styles = css `
|
|
49
50
|
affine-data-view-kanban-card {
|
|
@@ -54,7 +55,10 @@ const styles = css `
|
|
|
54
55
|
box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.05);
|
|
55
56
|
border-radius: 8px;
|
|
56
57
|
transition: background-color 100ms ease-in-out;
|
|
57
|
-
background-color: var(
|
|
58
|
+
background-color: var(
|
|
59
|
+
${unsafeCSS(ROW_COLOR_PROPERTY)},
|
|
60
|
+
var(--affine-background-kanban-card-color)
|
|
61
|
+
);
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
affine-data-view-kanban-card:hover {
|
|
@@ -287,6 +291,7 @@ let KanbanCard = (() => {
|
|
|
287
291
|
this.style.border = this.isFocus$.value
|
|
288
292
|
? '1px solid var(--affine-primary-color)'
|
|
289
293
|
: '';
|
|
294
|
+
paintRowColor(this, viewRowColor(this.view, this.cardId));
|
|
290
295
|
return html `
|
|
291
296
|
${this.renderHeader(columns)} ${this.renderBody(columns)}
|
|
292
297
|
${this.renderOps()}
|
|
@@ -2,8 +2,10 @@ import { PlusIcon } from '@blocksuite/icons/lit';
|
|
|
2
2
|
import { cssVarV2 } from '@toeverything/theme/v2';
|
|
3
3
|
import { css, html, nothing, unsafeCSS } from 'lit';
|
|
4
4
|
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
6
|
import { groupToggleStyles } from '../../core/group-by/group-visibility.js';
|
|
6
7
|
import { createUniComponentFromWebComponent } from '../../core/utils/uni-component/uni-component.js';
|
|
8
|
+
import { ROW_COLOR_PROPERTY, rowColorStyle, viewRowColor, } from '../../core/view/color-rules.js';
|
|
7
9
|
import { DATA_VIEW_NEW_PAGE } from '../../translations.js';
|
|
8
10
|
import { flatGroupStyles, flatOpenButtonStyles, FlatViewUI, FlatViewUILogic, } from '../flat/flat-view-ui.js';
|
|
9
11
|
/**
|
|
@@ -45,6 +47,7 @@ export class ListViewUI extends FlatViewUI {
|
|
|
45
47
|
box-sizing: border-box;
|
|
46
48
|
border-bottom: 1px solid
|
|
47
49
|
${unsafeCSS(cssVarV2.layer.insideBorder.border)};
|
|
50
|
+
background-color: var(${unsafeCSS(ROW_COLOR_PROPERTY)}, transparent);
|
|
48
51
|
cursor: pointer;
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -158,6 +161,7 @@ export class ListViewUI extends FlatViewUI {
|
|
|
158
161
|
class="dv-list-row"
|
|
159
162
|
data-testid="dv-list-row"
|
|
160
163
|
data-row-id="${rowId}"
|
|
164
|
+
style=${styleMap(rowColorStyle(viewRowColor(view, rowId)))}
|
|
161
165
|
@click="${this.onRowClick}"
|
|
162
166
|
>
|
|
163
167
|
<div class="dv-list-row-title">
|
|
@@ -43,6 +43,7 @@ import { property } from 'lit/decorators.js';
|
|
|
43
43
|
import { repeat } from 'lit/directives/repeat.js';
|
|
44
44
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
45
45
|
import { html } from 'lit/static-html.js';
|
|
46
|
+
import { paintRowColor, ROW_COLOR_PROPERTY, viewRowColor, } from '../../../core/view/color-rules.js';
|
|
46
47
|
import { cellDivider } from '../styles.js';
|
|
47
48
|
import { popMobileRowMenu } from './menu.js';
|
|
48
49
|
let MobileTableRow = (() => {
|
|
@@ -77,6 +78,7 @@ let MobileTableRow = (() => {
|
|
|
77
78
|
border-bottom: 1px solid ${unsafeCSS(cssVarV2.layer.insideBorder.border)};
|
|
78
79
|
position: relative;
|
|
79
80
|
min-height: 44px;
|
|
81
|
+
background-color: var(${unsafeCSS(ROW_COLOR_PROPERTY)}, transparent);
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
.mobile-row-ops {
|
|
@@ -122,6 +124,7 @@ let MobileTableRow = (() => {
|
|
|
122
124
|
}
|
|
123
125
|
render() {
|
|
124
126
|
const view = this.view;
|
|
127
|
+
paintRowColor(this, viewRowColor(view, this.rowId));
|
|
125
128
|
return html `
|
|
126
129
|
${repeat(view.properties$.value, v => v.id, (column, i) => {
|
|
127
130
|
const clickDetail = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShadowlessElement } from '../../../../../std/index.js';
|
|
1
|
+
import { type BlockStdScope, ShadowlessElement } from '../../../../../std/index.js';
|
|
2
2
|
import type { TableProperty } from '../../table-view-manager.js';
|
|
3
3
|
import type { TableViewUILogic } from '../table-view-ui-logic.js';
|
|
4
4
|
declare const DatabaseHeaderColumn_base: typeof ShadowlessElement & import("../../../../../global/utils/types.js").Constructor<import("../../../../../global/lit/with-disposable.js").DisposableClass>;
|
|
@@ -22,6 +22,8 @@ export declare class DatabaseHeaderColumn extends DatabaseHeaderColumn_base {
|
|
|
22
22
|
connectedCallback(): void;
|
|
23
23
|
render(): import("lit-html").TemplateResult;
|
|
24
24
|
accessor column: TableProperty;
|
|
25
|
+
/** Absent outside an editor (a unit test): the menu reads English. */
|
|
26
|
+
accessor std: BlockStdScope;
|
|
25
27
|
accessor grabStatus: 'grabStart' | 'grabEnd' | 'grabbing';
|
|
26
28
|
accessor tableViewLogic: TableViewUILogic;
|
|
27
29
|
get tableViewManager(): import("../../table-view-manager.js").TableSingleView;
|