@lvl99dotcom/paintcanvas 0.3.0 → 0.4.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.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/lib/brushes/StrokeEngine/index.d.ts +2 -2
  3. package/dist/lib/brushes/StrokeEngine/index.js +26 -28
  4. package/dist/lib/classes/BrushSettings/index.d.ts +24 -0
  5. package/dist/lib/classes/BrushSettings/index.js +35 -1
  6. package/dist/lib/classes/KeyboardShortcuts/index.d.ts +17 -6
  7. package/dist/lib/classes/KeyboardShortcuts/index.js +81 -18
  8. package/dist/lib/classes/PaintCanvas/index.d.ts +77 -27
  9. package/dist/lib/classes/PaintCanvas/index.js +143 -42
  10. package/dist/lib/classes/PaintCanvas/tool.d.ts +15 -0
  11. package/dist/lib/classes/PaintCanvas/tool.js +18 -0
  12. package/dist/lib/classes/Palette/index.d.ts +58 -0
  13. package/dist/lib/classes/Palette/index.js +92 -0
  14. package/dist/lib/classes/SettingsAutosave/index.d.ts +52 -0
  15. package/dist/lib/classes/SettingsAutosave/index.js +96 -0
  16. package/dist/lib/classes/ShortcutSettings/index.d.ts +63 -0
  17. package/dist/lib/classes/ShortcutSettings/index.js +110 -0
  18. package/dist/lib/palette/index.d.ts +49 -0
  19. package/dist/lib/palette/index.js +82 -0
  20. package/dist/lib/palette/schema.d.ts +45 -0
  21. package/dist/lib/palette/schema.js +41 -0
  22. package/dist/lib/rendering/cursors/index.d.ts +2 -0
  23. package/dist/lib/rendering/cursors/index.js +3 -1
  24. package/dist/lib/rendering/sample/index.js +3 -2
  25. package/dist/lib/settings/index.d.ts +63 -0
  26. package/dist/lib/settings/index.js +91 -0
  27. package/dist/lib/settings/schema.d.ts +150 -0
  28. package/dist/lib/settings/schema.js +102 -0
  29. package/dist/lib/storage/index.d.ts +36 -5
  30. package/dist/lib/storage/index.js +87 -29
  31. package/dist/lib/utils/colour/index.d.ts +72 -0
  32. package/dist/lib/utils/colour/index.js +154 -0
  33. package/dist/lib/utils/shortcuts/index.d.ts +174 -11
  34. package/dist/lib/utils/shortcuts/index.js +391 -145
  35. package/dist/lib/validation/validators.generated.d.ts +5 -0
  36. package/dist/lib/validation/validators.generated.js +872 -1
  37. package/dist/locales/en-GB.js +87 -1
  38. package/dist/locales/en-US.js +87 -1
  39. package/dist/locales/fr.js +87 -1
  40. package/dist/locales/ja.js +87 -1
  41. package/dist/locales/ko.js +87 -1
  42. package/dist/locales/zh-Hans.js +87 -1
  43. package/dist/locales/zh-Hant.js +87 -1
  44. package/dist/package.js +1 -1
  45. package/dist/ui/elements/PaintCanvas/index.d.ts +49 -47
  46. package/dist/ui/elements/PaintCanvas/index.js +128 -169
  47. package/dist/ui/elements/PaintCanvas/style.js +1 -1
  48. package/dist/ui/elements/PcAppSettings/index.d.ts +59 -0
  49. package/dist/ui/elements/PcAppSettings/index.js +222 -0
  50. package/dist/ui/elements/PcBrushConfig/index.js +1 -0
  51. package/dist/ui/elements/PcButton/index.js +1 -0
  52. package/dist/ui/elements/PcCanvas/index.d.ts +1 -1
  53. package/dist/ui/elements/PcCanvas/index.js +7 -5
  54. package/dist/ui/elements/PcColourPair/index.d.ts +43 -0
  55. package/dist/ui/elements/PcColourPair/index.js +125 -0
  56. package/dist/ui/elements/PcContextMenu/index.d.ts +70 -33
  57. package/dist/ui/elements/PcContextMenu/index.js +128 -97
  58. package/dist/ui/elements/PcDialog/index.js +1 -0
  59. package/dist/ui/elements/PcIconToggle/index.js +1 -0
  60. package/dist/ui/elements/PcLayerItem/index.d.ts +13 -34
  61. package/dist/ui/elements/PcLayerItem/index.js +39 -91
  62. package/dist/ui/elements/PcLayerItem/style.js +1 -1
  63. package/dist/ui/elements/PcMenu/index.d.ts +93 -0
  64. package/dist/ui/elements/PcMenu/index.js +204 -0
  65. package/dist/ui/elements/PcPane/index.d.ts +118 -0
  66. package/dist/ui/elements/PcPane/index.js +357 -0
  67. package/dist/ui/elements/PcPanel/index.d.ts +26 -8
  68. package/dist/ui/elements/PcPanel/index.js +76 -8
  69. package/dist/ui/elements/{PcBrushMenu → PcPanelBrushes}/index.d.ts +20 -6
  70. package/dist/ui/elements/{PcBrushMenu → PcPanelBrushes}/index.js +20 -15
  71. package/dist/ui/elements/PcPanelBrushes/style.js +3 -0
  72. package/dist/ui/elements/PcPanelColours/index.d.ts +171 -0
  73. package/dist/ui/elements/PcPanelColours/index.js +650 -0
  74. package/dist/ui/elements/PcPanelColours/style.js +3 -0
  75. package/dist/ui/elements/{PcLayersMenu → PcPanelLayers}/index.d.ts +17 -4
  76. package/dist/ui/elements/{PcLayersMenu → PcPanelLayers}/index.js +17 -10
  77. package/dist/ui/elements/PcPanelLayers/style.js +3 -0
  78. package/dist/ui/elements/PcShortcutSettings/index.d.ts +69 -0
  79. package/dist/ui/elements/PcShortcutSettings/index.js +273 -0
  80. package/dist/ui/elements/PcThemePicker/index.js +1 -0
  81. package/dist/ui/elements/PcToast/index.js +1 -0
  82. package/dist/ui/elements/PcToolSettings/index.js +2 -1
  83. package/dist/ui/elements/PcToolbar/index.d.ts +47 -12
  84. package/dist/ui/elements/PcToolbar/index.js +77 -56
  85. package/dist/ui/elements/PcToolbar/style.js +1 -1
  86. package/dist/ui/index.d.ts +7 -1
  87. package/dist/ui/index.js +8 -2
  88. package/dist/ui/tokens/index.js +3 -1
  89. package/locales/en-GB.json +87 -1
  90. package/locales/en-US.json +87 -1
  91. package/locales/fr.json +87 -1
  92. package/locales/ja.json +87 -1
  93. package/locales/ko.json +87 -1
  94. package/locales/zh-Hans.json +87 -1
  95. package/locales/zh-Hant.json +87 -1
  96. package/package.json +1 -1
  97. package/dist/ui/elements/PcBrushMenu/style.js +0 -3
  98. package/dist/ui/elements/PcLayersMenu/style.js +0 -3
@@ -26,8 +26,34 @@ var zh_Hant_default = {
26
26
  "paintCanvas.tool.zoom": "縮放",
27
27
  "paintCanvas.tool.colourSample": "滴管",
28
28
  "paintCanvas.tool.withShortcut": "{tool}({shortcut})",
29
+ "paintCanvas.colours.foreground": "前景色({colour})",
30
+ "paintCanvas.colours.background": "背景色({colour})",
31
+ "paintCanvas.palette.label": "調色盤",
32
+ "paintCanvas.palette.hex": "十六進位顏色",
33
+ "paintCanvas.palette.model": "色彩模式",
34
+ "paintCanvas.palette.rgb": "RGB",
35
+ "paintCanvas.palette.hsl": "HSL",
36
+ "paintCanvas.palette.red": "紅",
37
+ "paintCanvas.palette.green": "綠",
38
+ "paintCanvas.palette.blue": "藍",
39
+ "paintCanvas.palette.hue": "色相",
40
+ "paintCanvas.palette.saturation": "飽和度",
41
+ "paintCanvas.palette.lightness": "亮度",
42
+ "paintCanvas.palette.saved": "已儲存的顏色",
43
+ "paintCanvas.palette.add": "將 {colour} 儲存到調色盤",
44
+ "paintCanvas.palette.colourActions": "{colour} 的操作",
45
+ "paintCanvas.palette.deleteColour": "刪除顏色",
46
+ "paintCanvas.palette.deleteMessage": "要刪除這個顏色嗎?",
47
+ "paintCanvas.palette.deleteConfirm": "是,刪除顏色",
48
+ "paintCanvas.palette.import": "匯入",
49
+ "paintCanvas.palette.export": "匯出",
50
+ "paintCanvas.palette.importFile": "匯入調色盤檔案",
51
+ "paintCanvas.palette.imported.one": "已新增 {count} 個顏色",
52
+ "paintCanvas.palette.imported.other": "已新增 {count} 個顏色",
53
+ "paintCanvas.palette.fileIncompatible": "不相容的調色盤 JSON 檔案",
54
+ "paintCanvas.palette.fileReadFailed": "無法讀取調色盤 JSON 檔案",
55
+ "paintCanvas.palette.exportFailed": "匯出調色盤 JSON 檔案時發生錯誤",
29
56
  "paintCanvas.toolbar.label": "工具",
30
- "paintCanvas.toolbar.currentColour": "目前顏色",
31
57
  "paintCanvas.toolbar.layers": "圖層",
32
58
  "paintCanvas.toolbar.menu": "選單",
33
59
  "paintCanvas.toolbar.undoWithShortcut": "復原({shortcut})",
@@ -168,6 +194,66 @@ var zh_Hant_default = {
168
194
  "paintCanvas.autosave.elsewhereMessage": "此畫作已在另一個視窗或分頁中開啟,一次只能在一個視窗中繪畫。選擇「在此繪畫」即可在此視窗繼續(另一個視窗將停止)。",
169
195
  "paintCanvas.autosave.takeOver": "在此繪畫",
170
196
  "paintCanvas.autosave.failed": "無法在此瀏覽器中儲存畫作",
197
+ "paintCanvas.settings.saveFailed": "無法在此瀏覽器中保存你的設定",
198
+ "paintCanvas.shortcuts.title": "鍵盤快速鍵",
199
+ "paintCanvas.shortcuts.recordHint": "按下要使用的按鍵",
200
+ "paintCanvas.shortcuts.none": "無",
201
+ "paintCanvas.shortcuts.remove": "刪除「{action}」的快速鍵",
202
+ "paintCanvas.shortcuts.fixed": "無法變更",
203
+ "paintCanvas.shortcuts.fixedUsed": "{keys} 已用於「{action}」,無法變更",
204
+ "paintCanvas.shortcuts.moved": "{keys} 已從「{from}」移到「{to}」",
205
+ "paintCanvas.shortcuts.reset": "恢復預設值",
206
+ "paintCanvas.shortcuts.wasReset": "已將鍵盤快速鍵恢復為預設值",
207
+ "paintCanvas.shortcuts.group.tools": "工具",
208
+ "paintCanvas.shortcuts.group.brushes": "筆刷與橡皮擦",
209
+ "paintCanvas.shortcuts.group.clipboard": "剪貼簿",
210
+ "paintCanvas.shortcuts.group.masking": "遮罩",
211
+ "paintCanvas.shortcuts.group.fills": "填色與顏色",
212
+ "paintCanvas.shortcuts.group.viewport": "檢視",
213
+ "paintCanvas.shortcuts.group.layers": "圖層",
214
+ "paintCanvas.shortcuts.group.history": "歷史紀錄",
215
+ "paintCanvas.shortcuts.group.general": "一般",
216
+ "paintCanvas.shortcuts.pan": "按住時平移(放開後回到上一個工具)",
217
+ "paintCanvas.shortcuts.tool-move": "移動",
218
+ "paintCanvas.shortcuts.tool-brush": "筆刷",
219
+ "paintCanvas.shortcuts.tool-eraser": "橡皮擦",
220
+ "paintCanvas.shortcuts.tool-rectangle-mask": "矩形遮罩",
221
+ "paintCanvas.shortcuts.tool-circle-mask": "圓形遮罩",
222
+ "paintCanvas.shortcuts.tool-polygon-mask": "多邊形遮罩",
223
+ "paintCanvas.shortcuts.tool-freehand-mask": "手繪遮罩",
224
+ "paintCanvas.shortcuts.tool-colour-sample": "滴管",
225
+ "paintCanvas.shortcuts.tool-zoom": "縮放",
226
+ "paintCanvas.shortcuts.brush-bigger": "放大尺寸",
227
+ "paintCanvas.shortcuts.brush-smaller": "縮小尺寸",
228
+ "paintCanvas.shortcuts.brush-more-opaque": "提高不透明度",
229
+ "paintCanvas.shortcuts.brush-less-opaque": "降低不透明度",
230
+ "paintCanvas.shortcuts.cut": "剪下",
231
+ "paintCanvas.shortcuts.copy": "複製",
232
+ "paintCanvas.shortcuts.paste": "貼上",
233
+ "paintCanvas.shortcuts.select-all": "全選",
234
+ "paintCanvas.shortcuts.invert-selection": "反轉選取範圍",
235
+ "paintCanvas.shortcuts.deselect": "取消選取",
236
+ "paintCanvas.shortcuts.fill-foreground": "以前景色填色",
237
+ "paintCanvas.shortcuts.fill-background": "以背景色填色",
238
+ "paintCanvas.shortcuts.swap-colours": "交換前景色與背景色",
239
+ "paintCanvas.shortcuts.zoom-in": "放大",
240
+ "paintCanvas.shortcuts.zoom-out": "縮小",
241
+ "paintCanvas.shortcuts.reset-zoom": "縮放至 100%",
242
+ "paintCanvas.shortcuts.toggle-interface": "顯示或隱藏介面",
243
+ "paintCanvas.shortcuts.save": "儲存為 PNG",
244
+ "paintCanvas.shortcuts.undo": "復原",
245
+ "paintCanvas.shortcuts.redo": "重做",
246
+ "paintCanvas.shortcuts.delete": "刪除遮罩區域",
247
+ "paintCanvas.shortcuts.cancel": "取消",
248
+ "paintCanvas.shortcuts.commit": "套用",
249
+ "paintCanvas.shortcuts.layerOpacity": "將圖層不透明度設為 {percent}%",
250
+ "paintCanvas.settings.import": "匯入設定",
251
+ "paintCanvas.settings.export": "匯出設定",
252
+ "paintCanvas.settings.importFile": "匯入設定檔",
253
+ "paintCanvas.settings.imported": "已匯入設定",
254
+ "paintCanvas.settings.fileIncompatible": "不相容的設定 JSON 檔案",
255
+ "paintCanvas.settings.fileReadFailed": "無法讀取設定 JSON 檔案",
256
+ "paintCanvas.settings.exportFailed": "匯出設定 JSON 檔案時發生錯誤",
171
257
  "paintCanvas.stats.label": "畫布詳細資料",
172
258
  "paintCanvas.stats.size": "畫布:{width} × {height} 像素",
173
259
  "paintCanvas.stats.zoom": "縮放:{zoom}",
package/dist/package.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // package.json
2
- var version = "0.3.0";
2
+ var version = "0.4.0";
3
3
  export { version };
@@ -1,42 +1,42 @@
1
1
  import { PcElement } from "../../base";
2
2
  import PaintCanvas from "../../../lib/classes/PaintCanvas";
3
+ import SettingsAutosave from "../../../lib/classes/SettingsAutosave";
3
4
  import type { BrushConfig } from "../../../lib/brushes/types";
4
5
  import { type SaveMethod } from "../../../lib/rendering/screenshot";
5
6
  import { type InputKind, type LayoutState } from "../../layout";
6
- import type { PcPanel } from "../PcPanel";
7
7
  import "../PcPanel";
8
8
  import "../PcToolbar";
9
9
  import "../PcToolSettings";
10
10
  import "../PcCanvas";
11
11
  import "../PcCanvasMap";
12
- import "../PcBrushMenu";
13
- import "../PcLayersMenu";
12
+ import "../PcPanelBrushes";
13
+ import "../PcPanelLayers";
14
14
  import "../PcBrushConfig";
15
15
  import "../PcStats";
16
+ import "../PcPanelColours";
16
17
  import "../PcDialog";
17
- /** A side of the layout */
18
- type Side = "left" | "right";
19
18
  /**
20
19
  * A ready-made painting app: the drawing elements arranged around the canvas, sized to its container (not the
21
20
  * window), with slots to add or replace content:
22
21
  *
23
22
  * - `header`: across the top (empty by default)
24
- * - `left`: `<pc-toolbar>` by default
25
- * - `top`: `<pc-tool-settings>` (for tools that have settings) by default
26
- * - `right`: empty by default (e.g. a `<pc-panel>` with a layers menu or chat)
23
+ * - `left`: `<pc-toolbar>` (a pane) by default
24
+ * - `top`: a horizontal `<pc-pane>` with `<pc-tool-settings>` (for tools that have settings) by default
25
+ * - `right`: a `<pc-pane>` with `<pc-panel-layers>` by default
27
26
  * - `center`: `<pc-canvas>` by default
28
27
  * - `overlay`: drawn over the canvas; `<pc-canvas-map>` by default
29
28
  * - `bottom`: under the canvas (empty by default)
30
29
  * - `footer`: across the bottom; `<pc-stats>` by default
31
- * - `menu`: the app menu the toolbar's menu button opens (the button shows only with a menu)
30
+ * - `menu`: the app menu the toolbar's menu button opens, shown in a `<pc-panel>` (the button shows only with a menu)
32
31
  *
33
32
  * Content given for a slot replaces its default; an empty element clears it. Empty slots take no space. Hiding the
34
- * interface (Tab key) leaves only the canvas and overlay. A `<pc-layers-menu>` given in a side (e.g. in a `<pc-panel>`)
35
- * replaces the toolbar's layers menu button.
33
+ * interface (Tab key) leaves only the canvas and overlay. While a side has a `<pc-panel-layers>` (as the right side
34
+ * does by default), the toolbar has no layers menu button.
36
35
  *
37
36
  * Each side has a mode, chosen by the layout's width from `left-modes` and `right-modes` (default `"docked,
38
- * rail@600"`): `docked` beside the canvas; `rail`, a column of buttons (one per `<pc-panel>`) that open each panel over
39
- * the canvas; or `floating`, the side over the canvas as a palette that collapses to a button.
37
+ * rail@600"`), which the layout gives the side's `<pc-pane>`s (see `PcPane`): `docked` beside the canvas; `rail`, a
38
+ * column of buttons (one per panel) that open each panel over the canvas; or `floating`, the pane over the canvas as a
39
+ * box that collapses to a button. Give side content in a `<pc-pane>` to have it follow the side's mode.
40
40
  *
41
41
  * Reports its state for styling as attributes (`narrow`, `input="pen|touch|mouse"`, `ui-hidden`, `left-mode`,
42
42
  * `right-mode`) and as `pc-state-change` events (see `LayoutState`). Creates its own canvas unless given one, and
@@ -46,10 +46,16 @@ type Side = "left" | "right";
46
46
  * reloading the page (see `LayerAutosave`). While another window is drawing on it, the layout is blocked by a message
47
47
  * that offers to draw here instead. Fires `pc-toast` when the drawing can't be loaded or saved.
48
48
  *
49
+ * With a `settings-store` name, the user's app settings (input settings, keyboard shortcuts, colour palette and
50
+ * colours) are kept in the browser under that name (see `SettingsAutosave`). Fires `pc-toast` when they can't be.
51
+ *
49
52
  * @example
50
53
  * html`<paint-canvas style="height: 600px"></paint-canvas>`
51
54
  * html`<paint-canvas .app=${canvas} right-modes="docked, rail@800">
52
- * <pc-panel slot="right" icon="layers" label="Layers"><pc-layers-menu .app=${canvas}></pc-layers-menu></pc-panel>
55
+ * <pc-pane slot="right">
56
+ * <pc-panel-layers .app=${canvas}></pc-panel-layers>
57
+ * <pc-panel icon="chat" label="Chat"><my-chat></my-chat></pc-panel>
58
+ * </pc-pane>
53
59
  * </paint-canvas>`
54
60
  */
55
61
  export declare class PaintCanvasElement extends PcElement {
@@ -83,6 +89,10 @@ export declare class PaintCanvasElement extends PcElement {
83
89
  store: {
84
90
  type: StringConstructor;
85
91
  };
92
+ settingsStore: {
93
+ type: StringConstructor;
94
+ attribute: string;
95
+ };
86
96
  width: {
87
97
  state: boolean;
88
98
  };
@@ -92,12 +102,6 @@ export declare class PaintCanvasElement extends PcElement {
92
102
  configuring: {
93
103
  state: boolean;
94
104
  };
95
- collapsed: {
96
- state: boolean;
97
- };
98
- openPanel: {
99
- state: boolean;
100
- };
101
105
  translations: {
102
106
  attribute: boolean;
103
107
  };
@@ -126,6 +130,8 @@ export declare class PaintCanvasElement extends PcElement {
126
130
  shortcuts: boolean;
127
131
  /** Name to keep the user's layers under in the browser, so the drawing survives reloading the page (none by default) */
128
132
  store?: string;
133
+ /** Name to keep the user's app settings under in the browser (none by default) */
134
+ settingsStore?: string;
129
135
  /** The layout's width in CSS pixels */
130
136
  width: number;
131
137
  /** The input being used now */
@@ -136,10 +142,6 @@ export declare class PaintCanvasElement extends PcElement {
136
142
  config: BrushConfig;
137
143
  editingId?: string;
138
144
  };
139
- /** Which floating sides are collapsed to a button */
140
- collapsed: Record<Side, boolean>;
141
- /** The panel open from a rail, if any */
142
- openPanel?: PcPanel;
143
145
  /** Saves files (replaceable for tests) */
144
146
  saveFile: (blob: Blob, name: string) => Promise<SaveMethod | undefined>;
145
147
  private changes;
@@ -147,10 +149,10 @@ export declare class PaintCanvasElement extends PcElement {
147
149
  private ownAutosave?;
148
150
  /** The autosave whose errors are shown */
149
151
  private watchedAutosave?;
152
+ /** Keeps the app settings under the `settings-store` name, if any */
153
+ private ownSettingsAutosave?;
150
154
  /** Whether drawing was blocked when shortcuts were last watched */
151
155
  private blockedShortcuts;
152
- /** The panels in each side's slot */
153
- private panels;
154
156
  /** Whether each side's slot has a layers menu (the toolbar's isn't needed then) */
155
157
  private sideLayers;
156
158
  /** Whether the implementer gave a menu */
@@ -163,15 +165,13 @@ export declare class PaintCanvasElement extends PcElement {
163
165
  private reported?;
164
166
  /** Space the floating sides cover over the canvas */
165
167
  private floatingInsets;
166
- /** The rail button that opened the open panel, to return focus to */
167
- private opener?;
168
168
  private readonly resizeObserver?;
169
- private readonly panelObserver;
170
169
  private readonly onPointerDown;
171
170
  private readonly onAutosaveError;
171
+ private readonly onSettingsAutosaveError;
172
172
  private readonly onShortcut;
173
173
  private readonly onDocumentPointerDown;
174
- private readonly onKeyDown;
174
+ private readonly onPaneCollapse;
175
175
  constructor();
176
176
  /** Whether another window is drawing on the stored drawing, so this one is blocked */
177
177
  get blocked(): boolean;
@@ -183,6 +183,10 @@ export declare class PaintCanvasElement extends PcElement {
183
183
  disconnectedCallback(): void;
184
184
  protected willUpdate(changed: Map<PropertyKey, unknown>): void;
185
185
  protected updated(): void;
186
+ /** The panes in a side: the default one, or those given for it */
187
+ private panesIn;
188
+ /** Show each side's panes in the side's mode, facing the canvas */
189
+ private setPaneModes;
186
190
  /** Keep the canvas clear of floating sides when fitting it */
187
191
  private measureFloatingSides;
188
192
  /**
@@ -190,6 +194,13 @@ export declare class PaintCanvasElement extends PcElement {
190
194
  * previous canvas). An autosave the implementer started is left alone when there's no name.
191
195
  */
192
196
  private useStore;
197
+ /** Keeps the app settings under the `settings-store` name, if any (e.g. to wait until they are restored with `ready`) */
198
+ get settingsAutosave(): SettingsAutosave | undefined;
199
+ /**
200
+ * Keep the canvas's app settings under the `settings-store` name, stopping the previous settings autosave (which
201
+ * saves any change waiting to be saved).
202
+ */
203
+ private useSettingsStore;
193
204
  /** Show errors from the canvas's current autosave */
194
205
  private watchAutosaveErrors;
195
206
  /** Handle keyboard shortcuts for the current canvas, if asked to (not while blocked) */
@@ -212,32 +223,24 @@ export declare class PaintCanvasElement extends PcElement {
212
223
  * Open the configuration window to make a new preset, starting from the current brush or eraser settings.
213
224
  */
214
225
  newPreset(kind: "brush" | "eraser"): void;
215
- /** Which side a panel is in */
216
- private sideOf;
217
- /**
218
- * Open a panel from its rail button (closing any other), or close it if it's open. Focus moves into the panel.
219
- */
220
- togglePanel(panel: PcPanel, opener?: HTMLElement): void;
221
- /**
222
- * Close the panel open from a rail, moving focus back to its rail button if asked.
223
- */
224
- closePanel(returnFocus: boolean): void;
225
226
  /** Follow which slots have content given (their defaults aren't needed) */
226
227
  private onSlotChange;
227
228
  /** A slot, with its default content unless content was given for it */
228
229
  private slotWithDefault;
229
- /** Follow the panels given for a side, and whether it has a layers menu */
230
+ /** Follow whether a side given content has a layers menu */
230
231
  private onSideSlotChange;
231
232
  /** Follow whether a menu was given */
232
233
  private onMenuSlotChange;
233
234
  /** Whether a side has a layers menu, replacing the toolbar's */
234
235
  private get layersInSide();
235
- /** The toolbar shown on the left unless the implementer gives other content */
236
- private renderToolbar;
237
- /** A side's rail buttons, one per panel */
238
- private renderRail;
239
- /** A side, in its mode */
236
+ /** A side's default content: the toolbar on the left, and the layers on the right */
237
+ private renderSideDefault;
238
+ /** A side: its panes, in its mode (set on them after rendering) */
240
239
  private renderSide;
240
+ /**
241
+ * Close the colour palette on a press outside it and the colours that open it.
242
+ */
243
+ private closePaletteOutside;
241
244
  /** The menus the toolbar opens, floating over the canvas beside it */
242
245
  private renderPanels;
243
246
  /** The brush configuration window, while open */
@@ -246,4 +249,3 @@ export declare class PaintCanvasElement extends PcElement {
246
249
  private renderBlocked;
247
250
  render(): import("lit").TemplateResult<1>;
248
251
  }
249
- export {};