@nymphjs/tilmeld-setup 1.0.0-beta.123 → 1.0.0-beta.125

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.125](https://forge.sciactive.com/sciactive/nymphjs/compare/v1.0.0-beta.124...v1.0.0-beta.125) (2026-09-24)
7
+
8
+ **Note:** Version bump only for package @nymphjs/tilmeld-setup
9
+
10
+ # [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)
11
+
12
+ **Note:** Version bump only for package @nymphjs/tilmeld-setup
13
+
6
14
  # [1.0.0-beta.123](https://forge.sciactive.com/sciactive/nymphjs/compare/v1.0.0-beta.122...v1.0.0-beta.123) (2026-09-23)
7
15
 
8
16
  ### Bug Fixes
package/dist/app/index.js CHANGED
@@ -22327,11 +22327,16 @@
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') {
22333
- // Convert entity classes to strings.
22334
- return item.class;
22330
+ if (item == null) {
22331
+ return item;
22332
+ }
22333
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22334
+ // Convert entity classes to class references.
22335
+ return ['nymph_class_reference', item.class];
22336
+ }
22337
+ else if (item instanceof Entity) {
22338
+ // Don't touch entities.
22339
+ return item;
22335
22340
  }
22336
22341
  else if (Array.isArray(item)) {
22337
22342
  // Recurse into lower arrays.
@@ -22347,45 +22352,60 @@
22347
22352
  // Not an entity or array, just return it.
22348
22353
  return item;
22349
22354
  }
22350
- function entitiesToReferences(item) {
22355
+ function classNamesToEntityConstructors(nymph, item) {
22351
22356
  if (item == null) {
22352
22357
  return item;
22353
22358
  }
22354
- else if (item instanceof Entity &&
22355
- typeof item.$toReference === 'function') {
22356
- // Convert entities to references.
22357
- return item.$toReference();
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;
22358
22374
  }
22359
22375
  else if (Array.isArray(item)) {
22360
22376
  // Recurse into lower arrays.
22361
- return item.map((entry) => entitiesToReferences(entry));
22377
+ return item.map((entry) => classNamesToEntityConstructors(nymph, entry));
22362
22378
  }
22363
22379
  else if (item instanceof Object) {
22364
22380
  let newObj = Object.create(item);
22365
22381
  for (let [key, value] of Object.entries(item)) {
22366
- newObj[key] = entitiesToReferences(value);
22382
+ newObj[key] = classNamesToEntityConstructors(nymph, value);
22367
22383
  }
22368
22384
  return newObj;
22369
22385
  }
22370
22386
  // Not an entity or array, just return it.
22371
22387
  return item;
22372
22388
  }
22373
- function entitiesToGuids(item) {
22389
+ function entitiesToReferences(item) {
22374
22390
  if (item == null) {
22375
22391
  return item;
22376
22392
  }
22377
- else if (item instanceof Entity && item.guid != null) {
22378
- // Convert entities to guids.
22379
- return item.guid;
22393
+ else if (item instanceof Entity) {
22394
+ // Convert entities to references.
22395
+ return item.$toReference();
22396
+ }
22397
+ else if (typeof item === 'function' && item.prototype instanceof Entity) {
22398
+ // Don't touch Entity classes.
22399
+ return item;
22380
22400
  }
22381
22401
  else if (Array.isArray(item)) {
22382
22402
  // Recurse into lower arrays.
22383
- return item.map((entry) => entitiesToGuids(entry));
22403
+ return item.map((entry) => entitiesToReferences(entry));
22384
22404
  }
22385
22405
  else if (item instanceof Object) {
22386
22406
  let newObj = Object.create(item);
22387
22407
  for (let [key, value] of Object.entries(item)) {
22388
- newObj[key] = entitiesToGuids(value);
22408
+ newObj[key] = entitiesToReferences(value);
22389
22409
  }
22390
22410
  return newObj;
22391
22411
  }
@@ -22412,10 +22432,20 @@
22412
22432
  return item.map((item) => referencesToEntities(item, nymph));
22413
22433
  }
22414
22434
  }
22415
- 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);
22416
22445
  for (let [key, value] of Object.entries(item)) {
22417
- item[key] = referencesToEntities(value, nymph);
22446
+ newObj[key] = referencesToEntities(value, nymph);
22418
22447
  }
22448
+ return newObj;
22419
22449
  }
22420
22450
  // Not an array, just return it.
22421
22451
  return item;
@@ -22721,7 +22751,7 @@
22721
22751
  toJSON() {
22722
22752
  this.$check();
22723
22753
  const obj = {
22724
- class: this.constructor.class,
22754
+ class: entityConstructorsToClassNames(this.constructor),
22725
22755
  guid: this.guid,
22726
22756
  cdate: this.cdate,
22727
22757
  mdate: this.mdate,
@@ -22729,7 +22759,7 @@
22729
22759
  data: {},
22730
22760
  };
22731
22761
  for (let [key, value] of Object.entries(this.$dataStore)) {
22732
- obj.data[key] = entitiesToReferences(value);
22762
+ obj.data[key] = entityConstructorsToClassNames(entitiesToReferences(value));
22733
22763
  }
22734
22764
  return obj;
22735
22765
  }
@@ -22748,7 +22778,10 @@
22748
22778
  this.$dataStore = Object.entries(entityJson.data)
22749
22779
  .map(([key, value]) => {
22750
22780
  this.$dirty[key] = false;
22751
- return { key, value: referencesToEntities(value, this.$nymph) };
22781
+ return {
22782
+ key,
22783
+ value: classNamesToEntityConstructors(this.$nymph, referencesToEntities(value, this.$nymph)),
22784
+ };
22752
22785
  })
22753
22786
  .reduce((obj, { key, value }) => Object.assign(obj, { [key]: value }), {});
22754
22787
  this.$data = new Proxy(this.$dataStore, this.$dataHandler);
@@ -22814,7 +22847,7 @@
22814
22847
  const patch = {
22815
22848
  guid: this.guid,
22816
22849
  mdate: this.mdate,
22817
- class: this.constructor.class,
22850
+ class: entityConstructorsToClassNames(this.constructor),
22818
22851
  addTags: this.tags.filter((tag) => this.$originalTags.indexOf(tag) === -1),
22819
22852
  removeTags: this.$originalTags.filter((tag) => this.tags.indexOf(tag) === -1),
22820
22853
  unset: [],
@@ -22823,7 +22856,7 @@
22823
22856
  for (let [key, dirty] of Object.entries(this.$dirty)) {
22824
22857
  if (dirty) {
22825
22858
  if (key in this.$data) {
22826
- patch.set[key] = entitiesToReferences(this.$data[key]);
22859
+ patch.set[key] = entityConstructorsToClassNames(entitiesToReferences(this.$data[key]));
22827
22860
  }
22828
22861
  else {
22829
22862
  patch.unset.push(key);
@@ -23890,8 +23923,8 @@
23890
23923
  data: {
23891
23924
  action: 'entity',
23892
23925
  data: [
23893
- { ...options, class: options.class.class },
23894
- ...entityConstructorsToClassNames(entitiesToGuids(selectors)),
23926
+ entityConstructorsToClassNames(options),
23927
+ ...entityConstructorsToClassNames(entitiesToReferences(selectors)),
23895
23928
  ],
23896
23929
  },
23897
23930
  });
@@ -23910,8 +23943,8 @@
23910
23943
  data: {
23911
23944
  action: 'entities',
23912
23945
  data: [
23913
- { ...options, class: options.class.class },
23914
- ...entityConstructorsToClassNames(entitiesToGuids(selectors)),
23946
+ entityConstructorsToClassNames(options),
23947
+ ...entityConstructorsToClassNames(entitiesToReferences(selectors)),
23915
23948
  ],
23916
23949
  },
23917
23950
  });
@@ -23938,7 +23971,7 @@
23938
23971
  return data.map((e) => this.initEntity(e));
23939
23972
  }
23940
23973
  initEntity(entityJSON) {
23941
- const EntityClass = this.getEntityClass(entityJSON.class);
23974
+ const EntityClass = classNamesToEntityConstructors(this, entityJSON.class);
23942
23975
  if (!EntityClass) {
23943
23976
  throw new ClassNotAvailableError(entityJSON.class + ' class cannot be found.');
23944
23977
  }
@@ -23976,7 +24009,7 @@
23976
24009
  item.hasOwnProperty('mdate') &&
23977
24010
  item.hasOwnProperty('tags') &&
23978
24011
  item.hasOwnProperty('data') &&
23979
- this.getEntityClass(item.class)) {
24012
+ classNamesToEntityConstructors(this, item.class) != null) {
23980
24013
  return this.initEntity(item);
23981
24014
  }
23982
24015
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/tilmeld-setup",
3
- "version": "1.0.0-beta.123",
3
+ "version": "1.0.0-beta.125",
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.123",
45
- "@nymphjs/tilmeld": "^1.0.0-beta.123",
44
+ "@nymphjs/nymph": "^1.0.0-beta.125",
45
+ "@nymphjs/tilmeld": "^1.0.0-beta.125",
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.123",
54
- "@nymphjs/driver-sqlite3": "^1.0.0-beta.123",
55
- "@nymphjs/query-parser": "^1.0.0-beta.123",
56
- "@nymphjs/server": "^1.0.0-beta.123",
57
- "@nymphjs/tilmeld-client": "^1.0.0-beta.123",
58
- "@nymphjs/tilmeld-components": "^1.0.0-beta.123",
53
+ "@nymphjs/client": "^1.0.0-beta.125",
54
+ "@nymphjs/driver-sqlite3": "^1.0.0-beta.125",
55
+ "@nymphjs/query-parser": "^1.0.0-beta.125",
56
+ "@nymphjs/server": "^1.0.0-beta.125",
57
+ "@nymphjs/tilmeld-client": "^1.0.0-beta.125",
58
+ "@nymphjs/tilmeld-components": "^1.0.0-beta.125",
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": "c37dc940d7bf39e0f63158add6d0c54e7c050782"
101
+ "gitHead": "b87bd7ebda690fc8c491835e44fece78dc650b9c"
102
102
  }