@mintjamsinc/ichigojs 0.1.11 → 0.1.13

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.
@@ -7279,8 +7279,18 @@ class VComponentDirective {
7279
7279
  * @inheritdoc
7280
7280
  */
7281
7281
  get domUpdater() {
7282
- // Component rendering is handled through onMounted lifecycle hook
7283
- return undefined;
7282
+ // Create and return the DOM updater
7283
+ const updater = {
7284
+ get dependentIdentifiers() {
7285
+ return [];
7286
+ },
7287
+ applyToDOM: () => {
7288
+ if (!this.#isActivated) {
7289
+ this.renderComponent();
7290
+ }
7291
+ }
7292
+ };
7293
+ return updater;
7284
7294
  }
7285
7295
  /**
7286
7296
  * @inheritdoc
@@ -7298,9 +7308,7 @@ class VComponentDirective {
7298
7308
  * @inheritdoc
7299
7309
  */
7300
7310
  get onMount() {
7301
- return () => {
7302
- this.renderComponent();
7303
- };
7311
+ return undefined;
7304
7312
  }
7305
7313
  /**
7306
7314
  * @inheritdoc
@@ -7404,10 +7412,12 @@ class VComponentDirective {
7404
7412
  }
7405
7413
  // Replace element with component element
7406
7414
  const parent = element.parentNode;
7407
- if (parent) {
7408
- parent.insertBefore(componentElement, element);
7409
- parent.removeChild(element);
7415
+ if (!parent) {
7416
+ console.error(`Element has no parent node. Component '${componentId}' cannot be mounted.`);
7417
+ return;
7410
7418
  }
7419
+ parent.insertBefore(componentElement, element);
7420
+ parent.removeChild(element);
7411
7421
  // Create component instance
7412
7422
  const instance = component.createInstance(properties);
7413
7423
  // Create and mount child application using the parent application's registries
@@ -7420,8 +7430,7 @@ class VComponentDirective {
7420
7430
  */
7421
7431
  cleanupComponent() {
7422
7432
  if (this.#childApp) {
7423
- // TODO: Implement unmount when available in VApplication
7424
- // this.#childApp.unmount();
7433
+ this.#childApp.unmount();
7425
7434
  this.#childApp = undefined;
7426
7435
  }
7427
7436
  this.#isActivated = false;
@@ -11207,6 +11216,16 @@ class VApplication {
11207
11216
  this.#vNode.update();
11208
11217
  this.#logger.info('Application mounted.');
11209
11218
  }
11219
+ /**
11220
+ * Unmounts the application and cleans up resources.
11221
+ */
11222
+ unmount() {
11223
+ if (this.#vNode) {
11224
+ this.#vNode.destroy();
11225
+ this.#vNode = undefined;
11226
+ }
11227
+ this.#logger.info('Application unmounted.');
11228
+ }
11210
11229
  /**
11211
11230
  * Creates a child application instance with the same registries.
11212
11231
  * @param options The application options for the child.