@bpmn-io/form-js-playground 1.9.1 → 1.10.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.
@@ -1987,7 +1987,7 @@
1987
1987
  * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
1988
1988
  * [more] {boolean} Whether the result of division was truncated.
1989
1989
  */
1990
- function round$2(x, sd, rm, more) {
1990
+ function round$1(x, sd, rm, more) {
1991
1991
  var xc = x.c;
1992
1992
  if (rm === UNDEFINED$1) rm = x.constructor.RM;
1993
1993
  if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {
@@ -2208,7 +2208,7 @@
2208
2208
  }
2209
2209
 
2210
2210
  // Round?
2211
- if (qi > p) round$2(q, p, Big.RM, r[0] !== UNDEFINED$1);
2211
+ if (qi > p) round$1(q, p, Big.RM, r[0] !== UNDEFINED$1);
2212
2212
  return q;
2213
2213
  };
2214
2214
 
@@ -2497,7 +2497,7 @@
2497
2497
  if (sd !== ~~sd || sd < 1 || sd > MAX_DP$1) {
2498
2498
  throw Error(INVALID$4 + 'precision');
2499
2499
  }
2500
- return round$2(new this.constructor(this), sd, rm);
2500
+ return round$1(new this.constructor(this), sd, rm);
2501
2501
  };
2502
2502
 
2503
2503
  /*
@@ -2513,7 +2513,7 @@
2513
2513
  if (dp === UNDEFINED$1) dp = 0;else if (dp !== ~~dp || dp < -MAX_DP$1 || dp > MAX_DP$1) {
2514
2514
  throw Error(INVALID_DP$1);
2515
2515
  }
2516
- return round$2(new this.constructor(this), dp + this.e + 1, rm);
2516
+ return round$1(new this.constructor(this), dp + this.e + 1, rm);
2517
2517
  };
2518
2518
 
2519
2519
  /*
@@ -2559,7 +2559,7 @@
2559
2559
  t = r;
2560
2560
  r = half.times(t.plus(x.div(t)));
2561
2561
  } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));
2562
- return round$2(r, (Big.DP -= 4) + r.e + 1, Big.RM);
2562
+ return round$1(r, (Big.DP -= 4) + r.e + 1, Big.RM);
2563
2563
  };
2564
2564
 
2565
2565
  /*
@@ -2642,7 +2642,7 @@
2642
2642
  if (dp !== ~~dp || dp < 0 || dp > MAX_DP$1) {
2643
2643
  throw Error(INVALID_DP$1);
2644
2644
  }
2645
- x = round$2(new x.constructor(x), ++dp, rm);
2645
+ x = round$1(new x.constructor(x), ++dp, rm);
2646
2646
  for (; x.c.length < dp;) x.c.push(0);
2647
2647
  }
2648
2648
  return stringify$1(x, true, !!n);
@@ -2665,7 +2665,7 @@
2665
2665
  if (dp !== ~~dp || dp < 0 || dp > MAX_DP$1) {
2666
2666
  throw Error(INVALID_DP$1);
2667
2667
  }
2668
- x = round$2(new x.constructor(x), dp + x.e + 1, rm);
2668
+ x = round$1(new x.constructor(x), dp + x.e + 1, rm);
2669
2669
 
2670
2670
  // x.e may have changed if the value is rounded up.
2671
2671
  for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);
@@ -2713,7 +2713,7 @@
2713
2713
  if (sd !== ~~sd || sd < 1 || sd > MAX_DP$1) {
2714
2714
  throw Error(INVALID$4 + 'precision');
2715
2715
  }
2716
- x = round$2(new Big(x), sd, rm);
2716
+ x = round$1(new Big(x), sd, rm);
2717
2717
  for (; x.c.length < sd;) x.c.push(0);
2718
2718
  }
2719
2719
  return stringify$1(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);
@@ -28778,13 +28778,15 @@
28778
28778
  let {
28779
28779
  parser
28780
28780
  } = this.p;
28781
+ let lookaheadRecord = this.reducePos < this.pos - 25 /* Lookahead.Margin */;
28782
+ if (lookaheadRecord) this.setLookAhead(this.pos);
28781
28783
  let dPrec = parser.dynamicPrecedence(type);
28782
28784
  if (dPrec) this.score += dPrec;
28783
28785
  if (depth == 0) {
28784
28786
  this.pushState(parser.getGoto(this.state, type, true), this.reducePos);
28785
28787
  // Zero-depth reductions are a special case—they add stuff to
28786
28788
  // the stack without popping anything off.
28787
- if (type < parser.minRepeatTerm) this.storeNode(type, this.reducePos, this.reducePos, 4, true);
28789
+ if (type < parser.minRepeatTerm) this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);
28788
28790
  this.reduceContext(type, this.reducePos);
28789
28791
  return;
28790
28792
  }
@@ -28829,7 +28831,7 @@
28829
28831
  /**
28830
28832
  @internal
28831
28833
  */
28832
- storeNode(term, start, end, size = 4, isReduce = false) {
28834
+ storeNode(term, start, end, size = 4, mustSink = false) {
28833
28835
  if (term == 0 /* Term.Err */ && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
28834
28836
  // Try to omit/merge adjacent error nodes
28835
28837
  let cur = this,
@@ -28846,20 +28848,29 @@
28846
28848
  }
28847
28849
  }
28848
28850
  }
28849
- if (!isReduce || this.pos == end) {
28851
+ if (!mustSink || this.pos == end) {
28850
28852
  // Simple case, just append
28851
28853
  this.buffer.push(term, start, end, size);
28852
28854
  } else {
28853
28855
  // There may be skipped nodes that have to be moved forward
28854
28856
  let index = this.buffer.length;
28855
- if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */) while (index > 0 && this.buffer[index - 2] > end) {
28856
- // Move this record forward
28857
- this.buffer[index] = this.buffer[index - 4];
28858
- this.buffer[index + 1] = this.buffer[index - 3];
28859
- this.buffer[index + 2] = this.buffer[index - 2];
28860
- this.buffer[index + 3] = this.buffer[index - 1];
28861
- index -= 4;
28862
- if (size > 4) size -= 4;
28857
+ if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */) {
28858
+ let mustMove = false;
28859
+ for (let scan = index; scan > 0 && this.buffer[scan - 2] > end; scan -= 4) {
28860
+ if (this.buffer[scan - 1] >= 0) {
28861
+ mustMove = true;
28862
+ break;
28863
+ }
28864
+ }
28865
+ if (mustMove) while (index > 0 && this.buffer[index - 2] > end) {
28866
+ // Move this record forward
28867
+ this.buffer[index] = this.buffer[index - 4];
28868
+ this.buffer[index + 1] = this.buffer[index - 3];
28869
+ this.buffer[index + 2] = this.buffer[index - 2];
28870
+ this.buffer[index + 3] = this.buffer[index - 1];
28871
+ index -= 4;
28872
+ if (size > 4) size -= 4;
28873
+ }
28863
28874
  }
28864
28875
  this.buffer[index] = term;
28865
28876
  this.buffer[index + 1] = start;
@@ -29610,7 +29621,7 @@
29610
29621
  cursor.moveTo(pos);
29611
29622
  for (;;) {
29612
29623
  if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos))) for (;;) {
29613
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */));
29624
+ if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError) return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */));
29614
29625
  if (side < 0 ? cursor.prevSibling() : cursor.nextSibling()) break;
29615
29626
  if (!cursor.parent()) return side < 0 ? 0 : tree.length;
29616
29627
  }
@@ -29726,7 +29737,7 @@
29726
29737
  token.mask = mask;
29727
29738
  token.context = context;
29728
29739
  }
29729
- if (token.lookAhead > token.end + 25 /* Safety.Margin */) lookAhead = Math.max(token.lookAhead, lookAhead);
29740
+ if (token.lookAhead > token.end + 25 /* Lookahead.Margin */) lookAhead = Math.max(token.lookAhead, lookAhead);
29730
29741
  if (token.value != 0 /* Term.Err */) {
29731
29742
  let startIndex = actionIndex;
29732
29743
  if (token.extended > -1) actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
@@ -32249,6 +32260,7 @@
32249
32260
  },
32250
32261
  dynamicPrecedences: {
32251
32262
  "31": -1,
32263
+ "67": 1,
32252
32264
  "71": -1,
32253
32265
  "73": -1
32254
32266
  },
@@ -32855,10 +32867,10 @@
32855
32867
  // 10.3.4.5 Numeric functions
32856
32868
  'decimal': fn(function (n, scale) {
32857
32869
  if (!scale) {
32858
- return round$1(n);
32870
+ return bankersRound(n);
32859
32871
  }
32860
32872
  const offset = Math.pow(10, scale);
32861
- return round$1(n * offset) / offset;
32873
+ return bankersRound(n * offset) / offset;
32862
32874
  }, ['number', 'number']),
32863
32875
  'floor': fn(function (n, scale = 0) {
32864
32876
  if (scale === null) {
@@ -32997,7 +33009,8 @@
32997
33009
  }, ['list', 'function']),
32998
33010
  // 10.3.4.10 Context function
32999
33011
  'get value': fn(function (m, key) {
33000
- return getFromContext(key, m) || null;
33012
+ const value = getFromContext(key, m);
33013
+ return value != undefined ? value : null;
33001
33014
  }, ['context', 'string']),
33002
33015
  'get entries': fn(function (m) {
33003
33016
  if (arguments.length !== 1) {
@@ -33274,13 +33287,13 @@
33274
33287
  // cf. https://mathiasbynens.be/notes/javascript-unicode
33275
33288
  return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
33276
33289
  }
33277
- function round$1(n) {
33278
- const integral = Math.trunc(n);
33279
- if (n - integral > .5) {
33280
- return integral + 1;
33281
- } else {
33282
- return integral;
33290
+ function bankersRound(n) {
33291
+ const floored = Math.floor(n);
33292
+ const decimalPart = n - floored;
33293
+ if (decimalPart === 0.5) {
33294
+ return floored % 2 === 0 ? floored : floored + 1;
33283
33295
  }
33296
+ return Math.round(n);
33284
33297
  }
33285
33298
  // adapted from https://stackoverflow.com/a/53577159
33286
33299
  function stddev(array) {
@@ -33463,6 +33476,12 @@
33463
33476
  switch (input) {
33464
33477
  case '+':
33465
33478
  return nullable((a, b) => {
33479
+ // flip these as luxon operations with durations aren't commutative
33480
+ if (isDuration(a) && !isDuration(b)) {
33481
+ const tmp = a;
33482
+ a = b;
33483
+ b = tmp;
33484
+ }
33466
33485
  if (isType(a, 'time') && isDuration(b)) {
33467
33486
  return a.plus(b).set({
33468
33487
  year: 1900,
@@ -58182,7 +58201,7 @@
58182
58201
  };
58183
58202
 
58184
58203
  /**
58185
- * marked v13.0.0 - a markdown parser
58204
+ * marked v14.0.0 - a markdown parser
58186
58205
  * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
58187
58206
  * https://github.com/markedjs/marked
58188
58207
  */
@@ -58241,18 +58260,6 @@
58241
58260
  }
58242
58261
  return html;
58243
58262
  }
58244
- const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
58245
- function unescape(html) {
58246
- // explicitly match decimal, hex, and named HTML entities
58247
- return html.replace(unescapeTest, (_, n) => {
58248
- n = n.toLowerCase();
58249
- if (n === 'colon') return ':';
58250
- if (n.charAt(0) === '#') {
58251
- return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
58252
- }
58253
- return '';
58254
- });
58255
- }
58256
58263
  const caret = /(^|[^\[])\^/g;
58257
58264
  function edit(regex, opt) {
58258
58265
  let source = typeof regex === 'string' ? regex : regex.source;
@@ -58273,7 +58280,7 @@
58273
58280
  function cleanUrl(href) {
58274
58281
  try {
58275
58282
  href = encodeURI(href).replace(/%25/g, '%');
58276
- } catch (e) {
58283
+ } catch {
58277
58284
  return null;
58278
58285
  }
58279
58286
  return href;
@@ -58576,12 +58583,12 @@
58576
58583
  }
58577
58584
  // Get next list item
58578
58585
  const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`);
58579
- let raw = '';
58580
- let itemContents = '';
58581
58586
  let endsWithBlankLine = false;
58582
58587
  // Check if current bullet point can start a new List Item
58583
58588
  while (src) {
58584
58589
  let endEarly = false;
58590
+ let raw = '';
58591
+ let itemContents = '';
58585
58592
  if (!(cap = itemRegex.exec(src))) {
58586
58593
  break;
58587
58594
  }
@@ -58593,18 +58600,20 @@
58593
58600
  src = src.substring(raw.length);
58594
58601
  let line = cap[2].split('\n', 1)[0].replace(/^\t+/, t => ' '.repeat(3 * t.length));
58595
58602
  let nextLine = src.split('\n', 1)[0];
58603
+ let blankLine = !line.trim();
58596
58604
  let indent = 0;
58597
58605
  if (this.options.pedantic) {
58598
58606
  indent = 2;
58599
58607
  itemContents = line.trimStart();
58608
+ } else if (blankLine) {
58609
+ indent = cap[1].length + 1;
58600
58610
  } else {
58601
58611
  indent = cap[2].search(/[^ ]/); // Find first non-space char
58602
58612
  indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
58603
58613
  itemContents = line.slice(indent);
58604
58614
  indent += cap[1].length;
58605
58615
  }
58606
- let blankLine = false;
58607
- if (!line && /^ *$/.test(nextLine)) {
58616
+ if (blankLine && /^ *$/.test(nextLine)) {
58608
58617
  // Items begin with at most one blank line
58609
58618
  raw += nextLine + '\n';
58610
58619
  src = src.substring(nextLine.length + 1);
@@ -58702,8 +58711,8 @@
58702
58711
  list.raw += raw;
58703
58712
  }
58704
58713
  // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
58705
- list.items[list.items.length - 1].raw = raw.trimEnd();
58706
- list.items[list.items.length - 1].text = itemContents.trimEnd();
58714
+ list.items[list.items.length - 1].raw = list.items[list.items.length - 1].raw.trimEnd();
58715
+ list.items[list.items.length - 1].text = list.items[list.items.length - 1].text.trimEnd();
58707
58716
  list.raw = list.raw.trimEnd();
58708
58717
  // Item child tokens handled here at end because we needed to have the final item to trim it first
58709
58718
  for (let i = 0; i < list.items.length; i++) {
@@ -60230,8 +60239,8 @@
60230
60239
  class Marked {
60231
60240
  defaults = _getDefaults();
60232
60241
  options = this.setOptions;
60233
- parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);
60234
- parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
60242
+ parse = this.parseMarkdown(_Lexer.lex, _Parser.parse);
60243
+ parseInline = this.parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
60235
60244
  Parser = _Parser;
60236
60245
  Renderer = _Renderer;
60237
60246
  TextRenderer = _TextRenderer;
@@ -60365,14 +60374,10 @@
60365
60374
  continue;
60366
60375
  }
60367
60376
  const rendererProp = prop;
60368
- let rendererFunc = pack.renderer[rendererProp];
60377
+ const rendererFunc = pack.renderer[rendererProp];
60369
60378
  const prevRenderer = renderer[rendererProp];
60370
60379
  // Replace renderer with func to run extension, but fall back if false
60371
60380
  renderer[rendererProp] = (...args) => {
60372
- if (!pack.useNewRenderer) {
60373
- // TODO: Remove this in next major version
60374
- rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer);
60375
- }
60376
60381
  let ret = rendererFunc.apply(renderer, args);
60377
60382
  if (ret === false) {
60378
60383
  ret = prevRenderer.apply(renderer, args);
@@ -60465,219 +60470,6 @@
60465
60470
  });
60466
60471
  return this;
60467
60472
  }
60468
- // TODO: Remove this in next major release
60469
- #convertRendererFunction(func, prop, renderer) {
60470
- switch (prop) {
60471
- case 'heading':
60472
- return function (token) {
60473
- if (!token.type || token.type !== prop) {
60474
- // @ts-ignore
60475
- // eslint-disable-next-line prefer-rest-params
60476
- return func.apply(this, arguments);
60477
- }
60478
- return func(renderer.parser.parseInline(token.tokens), token.depth, unescape(renderer.parser.parseInline(token.tokens, renderer.parser.textRenderer)));
60479
- };
60480
- case 'code':
60481
- return function (token) {
60482
- if (!token.type || token.type !== prop) {
60483
- // @ts-ignore
60484
- // eslint-disable-next-line prefer-rest-params
60485
- return func.apply(this, arguments);
60486
- }
60487
- return func(token.text, token.lang, !!token.escaped);
60488
- };
60489
- case 'table':
60490
- return function (token) {
60491
- if (!token.type || token.type !== prop) {
60492
- // @ts-ignore
60493
- // eslint-disable-next-line prefer-rest-params
60494
- return func.apply(this, arguments);
60495
- }
60496
- let header = '';
60497
- // header
60498
- let cell = '';
60499
- for (let j = 0; j < token.header.length; j++) {
60500
- cell += this.tablecell({
60501
- text: token.header[j].text,
60502
- tokens: token.header[j].tokens,
60503
- header: true,
60504
- align: token.align[j]
60505
- });
60506
- }
60507
- header += this.tablerow({
60508
- text: cell
60509
- });
60510
- let body = '';
60511
- for (let j = 0; j < token.rows.length; j++) {
60512
- const row = token.rows[j];
60513
- cell = '';
60514
- for (let k = 0; k < row.length; k++) {
60515
- cell += this.tablecell({
60516
- text: row[k].text,
60517
- tokens: row[k].tokens,
60518
- header: false,
60519
- align: token.align[k]
60520
- });
60521
- }
60522
- body += this.tablerow({
60523
- text: cell
60524
- });
60525
- }
60526
- return func(header, body);
60527
- };
60528
- case 'blockquote':
60529
- return function (token) {
60530
- if (!token.type || token.type !== prop) {
60531
- // @ts-ignore
60532
- // eslint-disable-next-line prefer-rest-params
60533
- return func.apply(this, arguments);
60534
- }
60535
- const body = this.parser.parse(token.tokens);
60536
- return func(body);
60537
- };
60538
- case 'list':
60539
- return function (token) {
60540
- if (!token.type || token.type !== prop) {
60541
- // @ts-ignore
60542
- // eslint-disable-next-line prefer-rest-params
60543
- return func.apply(this, arguments);
60544
- }
60545
- const ordered = token.ordered;
60546
- const start = token.start;
60547
- const loose = token.loose;
60548
- let body = '';
60549
- for (let j = 0; j < token.items.length; j++) {
60550
- const item = token.items[j];
60551
- const checked = item.checked;
60552
- const task = item.task;
60553
- let itemBody = '';
60554
- if (item.task) {
60555
- const checkbox = this.checkbox({
60556
- checked: !!checked
60557
- });
60558
- if (loose) {
60559
- if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
60560
- item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
60561
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
60562
- item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
60563
- }
60564
- } else {
60565
- item.tokens.unshift({
60566
- type: 'text',
60567
- text: checkbox + ' '
60568
- });
60569
- }
60570
- } else {
60571
- itemBody += checkbox + ' ';
60572
- }
60573
- }
60574
- itemBody += this.parser.parse(item.tokens, loose);
60575
- body += this.listitem({
60576
- type: 'list_item',
60577
- raw: itemBody,
60578
- text: itemBody,
60579
- task,
60580
- checked: !!checked,
60581
- loose,
60582
- tokens: item.tokens
60583
- });
60584
- }
60585
- return func(body, ordered, start);
60586
- };
60587
- case 'html':
60588
- return function (token) {
60589
- if (!token.type || token.type !== prop) {
60590
- // @ts-ignore
60591
- // eslint-disable-next-line prefer-rest-params
60592
- return func.apply(this, arguments);
60593
- }
60594
- return func(token.text, token.block);
60595
- };
60596
- case 'paragraph':
60597
- return function (token) {
60598
- if (!token.type || token.type !== prop) {
60599
- // @ts-ignore
60600
- // eslint-disable-next-line prefer-rest-params
60601
- return func.apply(this, arguments);
60602
- }
60603
- return func(this.parser.parseInline(token.tokens));
60604
- };
60605
- case 'escape':
60606
- return function (token) {
60607
- if (!token.type || token.type !== prop) {
60608
- // @ts-ignore
60609
- // eslint-disable-next-line prefer-rest-params
60610
- return func.apply(this, arguments);
60611
- }
60612
- return func(token.text);
60613
- };
60614
- case 'link':
60615
- return function (token) {
60616
- if (!token.type || token.type !== prop) {
60617
- // @ts-ignore
60618
- // eslint-disable-next-line prefer-rest-params
60619
- return func.apply(this, arguments);
60620
- }
60621
- return func(token.href, token.title, this.parser.parseInline(token.tokens));
60622
- };
60623
- case 'image':
60624
- return function (token) {
60625
- if (!token.type || token.type !== prop) {
60626
- // @ts-ignore
60627
- // eslint-disable-next-line prefer-rest-params
60628
- return func.apply(this, arguments);
60629
- }
60630
- return func(token.href, token.title, token.text);
60631
- };
60632
- case 'strong':
60633
- return function (token) {
60634
- if (!token.type || token.type !== prop) {
60635
- // @ts-ignore
60636
- // eslint-disable-next-line prefer-rest-params
60637
- return func.apply(this, arguments);
60638
- }
60639
- return func(this.parser.parseInline(token.tokens));
60640
- };
60641
- case 'em':
60642
- return function (token) {
60643
- if (!token.type || token.type !== prop) {
60644
- // @ts-ignore
60645
- // eslint-disable-next-line prefer-rest-params
60646
- return func.apply(this, arguments);
60647
- }
60648
- return func(this.parser.parseInline(token.tokens));
60649
- };
60650
- case 'codespan':
60651
- return function (token) {
60652
- if (!token.type || token.type !== prop) {
60653
- // @ts-ignore
60654
- // eslint-disable-next-line prefer-rest-params
60655
- return func.apply(this, arguments);
60656
- }
60657
- return func(token.text);
60658
- };
60659
- case 'del':
60660
- return function (token) {
60661
- if (!token.type || token.type !== prop) {
60662
- // @ts-ignore
60663
- // eslint-disable-next-line prefer-rest-params
60664
- return func.apply(this, arguments);
60665
- }
60666
- return func(this.parser.parseInline(token.tokens));
60667
- };
60668
- case 'text':
60669
- return function (token) {
60670
- if (!token.type || token.type !== prop) {
60671
- // @ts-ignore
60672
- // eslint-disable-next-line prefer-rest-params
60673
- return func.apply(this, arguments);
60674
- }
60675
- return func(token.text);
60676
- };
60677
- // do nothing
60678
- }
60679
- return func;
60680
- }
60681
60473
  setOptions(opt) {
60682
60474
  this.defaults = {
60683
60475
  ...this.defaults,
@@ -60691,8 +60483,9 @@
60691
60483
  parser(tokens, options) {
60692
60484
  return _Parser.parse(tokens, options ?? this.defaults);
60693
60485
  }
60694
- #parseMarkdown(lexer, parser) {
60695
- return (src, options) => {
60486
+ parseMarkdown(lexer, parser) {
60487
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60488
+ const parse = (src, options) => {
60696
60489
  const origOpt = {
60697
60490
  ...options
60698
60491
  };
@@ -60700,14 +60493,11 @@
60700
60493
  ...this.defaults,
60701
60494
  ...origOpt
60702
60495
  };
60703
- // Show warning if an extension set async to true but the parse was called with async: false
60496
+ const throwError = this.onError(!!opt.silent, !!opt.async);
60497
+ // throw error if an extension set async to true but parse was called with async: false
60704
60498
  if (this.defaults.async === true && origOpt.async === false) {
60705
- if (!opt.silent) {
60706
- console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');
60707
- }
60708
- opt.async = true;
60499
+ return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.'));
60709
60500
  }
60710
- const throwError = this.#onError(!!opt.silent, !!opt.async);
60711
60501
  // throw error in case of non string input
60712
60502
  if (typeof src === 'undefined' || src === null) {
60713
60503
  return throwError(new Error('marked(): input parameter is undefined or null'));
@@ -60741,8 +60531,9 @@
60741
60531
  return throwError(e);
60742
60532
  }
60743
60533
  };
60534
+ return parse;
60744
60535
  }
60745
- #onError(silent, async) {
60536
+ onError(silent, async) {
60746
60537
  return e => {
60747
60538
  e.message += '\nPlease report this to https://github.com/markedjs/marked.';
60748
60539
  if (silent) {
@@ -67911,6 +67702,7 @@
67911
67702
  const hasChildren = repeaterField.components && repeaterField.components.length > 0;
67912
67703
  const showRemove = repeaterField.allowAddRemove && hasChildren;
67913
67704
  const displayValues = isCollapsed ? values.slice(0, nonCollapsedItems) : values;
67705
+ const hiddenValues = isCollapsed ? values.slice(nonCollapsedItems) : [];
67914
67706
  const onDeleteItem = index => {
67915
67707
  const updatedValues = values.slice();
67916
67708
  updatedValues.splice(index, 1);
@@ -67922,7 +67714,7 @@
67922
67714
  };
67923
67715
  const parentExpressionContextInfo = F$1(LocalExpressionContext);
67924
67716
  return e(d$1, {
67925
- children: displayValues.map((itemValue, itemIndex) => e(RepetitionScaffold, {
67717
+ children: [displayValues.map((itemValue, itemIndex) => e(RepetitionScaffold, {
67926
67718
  itemIndex: itemIndex,
67927
67719
  itemValue: itemValue,
67928
67720
  parentExpressionContextInfo: parentExpressionContextInfo,
@@ -67932,7 +67724,20 @@
67932
67724
  onDeleteItem: onDeleteItem,
67933
67725
  showRemove: showRemove,
67934
67726
  ...restProps
67935
- }, itemIndex))
67727
+ }, itemIndex)), hiddenValues.length > 0 ? e("div", {
67728
+ className: "fjs-repeat-row-collapsed",
67729
+ children: hiddenValues.map((itemValue, itemIndex) => e(RepetitionScaffold, {
67730
+ itemIndex: itemIndex + nonCollapsedItems,
67731
+ itemValue: itemValue,
67732
+ parentExpressionContextInfo: parentExpressionContextInfo,
67733
+ repeaterField: repeaterField,
67734
+ RowsRenderer: RowsRenderer,
67735
+ indexes: indexes,
67736
+ onDeleteItem: onDeleteItem,
67737
+ showRemove: showRemove,
67738
+ ...restProps
67739
+ }, itemIndex))
67740
+ }) : null]
67936
67741
  });
67937
67742
  }
67938
67743
  RepeatFooter(props) {
@@ -75769,6 +75574,9 @@
75769
75574
  let targetParentId;
75770
75575
  if (formFieldNode) {
75771
75576
  formField = this._formFieldRegistry.get(formFieldNode.dataset.id);
75577
+ if (!formField) {
75578
+ return 'No associated form field in the registry';
75579
+ }
75772
75580
  columns = (formField.layout || {}).columns;
75773
75581
 
75774
75582
  // (1) check for row constraints
@@ -86396,10 +86204,59 @@
86396
86204
  add: addEntry
86397
86205
  };
86398
86206
  }
86207
+ function VersionTagEntry(props) {
86208
+ const {
86209
+ editField,
86210
+ field
86211
+ } = props;
86212
+ const entries = [];
86213
+ entries.push({
86214
+ id: 'versionTag',
86215
+ component: VersionTag,
86216
+ editField: editField,
86217
+ field: field,
86218
+ isEdited: isEdited,
86219
+ isDefaultVisible: field => field.type === 'default'
86220
+ });
86221
+ return entries;
86222
+ }
86223
+ function VersionTag(props) {
86224
+ const {
86225
+ editField,
86226
+ field,
86227
+ id
86228
+ } = props;
86229
+ const debounce = useService('debounce');
86230
+ const path = ['versionTag'];
86231
+ const getValue = () => {
86232
+ return get(field, path, '');
86233
+ };
86234
+ const setValue = (value, error) => {
86235
+ if (error) {
86236
+ return;
86237
+ }
86238
+ return editField(field, path, value);
86239
+ };
86240
+ const tooltip = e("div", {
86241
+ children: "Version tag by which this form can be referenced."
86242
+ });
86243
+ return TextfieldEntry({
86244
+ debounce,
86245
+ element: field,
86246
+ getValue,
86247
+ id,
86248
+ label: 'Version tag',
86249
+ setValue,
86250
+ tooltip
86251
+ });
86252
+ }
86399
86253
  function GeneralGroup(field, editField, getService) {
86400
86254
  const entries = [...IdEntry({
86401
86255
  field,
86402
86256
  editField
86257
+ }), ...VersionTagEntry({
86258
+ field,
86259
+ editField
86403
86260
  }), ...LabelEntry({
86404
86261
  field,
86405
86262
  editField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-playground",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "A form-js playground",
5
5
  "files": [
6
6
  "dist"
@@ -45,8 +45,8 @@
45
45
  "url": "https://github.com/bpmn-io"
46
46
  },
47
47
  "dependencies": {
48
- "@bpmn-io/form-js-editor": "^1.9.1",
49
- "@bpmn-io/form-js-viewer": "^1.9.1",
48
+ "@bpmn-io/form-js-editor": "^1.10.0",
49
+ "@bpmn-io/form-js-viewer": "^1.10.0",
50
50
  "@codemirror/autocomplete": "^6.16.0",
51
51
  "@codemirror/commands": "^6.5.0",
52
52
  "@codemirror/lang-json": "^6.0.1",
@@ -70,5 +70,6 @@
70
70
  "min-dom": "^4.1.0",
71
71
  "rollup-plugin-css-only": "^4.5.2",
72
72
  "style-loader": "^4.0.0"
73
- }
73
+ },
74
+ "gitHead": "50d5de8e46f342a99ce238231f958610ad2c6ae4"
74
75
  }