@webround/editor 0.0.0-stage → 0.3.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/blocks.d.ts +90 -0
- package/dist/blocks.js +119 -0
- package/dist/bridge.d.ts +96 -0
- package/dist/bridge.js +970 -0
- package/dist/check/aria.d.ts +19 -0
- package/dist/check/aria.js +106 -0
- package/dist/check/cli.d.ts +3 -0
- package/dist/check/cli.js +30 -0
- package/dist/check/css.d.ts +13 -0
- package/dist/check/css.js +63 -0
- package/dist/check/html.d.ts +8 -0
- package/dist/check/html.js +29 -0
- package/dist/check/index.d.ts +4 -0
- package/dist/check/index.js +5 -0
- package/dist/check/links.d.ts +7 -0
- package/dist/check/links.js +23 -0
- package/dist/check/orphans.d.ts +20 -0
- package/dist/check/orphans.js +57 -0
- package/dist/check/producer-code.d.ts +53 -0
- package/dist/check/producer-code.js +379 -0
- package/dist/check/producer-dom.d.ts +21 -0
- package/dist/check/producer-dom.js +52 -0
- package/dist/check/project.d.ts +20 -0
- package/dist/check/project.js +51 -0
- package/dist/check/rules.d.ts +7 -0
- package/dist/check/rules.js +517 -0
- package/dist/check/types.d.ts +160 -0
- package/dist/check/types.js +22 -0
- package/dist/components/WrAltcha.d.ts +5 -0
- package/dist/components/WrAltcha.js +8 -0
- package/dist/components/WrButton.d.ts +8 -0
- package/dist/components/WrButton.js +34 -0
- package/dist/components/WrForm.d.ts +6 -0
- package/dist/components/WrForm.js +29 -0
- package/dist/components/WrFormPrivacy.d.ts +4 -0
- package/dist/components/WrFormPrivacy.js +7 -0
- package/dist/components/WrFormSuccess.d.ts +4 -0
- package/dist/components/WrFormSuccess.js +12 -0
- package/dist/components/WrIframe.d.ts +12 -0
- package/dist/components/WrIframe.js +30 -0
- package/dist/components/WrImage.d.ts +9 -0
- package/dist/components/WrImage.js +28 -0
- package/dist/components/WrInput.d.ts +8 -0
- package/dist/components/WrInput.js +29 -0
- package/dist/components/WrLink.d.ts +10 -0
- package/dist/components/WrLink.js +38 -0
- package/dist/components/WrNav.d.ts +26 -0
- package/dist/components/WrNav.js +30 -0
- package/dist/components/WrSection.d.ts +11 -0
- package/dist/components/WrSection.js +5 -0
- package/dist/components/WrShared.d.ts +12 -0
- package/dist/components/WrShared.js +20 -0
- package/dist/components/WrText.d.ts +11 -0
- package/dist/components/WrText.js +41 -0
- package/dist/components/WrVideo.d.ts +9 -0
- package/dist/components/WrVideo.js +73 -0
- package/dist/components/text-editor/CodeThemeContext.d.ts +8 -0
- package/dist/components/text-editor/CodeThemeContext.js +10 -0
- package/dist/components/text-editor/ExampleTheme.d.ts +77 -0
- package/dist/components/text-editor/ExampleTheme.js +76 -0
- package/dist/components/text-editor/ToolbarContext.d.ts +17 -0
- package/dist/components/text-editor/ToolbarContext.js +32 -0
- package/dist/components/text-editor/WrTextEditor.d.ts +13 -0
- package/dist/components/text-editor/WrTextEditor.js +48 -0
- package/dist/components/text-editor/common/constants.d.ts +109 -0
- package/dist/components/text-editor/common/constants.js +58 -0
- package/dist/components/text-editor/common/surface.d.ts +3 -0
- package/dist/components/text-editor/common/surface.js +8 -0
- package/dist/components/text-editor/common/utils.d.ts +7 -0
- package/dist/components/text-editor/common/utils.js +78 -0
- package/dist/components/text-editor/hooks/useLexicalCommitOnBlur.d.ts +5 -0
- package/dist/components/text-editor/hooks/useLexicalCommitOnBlur.js +41 -0
- package/dist/components/text-editor/hooks/useLexicalMarkdown.d.ts +33 -0
- package/dist/components/text-editor/hooks/useLexicalMarkdown.js +284 -0
- package/dist/components/text-editor/nodes/CodeBlockNode.d.ts +23 -0
- package/dist/components/text-editor/nodes/CodeBlockNode.js +138 -0
- package/dist/components/text-editor/nodes/HorizontalRuleNode.d.ts +13 -0
- package/dist/components/text-editor/nodes/HorizontalRuleNode.js +22 -0
- package/dist/components/text-editor/plugins/CodeBlockPlugin.d.ts +2 -0
- package/dist/components/text-editor/plugins/CodeBlockPlugin.js +38 -0
- package/dist/components/text-editor/plugins/FontPlugin.d.ts +12 -0
- package/dist/components/text-editor/plugins/FontPlugin.js +114 -0
- package/dist/components/text-editor/plugins/FontSizePlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/FontSizePlugin.js +105 -0
- package/dist/components/text-editor/plugins/FontWeightPlugin.d.ts +6 -0
- package/dist/components/text-editor/plugins/FontWeightPlugin.js +103 -0
- package/dist/components/text-editor/plugins/HTMLTagPlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/HTMLTagPlugin.js +82 -0
- package/dist/components/text-editor/plugins/HorizontalRulePlugin.d.ts +2 -0
- package/dist/components/text-editor/plugins/HorizontalRulePlugin.js +35 -0
- package/dist/components/text-editor/plugins/LineSpacingPlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/LineSpacingPlugin.js +83 -0
- package/dist/components/text-editor/plugins/LinkPlugin.d.ts +8 -0
- package/dist/components/text-editor/plugins/LinkPlugin.js +183 -0
- package/dist/components/text-editor/plugins/ListToolbarPlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/ListToolbarPlugin.js +40 -0
- package/dist/components/text-editor/plugins/LoadContentPlugin.d.ts +4 -0
- package/dist/components/text-editor/plugins/LoadContentPlugin.js +63 -0
- package/dist/components/text-editor/plugins/MarkdownExportPlugin.d.ts +4 -0
- package/dist/components/text-editor/plugins/MarkdownExportPlugin.js +17 -0
- package/dist/components/text-editor/plugins/MarkdownPastePlugin.d.ts +2 -0
- package/dist/components/text-editor/plugins/MarkdownPastePlugin.js +45 -0
- package/dist/components/text-editor/plugins/SanitizePastePlugin.d.ts +3 -0
- package/dist/components/text-editor/plugins/SanitizePastePlugin.js +40 -0
- package/dist/components/text-editor/plugins/TextAlignPlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/TextAlignPlugin.js +65 -0
- package/dist/components/text-editor/plugins/TextColorPlugin.d.ts +7 -0
- package/dist/components/text-editor/plugins/TextColorPlugin.js +117 -0
- package/dist/components/text-editor/plugins/ToolbarPlugin.d.ts +10 -0
- package/dist/components/text-editor/plugins/ToolbarPlugin.js +73 -0
- package/dist/components/text-editor/theme-colors.d.ts +11 -0
- package/dist/components/text-editor/theme-colors.js +28 -0
- package/dist/context/WrAppContext.d.ts +35 -0
- package/dist/context/WrAppContext.js +113 -0
- package/dist/context/WrLayout.d.ts +15 -0
- package/dist/context/WrLayout.js +22 -0
- package/dist/context/WrPageContext.d.ts +28 -0
- package/dist/context/WrPageContext.js +282 -0
- package/dist/context/restoreValues.d.ts +2 -0
- package/dist/context/restoreValues.js +6 -0
- package/dist/contrast.d.ts +45 -0
- package/dist/contrast.js +122 -0
- package/dist/drop.d.ts +7 -0
- package/dist/drop.js +51 -0
- package/dist/gaps.d.ts +14 -0
- package/dist/gaps.js +50 -0
- package/dist/hooks/useWrMessage.d.ts +5 -0
- package/dist/hooks/useWrMessage.js +24 -0
- package/dist/hooks/useWrSave.d.ts +2 -0
- package/dist/hooks/useWrSave.js +11 -0
- package/dist/index.css +467 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +20 -0
- package/dist/interactive.d.ts +8 -0
- package/dist/interactive.js +13 -0
- package/dist/measure-rules.d.ts +34 -0
- package/dist/measure-rules.js +54 -0
- package/dist/measure.d.ts +11 -0
- package/dist/measure.js +139 -0
- package/dist/messages.d.ts +860 -0
- package/dist/messages.js +2 -0
- package/dist/nav.d.ts +5 -0
- package/dist/nav.js +10 -0
- package/dist/operations/animations-store.d.ts +6 -0
- package/dist/operations/animations-store.js +63 -0
- package/dist/operations/cli.d.ts +3 -0
- package/dist/operations/cli.js +52 -0
- package/dist/operations/comments-store.d.ts +17 -0
- package/dist/operations/comments-store.js +62 -0
- package/dist/operations/context.d.ts +12 -0
- package/dist/operations/context.js +35 -0
- package/dist/operations/define.d.ts +81 -0
- package/dist/operations/define.js +86 -0
- package/dist/operations/index.d.ts +6 -0
- package/dist/operations/index.js +6 -0
- package/dist/operations/ops/check.d.ts +5 -0
- package/dist/operations/ops/check.js +53 -0
- package/dist/operations/ops/comments.d.ts +6 -0
- package/dist/operations/ops/comments.js +133 -0
- package/dist/operations/ops/content.d.ts +16 -0
- package/dist/operations/ops/content.js +73 -0
- package/dist/operations/ops/json.d.ts +4 -0
- package/dist/operations/ops/json.js +27 -0
- package/dist/operations/ops/langs.d.ts +4 -0
- package/dist/operations/ops/langs.js +32 -0
- package/dist/operations/ops/nodes.d.ts +8 -0
- package/dist/operations/ops/nodes.js +270 -0
- package/dist/operations/ops/pages.d.ts +8 -0
- package/dist/operations/ops/pages.js +154 -0
- package/dist/operations/ops/project.d.ts +36 -0
- package/dist/operations/ops/project.js +97 -0
- package/dist/operations/ops/seo.d.ts +17 -0
- package/dist/operations/ops/seo.js +358 -0
- package/dist/operations/ops/style.d.ts +76 -0
- package/dist/operations/ops/style.js +268 -0
- package/dist/operations/ops/stylesets.d.ts +9 -0
- package/dist/operations/ops/stylesets.js +145 -0
- package/dist/operations/ops/theme.d.ts +6 -0
- package/dist/operations/ops/theme.js +304 -0
- package/dist/operations/registry.d.ts +8 -0
- package/dist/operations/registry.js +19 -0
- package/dist/operations/stylesets-store.d.ts +50 -0
- package/dist/operations/stylesets-store.js +216 -0
- package/dist/registry.d.ts +5 -0
- package/dist/registry.js +24 -0
- package/dist/save.d.ts +65 -0
- package/dist/save.js +86 -0
- package/dist/schema.d.ts +69 -0
- package/dist/schema.js +110 -0
- package/dist/scope.d.ts +41 -0
- package/dist/scope.js +44 -0
- package/dist/vite-plugins/ast.d.ts +3 -0
- package/dist/vite-plugins/ast.js +238 -0
- package/dist/vite-plugins/core-swap.d.ts +3 -0
- package/dist/vite-plugins/core-swap.js +57 -0
- package/dist/vite-plugins/create-page.d.ts +4 -0
- package/dist/vite-plugins/create-page.js +59 -0
- package/dist/vite-plugins/guard.d.ts +15 -0
- package/dist/vite-plugins/guard.js +35 -0
- package/dist/vite-plugins/head.d.ts +13 -0
- package/dist/vite-plugins/head.js +53 -0
- package/dist/vite-plugins/index.d.ts +7 -0
- package/dist/vite-plugins/index.js +7 -0
- package/dist/vite-plugins/jsx-tree.d.ts +118 -0
- package/dist/vite-plugins/jsx-tree.js +686 -0
- package/dist/vite-plugins/langs.d.ts +3 -0
- package/dist/vite-plugins/langs.js +44 -0
- package/dist/vite-plugins/operations.d.ts +10 -0
- package/dist/vite-plugins/operations.js +66 -0
- package/dist/vite-plugins/pages-api.d.ts +3 -0
- package/dist/vite-plugins/pages-api.js +112 -0
- package/dist/vite-plugins/pages.d.ts +3 -0
- package/dist/vite-plugins/pages.js +64 -0
- package/dist/vite-plugins/read.d.ts +3 -0
- package/dist/vite-plugins/read.js +45 -0
- package/dist/vite-plugins/seo-files.d.ts +8 -0
- package/dist/vite-plugins/seo-files.js +42 -0
- package/dist/vite-plugins/theme.d.ts +3 -0
- package/dist/vite-plugins/theme.js +207 -0
- package/dist/vite-plugins/update.d.ts +3 -0
- package/dist/vite-plugins/update.js +46 -0
- package/dist/vite-plugins/wr-plugins.d.ts +15 -0
- package/dist/vite-plugins/wr-plugins.js +34 -0
- package/dist/vite-plugins.d.ts +11 -0
- package/dist/vite-plugins.js +518 -0
- package/package.json +96 -5
- package/README.md +0 -3
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
import type { WrElementKind } from '@webround/core/kinds';
|
|
2
|
+
import type { WrNavConfig } from '@webround/core/types';
|
|
3
|
+
import type { WrLangConfig } from '@webround/core/routing';
|
|
4
|
+
import type { WrSeoPage, WrSeoSite } from '@webround/core/seo';
|
|
5
|
+
import type { WrBreakpointId, WrStateId, WrStyleCatalog, WrStyleChange, WrStyleDescription } from '@webround/core/style';
|
|
6
|
+
import type { Issue } from './check/types';
|
|
7
|
+
import { LangCode } from '@webround/core/lang-codes';
|
|
8
|
+
interface WrTargeted {
|
|
9
|
+
elementId: string;
|
|
10
|
+
}
|
|
11
|
+
interface WrCommonUpdate {
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface WrButtonUpdate extends WrTargeted, WrCommonUpdate {
|
|
16
|
+
content: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WrLinkUpdate extends WrTargeted, WrCommonUpdate {
|
|
19
|
+
content?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface WrVideoUpdate extends WrTargeted, WrCommonUpdate {
|
|
22
|
+
}
|
|
23
|
+
export interface WrIframeUpdate extends WrTargeted, WrCommonUpdate {
|
|
24
|
+
}
|
|
25
|
+
export interface WrInputUpdate extends WrTargeted, WrCommonUpdate {
|
|
26
|
+
label?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
}
|
|
29
|
+
/** A form's messages are `msg-<code>` fields (see `wrFormMessagesOf`), each the text for the language shown. */
|
|
30
|
+
export interface WrFormUpdate extends WrTargeted, WrCommonUpdate {
|
|
31
|
+
[message: `msg-${string}`]: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface WrNavUpdate extends WrTargeted, WrCommonUpdate, Pick<WrNavConfig, 'items'> {
|
|
34
|
+
}
|
|
35
|
+
export interface WrImageUpdate extends WrTargeted, WrCommonUpdate {
|
|
36
|
+
alt?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface WrUploadResponse extends WrTargeted {
|
|
39
|
+
src?: string;
|
|
40
|
+
error?: string;
|
|
41
|
+
requestId?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WrUploadRequest extends WrTargeted {
|
|
44
|
+
requestId: string;
|
|
45
|
+
filename: string;
|
|
46
|
+
mimeType: string;
|
|
47
|
+
data: ArrayBuffer;
|
|
48
|
+
}
|
|
49
|
+
export type { WrElementKind };
|
|
50
|
+
export interface WrElementInfo {
|
|
51
|
+
type: WrElementKind;
|
|
52
|
+
id: string | null;
|
|
53
|
+
/** L'id dell'elemento Wr* che lo contiene (null in cima): permette all'editor di mostrare il percorso e salire al genitore. */
|
|
54
|
+
parentId?: string | null;
|
|
55
|
+
/** Nome del JSON dell'ambito quando NON è la pagina (`_shared/header`, `_shared/footer`): l'elemento è condiviso tra pagine. */
|
|
56
|
+
scope?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface WrRect {
|
|
59
|
+
top: number;
|
|
60
|
+
left: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
}
|
|
64
|
+
export interface WrScanMessage {
|
|
65
|
+
elements: WrElementInfo[];
|
|
66
|
+
}
|
|
67
|
+
export interface WrSelectMessage {
|
|
68
|
+
element: WrElementInfo | null;
|
|
69
|
+
rect: WrRect | null;
|
|
70
|
+
parent?: WrParentSize | null;
|
|
71
|
+
fit?: WrBoxFit | null;
|
|
72
|
+
space?: WrBoxSpace | null;
|
|
73
|
+
gaps?: WrBoxGaps | null;
|
|
74
|
+
floor?: WrBoxFloor | null;
|
|
75
|
+
value: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface WrNavigateMessage {
|
|
78
|
+
pathname: string;
|
|
79
|
+
}
|
|
80
|
+
export interface WrHighlightMessage {
|
|
81
|
+
element: WrElementInfo;
|
|
82
|
+
}
|
|
83
|
+
export interface WrHoverMessage {
|
|
84
|
+
element: WrElementInfo;
|
|
85
|
+
rect: WrRect;
|
|
86
|
+
}
|
|
87
|
+
export interface WrPageCreateRequest {
|
|
88
|
+
pageName: string;
|
|
89
|
+
component: string;
|
|
90
|
+
lazy?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface WrPageCreateResponse {
|
|
93
|
+
pageName: string;
|
|
94
|
+
error?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface WrPageListEntry {
|
|
97
|
+
pageName: string;
|
|
98
|
+
component: string;
|
|
99
|
+
lazy?: boolean;
|
|
100
|
+
/** Header y footer del sito si vedono di default: `false` = questa pagina non li mostra. */
|
|
101
|
+
header?: boolean;
|
|
102
|
+
footer?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export interface WrPageDeleteRequest {
|
|
105
|
+
pageName: string;
|
|
106
|
+
}
|
|
107
|
+
export interface WrPageDeleteResponse {
|
|
108
|
+
pageName: string;
|
|
109
|
+
error?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface WrPageUpdateRequest {
|
|
112
|
+
pageName: string;
|
|
113
|
+
newPageName?: string;
|
|
114
|
+
newComponent?: string;
|
|
115
|
+
lazy?: boolean;
|
|
116
|
+
header?: boolean;
|
|
117
|
+
footer?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface WrPageUpdateResponse {
|
|
120
|
+
pageName: string;
|
|
121
|
+
error?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface WrSeoGetRequest {
|
|
124
|
+
pageName?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface WrSeoGetResponse {
|
|
127
|
+
site: WrSeoSite;
|
|
128
|
+
/** Il sito conosce il suo indirizzo pubblico (senza, canonical, hreflang e sitemap non si possono scrivere). */
|
|
129
|
+
siteUrlKnown: boolean;
|
|
130
|
+
/** I dati della pagina chiesta, come sono salvati (titolo e descrizione per lingua). */
|
|
131
|
+
page?: {
|
|
132
|
+
pageName: string;
|
|
133
|
+
seo: WrSeoPage;
|
|
134
|
+
};
|
|
135
|
+
error?: string;
|
|
136
|
+
}
|
|
137
|
+
/** Una pagina: un testo vuoto toglie il valore. Testi e immagini (titolo, descrizione, immagine, testi social) si scrivono in una lingua (`default` se omessa). */
|
|
138
|
+
export interface WrSeoSetRequest {
|
|
139
|
+
pageName: string;
|
|
140
|
+
lang?: string;
|
|
141
|
+
title?: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
image?: string;
|
|
144
|
+
noindex?: boolean;
|
|
145
|
+
canonical?: string;
|
|
146
|
+
robots?: string;
|
|
147
|
+
ogTitle?: string;
|
|
148
|
+
ogDescription?: string;
|
|
149
|
+
ogImage?: string;
|
|
150
|
+
ogType?: string;
|
|
151
|
+
twitterCard?: string;
|
|
152
|
+
twitterSite?: string;
|
|
153
|
+
twitterCreator?: string;
|
|
154
|
+
/** Dati strutturati (JSON-LD) come testo JSON, nella lingua `lang`: una lista di oggetti con "@type"; vuoto li toglie. */
|
|
155
|
+
jsonLd?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface WrSeoSiteSetRequest {
|
|
158
|
+
siteUrl?: string;
|
|
159
|
+
siteName?: string;
|
|
160
|
+
titleTemplate?: string;
|
|
161
|
+
favicon?: string;
|
|
162
|
+
image?: string;
|
|
163
|
+
/** Il codice (o il tag intero) di verifica di Google Search Console. */
|
|
164
|
+
searchConsole?: string;
|
|
165
|
+
twitterSite?: string;
|
|
166
|
+
twitterCreator?: string;
|
|
167
|
+
/** Per `lang` (default se omessa): nome, modello del titolo, immagine e dati strutturati. */
|
|
168
|
+
lang?: string;
|
|
169
|
+
jsonLd?: string;
|
|
170
|
+
}
|
|
171
|
+
/** Un titolo e una descrizione proposti per una pagina, a partire da ciò che dice (niente è scritto). */
|
|
172
|
+
export interface WrSeoSuggestRequest {
|
|
173
|
+
pageName: string;
|
|
174
|
+
lang?: string;
|
|
175
|
+
}
|
|
176
|
+
export interface WrSeoSuggestResponse {
|
|
177
|
+
pageName: string;
|
|
178
|
+
lang: string;
|
|
179
|
+
title?: string;
|
|
180
|
+
description?: string;
|
|
181
|
+
error?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface WrSeoUpdateResponse {
|
|
184
|
+
error?: string;
|
|
185
|
+
code?: string;
|
|
186
|
+
}
|
|
187
|
+
export interface WrComment {
|
|
188
|
+
id: string;
|
|
189
|
+
/** Una pagina (`home`) o un componente condiviso (`_shared/header`): dov'è l'elemento. */
|
|
190
|
+
scope: string;
|
|
191
|
+
/** L'elemento di cui parla; assente se parla della pagina (o del componente condiviso) intera. */
|
|
192
|
+
elementId?: string;
|
|
193
|
+
text: string;
|
|
194
|
+
/** `user`: una persona, dall'editor. `ai`: un agente, dai tool. */
|
|
195
|
+
author: {
|
|
196
|
+
name: string;
|
|
197
|
+
kind: 'user' | 'ai';
|
|
198
|
+
};
|
|
199
|
+
/** Data ISO. */
|
|
200
|
+
createdAt: string;
|
|
201
|
+
status: 'open' | 'resolved';
|
|
202
|
+
resolvedAt?: string;
|
|
203
|
+
/** Cos'era l'elemento quando è stato commentato (tipo e inizio del testo). */
|
|
204
|
+
context?: {
|
|
205
|
+
kind: string;
|
|
206
|
+
excerpt?: string;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/** Un commento come lo elenca `comment-list`: `orphan` se l'elemento non è più nel codice. */
|
|
210
|
+
export type WrListedComment = WrComment & {
|
|
211
|
+
orphan: boolean;
|
|
212
|
+
};
|
|
213
|
+
export interface WrCommentsResponse {
|
|
214
|
+
comments: WrListedComment[];
|
|
215
|
+
open: number;
|
|
216
|
+
error?: string;
|
|
217
|
+
}
|
|
218
|
+
export interface WrCommentAddRequest {
|
|
219
|
+
/** La pagina, o il componente condiviso (`_shared/header`), dell'elemento. */
|
|
220
|
+
page: string;
|
|
221
|
+
elementId?: string;
|
|
222
|
+
text: string;
|
|
223
|
+
/** Chi scrive (il nome della persona: l'editor lo conosce, l'anteprima no). */
|
|
224
|
+
authorName: string;
|
|
225
|
+
}
|
|
226
|
+
export interface WrCommentResolveRequest {
|
|
227
|
+
id: string;
|
|
228
|
+
resolved: boolean;
|
|
229
|
+
}
|
|
230
|
+
export interface WrCommentDeleteRequest {
|
|
231
|
+
id: string;
|
|
232
|
+
}
|
|
233
|
+
/** Gli elementi su cui l'anteprima deve dire dov'è il puntino di un commento aperto (ambito + id). */
|
|
234
|
+
export interface WrCommentMarksRequest {
|
|
235
|
+
marks: {
|
|
236
|
+
scope: string;
|
|
237
|
+
id: string;
|
|
238
|
+
}[];
|
|
239
|
+
}
|
|
240
|
+
export interface WrCommentRectsResponse {
|
|
241
|
+
rects: {
|
|
242
|
+
scope: string;
|
|
243
|
+
id: string;
|
|
244
|
+
rect: WrRect;
|
|
245
|
+
}[];
|
|
246
|
+
}
|
|
247
|
+
export interface WrCheckResponse {
|
|
248
|
+
issues: Issue[];
|
|
249
|
+
/** Le chiavi dei problemi che la persona ha silenziato (valgono anche per ciò che l'anteprima misura da sé). */
|
|
250
|
+
muted: string[];
|
|
251
|
+
error?: string;
|
|
252
|
+
}
|
|
253
|
+
/** Silenzia un problema (o lo riporta): resta nel progetto, contato a parte. */
|
|
254
|
+
export interface WrIssueMuteRequest {
|
|
255
|
+
key: string;
|
|
256
|
+
muted: boolean;
|
|
257
|
+
}
|
|
258
|
+
export interface WrIssueMuteResponse {
|
|
259
|
+
error?: string;
|
|
260
|
+
}
|
|
261
|
+
/** Toglie dal JSON i valori degli elementi che non sono più nel codice (di una pagina, o di tutte): le chiavi orfane. */
|
|
262
|
+
export interface WrJsonPruneRequest {
|
|
263
|
+
page?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface WrJsonPruneResponse {
|
|
266
|
+
removed: {
|
|
267
|
+
scope: string;
|
|
268
|
+
keys: string[];
|
|
269
|
+
}[];
|
|
270
|
+
error?: string;
|
|
271
|
+
code?: string;
|
|
272
|
+
}
|
|
273
|
+
/** Ciò che la pagina disegnata dice della sua accessibilità (contrasto, bersagli, testo piccolo, spaziatura, riflusso), misurato com'è ora (tema, breakpoint e modalità scura compresi): l'anteprima lo manda da sola quando cambia. */
|
|
274
|
+
export interface WrMeasureReport {
|
|
275
|
+
pathname: string;
|
|
276
|
+
findings: {
|
|
277
|
+
rule: string;
|
|
278
|
+
elementId: string;
|
|
279
|
+
message: string;
|
|
280
|
+
}[];
|
|
281
|
+
}
|
|
282
|
+
export interface WrLangsUpdateRequest {
|
|
283
|
+
langs: WrLangConfig;
|
|
284
|
+
}
|
|
285
|
+
export interface WrLangsUpdateResponse {
|
|
286
|
+
error?: string;
|
|
287
|
+
}
|
|
288
|
+
export interface WrLangEntry {
|
|
289
|
+
code: LangCode;
|
|
290
|
+
isDefault: boolean;
|
|
291
|
+
}
|
|
292
|
+
export interface WrLangCreateRequest {
|
|
293
|
+
code: LangCode;
|
|
294
|
+
}
|
|
295
|
+
export interface WrLangCreateResponse {
|
|
296
|
+
code: LangCode;
|
|
297
|
+
error?: string;
|
|
298
|
+
}
|
|
299
|
+
export interface WrLangDeleteRequest {
|
|
300
|
+
code: LangCode;
|
|
301
|
+
}
|
|
302
|
+
export interface WrLangDeleteResponse {
|
|
303
|
+
code: LangCode;
|
|
304
|
+
error?: string;
|
|
305
|
+
}
|
|
306
|
+
export interface WrLangUpdateRequest {
|
|
307
|
+
code: LangCode;
|
|
308
|
+
setDefault?: boolean;
|
|
309
|
+
}
|
|
310
|
+
export interface WrLangUpdateResponse {
|
|
311
|
+
code: LangCode;
|
|
312
|
+
error?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface WrNodeGetRequest {
|
|
315
|
+
elementId: string;
|
|
316
|
+
}
|
|
317
|
+
export interface WrNodeGetResponse {
|
|
318
|
+
elementId: string;
|
|
319
|
+
fields: string[];
|
|
320
|
+
values: Record<string, string | boolean | number>;
|
|
321
|
+
}
|
|
322
|
+
export interface WrNodeSetRequest {
|
|
323
|
+
elementId: string;
|
|
324
|
+
key: string;
|
|
325
|
+
value: string | boolean | number;
|
|
326
|
+
prevValue?: string | boolean | number;
|
|
327
|
+
}
|
|
328
|
+
export interface WrNodeSetResponse {
|
|
329
|
+
elementId: string;
|
|
330
|
+
key: string;
|
|
331
|
+
ok: boolean;
|
|
332
|
+
error?: string;
|
|
333
|
+
}
|
|
334
|
+
export interface WrStyleCatalogResponse {
|
|
335
|
+
catalog: WrStyleCatalog | null;
|
|
336
|
+
error?: string;
|
|
337
|
+
}
|
|
338
|
+
/** Lo stile di un elemento per ogni stato (hover, focus, premuto) per cui ha qualcosa. */
|
|
339
|
+
export type WrStyleStates = Partial<Record<WrStateId, WrStyleDescription[]>>;
|
|
340
|
+
export interface WrStyleGetRequest {
|
|
341
|
+
elementId: string;
|
|
342
|
+
}
|
|
343
|
+
export interface WrStyleGetResponse {
|
|
344
|
+
elementId: string;
|
|
345
|
+
/** false: le classi le decide il codice (un'espressione), non si toccano da qui; `reason` dice perché. */
|
|
346
|
+
editable: boolean;
|
|
347
|
+
reason?: string;
|
|
348
|
+
className: string | null;
|
|
349
|
+
styles: WrStyleDescription[];
|
|
350
|
+
/** Le classi che il pannello non gestisce (hover:, dark:, quelle del progetto). */
|
|
351
|
+
unmanaged: string[];
|
|
352
|
+
/** Gli stili condivisi che l'elemento usa (la loro classe sta nel suo className). */
|
|
353
|
+
sets?: {
|
|
354
|
+
name: string;
|
|
355
|
+
class: string;
|
|
356
|
+
}[];
|
|
357
|
+
/** Cosa dice per ogni stato (hover, focus, premuto) per cui dice qualcosa. */
|
|
358
|
+
states?: WrStyleStates;
|
|
359
|
+
error?: string;
|
|
360
|
+
}
|
|
361
|
+
/** `everywhere`: la modifica vale per tutti gli schermi ("All screens"): fatta dove si guarda, poi le proprietà toccate diventano una lista sola e gli override degli altri schermi spariscono. */
|
|
362
|
+
export interface WrStyleSetRequest {
|
|
363
|
+
elementId: string;
|
|
364
|
+
changes: WrStyleChange[];
|
|
365
|
+
everywhere?: boolean;
|
|
366
|
+
}
|
|
367
|
+
/** The classes of one screen put on another, or (`to: 'all'`) one clean list for every screen: a single change, a single step of undo. Answered with `wr:style:set:response`. */
|
|
368
|
+
export interface WrStyleCopyRequest {
|
|
369
|
+
elementId: string;
|
|
370
|
+
from: WrBreakpointId;
|
|
371
|
+
to: WrBreakpointId | 'all';
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* An element shown at a size that is not written yet (the drag of a handle, a number being dragged): `styles` are CSS properties of `WR_STYLE_PREVIEW_CSS`, nothing else is applied.
|
|
375
|
+
* the CSS is applied to the element for the moment and nothing is saved, nothing enters the history.
|
|
376
|
+
* `styles: null` ends it: the element goes back to what the code says, at once, or (`settle`) when its classes change or a moment has passed, so a size that was just written does
|
|
377
|
+
* not flash back to the old one before the page redraws.
|
|
378
|
+
*/
|
|
379
|
+
export interface WrStylePreviewRequest {
|
|
380
|
+
elementId: string;
|
|
381
|
+
styles: Record<string, string> | null;
|
|
382
|
+
settle?: boolean;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* How the children of the selected box fill the room the box leaves them (its content box: without its padding): what an alignment has to move in. A box whose children fill
|
|
386
|
+
* all of it has nothing to move, and the person is told why (a padding that squeezes the content, a child as wide as the box).
|
|
387
|
+
*/
|
|
388
|
+
export interface WrBoxFit {
|
|
389
|
+
contentWidth: number;
|
|
390
|
+
contentHeight: number;
|
|
391
|
+
kidsWidth: number;
|
|
392
|
+
kidsHeight: number;
|
|
393
|
+
padX: [number, number];
|
|
394
|
+
padY: [number, number];
|
|
395
|
+
}
|
|
396
|
+
/** Where an element dragged over the page would land (see `drop.ts`): next to `overId` (before or after it) or inside it, and the line that shows it, in the page's coordinates. */
|
|
397
|
+
export interface WrDropTarget {
|
|
398
|
+
overId: string;
|
|
399
|
+
zone: 'before' | 'inside' | 'after';
|
|
400
|
+
line: WrRect;
|
|
401
|
+
}
|
|
402
|
+
/** The smallest the element can be where it is, in pixels: what its width or height comes to when it is asked to be nothing (a `min-w-60`, its content, its padding hold it up). A size under it changes nothing. */
|
|
403
|
+
export interface WrBoxFloor {
|
|
404
|
+
width: number;
|
|
405
|
+
height: number;
|
|
406
|
+
}
|
|
407
|
+
/** The room an element has inside (padding) and around (margin), each as top, right, bottom, left, in px, as the page shows it now: where the handles that drag them start from. */
|
|
408
|
+
export interface WrBoxSpace {
|
|
409
|
+
padding: [number, number, number, number];
|
|
410
|
+
margin: [number, number, number, number];
|
|
411
|
+
}
|
|
412
|
+
/** One band of the gap between the children of a flex or grid box, where the page has it now (in the page's own coordinates, like a `WrRect`): `column` between children side by side, `row` between children one above the other. */
|
|
413
|
+
export interface WrGapBand extends WrRect {
|
|
414
|
+
axis: 'column' | 'row';
|
|
415
|
+
}
|
|
416
|
+
/** The gap between the children of a flex or grid box, as the page shows it now: what each is in px, and the bands it takes (none: there is no gap to show). */
|
|
417
|
+
export interface WrBoxGaps {
|
|
418
|
+
column: number;
|
|
419
|
+
row: number;
|
|
420
|
+
bands: WrGapBand[];
|
|
421
|
+
}
|
|
422
|
+
/** The room an element has around it: what its size can be a part of (a width is `3/4` of the parent's), and the size of 1rem. */
|
|
423
|
+
export interface WrParentSize {
|
|
424
|
+
width: number;
|
|
425
|
+
height: number;
|
|
426
|
+
rem: number;
|
|
427
|
+
}
|
|
428
|
+
export interface WrStyleSetResponse {
|
|
429
|
+
elementId: string;
|
|
430
|
+
ok: boolean;
|
|
431
|
+
error?: string;
|
|
432
|
+
code?: string;
|
|
433
|
+
/** false: il valore era già quello, niente è stato scritto. */
|
|
434
|
+
changed?: boolean;
|
|
435
|
+
className?: string;
|
|
436
|
+
styles?: WrStyleDescription[];
|
|
437
|
+
unmanaged?: string[];
|
|
438
|
+
/** Gli stili condivisi che l'elemento usa ora. */
|
|
439
|
+
sets?: {
|
|
440
|
+
name: string;
|
|
441
|
+
class: string;
|
|
442
|
+
}[];
|
|
443
|
+
states?: WrStyleStates;
|
|
444
|
+
}
|
|
445
|
+
export interface WrStyleSetInfo {
|
|
446
|
+
name: string;
|
|
447
|
+
/** La classe che un elemento usa (`s-card`). */
|
|
448
|
+
class: string;
|
|
449
|
+
/** Le classi Tailwind che contiene, come un solo testo. */
|
|
450
|
+
classes: string;
|
|
451
|
+
/** Cosa significano, a parole. */
|
|
452
|
+
styles: string[];
|
|
453
|
+
usedBy: number;
|
|
454
|
+
places: {
|
|
455
|
+
file: string;
|
|
456
|
+
line: number;
|
|
457
|
+
id: string | null;
|
|
458
|
+
}[];
|
|
459
|
+
}
|
|
460
|
+
export interface WrStyleSetListResponse {
|
|
461
|
+
sets: WrStyleSetInfo[];
|
|
462
|
+
error?: string;
|
|
463
|
+
}
|
|
464
|
+
/** Crea uno stile; con `elementId` le classi dell'elemento ci vanno dentro e l'elemento lo usa. */
|
|
465
|
+
export interface WrStyleSetCreateRequest {
|
|
466
|
+
name: string;
|
|
467
|
+
elementId?: string;
|
|
468
|
+
}
|
|
469
|
+
export interface WrStyleSetApplyRequest {
|
|
470
|
+
elementId: string;
|
|
471
|
+
name: string;
|
|
472
|
+
}
|
|
473
|
+
/** Toglie lo stile condiviso da un elemento, tenendone l'aspetto. */
|
|
474
|
+
export interface WrStyleSetDetachRequest {
|
|
475
|
+
elementId: string;
|
|
476
|
+
}
|
|
477
|
+
export interface WrStyleSetNameRequest {
|
|
478
|
+
name: string;
|
|
479
|
+
}
|
|
480
|
+
/** Da un nome a un altro: la regola in theme.css e la classe in ogni elemento che la usa. */
|
|
481
|
+
export interface WrStyleSetRenameRequest {
|
|
482
|
+
name: string;
|
|
483
|
+
to: string;
|
|
484
|
+
}
|
|
485
|
+
/** Lo stile di uno stile condiviso: le stesse richieste di un elemento, con il nome al posto dell'id. */
|
|
486
|
+
export interface WrStyleSetStyleRequest {
|
|
487
|
+
name: string;
|
|
488
|
+
}
|
|
489
|
+
export interface WrStyleSetEditRequest {
|
|
490
|
+
name: string;
|
|
491
|
+
changes: WrStyleChange[];
|
|
492
|
+
everywhere?: boolean;
|
|
493
|
+
}
|
|
494
|
+
export interface WrStyleSetCopyRequest {
|
|
495
|
+
name: string;
|
|
496
|
+
from: WrBreakpointId;
|
|
497
|
+
to: WrBreakpointId | 'all';
|
|
498
|
+
}
|
|
499
|
+
export interface WrStyleSetStyleResponse {
|
|
500
|
+
name: string;
|
|
501
|
+
ok: boolean;
|
|
502
|
+
error?: string;
|
|
503
|
+
code?: string;
|
|
504
|
+
className?: string;
|
|
505
|
+
styles?: WrStyleDescription[];
|
|
506
|
+
unmanaged?: string[];
|
|
507
|
+
states?: WrStyleStates;
|
|
508
|
+
/** Quanti elementi cambiano insieme allo stile. */
|
|
509
|
+
usedBy?: number;
|
|
510
|
+
}
|
|
511
|
+
export type WrStyleSetAction = 'create' | 'apply' | 'detach' | 'detach-all' | 'rename' | 'delete';
|
|
512
|
+
export interface WrStyleSetResult {
|
|
513
|
+
action: WrStyleSetAction;
|
|
514
|
+
name?: string;
|
|
515
|
+
ok: boolean;
|
|
516
|
+
error?: string;
|
|
517
|
+
code?: string;
|
|
518
|
+
}
|
|
519
|
+
export interface WrNodeDeleteRequest {
|
|
520
|
+
elementId: string;
|
|
521
|
+
}
|
|
522
|
+
export interface WrNodeDeleteResponse {
|
|
523
|
+
elementId: string;
|
|
524
|
+
removedIds: string[];
|
|
525
|
+
ok: boolean;
|
|
526
|
+
/** Falso se l'elemento non ha un posto da cui reinserirlo (dentro il codice che genera, es. una render prop): cancellato, ma niente annulla. */
|
|
527
|
+
undoable?: boolean;
|
|
528
|
+
error?: string;
|
|
529
|
+
}
|
|
530
|
+
export interface WrNodeMoveRequest {
|
|
531
|
+
elementId: string;
|
|
532
|
+
anchor: WrAnchor;
|
|
533
|
+
anchorMode: WrAnchorMode;
|
|
534
|
+
}
|
|
535
|
+
export interface WrNodeMoveResponse {
|
|
536
|
+
elementId: string;
|
|
537
|
+
ok: boolean;
|
|
538
|
+
/** Perché no: `invalid-move`, `not-a-container`, `generated-by-code`, `component-root`, `anchor-not-found`… */
|
|
539
|
+
code?: string;
|
|
540
|
+
error?: string;
|
|
541
|
+
}
|
|
542
|
+
/** Un tasto di spostamento premuto dentro la pagina (Alt + frecce) con un elemento selezionato: lo applica l'editor. */
|
|
543
|
+
export type WrMoveDirection = 'up' | 'down' | 'out' | 'in';
|
|
544
|
+
export type WrAnchorMode = 'before' | 'after' | 'first-child' | 'last-child';
|
|
545
|
+
export type WrAnchor = {
|
|
546
|
+
id: string;
|
|
547
|
+
} | {
|
|
548
|
+
root: true;
|
|
549
|
+
};
|
|
550
|
+
export interface WrNodeInsertRequest {
|
|
551
|
+
jsx: string;
|
|
552
|
+
anchor: WrAnchor;
|
|
553
|
+
anchorMode: WrAnchorMode;
|
|
554
|
+
jsonSeed?: Record<string, unknown>;
|
|
555
|
+
/** Predefinito true: un id già preso diventa `hero-2` invece di far fallire l'inserimento. */
|
|
556
|
+
uniqueIds?: boolean;
|
|
557
|
+
}
|
|
558
|
+
/** Duplicate an element: a copy of it, with everything it contains and its values, right after it. Answered like an insert (`wr:node:insert:response`): the copy is what the editor selects. */
|
|
559
|
+
export interface WrNodeDuplicateRequest {
|
|
560
|
+
elementId: string;
|
|
561
|
+
}
|
|
562
|
+
export interface WrNodeInsertResponse {
|
|
563
|
+
ok: boolean;
|
|
564
|
+
/** Gli id di tutti i componenti inseriti, nell'ordine del documento, come sono finiti nel file. */
|
|
565
|
+
ids: string[];
|
|
566
|
+
/** Gli id degli elementi di primo livello che sono componenti Wr*. */
|
|
567
|
+
rootIds: string[];
|
|
568
|
+
/** Vero se ogni elemento di primo livello è un componente Wr*: solo allora un annulla per id può rimuoverlo. */
|
|
569
|
+
undoable: boolean;
|
|
570
|
+
/** `idRichiesto → idFinale` per gli id che il plugin ha cambiato. */
|
|
571
|
+
idMap: Record<string, string>;
|
|
572
|
+
/** Perché non è andata: `invalid-jsx`, `unknown-component`, `id-exists`, `generated-by-code`, `anchor-not-found`… */
|
|
573
|
+
code?: string;
|
|
574
|
+
error?: string;
|
|
575
|
+
}
|
|
576
|
+
export interface WrThemeFontFace {
|
|
577
|
+
src: string;
|
|
578
|
+
weight?: string;
|
|
579
|
+
style?: string;
|
|
580
|
+
stretch?: string;
|
|
581
|
+
}
|
|
582
|
+
export type WrThemeItem =
|
|
583
|
+
/** `dark`: the value in the `.dark` block, when the site has a dark theme and the property is in it. */
|
|
584
|
+
{
|
|
585
|
+
kind: 'property';
|
|
586
|
+
key: string;
|
|
587
|
+
value: string;
|
|
588
|
+
dark?: string;
|
|
589
|
+
} | {
|
|
590
|
+
kind: 'google-font';
|
|
591
|
+
key: string;
|
|
592
|
+
weights?: string;
|
|
593
|
+
} | {
|
|
594
|
+
kind: 'custom-font';
|
|
595
|
+
key: string;
|
|
596
|
+
faces: WrThemeFontFace[];
|
|
597
|
+
};
|
|
598
|
+
export interface WrThemeGetRequest {
|
|
599
|
+
}
|
|
600
|
+
export interface WrThemeGetResponse {
|
|
601
|
+
items: WrThemeItem[];
|
|
602
|
+
/** The site has a dark theme: a `.dark` block in `theme.css`. */
|
|
603
|
+
dark?: boolean;
|
|
604
|
+
error?: string;
|
|
605
|
+
}
|
|
606
|
+
export interface WrThemeSetItemRequest {
|
|
607
|
+
item: WrThemeItem;
|
|
608
|
+
}
|
|
609
|
+
export interface WrThemeSetItemResponse {
|
|
610
|
+
kind: WrThemeItem['kind'];
|
|
611
|
+
key: string;
|
|
612
|
+
ok: boolean;
|
|
613
|
+
error?: string;
|
|
614
|
+
}
|
|
615
|
+
/** Turn the dark theme on (a `.dark` block that starts from the light values) or off (the block is taken away). */
|
|
616
|
+
export interface WrThemeDarkRequest {
|
|
617
|
+
enabled: boolean;
|
|
618
|
+
}
|
|
619
|
+
export interface WrThemeDarkResponse {
|
|
620
|
+
enabled: boolean;
|
|
621
|
+
ok: boolean;
|
|
622
|
+
error?: string;
|
|
623
|
+
}
|
|
624
|
+
export interface WrThemeRemoveItemRequest {
|
|
625
|
+
kind: WrThemeItem['kind'];
|
|
626
|
+
key: string;
|
|
627
|
+
}
|
|
628
|
+
export interface WrThemeRemoveItemResponse {
|
|
629
|
+
kind: WrThemeItem['kind'];
|
|
630
|
+
key: string;
|
|
631
|
+
ok: boolean;
|
|
632
|
+
error?: string;
|
|
633
|
+
}
|
|
634
|
+
export type WrEditorInbound = ({
|
|
635
|
+
type: 'wr:button:update';
|
|
636
|
+
} & WrButtonUpdate) | ({
|
|
637
|
+
type: 'wr:link:update';
|
|
638
|
+
} & WrLinkUpdate) | ({
|
|
639
|
+
type: 'wr:nav:update';
|
|
640
|
+
} & WrNavUpdate) | ({
|
|
641
|
+
type: 'wr:input:update';
|
|
642
|
+
} & WrInputUpdate) | ({
|
|
643
|
+
type: 'wr:form:update';
|
|
644
|
+
} & WrFormUpdate) | ({
|
|
645
|
+
type: 'wr:image:update';
|
|
646
|
+
} & WrImageUpdate) | ({
|
|
647
|
+
type: 'wr:video:update';
|
|
648
|
+
} & WrVideoUpdate) | ({
|
|
649
|
+
type: 'wr:iframe:update';
|
|
650
|
+
} & WrIframeUpdate) | ({
|
|
651
|
+
type: 'wr:upload:response';
|
|
652
|
+
} & WrUploadResponse) | ({
|
|
653
|
+
type: 'wr:highlight';
|
|
654
|
+
} & WrHighlightMessage) | {
|
|
655
|
+
type: 'wr:highlight:clear';
|
|
656
|
+
}
|
|
657
|
+
/** Browsing the page as a visitor would: nothing is selected or hovered by clicking and pointing (what the page does with its clicks is its own). */
|
|
658
|
+
| {
|
|
659
|
+
type: 'wr:browse';
|
|
660
|
+
on: boolean;
|
|
661
|
+
} | {
|
|
662
|
+
type: 'wr:undo';
|
|
663
|
+
} | {
|
|
664
|
+
type: 'wr:redo';
|
|
665
|
+
} | ({
|
|
666
|
+
type: 'wr:navigate:push';
|
|
667
|
+
} & WrNavigateMessage) | ({
|
|
668
|
+
type: 'wr:page:create';
|
|
669
|
+
} & WrPageCreateRequest) | ({
|
|
670
|
+
type: 'wr:page:list';
|
|
671
|
+
}) | ({
|
|
672
|
+
type: 'wr:page:delete';
|
|
673
|
+
} & WrPageDeleteRequest) | ({
|
|
674
|
+
type: 'wr:page:update';
|
|
675
|
+
} & WrPageUpdateRequest) | ({
|
|
676
|
+
type: 'wr:seo:get';
|
|
677
|
+
} & WrSeoGetRequest) | ({
|
|
678
|
+
type: 'wr:seo:set';
|
|
679
|
+
} & WrSeoSetRequest) | ({
|
|
680
|
+
type: 'wr:seo:site:set';
|
|
681
|
+
} & WrSeoSiteSetRequest) | ({
|
|
682
|
+
type: 'wr:seo:suggest';
|
|
683
|
+
} & WrSeoSuggestRequest) | {
|
|
684
|
+
type: 'wr:check:run';
|
|
685
|
+
} | ({
|
|
686
|
+
type: 'wr:json:prune';
|
|
687
|
+
} & WrJsonPruneRequest) | ({
|
|
688
|
+
type: 'wr:issue:mute';
|
|
689
|
+
} & WrIssueMuteRequest) | {
|
|
690
|
+
type: 'wr:comments:get';
|
|
691
|
+
} | ({
|
|
692
|
+
type: 'wr:comment:add';
|
|
693
|
+
} & WrCommentAddRequest) | ({
|
|
694
|
+
type: 'wr:comment:resolve';
|
|
695
|
+
} & WrCommentResolveRequest) | ({
|
|
696
|
+
type: 'wr:comment:delete';
|
|
697
|
+
} & WrCommentDeleteRequest) | ({
|
|
698
|
+
type: 'wr:comments:marks';
|
|
699
|
+
} & WrCommentMarksRequest) | ({
|
|
700
|
+
type: 'wr:langs:list';
|
|
701
|
+
}) | ({
|
|
702
|
+
type: 'wr:langs:update';
|
|
703
|
+
} & WrLangsUpdateRequest) | ({
|
|
704
|
+
type: 'wr:node:get';
|
|
705
|
+
} & WrNodeGetRequest) | ({
|
|
706
|
+
type: 'wr:node:set';
|
|
707
|
+
} & WrNodeSetRequest) | ({
|
|
708
|
+
type: 'wr:node:delete';
|
|
709
|
+
} & WrNodeDeleteRequest) | ({
|
|
710
|
+
type: 'wr:node:insert';
|
|
711
|
+
} & WrNodeInsertRequest) | ({
|
|
712
|
+
type: 'wr:node:duplicate';
|
|
713
|
+
} & WrNodeDuplicateRequest) | ({
|
|
714
|
+
type: 'wr:node:move';
|
|
715
|
+
} & WrNodeMoveRequest) | {
|
|
716
|
+
type: 'wr:style:catalog';
|
|
717
|
+
} | ({
|
|
718
|
+
type: 'wr:style:get';
|
|
719
|
+
} & WrStyleGetRequest) | ({
|
|
720
|
+
type: 'wr:style:set';
|
|
721
|
+
} & WrStyleSetRequest) | ({
|
|
722
|
+
type: 'wr:style:copy';
|
|
723
|
+
} & WrStyleCopyRequest) | ({
|
|
724
|
+
type: 'wr:style:preview';
|
|
725
|
+
} & WrStylePreviewRequest) | {
|
|
726
|
+
type: 'wr:styleset:list';
|
|
727
|
+
} | ({
|
|
728
|
+
type: 'wr:styleset:create';
|
|
729
|
+
} & WrStyleSetCreateRequest) | ({
|
|
730
|
+
type: 'wr:styleset:apply';
|
|
731
|
+
} & WrStyleSetApplyRequest) | ({
|
|
732
|
+
type: 'wr:styleset:detach';
|
|
733
|
+
} & WrStyleSetDetachRequest) | ({
|
|
734
|
+
type: 'wr:styleset:detach-all';
|
|
735
|
+
} & WrStyleSetNameRequest) | ({
|
|
736
|
+
type: 'wr:styleset:rename';
|
|
737
|
+
} & WrStyleSetRenameRequest) | ({
|
|
738
|
+
type: 'wr:styleset:delete';
|
|
739
|
+
} & WrStyleSetNameRequest) | ({
|
|
740
|
+
type: 'wr:styleset:get';
|
|
741
|
+
} & WrStyleSetStyleRequest) | ({
|
|
742
|
+
type: 'wr:styleset:set';
|
|
743
|
+
} & WrStyleSetEditRequest) | ({
|
|
744
|
+
type: 'wr:styleset:copy';
|
|
745
|
+
} & WrStyleSetCopyRequest)
|
|
746
|
+
/** Where would `elementId` (none: a new block) land if it were let go at (x, y) of the page? `scroll`: the pointer is at the top (-1) or bottom (1) edge, so the page scrolls that way. Asked again while the drag goes on. */
|
|
747
|
+
| {
|
|
748
|
+
type: 'wr:drop:probe';
|
|
749
|
+
elementId?: string;
|
|
750
|
+
x: number;
|
|
751
|
+
y: number;
|
|
752
|
+
scroll?: -1 | 0 | 1;
|
|
753
|
+
} | ({
|
|
754
|
+
type: 'wr:theme:get';
|
|
755
|
+
} & WrThemeGetRequest) | ({
|
|
756
|
+
type: 'wr:theme:set-item';
|
|
757
|
+
} & WrThemeSetItemRequest) | ({
|
|
758
|
+
type: 'wr:theme:remove-item';
|
|
759
|
+
} & WrThemeRemoveItemRequest) | ({
|
|
760
|
+
type: 'wr:theme:dark';
|
|
761
|
+
} & WrThemeDarkRequest);
|
|
762
|
+
export type WrEditorOutbound = ({
|
|
763
|
+
type: 'wr:upload:request';
|
|
764
|
+
} & WrUploadRequest) | ({
|
|
765
|
+
type: 'wr:upload:open';
|
|
766
|
+
} & WrTargeted) | ({
|
|
767
|
+
type: 'wr:scan';
|
|
768
|
+
} & WrScanMessage) | ({
|
|
769
|
+
type: 'wr:select';
|
|
770
|
+
} & WrSelectMessage) | ({
|
|
771
|
+
type: 'wr:navigate';
|
|
772
|
+
} & WrNavigateMessage) | ({
|
|
773
|
+
type: 'wr:page:created';
|
|
774
|
+
} & WrPageCreateResponse) | ({
|
|
775
|
+
type: 'wr:page:list:response';
|
|
776
|
+
pages: WrPageListEntry[];
|
|
777
|
+
}) | ({
|
|
778
|
+
type: 'wr:page:deleted';
|
|
779
|
+
} & WrPageDeleteResponse) | ({
|
|
780
|
+
type: 'wr:page:updated';
|
|
781
|
+
} & WrPageUpdateResponse) | ({
|
|
782
|
+
type: 'wr:hover';
|
|
783
|
+
} & WrHoverMessage) | {
|
|
784
|
+
type: 'wr:hover:clear';
|
|
785
|
+
}
|
|
786
|
+
/** Where the selected and the hovered element are now (null: there is none): said again whenever either moves or changes shape (scroll, resize, a change of style, a layout that shifts). */
|
|
787
|
+
| {
|
|
788
|
+
type: 'wr:rects';
|
|
789
|
+
selected: WrRect | null;
|
|
790
|
+
hovered: WrRect | null;
|
|
791
|
+
parent?: WrParentSize | null;
|
|
792
|
+
fit?: WrBoxFit | null;
|
|
793
|
+
floor?: WrBoxFloor | null;
|
|
794
|
+
space?: WrBoxSpace | null;
|
|
795
|
+
gaps?: WrBoxGaps | null;
|
|
796
|
+
} | {
|
|
797
|
+
type: 'wr:history:state';
|
|
798
|
+
canUndo: boolean;
|
|
799
|
+
canRedo: boolean;
|
|
800
|
+
} | {
|
|
801
|
+
type: 'wr:drop:target';
|
|
802
|
+
target: WrDropTarget | null;
|
|
803
|
+
} | ({
|
|
804
|
+
type: 'wr:seo:get:response';
|
|
805
|
+
} & WrSeoGetResponse) | ({
|
|
806
|
+
type: 'wr:seo:updated';
|
|
807
|
+
} & WrSeoUpdateResponse) | ({
|
|
808
|
+
type: 'wr:seo:suggest:response';
|
|
809
|
+
} & WrSeoSuggestResponse) | ({
|
|
810
|
+
type: 'wr:check:response';
|
|
811
|
+
} & WrCheckResponse) | ({
|
|
812
|
+
type: 'wr:json:pruned';
|
|
813
|
+
} & WrJsonPruneResponse) | ({
|
|
814
|
+
type: 'wr:issue:muted';
|
|
815
|
+
} & WrIssueMuteResponse) | ({
|
|
816
|
+
type: 'wr:comments:response';
|
|
817
|
+
} & WrCommentsResponse) | ({
|
|
818
|
+
type: 'wr:comments:rects';
|
|
819
|
+
} & WrCommentRectsResponse) | ({
|
|
820
|
+
type: 'wr:measure:report';
|
|
821
|
+
} & WrMeasureReport) | ({
|
|
822
|
+
type: 'wr:langs:list:response';
|
|
823
|
+
langs: WrLangConfig | null;
|
|
824
|
+
}) | ({
|
|
825
|
+
type: 'wr:langs:updated';
|
|
826
|
+
} & WrLangsUpdateResponse) | ({
|
|
827
|
+
type: 'wr:node:get:response';
|
|
828
|
+
} & WrNodeGetResponse) | ({
|
|
829
|
+
type: 'wr:node:set:response';
|
|
830
|
+
} & WrNodeSetResponse) | ({
|
|
831
|
+
type: 'wr:node:delete:response';
|
|
832
|
+
} & WrNodeDeleteResponse) | ({
|
|
833
|
+
type: 'wr:node:insert:response';
|
|
834
|
+
} & WrNodeInsertResponse) | ({
|
|
835
|
+
type: 'wr:node:move:response';
|
|
836
|
+
} & WrNodeMoveResponse) | ({
|
|
837
|
+
type: 'wr:style:catalog:response';
|
|
838
|
+
} & WrStyleCatalogResponse) | ({
|
|
839
|
+
type: 'wr:style:get:response';
|
|
840
|
+
} & WrStyleGetResponse) | ({
|
|
841
|
+
type: 'wr:style:set:response';
|
|
842
|
+
} & WrStyleSetResponse) | ({
|
|
843
|
+
type: 'wr:styleset:list:response';
|
|
844
|
+
} & WrStyleSetListResponse) | ({
|
|
845
|
+
type: 'wr:styleset:style:response';
|
|
846
|
+
} & WrStyleSetStyleResponse) | ({
|
|
847
|
+
type: 'wr:styleset:result';
|
|
848
|
+
} & WrStyleSetResult) | {
|
|
849
|
+
type: 'wr:move:key';
|
|
850
|
+
direction: WrMoveDirection;
|
|
851
|
+
} | ({
|
|
852
|
+
type: 'wr:theme:get:response';
|
|
853
|
+
} & WrThemeGetResponse) | ({
|
|
854
|
+
type: 'wr:theme:set-item:response';
|
|
855
|
+
} & WrThemeSetItemResponse) | ({
|
|
856
|
+
type: 'wr:theme:remove-item:response';
|
|
857
|
+
} & WrThemeRemoveItemResponse) | ({
|
|
858
|
+
type: 'wr:theme:dark:response';
|
|
859
|
+
} & WrThemeDarkResponse);
|
|
860
|
+
//# sourceMappingURL=messages.d.ts.map
|