@formicoidea/labre-core 0.56.0 → 0.58.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/architecture/code.c4 +13 -13
- package/architecture/domain.c4 +2504 -0
- package/architecture/likec4.config.json +3 -3
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +3 -1
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +15 -2
- package/dist/_pkgs/affine-fragment-frame-panel/body/frame-panel-body.js +4 -4
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title.d.ts +19 -6
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title.js +136 -52
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card.js +22 -4
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-preview.d.ts +12 -0
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-preview.js +81 -5
- package/dist/_pkgs/affine-fragment-frame-panel/card/preview-size.d.ts +9 -0
- package/dist/_pkgs/affine-fragment-frame-panel/card/preview-size.js +20 -0
- package/dist/_pkgs/affine-fragment-frame-panel/effects.js +0 -2
- package/dist/_pkgs/affine-fragment-frame-panel/frame-panel.js +2 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
- package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/host-panels.d.ts +9 -4
- package/dist/host-panels.js +19 -4
- package/package.json +1 -1
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.d.ts +0 -25
- package/dist/_pkgs/affine-fragment-frame-panel/card/frame-card-title-editor.js +0 -181
package/dist/host-panels.js
CHANGED
|
@@ -57,8 +57,18 @@ import { frameworkDescriptor } from './frameworks.js';
|
|
|
57
57
|
*/
|
|
58
58
|
export { getCommandIcon, getCommandsForSurface, getRegisteredCommands, runCommand, runCommandAsync, } from './_pkgs/std/index.js';
|
|
59
59
|
export { armArtefact } from './_pkgs/affine-widget-edgeless-toolbar/index.js';
|
|
60
|
-
export { selectionPaneTree, } from './_pkgs/affine-block-surface/index.js';
|
|
60
|
+
export { selectionPaneCommands, selectionPaneTree, } from './_pkgs/affine-block-surface/index.js';
|
|
61
61
|
export { frameCommands, reorderFramesParams, } from './_pkgs/affine-block-frame/index.js';
|
|
62
|
+
/*
|
|
63
|
+
* The side panels' one drag-to-reorder gesture (ADR 0034 §6), the one the
|
|
64
|
+
* library's frame panel and selection pane run: a host's slide list hands it
|
|
65
|
+
* its rows, its drop rule and its write (`canvas.frame.reorder`), and gets the
|
|
66
|
+
* threshold, the read-only refusal, the cursor mask, Escape and
|
|
67
|
+
* `pointercancel` as cancels and the swallowed click. A factory, not a class:
|
|
68
|
+
* the controller it returns is the host's, disposed with its panel. DOM types
|
|
69
|
+
* only, so a React panel types it without Lit (recette 1, P0-1.3).
|
|
70
|
+
*/
|
|
71
|
+
export { createPanelReorderDrag, panelReorderGap, } from './_pkgs/affine-shared/utils/index.js';
|
|
62
72
|
/*
|
|
63
73
|
* The properties panel (ADR 0035 §9b and §11). The editor asks the host to
|
|
64
74
|
* show it through `PropertiesPanelExtension` and feeds the title band through
|
|
@@ -124,9 +134,12 @@ export function fitToModel(std, id, padding = [0, 0, 0, 0]) {
|
|
|
124
134
|
* thumbnail renders one through `ExportManager` instead.
|
|
125
135
|
*
|
|
126
136
|
* Returns the element ready to be appended; `width` and `height` are the
|
|
127
|
-
* preview box in CSS pixels
|
|
128
|
-
*
|
|
129
|
-
*
|
|
137
|
+
* preview box in CSS pixels, `fillScreen` covers the box instead of
|
|
138
|
+
* containing the frame. `fluid` (0.57) replaces the fixed box: the preview
|
|
139
|
+
* takes its container's width and the frame's proportions, never taller than
|
|
140
|
+
* wide, and follows the container as it is resized — the library's own panel
|
|
141
|
+
* cards draw it that way (recette 1, P0-1.2); `width` and `height` are then
|
|
142
|
+
* ignored. One mini editor per preview: mount only the cards on screen. The element is defined by the
|
|
130
143
|
* frame panel's view extension, so it renders nothing in an assembly where the
|
|
131
144
|
* `frame` flag is off (ADR 0009) — the same assembly where there is no frame
|
|
132
145
|
* to preview.
|
|
@@ -141,6 +154,8 @@ export function createFramePreview(std, frame, options = {}) {
|
|
|
141
154
|
preview.surfaceHeight = options.height;
|
|
142
155
|
if (options.fillScreen !== undefined)
|
|
143
156
|
preview.fillScreen = options.fillScreen;
|
|
157
|
+
if (options.fluid !== undefined)
|
|
158
|
+
preview.fluid = options.fluid;
|
|
144
159
|
return preview;
|
|
145
160
|
}
|
|
146
161
|
/**
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { FrameBlockModel } from '../../affine-model/index.js';
|
|
2
|
-
import type { RichText } from '../../affine-rich-text/index.js';
|
|
3
|
-
import { ShadowlessElement } from '../../std/index.js';
|
|
4
|
-
export declare const AFFINE_FRAME_TITLE_EDITOR = "affine-frame-card-title-editor";
|
|
5
|
-
declare const FrameCardTitleEditor_base: typeof ShadowlessElement & import("../../global/utils/types.js").Constructor<import("../../global/lit/with-disposable.js").DisposableClass>;
|
|
6
|
-
export declare class FrameCardTitleEditor extends FrameCardTitleEditor_base {
|
|
7
|
-
static styles: import("lit").CSSResult;
|
|
8
|
-
private readonly _isComposing;
|
|
9
|
-
get inlineEditor(): import("../../affine-shared/types/index.js").AffineInlineEditor | null;
|
|
10
|
-
private _unmount;
|
|
11
|
-
firstUpdated(): void;
|
|
12
|
-
getUpdateComplete(): Promise<boolean>;
|
|
13
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
-
accessor frameModel: FrameBlockModel;
|
|
15
|
-
accessor left: number;
|
|
16
|
-
accessor maxWidth: number;
|
|
17
|
-
accessor richText: RichText;
|
|
18
|
-
accessor titleContentElement: HTMLElement;
|
|
19
|
-
}
|
|
20
|
-
declare global {
|
|
21
|
-
interface HTMLElementTagNameMap {
|
|
22
|
-
[AFFINE_FRAME_TITLE_EDITOR]: FrameCardTitleEditor;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
import { WithDisposable } from '../../global/lit/index.js';
|
|
36
|
-
import { ShadowlessElement } from '../../std/index.js';
|
|
37
|
-
import { css, html } from 'lit';
|
|
38
|
-
import { property, query } from 'lit/decorators.js';
|
|
39
|
-
import { styleMap } from 'lit/directives/style-map.js';
|
|
40
|
-
const styles = css `
|
|
41
|
-
frame-card-title-editor rich-text .nowrap-lines::-webkit-scrollbar {
|
|
42
|
-
display: none;
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
45
|
-
export const AFFINE_FRAME_TITLE_EDITOR = 'affine-frame-card-title-editor';
|
|
46
|
-
let FrameCardTitleEditor = (() => {
|
|
47
|
-
let _classSuper = WithDisposable(ShadowlessElement);
|
|
48
|
-
let _frameModel_decorators;
|
|
49
|
-
let _frameModel_initializers = [];
|
|
50
|
-
let _frameModel_extraInitializers = [];
|
|
51
|
-
let _left_decorators;
|
|
52
|
-
let _left_initializers = [];
|
|
53
|
-
let _left_extraInitializers = [];
|
|
54
|
-
let _maxWidth_decorators;
|
|
55
|
-
let _maxWidth_initializers = [];
|
|
56
|
-
let _maxWidth_extraInitializers = [];
|
|
57
|
-
let _richText_decorators;
|
|
58
|
-
let _richText_initializers = [];
|
|
59
|
-
let _richText_extraInitializers = [];
|
|
60
|
-
let _titleContentElement_decorators;
|
|
61
|
-
let _titleContentElement_initializers = [];
|
|
62
|
-
let _titleContentElement_extraInitializers = [];
|
|
63
|
-
return class FrameCardTitleEditor extends _classSuper {
|
|
64
|
-
static {
|
|
65
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
66
|
-
_frameModel_decorators = [property({ attribute: false })];
|
|
67
|
-
_left_decorators = [property({ attribute: false })];
|
|
68
|
-
_maxWidth_decorators = [property({ attribute: false })];
|
|
69
|
-
_richText_decorators = [query('rich-text')];
|
|
70
|
-
_titleContentElement_decorators = [property({ attribute: false })];
|
|
71
|
-
__esDecorate(this, null, _frameModel_decorators, { kind: "accessor", name: "frameModel", static: false, private: false, access: { has: obj => "frameModel" in obj, get: obj => obj.frameModel, set: (obj, value) => { obj.frameModel = value; } }, metadata: _metadata }, _frameModel_initializers, _frameModel_extraInitializers);
|
|
72
|
-
__esDecorate(this, null, _left_decorators, { kind: "accessor", name: "left", static: false, private: false, access: { has: obj => "left" in obj, get: obj => obj.left, set: (obj, value) => { obj.left = value; } }, metadata: _metadata }, _left_initializers, _left_extraInitializers);
|
|
73
|
-
__esDecorate(this, null, _maxWidth_decorators, { kind: "accessor", name: "maxWidth", static: false, private: false, access: { has: obj => "maxWidth" in obj, get: obj => obj.maxWidth, set: (obj, value) => { obj.maxWidth = value; } }, metadata: _metadata }, _maxWidth_initializers, _maxWidth_extraInitializers);
|
|
74
|
-
__esDecorate(this, null, _richText_decorators, { kind: "accessor", name: "richText", static: false, private: false, access: { has: obj => "richText" in obj, get: obj => obj.richText, set: (obj, value) => { obj.richText = value; } }, metadata: _metadata }, _richText_initializers, _richText_extraInitializers);
|
|
75
|
-
__esDecorate(this, null, _titleContentElement_decorators, { kind: "accessor", name: "titleContentElement", static: false, private: false, access: { has: obj => "titleContentElement" in obj, get: obj => obj.titleContentElement, set: (obj, value) => { obj.titleContentElement = value; } }, metadata: _metadata }, _titleContentElement_initializers, _titleContentElement_extraInitializers);
|
|
76
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
77
|
-
}
|
|
78
|
-
static { this.styles = styles; }
|
|
79
|
-
get inlineEditor() {
|
|
80
|
-
return this.richText.inlineEditor;
|
|
81
|
-
}
|
|
82
|
-
_unmount() {
|
|
83
|
-
// dispose in advance to avoid execute `this.remove()` twice
|
|
84
|
-
this.disposables.dispose();
|
|
85
|
-
this.remove();
|
|
86
|
-
this.titleContentElement.style.display = 'block';
|
|
87
|
-
}
|
|
88
|
-
firstUpdated() {
|
|
89
|
-
this.updateComplete
|
|
90
|
-
.then(() => {
|
|
91
|
-
if (this.inlineEditor === null)
|
|
92
|
-
return;
|
|
93
|
-
this.titleContentElement.style.display = 'none';
|
|
94
|
-
this.inlineEditor.selectAll();
|
|
95
|
-
this.inlineEditor.slots.renderComplete.subscribe(() => {
|
|
96
|
-
this.requestUpdate();
|
|
97
|
-
});
|
|
98
|
-
const inlineEditorContainer = this.inlineEditor.rootElement;
|
|
99
|
-
if (!inlineEditorContainer)
|
|
100
|
-
return;
|
|
101
|
-
this.disposables.addFromEvent(inlineEditorContainer, 'blur', () => {
|
|
102
|
-
this._unmount();
|
|
103
|
-
});
|
|
104
|
-
this.disposables.addFromEvent(inlineEditorContainer, 'click', e => {
|
|
105
|
-
e.stopPropagation();
|
|
106
|
-
});
|
|
107
|
-
this.disposables.addFromEvent(inlineEditorContainer, 'dblclick', e => {
|
|
108
|
-
e.stopPropagation();
|
|
109
|
-
});
|
|
110
|
-
this.disposables.addFromEvent(inlineEditorContainer, 'keydown', e => {
|
|
111
|
-
e.stopPropagation();
|
|
112
|
-
if (e.key === 'Enter' && !this._isComposing) {
|
|
113
|
-
this._unmount();
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
})
|
|
117
|
-
.catch(console.error);
|
|
118
|
-
}
|
|
119
|
-
async getUpdateComplete() {
|
|
120
|
-
const result = await super.getUpdateComplete();
|
|
121
|
-
await this.richText?.updateComplete;
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
render() {
|
|
125
|
-
const inlineEditorStyle = styleMap({
|
|
126
|
-
transformOrigin: 'top left',
|
|
127
|
-
borderRadius: '4px',
|
|
128
|
-
maxWidth: `${this.maxWidth}px`,
|
|
129
|
-
maxHeight: '20px',
|
|
130
|
-
width: 'fit-content',
|
|
131
|
-
height: '20px',
|
|
132
|
-
fontSize: 'var(--affine-font-sm)',
|
|
133
|
-
lineHeight: '20px',
|
|
134
|
-
position: 'absolute',
|
|
135
|
-
left: `${this.left}px`,
|
|
136
|
-
top: '0px',
|
|
137
|
-
minWidth: '8px',
|
|
138
|
-
background: 'var(--affine-background-primary-color)',
|
|
139
|
-
border: '1px solid var(--affine-primary-color)',
|
|
140
|
-
color: 'var(--affine-text-primary-color)',
|
|
141
|
-
boxShadow: '0px 0px 0px 2px color-mix(in srgb, var(--affine-primary-color) 30%, transparent)',
|
|
142
|
-
zIndex: '1',
|
|
143
|
-
display: 'block',
|
|
144
|
-
});
|
|
145
|
-
return html `<rich-text
|
|
146
|
-
.yText=${this.frameModel.props.title.yText}
|
|
147
|
-
.enableFormat=${false}
|
|
148
|
-
.enableAutoScrollHorizontally=${true}
|
|
149
|
-
.enableUndoRedo=${false}
|
|
150
|
-
.wrapText=${false}
|
|
151
|
-
style=${inlineEditorStyle}
|
|
152
|
-
></rich-text>`;
|
|
153
|
-
}
|
|
154
|
-
#frameModel_accessor_storage;
|
|
155
|
-
get frameModel() { return this.#frameModel_accessor_storage; }
|
|
156
|
-
set frameModel(value) { this.#frameModel_accessor_storage = value; }
|
|
157
|
-
#left_accessor_storage;
|
|
158
|
-
get left() { return this.#left_accessor_storage; }
|
|
159
|
-
set left(value) { this.#left_accessor_storage = value; }
|
|
160
|
-
#maxWidth_accessor_storage;
|
|
161
|
-
get maxWidth() { return this.#maxWidth_accessor_storage; }
|
|
162
|
-
set maxWidth(value) { this.#maxWidth_accessor_storage = value; }
|
|
163
|
-
#richText_accessor_storage;
|
|
164
|
-
get richText() { return this.#richText_accessor_storage; }
|
|
165
|
-
set richText(value) { this.#richText_accessor_storage = value; }
|
|
166
|
-
#titleContentElement_accessor_storage;
|
|
167
|
-
get titleContentElement() { return this.#titleContentElement_accessor_storage; }
|
|
168
|
-
set titleContentElement(value) { this.#titleContentElement_accessor_storage = value; }
|
|
169
|
-
constructor() {
|
|
170
|
-
super(...arguments);
|
|
171
|
-
this._isComposing = false;
|
|
172
|
-
this.#frameModel_accessor_storage = __runInitializers(this, _frameModel_initializers, void 0);
|
|
173
|
-
this.#left_accessor_storage = (__runInitializers(this, _frameModel_extraInitializers), __runInitializers(this, _left_initializers, void 0));
|
|
174
|
-
this.#maxWidth_accessor_storage = (__runInitializers(this, _left_extraInitializers), __runInitializers(this, _maxWidth_initializers, void 0));
|
|
175
|
-
this.#richText_accessor_storage = (__runInitializers(this, _maxWidth_extraInitializers), __runInitializers(this, _richText_initializers, void 0));
|
|
176
|
-
this.#titleContentElement_accessor_storage = (__runInitializers(this, _richText_extraInitializers), __runInitializers(this, _titleContentElement_initializers, void 0));
|
|
177
|
-
__runInitializers(this, _titleContentElement_extraInitializers);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
})();
|
|
181
|
-
export { FrameCardTitleEditor };
|