@jinntec/fore 1.3.0 → 1.4.0

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.
Files changed (41) hide show
  1. package/dist/fore-dev.js +4 -4
  2. package/dist/fore-dev.js.map +1 -1
  3. package/dist/fore.js +3 -3
  4. package/dist/fore.js.map +1 -1
  5. package/package.json +1 -1
  6. package/resources/fore.css +6 -1
  7. package/src/ForeElementMixin.js +4 -0
  8. package/src/actions/abstract-action.js +77 -35
  9. package/src/actions/fx-action.js +9 -9
  10. package/src/actions/fx-append.js +1 -1
  11. package/src/actions/fx-confirm.js +1 -1
  12. package/src/actions/fx-copy.js +68 -0
  13. package/src/actions/fx-delete.js +1 -1
  14. package/src/actions/fx-dispatch.js +1 -1
  15. package/src/actions/fx-hide.js +1 -1
  16. package/src/actions/fx-insert.js +1 -1
  17. package/src/actions/fx-message.js +1 -1
  18. package/src/actions/fx-refresh.js +2 -2
  19. package/src/actions/fx-reload.js +1 -1
  20. package/src/actions/fx-replace.js +1 -1
  21. package/src/actions/fx-return.js +1 -1
  22. package/src/actions/fx-send.js +2 -2
  23. package/src/actions/fx-setfocus.js +1 -1
  24. package/src/actions/fx-setvalue.js +1 -1
  25. package/src/actions/fx-show.js +1 -1
  26. package/src/actions/fx-toggle.js +1 -1
  27. package/src/actions/fx-update.js +1 -1
  28. package/src/fore.js +58 -10
  29. package/src/fx-bind.js +5 -0
  30. package/src/fx-fore.js +36 -35
  31. package/src/fx-instance.js +70 -70
  32. package/src/fx-model.js +12 -17
  33. package/src/fx-submission.js +420 -416
  34. package/src/getInScopeContext.js +2 -4
  35. package/src/modelitem.js +3 -1
  36. package/src/ui/abstract-control.js +1 -1
  37. package/src/ui/fx-control.js +2 -2
  38. package/src/ui/fx-switch.js +9 -1
  39. package/src/ui/fx-trigger.js +19 -18
  40. package/src/xpath-evaluation.js +21 -9
  41. package/src/xpath-util.js +13 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jinntec/fore",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Fore - declarative user interfaces in plain HTML",
5
5
  "module": "./index.js",
6
6
  "publishConfig": {
@@ -130,7 +130,12 @@ fx-hint{
130
130
  display: none;
131
131
  }
132
132
 
133
- fx-model, fx-model *, fx-model ::slotted(fx-instance), fx-instance{
133
+ fx-model,
134
+ fx-model *,
135
+ fx-model ::slotted(fx-instance),
136
+ fx-instance,
137
+ fx-action,
138
+ fx-setvalue{
134
139
  display:none;
135
140
  }
136
141
 
@@ -100,6 +100,10 @@ export const foreElementMixin = superclass =>
100
100
  */
101
101
  evalInContext() {
102
102
  // const inscopeContext = this.getInScopeContext();
103
+ const model = this.getModel();
104
+ if(!model){
105
+ return;
106
+ }
103
107
  let inscopeContext;
104
108
  if (this.hasAttribute('context')) {
105
109
  inscopeContext = getInScopeContext(this.getAttributeNode('context') || this, this.context);
@@ -117,55 +117,65 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
117
117
  * @param e
118
118
  */
119
119
  async execute(e) {
120
+ let resolveThisEvent = () => {};
121
+ if (e && e.listenerPromises) {
122
+ e.listenerPromises.push(
123
+ new Promise(resolve => {
124
+ resolveThisEvent = resolve;
125
+ }),
126
+ );
127
+ }
128
+
120
129
  // console.log('executing', this);
121
130
 
122
131
  // console.log('executing e', e);
123
132
  // console.log('executing e phase', e.eventPhase);
124
- if(AbstractAction.outermostHandler === null){
133
+ if (AbstractAction.outermostHandler === null) {
134
+ console.time('outermostHandler');
125
135
  console.info(
126
- `%coutermost Action `,
127
- "background:#e65100; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;",
128
- this
136
+ `%coutermost Action `,
137
+ 'background:#e65100; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;',
138
+ this,
129
139
  );
130
140
  // console.log('starting outermost handler',this);
131
141
  AbstractAction.outermostHandler = this;
132
142
  }
133
143
 
134
- if(AbstractAction.outermostHandler !== this){
144
+ if (AbstractAction.outermostHandler !== this) {
135
145
  console.info(
136
- `%cAction `,
137
- "background:orange; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;",
138
- this
146
+ `%cAction `,
147
+ 'background:orange; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;',
148
+ this,
139
149
  );
140
150
  }
141
151
  // console.log('>>> outermostHandler', AbstractAction.outermostHandler);
142
152
 
143
- if(e && e.code){
153
+ if (e && e.code) {
144
154
  const vars = new Map();
145
155
  vars.set('code', e.code);
146
156
  // this.setInScopeVariables(vars);
147
- this.setInScopeVariables(new Map([ ...this.inScopeVariables, ...vars]));
157
+ this.setInScopeVariables(new Map([...this.inScopeVariables, ...vars]));
148
158
  }
149
159
 
150
160
  if (e && e.detail) {
151
161
  this.detail = e.detail;
152
162
  const vars = new Map();
153
- Object.keys(e.detail).forEach(function(key,index) {
163
+ Object.keys(e.detail).forEach(function(key, index) {
154
164
  // key: the name of the object key
155
165
  // index: the ordinal position of the key within the object
156
- vars.set(key,e.detail[key]);
166
+ vars.set(key, e.detail[key]);
157
167
  });
158
- if(vars.size !== 0){
159
- console.log("event detail vars", vars);
168
+ if (vars.size !== 0) {
169
+ console.log('event detail vars', vars);
160
170
  }
161
- this.setInScopeVariables(new Map([ ...this.inScopeVariables, ...vars]));
171
+ this.setInScopeVariables(new Map([...this.inScopeVariables, ...vars]));
162
172
  }
163
173
  this.needsUpdate = false;
164
174
 
165
- try{
175
+ try {
166
176
  this.evalInContext();
167
- }catch (error){
168
- console.warn('evaluation faild',error);
177
+ } catch (error) {
178
+ console.warn('evaluation faild', error);
169
179
  }
170
180
  if (this.targetElement && this.targetElement.nodeset) {
171
181
  this.nodeset = this.targetElement.nodeset;
@@ -173,6 +183,7 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
173
183
 
174
184
  // First check if 'if' condition is true - otherwise exist right away
175
185
  if (this.ifExpr && !evaluateXPathToBoolean(this.ifExpr, getInScopeContext(this), this)) {
186
+ this._finalizePerform(resolveThisEvent);
176
187
  return;
177
188
  }
178
189
 
@@ -196,13 +207,20 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
196
207
  this.perform();
197
208
 
198
209
  // Go for one more iteration
210
+ if (this.delay) {
211
+ // If we have a delay, fire and forget this.
212
+ // Otherwise, if we have no delay, keep waiting for all iterations to be done.
213
+ // The while is then uninteruptable and immediate
214
+ loop();
215
+ return;
216
+ }
199
217
  await loop();
200
218
  };
201
219
 
202
220
  // After loop is done call actionPerformed to update the model and UI
203
221
  await loop();
204
- this.actionPerformed();
205
- Fore.dispatch(this, 'while-performed', {});
222
+
223
+ this._finalizePerform(resolveThisEvent);
206
224
  return;
207
225
  }
208
226
 
@@ -212,21 +230,29 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
212
230
  if (!this.ownerDocument.contains(this)) {
213
231
  // We are no longer in the document. Stop working
214
232
  this.actionPerformed();
233
+ resolveThisEvent();
215
234
  return;
216
235
  }
217
236
  }
218
237
 
219
- this.perform();
238
+ await this.perform();
239
+ this._finalizePerform(resolveThisEvent);
240
+
241
+ }
242
+
243
+ _finalizePerform(resolveThisEvent) {
220
244
  this.actionPerformed();
221
- if(AbstractAction.outermostHandler === this){
245
+ if (AbstractAction.outermostHandler === this) {
222
246
  AbstractAction.outermostHandler = null;
223
247
  console.info(
224
- `%coutermost Action done`,
225
- "background:#e65100; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;",
226
- this
248
+ `%coutermost Action done`,
249
+ 'background:#e65100; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;',
250
+ this,
227
251
  );
252
+ console.timeEnd('outermostHandler');
228
253
 
229
254
  }
255
+ resolveThisEvent();
230
256
  }
231
257
 
232
258
  /**
@@ -235,13 +261,7 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
235
261
  *
236
262
  * This function should not called on any action directly - call execute() instead to ensure proper execution of 'if' and 'while'
237
263
  */
238
- perform() {
239
- console.info(
240
- `%cperform `,
241
- "background:orange; color:white; padding:0.3rem; display:inline-block; white-space: nowrap; border-radius:0.3rem;",
242
- this
243
- );
244
-
264
+ async perform() {
245
265
  //todo: review - this evaluation seems redundant as we already evaluated in execute
246
266
  if (this.isBound() || this.nodeName === 'FX-ACTION') {
247
267
  this.evalInContext();
@@ -252,14 +272,36 @@ export class AbstractAction extends foreElementMixin(HTMLElement) {
252
272
  * calls the update cycle if action signalled that update is needed.
253
273
  */
254
274
  actionPerformed() {
275
+ const model = this.getModel();
276
+ if(!model){
277
+ return;
278
+ }
279
+ if (!model.inited) {
280
+ return;
281
+ }
282
+ if (
283
+ AbstractAction.outermostHandler &&
284
+ !AbstractAction.outermostHandler.ownerDocument.contains(AbstractAction.outermostHandler)
285
+ ) {
286
+ // The old outermosthandler fell out of the document. An error has happened.
287
+ // Just remove the old one and act like we are starting anew.
288
+ console.warn('Unsetting outermost handler');
289
+ AbstractAction.outermostHandler = null;
290
+ }
255
291
  // console.log('actionPerformed action parentNode ', this.parentNode);
256
- // if (this.needsUpdate && AbstractAction.outermostHandler !== this) {
257
- if (this.needsUpdate) {
258
- const model = this.getModel();
292
+ if (
293
+ this.needsUpdate &&
294
+ (AbstractAction.outermostHandler === this || !AbstractAction.outermostHandler)
295
+ ) {
296
+ console.log('Running actionperformed');
259
297
  model.recalculate();
260
298
  model.revalidate();
261
299
  model.parentNode.refresh(true);
262
300
  this.dispatchActionPerformed();
301
+ } else if (this.needsUpdate) {
302
+ // We need an update, but the outermost action handler may not. Make this clear!
303
+ AbstractAction.outermostHandler.needsUpdate = true;
304
+ console.log('Update surpressed!');
263
305
  }
264
306
  }
265
307
 
@@ -31,7 +31,7 @@ export class FxAction extends AbstractAction {
31
31
  `;
32
32
  }
33
33
 
34
- perform() {
34
+ async perform() {
35
35
  super.perform();
36
36
  const { children } = this;
37
37
 
@@ -42,14 +42,14 @@ export class FxAction extends AbstractAction {
42
42
  script.src = this.src;
43
43
  this.appendChild(script);
44
44
  } else {
45
- Array.from(children).forEach(actionOrVar => {
46
- if (actionOrVar.localName === 'fx-var') {
47
- return;
48
- }
49
- const action = actionOrVar;
50
- action.detail = this.detail;
51
- action.execute();
52
- });
45
+ for (const actionOrVar of children) {
46
+ if (actionOrVar.localName === 'fx-var') {
47
+ continue;
48
+ }
49
+ const action = actionOrVar;
50
+ action.detail = this.detail;
51
+ await action.execute();
52
+ }
53
53
  this.dispatchActionPerformed();
54
54
  this.needsUpdate = true;
55
55
  }
@@ -58,7 +58,7 @@ class FxAppend extends AbstractAction {
58
58
  * behavior should be needed for some reason later on, it can be added easier by a providing an 'duplicate' action.
59
59
  *
60
60
  */
61
- perform() {
61
+ async perform() {
62
62
  super.perform();
63
63
 
64
64
  this._dataFromTemplate();
@@ -12,7 +12,7 @@ export class FxConfirm extends FxAction {
12
12
  this.message = this.hasAttribute('message') ? this.getAttribute('message') : null;
13
13
  }
14
14
 
15
- perform() {
15
+ async perform() {
16
16
  if (window.confirm(this.message)) {
17
17
  super.perform();
18
18
  }
@@ -0,0 +1,68 @@
1
+ import '../fx-model.js';
2
+ import {AbstractAction} from './abstract-action.js';
3
+
4
+ /**
5
+ * `fx-copy`
6
+ * todo: demo + tests
7
+ * @customElement
8
+ */
9
+ export default class FxCopy extends AbstractAction {
10
+ static get properties() {
11
+ return {
12
+ ...super.properties,
13
+ ref: {
14
+ type: String,
15
+ },
16
+ to: {
17
+ type: String,
18
+ },
19
+ };
20
+ }
21
+
22
+ constructor() {
23
+ super();
24
+ this.ref = '';
25
+ this.to = '';
26
+ }
27
+
28
+ connectedCallback() {
29
+ if (super.connectedCallback) {
30
+ super.connectedCallback();
31
+ }
32
+
33
+ if (this.hasAttribute('ref')) {
34
+ this.ref = this.getAttribute('ref');
35
+ } else {
36
+ throw new Error('fx-copy must specify a "ref" attribute');
37
+ }
38
+ this.to = this.getAttribute('to');
39
+ }
40
+
41
+ perform() {
42
+ console.log('copying to clipboard')
43
+ super.perform();
44
+
45
+ if(this.nodeset.nodeType === Node.ATTRIBUTE_NODE){
46
+ navigator.clipboard.writeText(this.nodeset.nodeValue);
47
+ }else{
48
+ navigator.clipboard.writeText(this.nodeset);
49
+ }
50
+ }
51
+
52
+ /*
53
+ setValue(modelItem, newVal) {
54
+ const item = modelItem;
55
+ if (!item) return;
56
+
57
+ if (item.value !== newVal) {
58
+ item.value = newVal;
59
+ this.getModel().changed.push(modelItem);
60
+ this.needsUpdate = true;
61
+ }
62
+ }
63
+ */
64
+ }
65
+
66
+ if (!customElements.get('fx-copy')) {
67
+ window.customElements.define('fx-copy', FxCopy);
68
+ }
@@ -22,7 +22,7 @@ class FxDelete extends AbstractAction {
22
22
  *
23
23
  * Will NOT perform delete if nodeset is pointing to document node, document fragment, root node or being readonly.
24
24
  */
25
- perform() {
25
+ async perform() {
26
26
  console.log('##### fx-delete executing...');
27
27
  const inscopeContext = getInScopeContext(this.getAttributeNode('ref') || this, this.ref);
28
28
  this.nodeset = evaluateXPathToNodes(this.ref, inscopeContext, this);
@@ -52,7 +52,7 @@ export class FxDispatch extends AbstractAction {
52
52
 
53
53
  */
54
54
 
55
- perform() {
55
+ async perform() {
56
56
  console.log('### fx-dispatch.perform ', this);
57
57
 
58
58
  const properties = this.querySelectorAll('fx-property');
@@ -17,7 +17,7 @@ export class FxHide extends AbstractAction {
17
17
  }
18
18
  }
19
19
 
20
- perform() {
20
+ async perform() {
21
21
  const dialog = resolveId(this.dialog, this);
22
22
  dialog.hide();
23
23
  Fore.dispatch(dialog,'dialog-hidden',{})
@@ -81,7 +81,7 @@ export class FxInsert extends AbstractAction {
81
81
  return targetSequence.length;
82
82
  }
83
83
 
84
- perform() {
84
+ async perform() {
85
85
  // super.perform();
86
86
 
87
87
  /*
@@ -47,7 +47,7 @@ class FxMessage extends AbstractAction {
47
47
  `;
48
48
  }
49
49
 
50
- perform() {
50
+ async perform() {
51
51
  super.perform();
52
52
  let message;
53
53
  if (this.hasAttribute('value')) {
@@ -9,7 +9,7 @@ import {resolveId} from "../xpath-evaluation.js";
9
9
  *
10
10
  */
11
11
  class FxRefresh extends AbstractAction {
12
- perform() {
12
+ async perform() {
13
13
  if (this.hasAttribute('self')) {
14
14
  const control = Fore.getClosest('fx-control', this);
15
15
  if (control) {
@@ -24,7 +24,7 @@ class FxRefresh extends AbstractAction {
24
24
  if(this.hasAttribute('control')){
25
25
  const targetId = this.getAttribute('control');
26
26
  const ctrl = resolveId(targetId, this);
27
- if (Fore.isUiElement(ctrl.nodeName) && typeof ctrl.refresh === 'function') {
27
+ if (ctrl && Fore.isUiElement(ctrl.nodeName) && typeof ctrl.refresh === 'function') {
28
28
  ctrl.refresh();
29
29
  }
30
30
  return;
@@ -19,7 +19,7 @@ export class FxReload extends AbstractAction {
19
19
  },{once:true});
20
20
  }
21
21
 
22
- perform() {
22
+ async perform() {
23
23
  Fore.dispatch(this, 'reload', {});
24
24
  }
25
25
  }
@@ -32,7 +32,7 @@ export default class FxReplace extends AbstractAction {
32
32
  this.with = this.getAttribute('with');
33
33
  }
34
34
 
35
- perform() {
35
+ async perform() {
36
36
  super.perform();
37
37
  console.log('replace action');
38
38
  // console.log('replace action variables', this.inScopeVariables);
@@ -20,7 +20,7 @@ export class FxReturn extends AbstractAction {
20
20
  // const nonrelevant = this.hasAttribute('nonrelevant') ? this.getAttribute('nonrelevant') : null;
21
21
  }
22
22
 
23
- perform() {
23
+ async perform() {
24
24
  super.perform();
25
25
  console.log('performing return with nodes', this.nodeset);
26
26
 
@@ -22,7 +22,7 @@ class FxSend extends AbstractAction {
22
22
  this.submission = this.getAttribute('submission');
23
23
  }
24
24
 
25
- perform() {
25
+ async perform() {
26
26
  super.perform();
27
27
 
28
28
  console.log('submitting ', this.submission);
@@ -44,7 +44,7 @@ class FxSend extends AbstractAction {
44
44
  throw new Error(`submission with id: ${this.submission} not found`);
45
45
  }
46
46
  console.log('submission', submission);
47
- submission.submit();
47
+ await submission.submit();
48
48
  /*
49
49
  if(submission.replace === 'instance'){
50
50
  this.getModel().updateModel();
@@ -13,7 +13,7 @@ export class FxSetfocus extends AbstractAction {
13
13
  this.control = this.hasAttribute('control') ? this.getAttribute('control') : null;
14
14
  }
15
15
 
16
- perform() {
16
+ async perform() {
17
17
  console.log('setting focus', this.control);
18
18
  // super.perform();
19
19
  const selector = '#'+this.control;
@@ -40,7 +40,7 @@ export default class FxSetvalue extends AbstractAction {
40
40
  this.valueAttr = this.getAttribute('value');
41
41
  }
42
42
 
43
- perform() {
43
+ async perform() {
44
44
  super.perform();
45
45
  let {value} = this;
46
46
  if (this.valueAttr !== null) {
@@ -17,7 +17,7 @@ export class FxShow extends FxAction {
17
17
  }
18
18
  }
19
19
 
20
- perform() {
20
+ async perform() {
21
21
  const targetDlg = resolveId(this.dialog,this);
22
22
  if(!targetDlg){
23
23
  console.error('target dialog with given id does not exist',this.dialog);
@@ -19,7 +19,7 @@ class FxToggle extends AbstractAction {
19
19
  }
20
20
  }
21
21
 
22
- perform() {
22
+ async perform() {
23
23
  super.perform();
24
24
  console.log('### fx-toggle.execute ');
25
25
  if (this.case) {
@@ -7,7 +7,7 @@ import { AbstractAction } from './abstract-action.js';
7
7
  *
8
8
  */
9
9
  class FxUpdate extends AbstractAction {
10
- perform() {
10
+ async perform() {
11
11
  this.getModel().updateModel();
12
12
  }
13
13
  }
package/src/fore.js CHANGED
@@ -9,6 +9,16 @@ export class Fore {
9
9
 
10
10
  static TYPE_DEFAULT = 'xs:string';
11
11
 
12
+ /**
13
+ * returns the next `fx-fore` element upwards in tree
14
+ *
15
+ * @param start
16
+ * @returns {*}
17
+ */
18
+ static getFore(start) {
19
+ return start.nodeType === Node.TEXT_NODE ? start.parentNode.closest('fx-fore'):start.closest('fx-fore');
20
+ }
21
+
12
22
  static get ACTION_ELEMENTS() {
13
23
  return [
14
24
  'FX-ACTION',
@@ -285,14 +295,23 @@ export class Fore {
285
295
  return fadeOut();
286
296
  }
287
297
 
288
- static dispatch(target, eventName, detail) {
298
+ static async dispatch(target, eventName, detail) {
289
299
  const event = new CustomEvent(eventName, {
290
300
  composed: false,
291
301
  bubbles: true,
292
302
  detail,
293
303
  });
294
- console.info('dispatching', event.type, target);
295
- target.dispatchEvent(event);
304
+ event.listenerPromises = [];
305
+ // console.info('dispatching', event.type, target);
306
+ // console.log('!!! DISPATCH_START', eventName);
307
+
308
+ target.dispatchEvent(event);
309
+
310
+ // By now, all listeners for the event should have registered their completion promises to us.
311
+ if (event.listenerPromises.length) {
312
+ await Promise.all(event.listenerPromises);
313
+ }
314
+ // console.log('!!! DISPATCH_DONE', eventName);
296
315
  }
297
316
 
298
317
  static prettifyXml(source) {
@@ -409,13 +428,42 @@ export class Fore {
409
428
  }),
410
429
  );
411
430
  }
412
- hostElement.appendChild(theFore);
413
- theFore.classList.add('widget');
414
- // return theFore;
415
- // theFore.setAttribute('from-src', this.src);
416
- // this.replaceWith(theFore);
431
+ const imported = document.importNode(theFore,true);
432
+ console.log(`########## loaded fore as component ##### ${hostElement.url}`);
433
+ imported.addEventListener(
434
+ 'model-construct-done',
435
+ e => {
436
+ console.log('subcomponent ready', e.target);
437
+ const defaultInst = imported.querySelector('fx-instance');
438
+ // console.log('defaultInst', defaultInst);
439
+ if(hostElement.initialNode){
440
+ const doc = new DOMParser().parseFromString('<data></data>', 'application/xml');
441
+ // Note: Clone the input to prevent the inner fore from editing the outer node
442
+ doc.firstElementChild.appendChild(hostElement.initialNode.cloneNode(true));
443
+ // defaultinst.setInstanceData(this.initialNode);
444
+ defaultInst.setInstanceData(doc);
445
+ }
446
+ // console.log('new data', defaultInst.getInstanceData());
447
+ // theFore.getModel().modelConstruct();
448
+ imported.getModel().updateModel();
449
+ imported.refresh();
450
+ return 'done';
451
+
452
+ },
453
+ { once: true },
454
+ );
455
+
456
+ const dummy = hostElement.querySelector('input');
457
+ if (hostElement.hasAttribute('shadow')) {
458
+ dummy.parentNode.removeChild(dummy);
459
+ hostElement.shadowRoot.appendChild(imported);
460
+ } else {
461
+ console.log(this, 'replacing widget with',theFore);
462
+ dummy.replaceWith(imported);
463
+ // this.appendChild(imported);
464
+ }
417
465
  })
418
- .catch(error => {
466
+ /*.catch(error => {
419
467
  hostElement.dispatchEvent(
420
468
  new CustomEvent('error', {
421
469
  composed: false,
@@ -426,7 +474,7 @@ export class Fore {
426
474
  },
427
475
  }),
428
476
  );
429
- });
477
+ });*/
430
478
  }
431
479
 
432
480
  /**
package/src/fx-bind.js CHANGED
@@ -320,6 +320,11 @@ export class FxBind extends foreElementMixin(HTMLElement) {
320
320
  this,
321
321
  );
322
322
 
323
+ const alert = this.getAlert();
324
+ if (alert) {
325
+ newItem.addAlert(alert);
326
+ }
327
+
323
328
  this.getModel().registerModelItem(newItem);
324
329
  }
325
330