microboard-temp 0.14.24 → 0.14.25
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/cjs/browser.js +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/node.js +0 -1
- package/dist/esm/browser.js +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/node.js +0 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/types/Items/Card/CardActions.d.ts +0 -2
- package/dist/types/Items/Comment/Tool/index.d.ts +0 -1
- package/dist/types/Items/Connector/Tool/index.d.ts +0 -1
- package/dist/types/Items/Deck/DeckActions.d.ts +0 -2
- package/dist/types/Items/Dice/DiceActions.d.ts +0 -2
- package/dist/types/Items/Drawing/Tool/Eraser/index.d.ts +0 -1
- package/dist/types/Items/Drawing/Tool/index.d.ts +0 -2
- package/dist/types/Items/Frame/Tool/index.d.ts +0 -1
- package/dist/types/Items/ItemActions.d.ts +0 -160
- package/dist/types/Items/RichText/Tool/index.d.ts +0 -1
- package/dist/types/Items/Screen/ScreenActions.d.ts +0 -12
- package/dist/types/Items/Shape/Tool/index.d.ts +0 -1
- package/dist/types/Items/Sticker/Tool/index.d.ts +0 -1
- package/dist/types/Items/itemActionsRegistry.d.ts +0 -11
package/dist/cjs/browser.js
CHANGED
|
@@ -686,7 +686,6 @@ __export(exports_browser, {
|
|
|
686
686
|
listCreateSurfaceEntries: () => listCreateSurfaceEntries,
|
|
687
687
|
itemOverlays: () => itemOverlays,
|
|
688
688
|
itemFactories: () => itemFactories2,
|
|
689
|
-
itemActions: () => itemOverlays,
|
|
690
689
|
isTransformation: () => isTransformation,
|
|
691
690
|
isShapeOp: () => isShapeOp,
|
|
692
691
|
isShallowSimilarTo: () => isShallowSimilarTo,
|
package/dist/cjs/index.js
CHANGED
|
@@ -686,7 +686,6 @@ __export(exports_src, {
|
|
|
686
686
|
listCreateSurfaceEntries: () => listCreateSurfaceEntries,
|
|
687
687
|
itemOverlays: () => itemOverlays,
|
|
688
688
|
itemFactories: () => itemFactories2,
|
|
689
|
-
itemActions: () => itemOverlays,
|
|
690
689
|
isTransformation: () => isTransformation,
|
|
691
690
|
isShapeOp: () => isShapeOp,
|
|
692
691
|
isShallowSimilarTo: () => isShallowSimilarTo,
|
package/dist/cjs/node.js
CHANGED
|
@@ -1723,7 +1723,6 @@ __export(exports_node, {
|
|
|
1723
1723
|
listCreateSurfaceEntries: () => listCreateSurfaceEntries,
|
|
1724
1724
|
itemOverlays: () => itemOverlays,
|
|
1725
1725
|
itemFactories: () => itemFactories2,
|
|
1726
|
-
itemActions: () => itemOverlays,
|
|
1727
1726
|
isTransformation: () => isTransformation,
|
|
1728
1727
|
isShapeOp: () => isShapeOp,
|
|
1729
1728
|
isShallowSimilarTo: () => isShallowSimilarTo,
|
package/dist/esm/browser.js
CHANGED
|
@@ -75970,7 +75970,6 @@ export {
|
|
|
75970
75970
|
listCreateSurfaceEntries,
|
|
75971
75971
|
itemOverlays,
|
|
75972
75972
|
itemFactories2 as itemFactories,
|
|
75973
|
-
itemOverlays as itemActions,
|
|
75974
75973
|
isTransformation,
|
|
75975
75974
|
isShapeOp,
|
|
75976
75975
|
isShallowSimilarTo,
|
package/dist/esm/index.js
CHANGED
|
@@ -75868,7 +75868,6 @@ export {
|
|
|
75868
75868
|
listCreateSurfaceEntries,
|
|
75869
75869
|
itemOverlays,
|
|
75870
75870
|
itemFactories2 as itemFactories,
|
|
75871
|
-
itemOverlays as itemActions,
|
|
75872
75871
|
isTransformation,
|
|
75873
75872
|
isShapeOp,
|
|
75874
75873
|
isShallowSimilarTo,
|
package/dist/esm/node.js
CHANGED
|
@@ -78503,7 +78503,6 @@ export {
|
|
|
78503
78503
|
listCreateSurfaceEntries,
|
|
78504
78504
|
itemOverlays,
|
|
78505
78505
|
itemFactories2 as itemFactories,
|
|
78506
|
-
itemOverlays as itemActions,
|
|
78507
78506
|
isTransformation,
|
|
78508
78507
|
isShapeOp,
|
|
78509
78508
|
isShallowSimilarTo,
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddComment } from "./AddComment";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddConnector } from "./AddConnector";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Eraser } from "./Eraser";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./AddFrame";
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ItemActions — declarative descriptor for item-specific UI actions.
|
|
3
|
-
*
|
|
4
|
-
* The UI repo reads these configs from the `itemActions` registry (keyed by
|
|
5
|
-
* `itemType`) and renders context panels, context menus, and tool panel buttons
|
|
6
|
-
* without any item-specific knowledge.
|
|
7
|
-
*
|
|
8
|
-
* Operation primitive hierarchy:
|
|
9
|
-
* 1. `setProperty` — the primary primitive for most property mutations.
|
|
10
|
-
* Emits `{ class: "Item", method: "setProperty", property, value }`.
|
|
11
|
-
* 2. `custom` — escape hatch for operations that cannot be expressed as
|
|
12
|
-
* setProperty (see docs on each `CustomAction` below).
|
|
13
|
-
*/
|
|
14
|
-
/** A plain SVG icon button. */
|
|
15
|
-
export interface IconButton {
|
|
16
|
-
kind: "icon";
|
|
17
|
-
/** Inline SVG markup (full `<svg>` element). */
|
|
18
|
-
svg: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A button whose icon displays the current value of a color property.
|
|
22
|
-
* The UI reads `item[property]` to fill the color swatch.
|
|
23
|
-
*/
|
|
24
|
-
export interface ColorButton {
|
|
25
|
-
kind: "color";
|
|
26
|
-
/** Property name on the item that holds the current color string. */
|
|
27
|
-
property: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* A button whose label displays the current value of a property.
|
|
31
|
-
* Useful for numeric or text property indicators.
|
|
32
|
-
*/
|
|
33
|
-
export interface LabelButton {
|
|
34
|
-
kind: "label";
|
|
35
|
-
/** Property name on the item to read for display. */
|
|
36
|
-
property: string;
|
|
37
|
-
}
|
|
38
|
-
export type ButtonVariant = IconButton | ColorButton | LabelButton;
|
|
39
|
-
/**
|
|
40
|
-
* A single option inside a `MenuAction` dropdown.
|
|
41
|
-
* When selected, emits `setProperty(property, value)`.
|
|
42
|
-
*/
|
|
43
|
-
export interface MenuOption {
|
|
44
|
-
/** Display label for this option. */
|
|
45
|
-
label: string;
|
|
46
|
-
/** Property name on the item to set. */
|
|
47
|
-
property: string;
|
|
48
|
-
/** The value to assign to the property. */
|
|
49
|
-
value: unknown;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A button that opens a dropdown of fixed options.
|
|
53
|
-
* Each option emits a `setProperty` operation when chosen.
|
|
54
|
-
*/
|
|
55
|
-
export interface MenuAction {
|
|
56
|
-
kind: "menu";
|
|
57
|
-
tooltip: string;
|
|
58
|
-
button: ButtonVariant;
|
|
59
|
-
options: MenuOption[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* A button that directly emits `setProperty(property, value)` when clicked.
|
|
63
|
-
*/
|
|
64
|
-
export interface SetPropertyAction {
|
|
65
|
-
kind: "setProperty";
|
|
66
|
-
tooltip: string;
|
|
67
|
-
button: ButtonVariant;
|
|
68
|
-
/** Property name on the item to set. */
|
|
69
|
-
property: string;
|
|
70
|
-
/** The value to assign to the property. */
|
|
71
|
-
value: unknown;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Escape hatch for operations that CANNOT be expressed as `setProperty`.
|
|
75
|
-
*
|
|
76
|
-
* These are complex operations, typically on container/group items, where:
|
|
77
|
-
* - The value must be computed at invocation time (e.g. random dice value), OR
|
|
78
|
-
* - The operation involves reading and mutating children, OR
|
|
79
|
-
* - The operation affects multiple items simultaneously with interdependent
|
|
80
|
-
* state (e.g. flip all cards in a deck).
|
|
81
|
-
*
|
|
82
|
-
* Known cases:
|
|
83
|
-
*
|
|
84
|
-
* **Dice**
|
|
85
|
-
* - `throwDice`: generates a random valueIndex at call time + triggers a
|
|
86
|
-
* timed rotation animation. The value is not known statically.
|
|
87
|
-
*
|
|
88
|
-
* **Card**
|
|
89
|
-
* - `toggleIsOpen(cards)`: operates on the entire selection of Card items
|
|
90
|
-
* simultaneously; must inspect each card's current `isOpen` state to decide
|
|
91
|
-
* which cards to open and which to close. Cannot be expressed as setProperty
|
|
92
|
-
* because the value to write depends on reading the current value first.
|
|
93
|
-
*
|
|
94
|
-
* **Deck** (group item — all operations involve child management)
|
|
95
|
-
* - `shuffleDeck`: randomly reorders children within the container and
|
|
96
|
-
* triggers a shuffle animation.
|
|
97
|
-
* - `flipDeck`: reverses child insertion order AND toggles face/back state
|
|
98
|
-
* on all contained cards.
|
|
99
|
-
* - `getTopCard`: removes the top child card from the Deck container and
|
|
100
|
-
* places it on the board at a computed position. Involves spatial math.
|
|
101
|
-
* - `getBottomCard`: same as getTopCard but for the bottom card.
|
|
102
|
-
* - `getRandomCard`: same but for a random card.
|
|
103
|
-
*
|
|
104
|
-
* The UI calls `(item as any)[methodName]()` for these actions. They are
|
|
105
|
-
* public methods on the item class. The UI repo's ActionRenderer component
|
|
106
|
-
* should handle this with a thin `custom` branch.
|
|
107
|
-
*/
|
|
108
|
-
export interface CustomAction {
|
|
109
|
-
kind: "custom";
|
|
110
|
-
tooltip: string;
|
|
111
|
-
button: ButtonVariant;
|
|
112
|
-
/**
|
|
113
|
-
* Name of the public method to call on the item instance.
|
|
114
|
-
* Must be a method on the item class.
|
|
115
|
-
*/
|
|
116
|
-
methodName: string;
|
|
117
|
-
}
|
|
118
|
-
export type ItemAction = MenuAction | SetPropertyAction | CustomAction;
|
|
119
|
-
/**
|
|
120
|
-
* Defines the toolbar entry for items that have a placement tool (e.g. "Add Dice").
|
|
121
|
-
* The UI panel renders a button for each registered item that has a `toolButton`.
|
|
122
|
-
*/
|
|
123
|
-
export interface ToolPanelButton {
|
|
124
|
-
/**
|
|
125
|
-
* Must match the `toolData.name` passed to `registerItem`.
|
|
126
|
-
* Used to activate the tool via `board.tools.activate(toolName)`.
|
|
127
|
-
*/
|
|
128
|
-
toolName: string;
|
|
129
|
-
/** Tooltip / accessible label for the tool panel button. */
|
|
130
|
-
tooltip: string;
|
|
131
|
-
/** Inline SVG markup for the button icon. */
|
|
132
|
-
svg: string;
|
|
133
|
-
/** Optional keyboard shortcut labels for display only. */
|
|
134
|
-
hotkey?: {
|
|
135
|
-
windows: string;
|
|
136
|
-
mac: string;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Complete action descriptor for an item type.
|
|
141
|
-
* Register via `registerItem({ actions: config })`.
|
|
142
|
-
* Read from `itemActions[itemType]` in the UI repo.
|
|
143
|
-
*/
|
|
144
|
-
export interface ItemActionConfig {
|
|
145
|
-
/**
|
|
146
|
-
* Actions shown in the floating context panel when this item type is selected.
|
|
147
|
-
* Rendered left-to-right as a row of buttons.
|
|
148
|
-
*/
|
|
149
|
-
contextPanel: ItemAction[];
|
|
150
|
-
/**
|
|
151
|
-
* Actions shown in the right-click context menu for this item type.
|
|
152
|
-
* A subset of contextPanel actions plus any menu-only actions.
|
|
153
|
-
*/
|
|
154
|
-
contextMenu: ItemAction[];
|
|
155
|
-
/**
|
|
156
|
-
* If this item has an "Add" placement tool, this defines its tool panel entry.
|
|
157
|
-
* Absent for items that cannot be placed by the user directly.
|
|
158
|
-
*/
|
|
159
|
-
toolButton?: ToolPanelButton;
|
|
160
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddText } from "./AddText";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ItemActionConfig } from "../ItemActions";
|
|
2
|
-
export declare const screenActions: ItemActionConfig;
|
|
3
|
-
/**
|
|
4
|
-
* Action config for the AddPouch tool — a Screen with no owner restriction.
|
|
5
|
-
* Registered separately because it uses the same Screen item type but a
|
|
6
|
-
* different tool.
|
|
7
|
-
*/
|
|
8
|
-
export declare const pouchToolButton: {
|
|
9
|
-
toolName: string;
|
|
10
|
-
tooltip: string;
|
|
11
|
-
svg: string;
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddShape } from "./AddShape";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { AddSticker } from "./AddSticker";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ItemActionConfig } from "./ItemActions";
|
|
2
|
-
/**
|
|
3
|
-
* Registry of item action configs, keyed by itemType.
|
|
4
|
-
* Populated lazily during `registerItem(...)` calls.
|
|
5
|
-
*
|
|
6
|
-
* Usage in UI repo:
|
|
7
|
-
* import { itemActions } from "microboard";
|
|
8
|
-
* const config = itemActions[item.itemType];
|
|
9
|
-
* // render config.contextPanel, config.contextMenu, config.toolButton
|
|
10
|
-
*/
|
|
11
|
-
export declare const itemActions: Record<string, ItemActionConfig>;
|