kritzel-stencil 0.0.75 → 0.0.76
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/kritzel-brush-style_18.cjs.entry.js +41 -42
- package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +41 -42
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js.map +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/{p-BrDtPpFQ.js → p-DzVQltWB.js} +43 -44
- package/dist/components/p-DzVQltWB.js.map +1 -0
- package/dist/esm/kritzel-brush-style_18.entry.js +41 -42
- package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
- package/dist/stencil/p-1f3fc9e2.entry.js +2 -0
- package/dist/stencil/p-1f3fc9e2.entry.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/components/ui/kritzel-controls/kritzel-controls.d.ts +0 -3
- package/package.json +1 -1
- package/dist/components/p-BrDtPpFQ.js.map +0 -1
- package/dist/stencil/p-ae16b994.entry.js +0 -2
- package/dist/stencil/p-ae16b994.entry.js.map +0 -1
|
@@ -3057,46 +3057,45 @@ const KritzelControls = class {
|
|
|
3057
3057
|
var _a;
|
|
3058
3058
|
return (_a = this.activeControl) === null || _a === void 0 ? void 0 : _a.tool;
|
|
3059
3059
|
}
|
|
3060
|
-
async componentDidLoad() {
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
}
|
|
3075
|
-
async initializeEngine() {
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
}
|
|
3081
|
-
async initializeTools() {
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
}
|
|
3060
|
+
// async componentDidLoad() {
|
|
3061
|
+
// console.log('KritzelControls componentDidLoad');
|
|
3062
|
+
// this.forceUpdate++;
|
|
3063
|
+
// this.controlsReady.emit();
|
|
3064
|
+
// this.initializeEngine().then(() => {
|
|
3065
|
+
// this.initializeTools()
|
|
3066
|
+
// .then(() => {
|
|
3067
|
+
// console.info('KritzelControls initialized with tools:', this.controls);
|
|
3068
|
+
// this.forceUpdate++;
|
|
3069
|
+
// })
|
|
3070
|
+
// .catch(error => {
|
|
3071
|
+
// console.error('Error initializing tools:', error);
|
|
3072
|
+
// });
|
|
3073
|
+
// });
|
|
3074
|
+
// }
|
|
3075
|
+
// private async initializeEngine() {
|
|
3076
|
+
// this.kritzelEngine = this.host.parentElement.querySelector('kritzel-engine');
|
|
3077
|
+
// if (!this.kritzelEngine) {
|
|
3078
|
+
// throw new Error('kritzel-engine not found in parent element.');
|
|
3079
|
+
// }
|
|
3080
|
+
// }
|
|
3081
|
+
// private async initializeTools() {
|
|
3082
|
+
// for (const c of this.controls) {
|
|
3083
|
+
// if (c.type === 'tool' && c.tool) {
|
|
3084
|
+
// c.tool = await this.kritzelEngine.registerTool(c.name, c.tool, c.config);
|
|
3085
|
+
// }
|
|
3086
|
+
// if (c.type === 'tool' && c.isDefault && c.tool) {
|
|
3087
|
+
// await this.kritzelEngine.changeActiveTool(c.tool as KritzelBaseTool);
|
|
3088
|
+
// this.activeControl = c;
|
|
3089
|
+
// }
|
|
3090
|
+
// if (c.type === 'config') {
|
|
3091
|
+
// if (this.firstConfig === null) {
|
|
3092
|
+
// this.firstConfig = c;
|
|
3093
|
+
// } else {
|
|
3094
|
+
// console.warn('Only one config control is allowed. The first one will be used.');
|
|
3095
|
+
// }
|
|
3096
|
+
// }
|
|
3097
|
+
// }
|
|
3098
|
+
// }
|
|
3100
3099
|
async handleActiveToolChange(event) {
|
|
3101
3100
|
var _a;
|
|
3102
3101
|
this.activeControl = this.controls.find(control => control.tool === event.detail) || null;
|
|
@@ -3134,11 +3133,11 @@ const KritzelControls = class {
|
|
|
3134
3133
|
render() {
|
|
3135
3134
|
var _a, _b;
|
|
3136
3135
|
const hasNoConfig = ((_a = this.activeControl) === null || _a === void 0 ? void 0 : _a.config) === undefined || ((_b = this.activeControl) === null || _b === void 0 ? void 0 : _b.config) === null;
|
|
3137
|
-
return (index.h(index.Host, { key: '
|
|
3136
|
+
return (index.h(index.Host, { key: 'e17295147adc548fc3051cafe5625a8f87474c3b' }, index.h("kritzel-utility-panel", { key: 'b8e715a2534b2750f31f5fe5f311528f64c1c013', style: {
|
|
3138
3137
|
position: 'absolute',
|
|
3139
3138
|
bottom: '56px',
|
|
3140
3139
|
left: '12px',
|
|
3141
|
-
}, onUndo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.undo(); }, onRedo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.redo(); }, onDelete: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.delete(); } }), index.h("div", { key: '
|
|
3140
|
+
}, onUndo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.undo(); }, onRedo: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.redo(); }, onDelete: () => { var _a; return (_a = this.kritzelEngine) === null || _a === void 0 ? void 0 : _a.delete(); } }), index.h("div", { key: 'c82659049cc0a55659159ad393c603759c25c2d3', class: "kritzel-controls" }, this.controls.map(control => {
|
|
3142
3141
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3143
3142
|
if (control.type === 'tool') {
|
|
3144
3143
|
return (index.h("button", { class: {
|