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.
@@ -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
- 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
- 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
- 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);
3088
- this.activeControl = c;
3089
- }
3090
- if (c.type === 'config') {
3091
- if (this.firstConfig === null) {
3092
- this.firstConfig = c;
3093
- }
3094
- else {
3095
- console.warn('Only one config control is allowed. The first one will be used.');
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: '843ec6f6887dc821fe5de4373fa074320973750f' }, index.h("kritzel-utility-panel", { key: '80da8761a8d0fd9df9ddbc65f935a631e834f33a', style: {
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: 'fdb54d5e8098a738bf8f8391ee683b3615ec5530', class: "kritzel-controls" }, this.controls.map(control => {
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: {