@yewdiel21/motion-kit 0.16.0 → 0.17.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/README.md +21 -0
- package/dist/auto/index.d.ts +8 -3
- package/dist/auto/index.js +13 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-SDQ776LG.js → chunk-7IQTMF7Y.js} +1414 -38
- package/dist/chunk-7IQTMF7Y.js.map +1 -0
- package/dist/{chunk-NFZIX3IA.js → chunk-BZLMCHUD.js} +2 -2
- package/dist/{chunk-RBEKR5UZ.js → chunk-VJFPTLAK.js} +2 -2
- package/dist/css/components/drilldown-menu.css +130 -0
- package/dist/css/components/signature-pad.css +104 -0
- package/dist/css/components/voice-message-bubble.css +50 -0
- package/dist/css/components/waveform-player.css +36 -0
- package/dist/css/components/wheel-picker.css +17 -0
- package/dist/elements/index.d.ts +90 -4
- package/dist/elements/index.js +281 -4
- package/dist/elements/index.js.map +1 -1
- package/dist/{reveal-DRpNO4KP.d.ts → engine-Bn6hC87X.d.ts} +194 -1
- package/dist/index.css +305 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +45 -7
- package/dist/react/index.js +227 -3
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-DQwVXQYb.d.ts → reduced-YS6TZjpa.d.ts} +1 -1
- package/dist/{store-Da3zSh8Z.d.ts → store-CZ6vdtIE.d.ts} +1 -1
- package/package.json +110 -110
- package/registry.json +64 -0
- package/src/auto/auto-init.ts +308 -293
- package/src/components/drilldown-menu/README.md +163 -0
- package/src/components/drilldown-menu/drilldown-menu.css +129 -0
- package/src/components/drilldown-menu/element.ts +59 -0
- package/src/components/drilldown-menu/engine.ts +338 -0
- package/src/components/drilldown-menu/react.tsx +76 -0
- package/src/components/signature-pad/README.md +97 -0
- package/src/components/signature-pad/element.ts +57 -0
- package/src/components/signature-pad/engine.ts +437 -0
- package/src/components/signature-pad/react.tsx +56 -0
- package/src/components/signature-pad/signature-pad.css +103 -0
- package/src/components/voice-message-bubble/README.md +31 -0
- package/src/components/voice-message-bubble/element.ts +20 -0
- package/src/components/voice-message-bubble/engine.ts +68 -0
- package/src/components/voice-message-bubble/react.tsx +27 -0
- package/src/components/voice-message-bubble/voice-message-bubble.css +12 -0
- package/src/components/waveform-player/README.md +30 -0
- package/src/components/waveform-player/element.ts +21 -0
- package/src/components/waveform-player/engine.ts +261 -0
- package/src/components/waveform-player/react.tsx +27 -0
- package/src/components/waveform-player/waveform-player.css +35 -0
- package/src/components/wheel-picker/README.md +33 -0
- package/src/components/wheel-picker/element.ts +18 -0
- package/src/components/wheel-picker/engine.ts +210 -0
- package/src/components/wheel-picker/react.tsx +32 -0
- package/src/components/wheel-picker/wheel-picker.css +16 -0
- package/src/elements/index.ts +273 -258
- package/src/index.ts +295 -290
- package/src/react/index.ts +176 -171
- package/dist/chunk-SDQ776LG.js.map +0 -1
- /package/dist/{chunk-NFZIX3IA.js.map → chunk-BZLMCHUD.js.map} +0 -0
- /package/dist/{chunk-RBEKR5UZ.js.map → chunk-VJFPTLAK.js.map} +0 -0
package/dist/elements/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
createVoiceDots,
|
|
18
18
|
iconSvg,
|
|
19
19
|
toast
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-VJFPTLAK.js";
|
|
21
21
|
import {
|
|
22
22
|
createActivityFeed,
|
|
23
23
|
createAddToCart,
|
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
createDateTimePicker,
|
|
41
41
|
createDialog,
|
|
42
42
|
createDrawer,
|
|
43
|
+
createDrilldownMenu,
|
|
43
44
|
createEditableTable,
|
|
44
45
|
createEmptyState,
|
|
45
46
|
createFileExplorer,
|
|
@@ -68,6 +69,7 @@ import {
|
|
|
68
69
|
createScratchCard,
|
|
69
70
|
createScrollIsland,
|
|
70
71
|
createSelect,
|
|
72
|
+
createSignaturePad,
|
|
71
73
|
createSkeleton,
|
|
72
74
|
createSlotPicker,
|
|
73
75
|
createSplitView,
|
|
@@ -82,8 +84,11 @@ import {
|
|
|
82
84
|
createTooltip,
|
|
83
85
|
createTrailer,
|
|
84
86
|
createTreeView,
|
|
85
|
-
createVirtualList
|
|
86
|
-
|
|
87
|
+
createVirtualList,
|
|
88
|
+
createVoiceMessageBubble,
|
|
89
|
+
createWaveformPlayer,
|
|
90
|
+
createWheelPicker
|
|
91
|
+
} from "../chunk-7IQTMF7Y.js";
|
|
87
92
|
import "../chunk-RVSKEBIC.js";
|
|
88
93
|
import "../chunk-DOOMULVV.js";
|
|
89
94
|
import "../chunk-TGV27ZWM.js";
|
|
@@ -2097,6 +2102,263 @@ var MkOrbitMenuElement = class extends MkElement {
|
|
|
2097
2102
|
}
|
|
2098
2103
|
};
|
|
2099
2104
|
|
|
2105
|
+
// src/components/signature-pad/element.ts
|
|
2106
|
+
var MkSignaturePadElement = class extends MkElement {
|
|
2107
|
+
static options = {
|
|
2108
|
+
data: "json",
|
|
2109
|
+
label: "string",
|
|
2110
|
+
hint: "string",
|
|
2111
|
+
placeholder: "string",
|
|
2112
|
+
color: "string",
|
|
2113
|
+
width: "number",
|
|
2114
|
+
disabled: "boolean",
|
|
2115
|
+
readOnly: "boolean",
|
|
2116
|
+
toolbar: "boolean",
|
|
2117
|
+
name: "string",
|
|
2118
|
+
historyLimit: "number"
|
|
2119
|
+
};
|
|
2120
|
+
saved;
|
|
2121
|
+
create(options) {
|
|
2122
|
+
return createSignaturePad(this, { ...options, data: options.data ?? this.saved });
|
|
2123
|
+
}
|
|
2124
|
+
attributeChangedCallback(name, previous, next) {
|
|
2125
|
+
if (previous === next || !this.instance || !this.isConnected) return;
|
|
2126
|
+
if (name === "disabled") {
|
|
2127
|
+
this.instance.setDisabled(next !== null && next !== "false");
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
if (name === "read-only") {
|
|
2131
|
+
this.instance.setReadOnly(next !== null && next !== "false");
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
if (name === "data") {
|
|
2135
|
+
try {
|
|
2136
|
+
this.instance.importData(next === null ? { version: 1, strokes: [] } : JSON.parse(next), false);
|
|
2137
|
+
} catch {
|
|
2138
|
+
}
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
this.saved = this.instance.exportData();
|
|
2142
|
+
this.instance.destroy();
|
|
2143
|
+
this.instance = createSignaturePad(this, { ...this.options, data: this.saved });
|
|
2144
|
+
}
|
|
2145
|
+
disconnectedCallback() {
|
|
2146
|
+
this.saved = this.instance?.exportData() ?? this.saved;
|
|
2147
|
+
super.disconnectedCallback();
|
|
2148
|
+
}
|
|
2149
|
+
connectedCallback() {
|
|
2150
|
+
if (!this.instance) this.instance = createSignaturePad(this, { ...this.options, data: this.saved ?? this.options.data });
|
|
2151
|
+
}
|
|
2152
|
+
get data() {
|
|
2153
|
+
if (this.instance) return this.instance.exportData();
|
|
2154
|
+
return this.saved ? { version: 1, strokes: this.saved.strokes.map((stroke) => ({ ...stroke, points: stroke.points.map((point) => ({ ...point })) })) } : { version: 1, strokes: [] };
|
|
2155
|
+
}
|
|
2156
|
+
set data(value) {
|
|
2157
|
+
this.importData(value);
|
|
2158
|
+
}
|
|
2159
|
+
get isEmpty() {
|
|
2160
|
+
return this.instance?.isEmpty ?? !this.saved?.strokes.length;
|
|
2161
|
+
}
|
|
2162
|
+
get canUndo() {
|
|
2163
|
+
return this.instance?.canUndo ?? false;
|
|
2164
|
+
}
|
|
2165
|
+
get canRedo() {
|
|
2166
|
+
return this.instance?.canRedo ?? false;
|
|
2167
|
+
}
|
|
2168
|
+
undo() {
|
|
2169
|
+
this.instance?.undo();
|
|
2170
|
+
}
|
|
2171
|
+
redo() {
|
|
2172
|
+
this.instance?.redo();
|
|
2173
|
+
}
|
|
2174
|
+
clear() {
|
|
2175
|
+
this.instance?.clear();
|
|
2176
|
+
}
|
|
2177
|
+
importData(value, notify = true) {
|
|
2178
|
+
return this.instance?.importData(value, notify) ?? false;
|
|
2179
|
+
}
|
|
2180
|
+
exportData() {
|
|
2181
|
+
return this.instance?.exportData() ?? this.data;
|
|
2182
|
+
}
|
|
2183
|
+
exportSVG(options) {
|
|
2184
|
+
return this.instance?.exportSVG(options) ?? "";
|
|
2185
|
+
}
|
|
2186
|
+
exportPNG(options) {
|
|
2187
|
+
return this.instance?.exportPNG(options) ?? Promise.resolve(null);
|
|
2188
|
+
}
|
|
2189
|
+
};
|
|
2190
|
+
var defineSignaturePad = () => defineElement("mk-signature-pad", MkSignaturePadElement);
|
|
2191
|
+
|
|
2192
|
+
// src/components/waveform-player/element.ts
|
|
2193
|
+
var MkWaveformPlayerElement = class _MkWaveformPlayerElement extends MkElement {
|
|
2194
|
+
static options = { src: "string", peaks: "json", label: "string", disabled: "boolean", playbackRates: "json" };
|
|
2195
|
+
create(options) {
|
|
2196
|
+
return createWaveformPlayer(this, options);
|
|
2197
|
+
}
|
|
2198
|
+
play() {
|
|
2199
|
+
return this.instance?.play() ?? Promise.resolve(false);
|
|
2200
|
+
}
|
|
2201
|
+
pause() {
|
|
2202
|
+
this.instance?.pause();
|
|
2203
|
+
}
|
|
2204
|
+
seek(seconds) {
|
|
2205
|
+
this.instance?.seek(seconds);
|
|
2206
|
+
}
|
|
2207
|
+
update(options) {
|
|
2208
|
+
this.instance?.update(options);
|
|
2209
|
+
}
|
|
2210
|
+
get state() {
|
|
2211
|
+
return this.instance?.state;
|
|
2212
|
+
}
|
|
2213
|
+
get audio() {
|
|
2214
|
+
return this.instance?.audio ?? null;
|
|
2215
|
+
}
|
|
2216
|
+
attributeChangedCallback(name, previous, next) {
|
|
2217
|
+
if (previous === next || !this.instance) return;
|
|
2218
|
+
const option = name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2219
|
+
if (!Object.hasOwn(_MkWaveformPlayerElement.options, option)) return;
|
|
2220
|
+
this.instance.update({ [option]: this.options[option] });
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
var defineWaveformPlayer = () => defineElement("mk-waveform-player", MkWaveformPlayerElement);
|
|
2224
|
+
|
|
2225
|
+
// src/components/voice-message-bubble/element.ts
|
|
2226
|
+
var MkVoiceMessageBubbleElement = class _MkVoiceMessageBubbleElement extends MkElement {
|
|
2227
|
+
static options = { src: "string", peaks: "json", label: "string", disabled: "boolean", playbackRates: "json", direction: "string", author: "string", timestamp: "string", dateTime: "string", status: "string" };
|
|
2228
|
+
create(options) {
|
|
2229
|
+
return createVoiceMessageBubble(this, options);
|
|
2230
|
+
}
|
|
2231
|
+
play() {
|
|
2232
|
+
return this.instance?.play() ?? Promise.resolve(false);
|
|
2233
|
+
}
|
|
2234
|
+
pause() {
|
|
2235
|
+
this.instance?.pause();
|
|
2236
|
+
}
|
|
2237
|
+
seek(seconds) {
|
|
2238
|
+
this.instance?.seek(seconds);
|
|
2239
|
+
}
|
|
2240
|
+
update(options) {
|
|
2241
|
+
this.instance?.update(options);
|
|
2242
|
+
}
|
|
2243
|
+
get state() {
|
|
2244
|
+
return this.instance?.state;
|
|
2245
|
+
}
|
|
2246
|
+
get audio() {
|
|
2247
|
+
return this.instance?.audio ?? null;
|
|
2248
|
+
}
|
|
2249
|
+
attributeChangedCallback(name, previous, next) {
|
|
2250
|
+
if (previous === next || !this.instance) return;
|
|
2251
|
+
const option = name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2252
|
+
if (!Object.hasOwn(_MkVoiceMessageBubbleElement.options, option)) return;
|
|
2253
|
+
this.instance.update({ [option]: this.options[option] });
|
|
2254
|
+
}
|
|
2255
|
+
};
|
|
2256
|
+
var defineVoiceMessageBubble = () => defineElement("mk-voice-message-bubble", MkVoiceMessageBubbleElement);
|
|
2257
|
+
|
|
2258
|
+
// src/components/drilldown-menu/element.ts
|
|
2259
|
+
var MkDrilldownMenuElement = class extends MkElement {
|
|
2260
|
+
static options = { items: "json", path: "json", label: "string", backLabel: "string", emptyText: "string" };
|
|
2261
|
+
pendingItems;
|
|
2262
|
+
pendingPath;
|
|
2263
|
+
create(options) {
|
|
2264
|
+
return createDrilldownMenu(this, {
|
|
2265
|
+
...options,
|
|
2266
|
+
...this.pendingItems !== void 0 ? { items: this.pendingItems } : {},
|
|
2267
|
+
...this.pendingPath !== void 0 ? { path: this.pendingPath } : {}
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
attributeChangedCallback(name, previous, next) {
|
|
2271
|
+
if (previous === next) return;
|
|
2272
|
+
if (name === "items" || name === "path") {
|
|
2273
|
+
try {
|
|
2274
|
+
const value = JSON.parse(next ?? "[]");
|
|
2275
|
+
if (!Array.isArray(value)) return;
|
|
2276
|
+
if (name === "items") {
|
|
2277
|
+
this.pendingItems = value;
|
|
2278
|
+
this.instance?.setItems(this.pendingItems);
|
|
2279
|
+
} else {
|
|
2280
|
+
this.pendingPath = value;
|
|
2281
|
+
this.instance?.setPath(this.pendingPath);
|
|
2282
|
+
}
|
|
2283
|
+
} catch {
|
|
2284
|
+
}
|
|
2285
|
+
} else if (this.instance) {
|
|
2286
|
+
const { label, backLabel, emptyText } = this.options;
|
|
2287
|
+
this.instance.update({ label, backLabel, emptyText });
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
get items() {
|
|
2291
|
+
return this.pendingItems ?? this.options.items ?? [];
|
|
2292
|
+
}
|
|
2293
|
+
set items(items) {
|
|
2294
|
+
this.pendingItems = items;
|
|
2295
|
+
this.instance?.setItems(items);
|
|
2296
|
+
}
|
|
2297
|
+
get path() {
|
|
2298
|
+
return this.instance?.path ?? this.pendingPath ?? this.options.path ?? [];
|
|
2299
|
+
}
|
|
2300
|
+
set path(path) {
|
|
2301
|
+
this.pendingPath = path;
|
|
2302
|
+
this.instance?.setPath(path);
|
|
2303
|
+
}
|
|
2304
|
+
open(id) {
|
|
2305
|
+
return this.instance?.open(id) ?? false;
|
|
2306
|
+
}
|
|
2307
|
+
back() {
|
|
2308
|
+
return this.instance?.back() ?? false;
|
|
2309
|
+
}
|
|
2310
|
+
root() {
|
|
2311
|
+
this.instance?.root();
|
|
2312
|
+
}
|
|
2313
|
+
reset() {
|
|
2314
|
+
this.instance?.reset();
|
|
2315
|
+
}
|
|
2316
|
+
setItems(items) {
|
|
2317
|
+
this.items = items;
|
|
2318
|
+
}
|
|
2319
|
+
setPath(path) {
|
|
2320
|
+
this.path = path;
|
|
2321
|
+
}
|
|
2322
|
+
focusItem(id) {
|
|
2323
|
+
this.instance?.focusItem(id);
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
var defineDrilldownMenu = () => defineElement("mk-drilldown-menu", MkDrilldownMenuElement);
|
|
2327
|
+
|
|
2328
|
+
// src/components/wheel-picker/element.ts
|
|
2329
|
+
var MkWheelPickerElement = class extends MkElement {
|
|
2330
|
+
static options = { items: "json", value: "string", name: "string", label: "string", disabled: "boolean", visibleItems: "number", itemHeight: "number" };
|
|
2331
|
+
create(options) {
|
|
2332
|
+
return createWheelPicker(this, options);
|
|
2333
|
+
}
|
|
2334
|
+
attributeChangedCallback(name, previous, next) {
|
|
2335
|
+
if (previous === next || !this.instance) return;
|
|
2336
|
+
if (name === "value" && next !== null) {
|
|
2337
|
+
this.instance.setValue(next);
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
if (name === "items") {
|
|
2341
|
+
this.instance.setItems(this.options.items ?? []);
|
|
2342
|
+
if (this.options.value !== void 0) this.instance.setValue(String(this.options.value));
|
|
2343
|
+
return;
|
|
2344
|
+
}
|
|
2345
|
+
super.attributeChangedCallback(name, previous, next);
|
|
2346
|
+
}
|
|
2347
|
+
get value() {
|
|
2348
|
+
return this.instance?.value ?? "";
|
|
2349
|
+
}
|
|
2350
|
+
set value(next) {
|
|
2351
|
+
this.setAttribute("value", next);
|
|
2352
|
+
}
|
|
2353
|
+
setValue(value, notify = false) {
|
|
2354
|
+
this.instance?.setValue(value, notify);
|
|
2355
|
+
}
|
|
2356
|
+
setItems(items, notify = false) {
|
|
2357
|
+
this.instance?.setItems(items, notify);
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
var defineWheelPicker = () => defineElement("mk-wheel-picker", MkWheelPickerElement);
|
|
2361
|
+
|
|
2100
2362
|
// src/elements/index.ts
|
|
2101
2363
|
var ELEMENTS = {
|
|
2102
2364
|
"mk-theme-picker": MkThemePickerElement,
|
|
@@ -2178,7 +2440,12 @@ var ELEMENTS = {
|
|
|
2178
2440
|
"mk-radial-chart": MkRadialChartElement,
|
|
2179
2441
|
"mk-sankey-chart": MkSankeyChartElement,
|
|
2180
2442
|
"mk-heatmap-chart": MkHeatmapChartElement,
|
|
2181
|
-
"mk-orbit-menu": MkOrbitMenuElement
|
|
2443
|
+
"mk-orbit-menu": MkOrbitMenuElement,
|
|
2444
|
+
"mk-signature-pad": MkSignaturePadElement,
|
|
2445
|
+
"mk-waveform-player": MkWaveformPlayerElement,
|
|
2446
|
+
"mk-voice-message-bubble": MkVoiceMessageBubbleElement,
|
|
2447
|
+
"mk-drilldown-menu": MkDrilldownMenuElement,
|
|
2448
|
+
"mk-wheel-picker": MkWheelPickerElement
|
|
2182
2449
|
// new-component:entries
|
|
2183
2450
|
};
|
|
2184
2451
|
function defineElements(names = Object.keys(ELEMENTS)) {
|
|
@@ -2210,6 +2477,7 @@ export {
|
|
|
2210
2477
|
MkDateTimePickerElement,
|
|
2211
2478
|
MkDialogElement,
|
|
2212
2479
|
MkDrawerElement,
|
|
2480
|
+
MkDrilldownMenuElement,
|
|
2213
2481
|
MkEditableTableElement,
|
|
2214
2482
|
MkElement,
|
|
2215
2483
|
MkEmptyStateElement,
|
|
@@ -2248,6 +2516,7 @@ export {
|
|
|
2248
2516
|
MkScratchCardElement,
|
|
2249
2517
|
MkScrollIslandElement,
|
|
2250
2518
|
MkSelectElement,
|
|
2519
|
+
MkSignaturePadElement,
|
|
2251
2520
|
MkSkeletonElement,
|
|
2252
2521
|
MkSlotPickerElement,
|
|
2253
2522
|
MkSplitViewElement,
|
|
@@ -2267,11 +2536,19 @@ export {
|
|
|
2267
2536
|
MkTreeViewElement,
|
|
2268
2537
|
MkVirtualListElement,
|
|
2269
2538
|
MkVoiceDotsElement,
|
|
2539
|
+
MkVoiceMessageBubbleElement,
|
|
2540
|
+
MkWaveformPlayerElement,
|
|
2541
|
+
MkWheelPickerElement,
|
|
2270
2542
|
SafeHTMLElement,
|
|
2543
|
+
defineDrilldownMenu,
|
|
2271
2544
|
defineElement,
|
|
2272
2545
|
defineElements,
|
|
2546
|
+
defineSignaturePad,
|
|
2273
2547
|
defineStudioDock,
|
|
2274
2548
|
defineTrailer,
|
|
2549
|
+
defineVoiceMessageBubble,
|
|
2550
|
+
defineWaveformPlayer,
|
|
2551
|
+
defineWheelPicker,
|
|
2275
2552
|
toast
|
|
2276
2553
|
};
|
|
2277
2554
|
//# sourceMappingURL=index.js.map
|