@nymphjs/tilmeld-setup 1.0.0-beta.124 → 1.0.0-beta.126

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-beta.126](https://forge.sciactive.com/sciactive/nymphjs/compare/v1.0.0-beta.125...v1.0.0-beta.126) (2026-09-24)
7
+
8
+ **Note:** Version bump only for package @nymphjs/tilmeld-setup
9
+
10
+ # [1.0.0-beta.125](https://forge.sciactive.com/sciactive/nymphjs/compare/v1.0.0-beta.124...v1.0.0-beta.125) (2026-09-24)
11
+
12
+ **Note:** Version bump only for package @nymphjs/tilmeld-setup
13
+
6
14
  # [1.0.0-beta.124](https://forge.sciactive.com/sciactive/nymphjs/compare/v1.0.0-beta.123...v1.0.0-beta.124) (2026-09-24)
7
15
 
8
16
  **Note:** Version bump only for package @nymphjs/tilmeld-setup
package/dist/app/index.js CHANGED
@@ -22327,14 +22327,14 @@
22327
22327
  return Object.keys(obj);
22328
22328
  }
22329
22329
  function entityConstructorsToClassNames(item) {
22330
- if (typeof item === 'function' &&
22331
- item.prototype instanceof Entity &&
22332
- typeof item.class === 'string') {
22330
+ if (item == null) {
22331
+ return item;
22332
+ }
22333
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22333
22334
  // Convert entity classes to class references.
22334
22335
  return ['nymph_class_reference', item.class];
22335
22336
  }
22336
- else if (item instanceof Entity &&
22337
- typeof item.$toReference === 'function') {
22337
+ else if (item instanceof Entity) {
22338
22338
  // Don't touch entities.
22339
22339
  return item;
22340
22340
  }
@@ -22352,18 +22352,49 @@
22352
22352
  // Not an entity or array, just return it.
22353
22353
  return item;
22354
22354
  }
22355
+ function classNamesToEntityConstructors(nymph, item) {
22356
+ if (item == null) {
22357
+ return item;
22358
+ }
22359
+ else if (Array.isArray(item) &&
22360
+ item.length === 2 &&
22361
+ item[0] === 'nymph_class_reference' &&
22362
+ typeof item[1] === 'string') {
22363
+ // Convert class references to entity classes.
22364
+ const EntityClass = nymph.getEntityClass(item[1]);
22365
+ return EntityClass;
22366
+ }
22367
+ else if (item instanceof Entity) {
22368
+ // Don't touch entities.
22369
+ return item;
22370
+ }
22371
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22372
+ // Don't touch Entity classes.
22373
+ return item;
22374
+ }
22375
+ else if (Array.isArray(item)) {
22376
+ // Recurse into lower arrays.
22377
+ return item.map((entry) => classNamesToEntityConstructors(nymph, entry));
22378
+ }
22379
+ else if (item instanceof Object) {
22380
+ let newObj = Object.create(item);
22381
+ for (let [key, value] of Object.entries(item)) {
22382
+ newObj[key] = classNamesToEntityConstructors(nymph, value);
22383
+ }
22384
+ return newObj;
22385
+ }
22386
+ // Not an entity or array, just return it.
22387
+ return item;
22388
+ }
22355
22389
  function entitiesToReferences(item) {
22356
22390
  if (item == null) {
22357
22391
  return item;
22358
22392
  }
22359
- else if (item instanceof Entity &&
22360
- typeof item.$toReference === 'function') {
22393
+ else if (item instanceof Entity) {
22361
22394
  // Convert entities to references.
22362
22395
  return item.$toReference();
22363
22396
  }
22364
- else if (typeof item === 'function' &&
22365
- item.prototype instanceof Entity &&
22366
- typeof item.class === 'string') {
22397
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22367
22398
  // Don't touch Entity classes.
22368
22399
  return item;
22369
22400
  }
@@ -22401,10 +22432,20 @@
22401
22432
  return item.map((item) => referencesToEntities(item, nymph));
22402
22433
  }
22403
22434
  }
22404
- else if (Entity && item instanceof Object && !(item instanceof Entity)) {
22435
+ else if (item instanceof Entity) {
22436
+ // Don't touch entities.
22437
+ return item;
22438
+ }
22439
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22440
+ // Don't touch Entity classes.
22441
+ return item;
22442
+ }
22443
+ else if (item instanceof Object) {
22444
+ let newObj = Object.create(item);
22405
22445
  for (let [key, value] of Object.entries(item)) {
22406
- item[key] = referencesToEntities(value, nymph);
22446
+ newObj[key] = referencesToEntities(value, nymph);
22407
22447
  }
22448
+ return newObj;
22408
22449
  }
22409
22450
  // Not an array, just return it.
22410
22451
  return item;
@@ -22710,7 +22751,7 @@
22710
22751
  toJSON() {
22711
22752
  this.$check();
22712
22753
  const obj = {
22713
- class: this.constructor.class,
22754
+ class: entityConstructorsToClassNames(this.constructor),
22714
22755
  guid: this.guid,
22715
22756
  cdate: this.cdate,
22716
22757
  mdate: this.mdate,
@@ -22718,7 +22759,7 @@
22718
22759
  data: {},
22719
22760
  };
22720
22761
  for (let [key, value] of Object.entries(this.$dataStore)) {
22721
- obj.data[key] = entitiesToReferences(value);
22762
+ obj.data[key] = entityConstructorsToClassNames(entitiesToReferences(value));
22722
22763
  }
22723
22764
  return obj;
22724
22765
  }
@@ -22737,7 +22778,10 @@
22737
22778
  this.$dataStore = Object.entries(entityJson.data)
22738
22779
  .map(([key, value]) => {
22739
22780
  this.$dirty[key] = false;
22740
- return { key, value: referencesToEntities(value, this.$nymph) };
22781
+ return {
22782
+ key,
22783
+ value: classNamesToEntityConstructors(this.$nymph, referencesToEntities(value, this.$nymph)),
22784
+ };
22741
22785
  })
22742
22786
  .reduce((obj, { key, value }) => Object.assign(obj, { [key]: value }), {});
22743
22787
  this.$data = new Proxy(this.$dataStore, this.$dataHandler);
@@ -22803,7 +22847,7 @@
22803
22847
  const patch = {
22804
22848
  guid: this.guid,
22805
22849
  mdate: this.mdate,
22806
- class: this.constructor.class,
22850
+ class: entityConstructorsToClassNames(this.constructor),
22807
22851
  addTags: this.tags.filter((tag) => this.$originalTags.indexOf(tag) === -1),
22808
22852
  removeTags: this.$originalTags.filter((tag) => this.tags.indexOf(tag) === -1),
22809
22853
  unset: [],
@@ -22812,7 +22856,7 @@
22812
22856
  for (let [key, dirty] of Object.entries(this.$dirty)) {
22813
22857
  if (dirty) {
22814
22858
  if (key in this.$data) {
22815
- patch.set[key] = entitiesToReferences(this.$data[key]);
22859
+ patch.set[key] = entityConstructorsToClassNames(entitiesToReferences(this.$data[key]));
22816
22860
  }
22817
22861
  else {
22818
22862
  patch.unset.push(key);
@@ -23927,7 +23971,7 @@
23927
23971
  return data.map((e) => this.initEntity(e));
23928
23972
  }
23929
23973
  initEntity(entityJSON) {
23930
- const EntityClass = this.getEntityClass(entityJSON.class);
23974
+ const EntityClass = classNamesToEntityConstructors(this, entityJSON.class);
23931
23975
  if (!EntityClass) {
23932
23976
  throw new ClassNotAvailableError(entityJSON.class + ' class cannot be found.');
23933
23977
  }
@@ -23965,7 +24009,7 @@
23965
24009
  item.hasOwnProperty('mdate') &&
23966
24010
  item.hasOwnProperty('tags') &&
23967
24011
  item.hasOwnProperty('data') &&
23968
- this.getEntityClass(item.class)) {
24012
+ classNamesToEntityConstructors(this, item.class) != null) {
23969
24013
  return this.initEntity(item);
23970
24014
  }
23971
24015
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/tilmeld-setup",
3
- "version": "1.0.0-beta.124",
3
+ "version": "1.0.0-beta.126",
4
4
  "description": "Nymph.js - Tilmeld Setup App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "license": "Apache-2.0",
43
43
  "dependencies": {
44
- "@nymphjs/nymph": "^1.0.0-beta.124",
45
- "@nymphjs/tilmeld": "^1.0.0-beta.124",
44
+ "@nymphjs/nymph": "^1.0.0-beta.126",
45
+ "@nymphjs/tilmeld": "^1.0.0-beta.126",
46
46
  "express": "^5.2.1",
47
47
  "locutus": "^3.0.36"
48
48
  },
@@ -50,12 +50,12 @@
50
50
  "@material/elevation": "^14.0.0",
51
51
  "@material/typography": "^14.0.0",
52
52
  "@mdi/js": "^7.4.47",
53
- "@nymphjs/client": "^1.0.0-beta.124",
54
- "@nymphjs/driver-sqlite3": "^1.0.0-beta.124",
55
- "@nymphjs/query-parser": "^1.0.0-beta.124",
56
- "@nymphjs/server": "^1.0.0-beta.124",
57
- "@nymphjs/tilmeld-client": "^1.0.0-beta.124",
58
- "@nymphjs/tilmeld-components": "^1.0.0-beta.124",
53
+ "@nymphjs/client": "^1.0.0-beta.126",
54
+ "@nymphjs/driver-sqlite3": "^1.0.0-beta.126",
55
+ "@nymphjs/query-parser": "^1.0.0-beta.126",
56
+ "@nymphjs/server": "^1.0.0-beta.126",
57
+ "@nymphjs/tilmeld-client": "^1.0.0-beta.126",
58
+ "@nymphjs/tilmeld-components": "^1.0.0-beta.126",
59
59
  "@rollup/plugin-commonjs": "^29.0.3",
60
60
  "@rollup/plugin-node-resolve": "^16.0.3",
61
61
  "@rollup/plugin-sucrase": "^5.1.0",
@@ -98,5 +98,5 @@
98
98
  "tslib": "^2.8.1",
99
99
  "typescript": "^7.0.2"
100
100
  },
101
- "gitHead": "f0e37f47c5ceeaaa1b389867f7cd24eac05cc5f9"
101
+ "gitHead": "92761dea0e829bd33b0e4eaadb86802bb9fd0d40"
102
102
  }