@nymphjs/tilmeld-setup 1.0.0-beta.85 → 1.0.0-beta.87

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,16 @@
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.87](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.86...v1.0.0-beta.87) (2025-01-20)
7
+
8
+ **Note:** Version bump only for package @nymphjs/tilmeld-setup
9
+
10
+ # [1.0.0-beta.86](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.85...v1.0.0-beta.86) (2024-12-28)
11
+
12
+ ### Features
13
+
14
+ - add domain support ([c965008](https://github.com/sciactive/nymphjs/commit/c96500811a4d64ab4e80eca6acdfbfdfae1de076))
15
+
6
16
  # [1.0.0-beta.85](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.84...v1.0.0-beta.85) (2024-12-27)
7
17
 
8
18
  **Note:** Version bump only for package @nymphjs/tilmeld-setup
package/README.md CHANGED
@@ -73,7 +73,7 @@ app.listen(80);
73
73
 
74
74
  # License
75
75
 
76
- Copyright 2021-2024 SciActive Inc
76
+ Copyright 2021-2025 SciActive Inc
77
77
 
78
78
  Licensed under the Apache License, Version 2.0 (the "License");
79
79
  you may not use this file except in compliance with the License.
@@ -279,9 +279,13 @@
279
279
 
280
280
  const onLogin = (currentUser: UserClass & CurrentUserData) => {
281
281
  $user = currentUser;
282
+ // Helps with admin and debugging.
283
+ (window as any).user = currentUser;
282
284
  };
283
285
  const onLogout = () => {
284
286
  $user = null;
287
+ // Helps with admin and debugging.
288
+ (window as any).user = null;
285
289
  };
286
290
 
287
291
  onMount(setMiniWindow);
@@ -292,6 +296,8 @@
292
296
  $clientConfig = await User.getClientConfig();
293
297
 
294
298
  $user = await User.current();
299
+ // Helps with admin and debugging.
300
+ (window as any).user = $user;
295
301
  });
296
302
 
297
303
  function setMiniWindow() {
package/dist/app/index.js CHANGED
@@ -315,7 +315,6 @@
315
315
  }
316
316
 
317
317
  let legacy_mode_flag = false;
318
- let tracing_mode_flag = false;
319
318
 
320
319
  const EACH_ITEM_REACTIVE = 1;
321
320
  const EACH_INDEX_REACTIVE = 1 << 1;
@@ -339,53 +338,6 @@
339
338
 
340
339
  const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';
341
340
 
342
- /** @import { Derived, Reaction, Signal, Value } from '#client' */
343
-
344
- /** @type { any } */
345
- let tracing_expressions = null;
346
-
347
- /**
348
- * @param {string} label
349
- */
350
- function get_stack$1(label) {
351
- let error = Error();
352
- const stack = error.stack;
353
-
354
- if (stack) {
355
- const lines = stack.split('\n');
356
- const new_lines = ['\n'];
357
-
358
- for (let i = 0; i < lines.length; i++) {
359
- const line = lines[i];
360
-
361
- if (line === 'Error') {
362
- continue;
363
- }
364
- if (line.includes('validate_each_keys')) {
365
- return null;
366
- }
367
- if (line.includes('svelte/src/internal')) {
368
- continue;
369
- }
370
- new_lines.push(line);
371
- }
372
-
373
- if (new_lines.length === 1) {
374
- return null;
375
- }
376
-
377
- define_property(error, 'stack', {
378
- value: new_lines.join('\n')
379
- });
380
-
381
- define_property(error, 'name', {
382
- // 'Error' suffix is required for stack traces to be rendered properly
383
- value: `${label}Error`
384
- });
385
- }
386
- return error;
387
- }
388
-
389
341
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
390
342
 
391
343
  let inspect_effects = new Set();
@@ -413,11 +365,6 @@
413
365
  version: 0
414
366
  };
415
367
 
416
- if (DEV && tracing_mode_flag) {
417
- signal.created = stack ?? get_stack$1('CreatedAt');
418
- signal.debug = null;
419
- }
420
-
421
368
  return signal;
422
369
  }
423
370
 
@@ -494,10 +441,6 @@
494
441
  source.v = value;
495
442
  source.version = increment_version();
496
443
 
497
- if (DEV && tracing_mode_flag) {
498
- source.updated = get_stack$1('UpdatedAt');
499
- }
500
-
501
444
  mark_reactions(source, DIRTY);
502
445
 
503
446
  // If the current signal is running for the first time, it won't have any
@@ -854,11 +797,6 @@
854
797
  * @returns {T}
855
798
  */
856
799
  function proxy(value, parent = null, prev) {
857
- /** @type {Error | null} */
858
- var stack = null;
859
- if (DEV && tracing_mode_flag) {
860
- stack = get_stack$1('CreatedAt');
861
- }
862
800
  // if non-proxyable, or is already a proxy, return `value`
863
801
  if (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {
864
802
  return value;
@@ -878,7 +816,7 @@
878
816
  if (is_proxied_array) {
879
817
  // We need to create the length source eagerly to ensure that
880
818
  // mutations to the array are properly synced with our proxy
881
- sources.set('length', source(/** @type {any[]} */ (value).length, stack));
819
+ sources.set('length', source(/** @type {any[]} */ (value).length));
882
820
  }
883
821
 
884
822
  /** @type {ProxyMetadata} */
@@ -918,7 +856,7 @@
918
856
  var s = sources.get(prop);
919
857
 
920
858
  if (s === undefined) {
921
- s = source(descriptor.value, stack);
859
+ s = source(descriptor.value);
922
860
  sources.set(prop, s);
923
861
  } else {
924
862
  set(s, proxy(descriptor.value, metadata));
@@ -932,7 +870,7 @@
932
870
 
933
871
  if (s === undefined) {
934
872
  if (prop in target) {
935
- sources.set(prop, source(UNINITIALIZED, stack));
873
+ sources.set(prop, source(UNINITIALIZED));
936
874
  }
937
875
  } else {
938
876
  // When working with arrays, we need to also ensure we update the length when removing
@@ -966,7 +904,7 @@
966
904
 
967
905
  // create a source, but only if it's an own property and not a prototype property
968
906
  if (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {
969
- s = source(proxy(exists ? target[prop] : UNINITIALIZED, metadata), stack);
907
+ s = source(proxy(exists ? target[prop] : UNINITIALIZED, metadata));
970
908
  sources.set(prop, s);
971
909
  }
972
910
 
@@ -1034,7 +972,7 @@
1034
972
  (active_effect !== null && (!has || get_descriptor(target, prop)?.writable))
1035
973
  ) {
1036
974
  if (s === undefined) {
1037
- s = source(has ? proxy(target[prop], metadata) : UNINITIALIZED, stack);
975
+ s = source(has ? proxy(target[prop], metadata) : UNINITIALIZED);
1038
976
  sources.set(prop, s);
1039
977
  }
1040
978
 
@@ -1061,7 +999,7 @@
1061
999
  // If the item exists in the original, we need to create a uninitialized source,
1062
1000
  // else a later read of the property would result in a source being created with
1063
1001
  // the value of the original item at that index.
1064
- other_s = source(UNINITIALIZED, stack);
1002
+ other_s = source(UNINITIALIZED);
1065
1003
  sources.set(i + '', other_s);
1066
1004
  }
1067
1005
  }
@@ -1073,7 +1011,7 @@
1073
1011
  // object property before writing to that property.
1074
1012
  if (s === undefined) {
1075
1013
  if (!has || get_descriptor(target, prop)?.writable) {
1076
- s = source(undefined, stack);
1014
+ s = source(undefined);
1077
1015
  set(s, proxy(value, metadata));
1078
1016
  sources.set(prop, s);
1079
1017
  }
@@ -1417,10 +1355,6 @@
1417
1355
  parent: parent_derived ?? active_effect
1418
1356
  };
1419
1357
 
1420
- if (DEV && tracing_mode_flag) {
1421
- signal.created = get_stack$1('CreatedAt');
1422
- }
1423
-
1424
1358
  if (parent_derived !== null) {
1425
1359
  (parent_derived.children ??= []).push(signal);
1426
1360
  }
@@ -2962,28 +2896,6 @@
2962
2896
  }
2963
2897
  }
2964
2898
 
2965
- if (
2966
- DEV &&
2967
- tracing_mode_flag &&
2968
- tracing_expressions !== null &&
2969
- active_reaction !== null &&
2970
- tracing_expressions.reaction === active_reaction
2971
- ) {
2972
- // Used when mapping state between special blocks like `each`
2973
- if (signal.debug) {
2974
- signal.debug();
2975
- } else if (signal.created) {
2976
- var entry = tracing_expressions.entries.get(signal);
2977
-
2978
- if (entry === undefined) {
2979
- entry = { read: [] };
2980
- tracing_expressions.entries.set(signal, entry);
2981
- }
2982
-
2983
- entry.read.push(get_stack$1('TracedAt'));
2984
- }
2985
- }
2986
-
2987
2899
  return signal.v;
2988
2900
  }
2989
2901
 
@@ -4009,20 +3921,14 @@
4009
3921
  }
4010
3922
 
4011
3923
  try {
4012
- if (state === PENDING && pending_fn) {
4013
- if (pending_effect) resume_effect(pending_effect);
4014
- else pending_effect = branch(() => pending_fn(anchor));
4015
- }
3924
+ if (state === PENDING && pending_fn) ;
4016
3925
 
4017
3926
  if (state === THEN && then_fn) {
4018
3927
  if (then_effect) resume_effect(then_effect);
4019
3928
  else then_effect = branch(() => then_fn(anchor, input_source));
4020
3929
  }
4021
3930
 
4022
- if (state === CATCH && catch_fn) {
4023
- if (catch_effect) resume_effect(catch_effect);
4024
- else catch_effect = branch(() => catch_fn(anchor, error_source));
4025
- }
3931
+ if (state === CATCH && catch_fn) ;
4026
3932
 
4027
3933
  if (state !== PENDING && pending_effect) {
4028
3934
  pause_effect(pending_effect, () => (pending_effect = null));
@@ -4738,8 +4644,6 @@
4738
4644
  */
4739
4645
  function element(node, get_tag, is_svg, render_fn, get_namespace, location) {
4740
4646
 
4741
- var filename = DEV && location && component_context?.function[FILENAME];
4742
-
4743
4647
  /** @type {string | null} */
4744
4648
  var tag;
4745
4649
 
@@ -4783,17 +4687,6 @@
4783
4687
  ? document.createElementNS(ns, next_tag)
4784
4688
  : document.createElement(next_tag);
4785
4689
 
4786
- if (DEV && location) {
4787
- // @ts-expect-error
4788
- element.__svelte_meta = {
4789
- loc: {
4790
- file: filename,
4791
- line: location[0],
4792
- column: location[1]
4793
- }
4794
- };
4795
- }
4796
-
4797
4690
  assign_nodes(element, element);
4798
4691
 
4799
4692
  if (render_fn) {
@@ -4864,6 +4757,21 @@
4864
4757
  });
4865
4758
  }
4866
4759
 
4760
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx$1(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
4761
+
4762
+ /**
4763
+ * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.
4764
+ * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)
4765
+ * @param {any} value
4766
+ */
4767
+ function clsx(value) {
4768
+ if (typeof value === 'object') {
4769
+ return clsx$1(value);
4770
+ } else {
4771
+ return value ?? '';
4772
+ }
4773
+ }
4774
+
4867
4775
  /**
4868
4776
  * Sets the `selected` attribute on an `option` element.
4869
4777
  * Not set through the property because that doesn't reflect to the DOM,
@@ -4944,6 +4852,10 @@
4944
4852
  }
4945
4853
  }
4946
4854
 
4855
+ if (next.class) {
4856
+ next.class = clsx(next.class);
4857
+ }
4858
+
4947
4859
  if (css_hash !== undefined) {
4948
4860
  next.class = next.class ? next.class + ' ' + css_hash : css_hash;
4949
4861
  }
@@ -5118,9 +5030,10 @@
5118
5030
  /**
5119
5031
  * @param {HTMLElement} dom
5120
5032
  * @param {string} value
5033
+ * @param {string} [hash]
5121
5034
  * @returns {void}
5122
5035
  */
5123
- function set_class(dom, value) {
5036
+ function set_class(dom, value, hash) {
5124
5037
  // @ts-expect-error need to add __className to patched prototype
5125
5038
  var prev_class_name = dom.__className;
5126
5039
  var next_class_name = to_class(value);
@@ -5132,7 +5045,7 @@
5132
5045
  // Removing the attribute when the value is only an empty string causes
5133
5046
  // peformance issues vs simply making the className an empty string. So
5134
5047
  // we should only remove the class if the the value is nullish.
5135
- if (value == null) {
5048
+ if (value == null && !hash) {
5136
5049
  dom.removeAttribute('class');
5137
5050
  } else {
5138
5051
  dom.className = next_class_name;
@@ -5146,10 +5059,11 @@
5146
5059
  /**
5147
5060
  * @template V
5148
5061
  * @param {V} value
5062
+ * @param {string} [hash]
5149
5063
  * @returns {string | V}
5150
5064
  */
5151
- function to_class(value) {
5152
- return value == null ? '' : value;
5065
+ function to_class(value, hash) {
5066
+ return (value == null ? '' : value) + ('');
5153
5067
  }
5154
5068
 
5155
5069
  /**
@@ -6689,13 +6603,13 @@
6689
6603
  each(div_2, 21, () => fourColor() ? [1, 2, 3, 4] : [1], index, ($$anchor, color) => {
6690
6604
  var div_3 = root_1$h();
6691
6605
 
6692
- const class_derived = derived(() => classMap({
6606
+ const class_derived = derived(() => clsx(classMap({
6693
6607
  [className()]: true,
6694
6608
  'mdc-circular-progress__spinner-layer': true,
6695
6609
  ['mdc-circular-progress__color-' + get(color)]: fourColor()
6696
- }));
6610
+ })));
6697
6611
 
6698
- template_effect(() => set_class(div_3, get(class_derived)));
6612
+ template_effect(() => set_class(div_3, get(class_derived), ""));
6699
6613
  append($$anchor, div_3);
6700
6614
  });
6701
6615
  bind_this(div, ($$value) => element = $$value, () => element);
@@ -9085,48 +8999,43 @@
9085
8999
 
9086
9000
  let use = prop($$props, "use", 19, () => []),
9087
9001
  className = prop($$props, "class", 3, ''),
9088
- _internals = prop($$props, "_internals", 19, () => ({
9089
- component: SmuiElement,
9090
- tag: 'div',
9091
- class: '',
9092
- classMap: {},
9093
- contexts: {},
9094
- props: {}
9095
- })),
9096
- MyComponent = prop($$props, "component", 19, () => _internals().component),
9097
- tag = prop($$props, "tag", 19, () => _internals().tag),
9002
+ MyComponent = prop($$props, "component", 3, SmuiElement),
9003
+ tag = prop($$props, "tag", 3, 'div'),
9004
+ _smuiClass = prop($$props, "_smuiClass", 3, ''),
9005
+ _smuiClassMap = prop($$props, "_smuiClassMap", 23, () => ({})),
9006
+ _smuiContexts = prop($$props, "_smuiContexts", 19, () => ({})),
9007
+ _smuiProps = prop($$props, "_smuiProps", 19, () => ({})),
9098
9008
  restProps = rest_props($$props, [
9099
9009
  "$$slots",
9100
9010
  "$$events",
9101
9011
  "$$legacy",
9102
9012
  "use",
9103
9013
  "class",
9104
- "_internals",
9105
9014
  "component",
9106
9015
  "tag",
9016
+ "_smuiClass",
9017
+ "_smuiClassMap",
9018
+ "_smuiContexts",
9019
+ "_smuiProps",
9107
9020
  "children"
9108
9021
  ]);
9109
9022
 
9110
9023
  let element;
9111
- const smuiClass = proxy(_internals().class);
9112
- const smuiClassMap = proxy({});
9113
9024
  const smuiClassUnsubscribes = [];
9114
- const contexts = proxy(_internals().contexts);
9115
- const props = proxy(_internals().props);
9116
9025
 
9117
- Object.entries(_internals().classMap).forEach(([name, context]) => {
9026
+ Object.entries(_smuiClassMap()).forEach(([name, context]) => {
9118
9027
  const store = getContext(context);
9119
9028
 
9120
9029
  if (store && 'subscribe' in store) {
9121
9030
  smuiClassUnsubscribes.push(store.subscribe((value) => {
9122
- smuiClassMap[name] = value;
9031
+ _smuiClassMap()[name] = value;
9123
9032
  }));
9124
9033
  }
9125
9034
  });
9126
9035
 
9127
- for (let context in contexts) {
9128
- if (contexts.hasOwnProperty(context)) {
9129
- setContext(context, contexts[context]);
9036
+ for (let context in _smuiContexts()) {
9037
+ if (_smuiContexts().hasOwnProperty(context)) {
9038
+ setContext(context, _smuiContexts()[context]);
9130
9039
  }
9131
9040
  }
9132
9041
 
@@ -9145,8 +9054,8 @@
9145
9054
 
9146
9055
  var class_1 = derived(() => classMap({
9147
9056
  [className()]: true,
9148
- [smuiClass]: true,
9149
- ...smuiClassMap
9057
+ [_smuiClass()]: true,
9058
+ ..._smuiClassMap()
9150
9059
  }));
9151
9060
 
9152
9061
  component(node, MyComponent, ($$anchor, $$component) => {
@@ -9163,7 +9072,7 @@
9163
9072
  return get(class_1);
9164
9073
  }
9165
9074
  },
9166
- () => props,
9075
+ _smuiProps,
9167
9076
  () => restProps,
9168
9077
  {
9169
9078
  children: ($$anchor, $$slotProps) => {
@@ -9185,32 +9094,118 @@
9185
9094
  return pop({ getElement });
9186
9095
  }
9187
9096
 
9188
- function classAdderBuilder(internals) {
9189
- return function (anchor, props) {
9190
- return ClassAdder(anchor, Object.assign(Object.assign({}, props), { _internals: Object.assign({ component: SmuiElement, tag: 'div', class: '', classMap: {}, contexts: {}, props: {} }, internals) }));
9191
- };
9097
+ function Title$1($$anchor, $$props) {
9098
+ push($$props, true);
9099
+
9100
+ let restProps = rest_props($$props, [
9101
+ "$$slots",
9102
+ "$$events",
9103
+ "$$legacy",
9104
+ "children"
9105
+ ]);
9106
+
9107
+ let element;
9108
+
9109
+ function getElement() {
9110
+ return element.getElement();
9111
+ }
9112
+
9113
+ bind_this(
9114
+ ClassAdder($$anchor, spread_props({ _smuiClass: "mdc-dialog__title", tag: "h2" }, () => restProps, {
9115
+ children: ($$anchor, $$slotProps) => {
9116
+ var fragment_1 = comment();
9117
+ var node = first_child(fragment_1);
9118
+
9119
+ snippet(node, () => $$props.children ?? noop);
9120
+ append($$anchor, fragment_1);
9121
+ },
9122
+ $$slots: { default: true }
9123
+ })),
9124
+ ($$value) => element = $$value,
9125
+ () => element
9126
+ );
9127
+
9128
+ return pop({ getElement });
9192
9129
  }
9193
9130
 
9194
- var Title$1 = classAdderBuilder({
9195
- class: 'mdc-dialog__title',
9196
- tag: 'h2',
9197
- });
9131
+ function Content$1($$anchor, $$props) {
9132
+ push($$props, true);
9198
9133
 
9199
- var Content$1 = classAdderBuilder({
9200
- class: 'mdc-dialog__content',
9201
- tag: 'div',
9202
- });
9134
+ let restProps = rest_props($$props, [
9135
+ "$$slots",
9136
+ "$$events",
9137
+ "$$legacy",
9138
+ "children"
9139
+ ]);
9203
9140
 
9204
- var Actions = classAdderBuilder({
9205
- class: 'mdc-dialog__actions',
9206
- tag: 'div',
9207
- classMap: {
9208
- 'smui-dialog__actions--reversed': 'SMUI:dialog:actions:reversed',
9209
- },
9210
- contexts: {
9211
- 'SMUI:button:context': 'dialog:action',
9212
- },
9213
- });
9141
+ let element;
9142
+
9143
+ function getElement() {
9144
+ return element.getElement();
9145
+ }
9146
+
9147
+ bind_this(
9148
+ ClassAdder($$anchor, spread_props({ _smuiClass: "mdc-dialog__content", tag: "div" }, () => restProps, {
9149
+ children: ($$anchor, $$slotProps) => {
9150
+ var fragment_1 = comment();
9151
+ var node = first_child(fragment_1);
9152
+
9153
+ snippet(node, () => $$props.children ?? noop);
9154
+ append($$anchor, fragment_1);
9155
+ },
9156
+ $$slots: { default: true }
9157
+ })),
9158
+ ($$value) => element = $$value,
9159
+ () => element
9160
+ );
9161
+
9162
+ return pop({ getElement });
9163
+ }
9164
+
9165
+ function Actions($$anchor, $$props) {
9166
+ push($$props, true);
9167
+
9168
+ let restProps = rest_props($$props, [
9169
+ "$$slots",
9170
+ "$$events",
9171
+ "$$legacy",
9172
+ "children"
9173
+ ]);
9174
+
9175
+ let element;
9176
+
9177
+ function getElement() {
9178
+ return element.getElement();
9179
+ }
9180
+
9181
+ bind_this(
9182
+ ClassAdder($$anchor, spread_props(
9183
+ {
9184
+ _smuiClass: "mdc-dialog__actions",
9185
+ _smuiClassMap: {
9186
+ 'smui-dialog__actions--reversed': 'SMUI:dialog:actions:reversed'
9187
+ },
9188
+ _smuiContexts: { 'SMUI:button:context': 'dialog:action' },
9189
+ tag: "div"
9190
+ },
9191
+ () => restProps,
9192
+ {
9193
+ children: ($$anchor, $$slotProps) => {
9194
+ var fragment_1 = comment();
9195
+ var node = first_child(fragment_1);
9196
+
9197
+ snippet(node, () => $$props.children ?? noop);
9198
+ append($$anchor, fragment_1);
9199
+ },
9200
+ $$slots: { default: true }
9201
+ }
9202
+ )),
9203
+ ($$value) => element = $$value,
9204
+ () => element
9205
+ );
9206
+
9207
+ return pop({ getElement });
9208
+ }
9214
9209
 
9215
9210
  /**
9216
9211
  * @license
@@ -11056,20 +11051,128 @@
11056
11051
  return pop({ notch, closeNotch, getElement });
11057
11052
  }
11058
11053
 
11059
- var HelperLine = classAdderBuilder({
11060
- class: 'mdc-text-field-helper-line',
11061
- tag: 'div',
11062
- });
11054
+ function HelperLine($$anchor, $$props) {
11055
+ push($$props, true);
11063
11056
 
11064
- var Prefix = classAdderBuilder({
11065
- class: 'mdc-text-field__affix mdc-text-field__affix--prefix',
11066
- tag: 'span',
11067
- });
11057
+ let restProps = rest_props($$props, [
11058
+ "$$slots",
11059
+ "$$events",
11060
+ "$$legacy",
11061
+ "children"
11062
+ ]);
11068
11063
 
11069
- var Suffix = classAdderBuilder({
11070
- class: 'mdc-text-field__affix mdc-text-field__affix--suffix',
11071
- tag: 'span',
11072
- });
11064
+ let element;
11065
+
11066
+ function getElement() {
11067
+ return element.getElement();
11068
+ }
11069
+
11070
+ bind_this(
11071
+ ClassAdder($$anchor, spread_props(
11072
+ {
11073
+ _smuiClass: "mdc-text-field-helper-line",
11074
+ tag: "div"
11075
+ },
11076
+ () => restProps,
11077
+ {
11078
+ children: ($$anchor, $$slotProps) => {
11079
+ var fragment_1 = comment();
11080
+ var node = first_child(fragment_1);
11081
+
11082
+ snippet(node, () => $$props.children ?? noop);
11083
+ append($$anchor, fragment_1);
11084
+ },
11085
+ $$slots: { default: true }
11086
+ }
11087
+ )),
11088
+ ($$value) => element = $$value,
11089
+ () => element
11090
+ );
11091
+
11092
+ return pop({ getElement });
11093
+ }
11094
+
11095
+ function Prefix($$anchor, $$props) {
11096
+ push($$props, true);
11097
+
11098
+ let restProps = rest_props($$props, [
11099
+ "$$slots",
11100
+ "$$events",
11101
+ "$$legacy",
11102
+ "children"
11103
+ ]);
11104
+
11105
+ let element;
11106
+
11107
+ function getElement() {
11108
+ return element.getElement();
11109
+ }
11110
+
11111
+ bind_this(
11112
+ ClassAdder($$anchor, spread_props(
11113
+ {
11114
+ _smuiClass: "mdc-text-field__affix mdc-text-field__affix--prefix",
11115
+ tag: "span"
11116
+ },
11117
+ () => restProps,
11118
+ {
11119
+ children: ($$anchor, $$slotProps) => {
11120
+ var fragment_1 = comment();
11121
+ var node = first_child(fragment_1);
11122
+
11123
+ snippet(node, () => $$props.children ?? noop);
11124
+ append($$anchor, fragment_1);
11125
+ },
11126
+ $$slots: { default: true }
11127
+ }
11128
+ )),
11129
+ ($$value) => element = $$value,
11130
+ () => element
11131
+ );
11132
+
11133
+ return pop({ getElement });
11134
+ }
11135
+
11136
+ function Suffix($$anchor, $$props) {
11137
+ push($$props, true);
11138
+
11139
+ let restProps = rest_props($$props, [
11140
+ "$$slots",
11141
+ "$$events",
11142
+ "$$legacy",
11143
+ "children"
11144
+ ]);
11145
+
11146
+ let element;
11147
+
11148
+ function getElement() {
11149
+ return element.getElement();
11150
+ }
11151
+
11152
+ bind_this(
11153
+ ClassAdder($$anchor, spread_props(
11154
+ {
11155
+ _smuiClass: "mdc-text-field__affix mdc-text-field__affix--suffix",
11156
+ tag: "span"
11157
+ },
11158
+ () => restProps,
11159
+ {
11160
+ children: ($$anchor, $$slotProps) => {
11161
+ var fragment_1 = comment();
11162
+ var node = first_child(fragment_1);
11163
+
11164
+ snippet(node, () => $$props.children ?? noop);
11165
+ append($$anchor, fragment_1);
11166
+ },
11167
+ $$slots: { default: true }
11168
+ }
11169
+ )),
11170
+ ($$value) => element = $$value,
11171
+ () => element
11172
+ );
11173
+
11174
+ return pop({ getElement });
11175
+ }
11073
11176
 
11074
11177
  var root$r = template(`<input>`);
11075
11178
 
@@ -11976,9 +12079,9 @@
11976
12079
  var consequent_9 = ($$anchor) => {
11977
12080
  var span_1 = root_17$3();
11978
12081
 
11979
- const class_derived = derived(() => classMap({
12082
+ const class_derived = derived(() => clsx(classMap({
11980
12083
  'mdc-text-field__resizer': !('input$resizable' in restProps) || $$props.input$resizable
11981
- }));
12084
+ })));
11982
12085
 
11983
12086
  var node_16 = child(span_1);
11984
12087
  var spread_element_3 = derived(() => prefixFilter(restProps, 'input$'));
@@ -12047,7 +12150,7 @@
12047
12150
  var node_17 = sibling(node_16, 2);
12048
12151
 
12049
12152
  snippet(node_17, () => $$props.internalCounter ?? noop);
12050
- template_effect(() => set_class(span_1, get(class_derived)));
12153
+ template_effect(() => set_class(span_1, get(class_derived), ""));
12051
12154
  append($$anchor, span_1);
12052
12155
  };
12053
12156
 
@@ -17295,21 +17398,6 @@
17295
17398
  return array;
17296
17399
  }
17297
17400
 
17298
- /** Built-in value references. */
17299
- var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
17300
-
17301
- /**
17302
- * Checks if `value` is a flattenable `arguments` object or array.
17303
- *
17304
- * @private
17305
- * @param {*} value The value to check.
17306
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
17307
- */
17308
- function isFlattenable(value) {
17309
- return isArray(value) || isArguments(value) ||
17310
- !!(spreadableSymbol && value && value[spreadableSymbol]);
17311
- }
17312
-
17313
17401
  /**
17314
17402
  * The base implementation of `_.flatten` with support for restricting flattening.
17315
17403
  *
@@ -17324,8 +17412,6 @@
17324
17412
  function baseFlatten(array, depth, predicate, isStrict, result) {
17325
17413
  var index = -1,
17326
17414
  length = array.length;
17327
-
17328
- predicate || (predicate = isFlattenable);
17329
17415
  result || (result = []);
17330
17416
 
17331
17417
  while (++index < length) {
@@ -18259,7 +18345,11 @@
18259
18345
  return item;
18260
18346
  }
18261
18347
  function entitiesToReferences(item) {
18262
- if (item instanceof Entity && typeof item.$toReference === 'function') {
18348
+ if (item == null) {
18349
+ return item;
18350
+ }
18351
+ else if (item instanceof Entity &&
18352
+ typeof item.$toReference === 'function') {
18263
18353
  // Convert entities to references.
18264
18354
  return item.$toReference();
18265
18355
  }
@@ -18278,7 +18368,10 @@
18278
18368
  return item;
18279
18369
  }
18280
18370
  function referencesToEntities(item, nymph) {
18281
- if (Array.isArray(item)) {
18371
+ if (item == null) {
18372
+ return item;
18373
+ }
18374
+ else if (Array.isArray(item)) {
18282
18375
  // Check if it's a reference.
18283
18376
  if (item[0] === 'nymph_entity_reference') {
18284
18377
  try {
@@ -18294,7 +18387,7 @@
18294
18387
  return item.map((item) => referencesToEntities(item, nymph));
18295
18388
  }
18296
18389
  }
18297
- else if (Entity && item instanceof Object && !(item instanceof Entity)) {
18390
+ else if (item instanceof Object && !(item instanceof Entity)) {
18298
18391
  for (let [key, value] of Object.entries(item)) {
18299
18392
  item[key] = referencesToEntities(value, nymph);
18300
18393
  }
@@ -19589,8 +19682,9 @@
19589
19682
  * Nymph and return it. You can then use this class's constructor and methods,
19590
19683
  * which will use this instance of Nymph.
19591
19684
  *
19592
- * Because this creates a subclass, don't use the class
19593
- * returned from `getEntityClass` to check with `instanceof`.
19685
+ * Because this creates a subclass, don't use the class returned from
19686
+ * `getEntityClass` to check with `instanceof`. Instead, use the base class
19687
+ * that you passed into this method.
19594
19688
  */
19595
19689
  addEntityClass(entityClass) {
19596
19690
  const nymph = this;
@@ -20107,7 +20201,6 @@
20107
20201
  }
20108
20202
  }
20109
20203
 
20110
- let currentToken = null;
20111
20204
  let User$1 = class User extends Entity {
20112
20205
  static stores = new WeakMap();
20113
20206
  // The name of the server class
@@ -20146,6 +20239,9 @@
20146
20239
  }
20147
20240
  return entity;
20148
20241
  }
20242
+ static async getDomainUsers(domain, options) {
20243
+ return await this.serverCallStatic('getDomainUsers', [domain, options]);
20244
+ }
20149
20245
  constructor() {
20150
20246
  super();
20151
20247
  this.$data.enabled = true;
@@ -20280,8 +20376,13 @@
20280
20376
  return await store.clientConfigPromise;
20281
20377
  }
20282
20378
  static handleToken(response) {
20379
+ const store = User.stores.get(this.nymph);
20380
+ if (store == null) {
20381
+ throw new Error('This user class was never initialized with an instance of Nymph');
20382
+ }
20283
20383
  let token = null;
20284
20384
  let switchToken = null;
20385
+ let hasNoCookie = typeof document === 'undefined' || typeof document.cookie === 'undefined';
20285
20386
  const authCookiePattern = /(?:(?:^|.*;\s*)TILMELDAUTH\s*=\s*([^;]*).*$)|^.*$/;
20286
20387
  const switchCookiePattern = /(?:(?:^|.*;\s*)TILMELDSWITCH\s*=\s*([^;]*).*$)|^.*$/;
20287
20388
  if (response && response.headers.has('X-TILMELDAUTH')) {
@@ -20296,14 +20397,16 @@
20296
20397
  else {
20297
20398
  return;
20298
20399
  }
20299
- if (currentToken !== token) {
20400
+ if (store.currentToken != token) {
20300
20401
  if (token == null || token === '') {
20301
- if (currentToken != null) {
20402
+ if (store.currentToken != null) {
20302
20403
  delete this.nymph.headers['X-Xsrf-Token'];
20404
+ delete this.nymph.headers['X-TILMELDAUTH'];
20405
+ delete this.nymph.headers['X-TILMELDSWITCH'];
20303
20406
  if (this.nymph.pubsub) {
20304
20407
  this.nymph.pubsub.authenticate(null);
20305
20408
  }
20306
- currentToken = null;
20409
+ delete store.currentToken;
20307
20410
  }
20308
20411
  }
20309
20412
  else {
@@ -20314,10 +20417,17 @@
20314
20417
  : atob(base64); // browser
20315
20418
  const jwt = JSON.parse(json);
20316
20419
  this.nymph.headers['X-Xsrf-Token'] = jwt.xsrfToken;
20420
+ if (hasNoCookie) {
20421
+ this.nymph.headers['X-TILMELDAUTH'] = token;
20422
+ delete this.nymph.headers['X-TILMELDSWITCH'];
20423
+ if (switchToken != null) {
20424
+ this.nymph.headers['X-TILMELDSWITCH'] = switchToken;
20425
+ }
20426
+ }
20317
20427
  if (this.nymph.pubsub) {
20318
20428
  this.nymph.pubsub.authenticate(token, switchToken);
20319
20429
  }
20320
- currentToken = token;
20430
+ store.currentToken = token;
20321
20431
  }
20322
20432
  }
20323
20433
  }
@@ -22879,10 +22989,46 @@
22879
22989
  return pop({ getPropStore, getElement });
22880
22990
  }
22881
22991
 
22882
- var Row$1 = classAdderBuilder({
22883
- class: 'mdc-top-app-bar__row',
22884
- tag: 'div',
22885
- });
22992
+ function Row$1($$anchor, $$props) {
22993
+ push($$props, true);
22994
+
22995
+ let restProps = rest_props($$props, [
22996
+ "$$slots",
22997
+ "$$events",
22998
+ "$$legacy",
22999
+ "children"
23000
+ ]);
23001
+
23002
+ let element;
23003
+
23004
+ function getElement() {
23005
+ return element.getElement();
23006
+ }
23007
+
23008
+ bind_this(
23009
+ ClassAdder($$anchor, spread_props(
23010
+ {
23011
+ _smuiClass: "mdc-top-app-bar__row",
23012
+ tag: "div"
23013
+ },
23014
+ () => restProps,
23015
+ {
23016
+ children: ($$anchor, $$slotProps) => {
23017
+ var fragment_1 = comment();
23018
+ var node = first_child(fragment_1);
23019
+
23020
+ snippet(node, () => $$props.children ?? noop);
23021
+ append($$anchor, fragment_1);
23022
+ },
23023
+ $$slots: { default: true }
23024
+ }
23025
+ )),
23026
+ ($$value) => element = $$value,
23027
+ () => element
23028
+ );
23029
+
23030
+ return pop({ getElement });
23031
+ }
22886
23032
 
22887
23033
  var root$h = template(`<section><!></section>`);
22888
23034
 
@@ -22936,10 +23082,46 @@
22936
23082
  return pop({ getElement });
22937
23083
  }
22938
23084
 
22939
- var Title = classAdderBuilder({
22940
- class: 'mdc-top-app-bar__title',
22941
- tag: 'span',
22942
- });
23085
+ function Title($$anchor, $$props) {
23086
+ push($$props, true);
23087
+
23088
+ let restProps = rest_props($$props, [
23089
+ "$$slots",
23090
+ "$$events",
23091
+ "$$legacy",
23092
+ "children"
23093
+ ]);
23094
+
23095
+ let element;
23096
+
23097
+ function getElement() {
23098
+ return element.getElement();
23099
+ }
23100
+
23101
+ bind_this(
23102
+ ClassAdder($$anchor, spread_props(
23103
+ {
23104
+ _smuiClass: "mdc-top-app-bar__title",
23105
+ tag: "span"
23106
+ },
23107
+ () => restProps,
23108
+ {
23109
+ children: ($$anchor, $$slotProps) => {
23110
+ var fragment_1 = comment();
23111
+ var node = first_child(fragment_1);
23112
+
23113
+ snippet(node, () => $$props.children ?? noop);
23114
+ append($$anchor, fragment_1);
23115
+ },
23116
+ $$slots: { default: true }
23117
+ }
23118
+ )),
23119
+ ($$value) => element = $$value,
23120
+ () => element
23121
+ );
23122
+
23123
+ return pop({ getElement });
23124
+ }
22943
23125
 
22944
23126
  /**
22945
23127
  * @license
@@ -24688,15 +24870,80 @@
24688
24870
  return pop({ setOpen, isOpen, getElement });
24689
24871
  }
24690
24872
 
24691
- var AppContent = classAdderBuilder({
24692
- class: 'mdc-drawer-app-content',
24693
- tag: 'div',
24694
- });
24873
+ function AppContent($$anchor, $$props) {
24874
+ push($$props, true);
24695
24875
 
24696
- var Content = classAdderBuilder({
24697
- class: 'mdc-drawer__content',
24698
- tag: 'div',
24699
- });
24876
+ let restProps = rest_props($$props, [
24877
+ "$$slots",
24878
+ "$$events",
24879
+ "$$legacy",
24880
+ "children"
24881
+ ]);
24882
+
24883
+ let element;
24884
+
24885
+ function getElement() {
24886
+ return element.getElement();
24887
+ }
24888
+
24889
+ bind_this(
24890
+ ClassAdder($$anchor, spread_props(
24891
+ {
24892
+ _smuiClass: "mdc-drawer-app-content",
24893
+ tag: "div"
24894
+ },
24895
+ () => restProps,
24896
+ {
24897
+ children: ($$anchor, $$slotProps) => {
24898
+ var fragment_1 = comment();
24899
+ var node = first_child(fragment_1);
24900
+
24901
+ snippet(node, () => $$props.children ?? noop);
24902
+ append($$anchor, fragment_1);
24903
+ },
24904
+ $$slots: { default: true }
24905
+ }
24906
+ )),
24907
+ ($$value) => element = $$value,
24908
+ () => element
24909
+ );
24910
+
24911
+ return pop({ getElement });
24912
+ }
24913
+
24914
+ function Content($$anchor, $$props) {
24915
+ push($$props, true);
24916
+
24917
+ let restProps = rest_props($$props, [
24918
+ "$$slots",
24919
+ "$$events",
24920
+ "$$legacy",
24921
+ "children"
24922
+ ]);
24923
+
24924
+ let element;
24925
+
24926
+ function getElement() {
24927
+ return element.getElement();
24928
+ }
24929
+
24930
+ bind_this(
24931
+ ClassAdder($$anchor, spread_props({ _smuiClass: "mdc-drawer__content", tag: "div" }, () => restProps, {
24932
+ children: ($$anchor, $$slotProps) => {
24933
+ var fragment_1 = comment();
24934
+ var node = first_child(fragment_1);
24935
+
24936
+ snippet(node, () => $$props.children ?? noop);
24937
+ append($$anchor, fragment_1);
24938
+ },
24939
+ $$slots: { default: true }
24940
+ })),
24941
+ ($$value) => element = $$value,
24942
+ () => element
24943
+ );
24944
+
24945
+ return pop({ getElement });
24946
+ }
24700
24947
 
24701
24948
  function Scrim($$anchor, $$props) {
24702
24949
  push($$props, true);
@@ -26113,15 +26360,87 @@
26113
26360
  return pop({ action, getPrimaryText, getElement });
26114
26361
  }
26115
26362
 
26116
- var Text$1 = classAdderBuilder({
26117
- class: 'mdc-deprecated-list-item__text',
26118
- tag: 'span',
26119
- });
26363
+ function Text$1($$anchor, $$props) {
26364
+ push($$props, true);
26120
26365
 
26121
- var Meta = classAdderBuilder({
26122
- class: 'mdc-deprecated-list-item__meta',
26123
- tag: 'span',
26124
- });
26366
+ let restProps = rest_props($$props, [
26367
+ "$$slots",
26368
+ "$$events",
26369
+ "$$legacy",
26370
+ "children"
26371
+ ]);
26372
+
26373
+ let element;
26374
+
26375
+ function getElement() {
26376
+ return element.getElement();
26377
+ }
26378
+
26379
+ bind_this(
26380
+ ClassAdder($$anchor, spread_props(
26381
+ {
26382
+ _smuiClass: "mdc-deprecated-list-item__text",
26383
+ tag: "span"
26384
+ },
26385
+ () => restProps,
26386
+ {
26387
+ children: ($$anchor, $$slotProps) => {
26388
+ var fragment_1 = comment();
26389
+ var node = first_child(fragment_1);
26390
+
26391
+ snippet(node, () => $$props.children ?? noop);
26392
+ append($$anchor, fragment_1);
26393
+ },
26394
+ $$slots: { default: true }
26395
+ }
26396
+ )),
26397
+ ($$value) => element = $$value,
26398
+ () => element
26399
+ );
26400
+
26401
+ return pop({ getElement });
26402
+ }
26403
+
26404
+ function Meta($$anchor, $$props) {
26405
+ push($$props, true);
26406
+
26407
+ let restProps = rest_props($$props, [
26408
+ "$$slots",
26409
+ "$$events",
26410
+ "$$legacy",
26411
+ "children"
26412
+ ]);
26413
+
26414
+ let element;
26415
+
26416
+ function getElement() {
26417
+ return element.getElement();
26418
+ }
26419
+
26420
+ bind_this(
26421
+ ClassAdder($$anchor, spread_props(
26422
+ {
26423
+ _smuiClass: "mdc-deprecated-list-item__meta",
26424
+ tag: "span"
26425
+ },
26426
+ () => restProps,
26427
+ {
26428
+ children: ($$anchor, $$slotProps) => {
26429
+ var fragment_1 = comment();
26430
+ var node = first_child(fragment_1);
26431
+
26432
+ snippet(node, () => $$props.children ?? noop);
26433
+ append($$anchor, fragment_1);
26434
+ },
26435
+ $$slots: { default: true }
26436
+ }
26437
+ )),
26438
+ ($$value) => element = $$value,
26439
+ () => element
26440
+ );
26441
+
26442
+ return pop({ getElement });
26443
+ }
26125
26444
 
26126
26445
  function Separator($$anchor, $$props) {
26127
26446
  push($$props, true);
@@ -38040,10 +38359,14 @@
38040
38359
 
38041
38360
  const onLogin = (currentUser) => {
38042
38361
  store_set(user, proxy(currentUser));
38362
+ // Helps with admin and debugging.
38363
+ window.user = currentUser;
38043
38364
  };
38044
38365
 
38045
38366
  const onLogout = () => {
38046
38367
  store_set(user, null);
38368
+ // Helps with admin and debugging.
38369
+ window.user = null;
38047
38370
  };
38048
38371
 
38049
38372
  onMount(setMiniWindow);
@@ -38053,6 +38376,8 @@
38053
38376
  User.on('logout', onLogout);
38054
38377
  store_set(clientConfig, proxy(await User.getClientConfig()));
38055
38378
  store_set(user, proxy(await User.current()));
38379
+ // Helps with admin and debugging.
38380
+ window.user = $user();
38056
38381
  });
38057
38382
 
38058
38383
  function setMiniWindow() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/tilmeld-setup",
3
- "version": "1.0.0-beta.85",
3
+ "version": "1.0.0-beta.87",
4
4
  "description": "Nymph.js - Tilmeld Setup App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "license": "Apache-2.0",
37
37
  "dependencies": {
38
- "@nymphjs/nymph": "^1.0.0-beta.85",
39
- "@nymphjs/tilmeld": "^1.0.0-beta.85",
38
+ "@nymphjs/nymph": "^1.0.0-beta.87",
39
+ "@nymphjs/tilmeld": "^1.0.0-beta.87",
40
40
  "express": "^4.21.2",
41
41
  "locutus": "^2.0.32"
42
42
  },
@@ -44,12 +44,12 @@
44
44
  "@material/elevation": "^14.0.0",
45
45
  "@material/typography": "^14.0.0",
46
46
  "@mdi/js": "^7.4.47",
47
- "@nymphjs/client": "^1.0.0-beta.85",
48
- "@nymphjs/driver-sqlite3": "^1.0.0-beta.85",
49
- "@nymphjs/query-parser": "^1.0.0-beta.85",
50
- "@nymphjs/server": "^1.0.0-beta.85",
51
- "@nymphjs/tilmeld-client": "^1.0.0-beta.85",
52
- "@nymphjs/tilmeld-components": "^1.0.0-beta.85",
47
+ "@nymphjs/client": "^1.0.0-beta.87",
48
+ "@nymphjs/driver-sqlite3": "^1.0.0-beta.87",
49
+ "@nymphjs/query-parser": "^1.0.0-beta.87",
50
+ "@nymphjs/server": "^1.0.0-beta.87",
51
+ "@nymphjs/tilmeld-client": "^1.0.0-beta.87",
52
+ "@nymphjs/tilmeld-components": "^1.0.0-beta.87",
53
53
  "@rollup/plugin-commonjs": "^28.0.1",
54
54
  "@rollup/plugin-node-resolve": "^15.3.0",
55
55
  "@rollup/plugin-typescript": "^12.1.1",
@@ -91,5 +91,5 @@
91
91
  "tslib": "^2.8.1",
92
92
  "typescript": "^5.7.2"
93
93
  },
94
- "gitHead": "1d0951d3124cc7f18a4b47f36d7939eb6741c3eb"
94
+ "gitHead": "0125c8ff146f2962ef30b7b579286c70c555e7f4"
95
95
  }
package/test.mjs CHANGED
@@ -17,6 +17,7 @@ const nymph = new Nymph(
17
17
  cookiePath: '/',
18
18
  setupPath: '/user',
19
19
  emailUsernames: false,
20
+ domainSupport: true,
20
21
  clientEnabledUIDs: ['test'],
21
22
  verifyRedirect: 'http://localhost:8080',
22
23
  verifyChangeRedirect: 'http://localhost:8080',