@bpmn-io/form-js-playground 1.9.2 → 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.
@@ -58201,7 +58201,7 @@
58201
58201
  };
58202
58202
 
58203
58203
  /**
58204
- * marked v13.0.0 - a markdown parser
58204
+ * marked v14.0.0 - a markdown parser
58205
58205
  * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
58206
58206
  * https://github.com/markedjs/marked
58207
58207
  */
@@ -58260,18 +58260,6 @@
58260
58260
  }
58261
58261
  return html;
58262
58262
  }
58263
- const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
58264
- function unescape(html) {
58265
- // explicitly match decimal, hex, and named HTML entities
58266
- return html.replace(unescapeTest, (_, n) => {
58267
- n = n.toLowerCase();
58268
- if (n === 'colon') return ':';
58269
- if (n.charAt(0) === '#') {
58270
- return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
58271
- }
58272
- return '';
58273
- });
58274
- }
58275
58263
  const caret = /(^|[^\[])\^/g;
58276
58264
  function edit(regex, opt) {
58277
58265
  let source = typeof regex === 'string' ? regex : regex.source;
@@ -58292,7 +58280,7 @@
58292
58280
  function cleanUrl(href) {
58293
58281
  try {
58294
58282
  href = encodeURI(href).replace(/%25/g, '%');
58295
- } catch (e) {
58283
+ } catch {
58296
58284
  return null;
58297
58285
  }
58298
58286
  return href;
@@ -58595,12 +58583,12 @@
58595
58583
  }
58596
58584
  // Get next list item
58597
58585
  const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`);
58598
- let raw = '';
58599
- let itemContents = '';
58600
58586
  let endsWithBlankLine = false;
58601
58587
  // Check if current bullet point can start a new List Item
58602
58588
  while (src) {
58603
58589
  let endEarly = false;
58590
+ let raw = '';
58591
+ let itemContents = '';
58604
58592
  if (!(cap = itemRegex.exec(src))) {
58605
58593
  break;
58606
58594
  }
@@ -58612,18 +58600,20 @@
58612
58600
  src = src.substring(raw.length);
58613
58601
  let line = cap[2].split('\n', 1)[0].replace(/^\t+/, t => ' '.repeat(3 * t.length));
58614
58602
  let nextLine = src.split('\n', 1)[0];
58603
+ let blankLine = !line.trim();
58615
58604
  let indent = 0;
58616
58605
  if (this.options.pedantic) {
58617
58606
  indent = 2;
58618
58607
  itemContents = line.trimStart();
58608
+ } else if (blankLine) {
58609
+ indent = cap[1].length + 1;
58619
58610
  } else {
58620
58611
  indent = cap[2].search(/[^ ]/); // Find first non-space char
58621
58612
  indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
58622
58613
  itemContents = line.slice(indent);
58623
58614
  indent += cap[1].length;
58624
58615
  }
58625
- let blankLine = false;
58626
- if (!line && /^ *$/.test(nextLine)) {
58616
+ if (blankLine && /^ *$/.test(nextLine)) {
58627
58617
  // Items begin with at most one blank line
58628
58618
  raw += nextLine + '\n';
58629
58619
  src = src.substring(nextLine.length + 1);
@@ -58721,8 +58711,8 @@
58721
58711
  list.raw += raw;
58722
58712
  }
58723
58713
  // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
58724
- list.items[list.items.length - 1].raw = raw.trimEnd();
58725
- 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();
58726
58716
  list.raw = list.raw.trimEnd();
58727
58717
  // Item child tokens handled here at end because we needed to have the final item to trim it first
58728
58718
  for (let i = 0; i < list.items.length; i++) {
@@ -60249,8 +60239,8 @@
60249
60239
  class Marked {
60250
60240
  defaults = _getDefaults();
60251
60241
  options = this.setOptions;
60252
- parse = this.#parseMarkdown(_Lexer.lex, _Parser.parse);
60253
- parseInline = this.#parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
60242
+ parse = this.parseMarkdown(_Lexer.lex, _Parser.parse);
60243
+ parseInline = this.parseMarkdown(_Lexer.lexInline, _Parser.parseInline);
60254
60244
  Parser = _Parser;
60255
60245
  Renderer = _Renderer;
60256
60246
  TextRenderer = _TextRenderer;
@@ -60384,14 +60374,10 @@
60384
60374
  continue;
60385
60375
  }
60386
60376
  const rendererProp = prop;
60387
- let rendererFunc = pack.renderer[rendererProp];
60377
+ const rendererFunc = pack.renderer[rendererProp];
60388
60378
  const prevRenderer = renderer[rendererProp];
60389
60379
  // Replace renderer with func to run extension, but fall back if false
60390
60380
  renderer[rendererProp] = (...args) => {
60391
- if (!pack.useNewRenderer) {
60392
- // TODO: Remove this in next major version
60393
- rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer);
60394
- }
60395
60381
  let ret = rendererFunc.apply(renderer, args);
60396
60382
  if (ret === false) {
60397
60383
  ret = prevRenderer.apply(renderer, args);
@@ -60484,219 +60470,6 @@
60484
60470
  });
60485
60471
  return this;
60486
60472
  }
60487
- // TODO: Remove this in next major release
60488
- #convertRendererFunction(func, prop, renderer) {
60489
- switch (prop) {
60490
- case 'heading':
60491
- return function (token) {
60492
- if (!token.type || token.type !== prop) {
60493
- // @ts-ignore
60494
- // eslint-disable-next-line prefer-rest-params
60495
- return func.apply(this, arguments);
60496
- }
60497
- return func(renderer.parser.parseInline(token.tokens), token.depth, unescape(renderer.parser.parseInline(token.tokens, renderer.parser.textRenderer)));
60498
- };
60499
- case 'code':
60500
- return function (token) {
60501
- if (!token.type || token.type !== prop) {
60502
- // @ts-ignore
60503
- // eslint-disable-next-line prefer-rest-params
60504
- return func.apply(this, arguments);
60505
- }
60506
- return func(token.text, token.lang, !!token.escaped);
60507
- };
60508
- case 'table':
60509
- return function (token) {
60510
- if (!token.type || token.type !== prop) {
60511
- // @ts-ignore
60512
- // eslint-disable-next-line prefer-rest-params
60513
- return func.apply(this, arguments);
60514
- }
60515
- let header = '';
60516
- // header
60517
- let cell = '';
60518
- for (let j = 0; j < token.header.length; j++) {
60519
- cell += this.tablecell({
60520
- text: token.header[j].text,
60521
- tokens: token.header[j].tokens,
60522
- header: true,
60523
- align: token.align[j]
60524
- });
60525
- }
60526
- header += this.tablerow({
60527
- text: cell
60528
- });
60529
- let body = '';
60530
- for (let j = 0; j < token.rows.length; j++) {
60531
- const row = token.rows[j];
60532
- cell = '';
60533
- for (let k = 0; k < row.length; k++) {
60534
- cell += this.tablecell({
60535
- text: row[k].text,
60536
- tokens: row[k].tokens,
60537
- header: false,
60538
- align: token.align[k]
60539
- });
60540
- }
60541
- body += this.tablerow({
60542
- text: cell
60543
- });
60544
- }
60545
- return func(header, body);
60546
- };
60547
- case 'blockquote':
60548
- return function (token) {
60549
- if (!token.type || token.type !== prop) {
60550
- // @ts-ignore
60551
- // eslint-disable-next-line prefer-rest-params
60552
- return func.apply(this, arguments);
60553
- }
60554
- const body = this.parser.parse(token.tokens);
60555
- return func(body);
60556
- };
60557
- case 'list':
60558
- return function (token) {
60559
- if (!token.type || token.type !== prop) {
60560
- // @ts-ignore
60561
- // eslint-disable-next-line prefer-rest-params
60562
- return func.apply(this, arguments);
60563
- }
60564
- const ordered = token.ordered;
60565
- const start = token.start;
60566
- const loose = token.loose;
60567
- let body = '';
60568
- for (let j = 0; j < token.items.length; j++) {
60569
- const item = token.items[j];
60570
- const checked = item.checked;
60571
- const task = item.task;
60572
- let itemBody = '';
60573
- if (item.task) {
60574
- const checkbox = this.checkbox({
60575
- checked: !!checked
60576
- });
60577
- if (loose) {
60578
- if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
60579
- item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
60580
- if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
60581
- item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
60582
- }
60583
- } else {
60584
- item.tokens.unshift({
60585
- type: 'text',
60586
- text: checkbox + ' '
60587
- });
60588
- }
60589
- } else {
60590
- itemBody += checkbox + ' ';
60591
- }
60592
- }
60593
- itemBody += this.parser.parse(item.tokens, loose);
60594
- body += this.listitem({
60595
- type: 'list_item',
60596
- raw: itemBody,
60597
- text: itemBody,
60598
- task,
60599
- checked: !!checked,
60600
- loose,
60601
- tokens: item.tokens
60602
- });
60603
- }
60604
- return func(body, ordered, start);
60605
- };
60606
- case 'html':
60607
- return function (token) {
60608
- if (!token.type || token.type !== prop) {
60609
- // @ts-ignore
60610
- // eslint-disable-next-line prefer-rest-params
60611
- return func.apply(this, arguments);
60612
- }
60613
- return func(token.text, token.block);
60614
- };
60615
- case 'paragraph':
60616
- return function (token) {
60617
- if (!token.type || token.type !== prop) {
60618
- // @ts-ignore
60619
- // eslint-disable-next-line prefer-rest-params
60620
- return func.apply(this, arguments);
60621
- }
60622
- return func(this.parser.parseInline(token.tokens));
60623
- };
60624
- case 'escape':
60625
- return function (token) {
60626
- if (!token.type || token.type !== prop) {
60627
- // @ts-ignore
60628
- // eslint-disable-next-line prefer-rest-params
60629
- return func.apply(this, arguments);
60630
- }
60631
- return func(token.text);
60632
- };
60633
- case 'link':
60634
- return function (token) {
60635
- if (!token.type || token.type !== prop) {
60636
- // @ts-ignore
60637
- // eslint-disable-next-line prefer-rest-params
60638
- return func.apply(this, arguments);
60639
- }
60640
- return func(token.href, token.title, this.parser.parseInline(token.tokens));
60641
- };
60642
- case 'image':
60643
- return function (token) {
60644
- if (!token.type || token.type !== prop) {
60645
- // @ts-ignore
60646
- // eslint-disable-next-line prefer-rest-params
60647
- return func.apply(this, arguments);
60648
- }
60649
- return func(token.href, token.title, token.text);
60650
- };
60651
- case 'strong':
60652
- return function (token) {
60653
- if (!token.type || token.type !== prop) {
60654
- // @ts-ignore
60655
- // eslint-disable-next-line prefer-rest-params
60656
- return func.apply(this, arguments);
60657
- }
60658
- return func(this.parser.parseInline(token.tokens));
60659
- };
60660
- case 'em':
60661
- return function (token) {
60662
- if (!token.type || token.type !== prop) {
60663
- // @ts-ignore
60664
- // eslint-disable-next-line prefer-rest-params
60665
- return func.apply(this, arguments);
60666
- }
60667
- return func(this.parser.parseInline(token.tokens));
60668
- };
60669
- case 'codespan':
60670
- return function (token) {
60671
- if (!token.type || token.type !== prop) {
60672
- // @ts-ignore
60673
- // eslint-disable-next-line prefer-rest-params
60674
- return func.apply(this, arguments);
60675
- }
60676
- return func(token.text);
60677
- };
60678
- case 'del':
60679
- return function (token) {
60680
- if (!token.type || token.type !== prop) {
60681
- // @ts-ignore
60682
- // eslint-disable-next-line prefer-rest-params
60683
- return func.apply(this, arguments);
60684
- }
60685
- return func(this.parser.parseInline(token.tokens));
60686
- };
60687
- case 'text':
60688
- return function (token) {
60689
- if (!token.type || token.type !== prop) {
60690
- // @ts-ignore
60691
- // eslint-disable-next-line prefer-rest-params
60692
- return func.apply(this, arguments);
60693
- }
60694
- return func(token.text);
60695
- };
60696
- // do nothing
60697
- }
60698
- return func;
60699
- }
60700
60473
  setOptions(opt) {
60701
60474
  this.defaults = {
60702
60475
  ...this.defaults,
@@ -60710,8 +60483,9 @@
60710
60483
  parser(tokens, options) {
60711
60484
  return _Parser.parse(tokens, options ?? this.defaults);
60712
60485
  }
60713
- #parseMarkdown(lexer, parser) {
60714
- return (src, options) => {
60486
+ parseMarkdown(lexer, parser) {
60487
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60488
+ const parse = (src, options) => {
60715
60489
  const origOpt = {
60716
60490
  ...options
60717
60491
  };
@@ -60719,14 +60493,11 @@
60719
60493
  ...this.defaults,
60720
60494
  ...origOpt
60721
60495
  };
60722
- // 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
60723
60498
  if (this.defaults.async === true && origOpt.async === false) {
60724
- if (!opt.silent) {
60725
- console.warn('marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.');
60726
- }
60727
- 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.'));
60728
60500
  }
60729
- const throwError = this.#onError(!!opt.silent, !!opt.async);
60730
60501
  // throw error in case of non string input
60731
60502
  if (typeof src === 'undefined' || src === null) {
60732
60503
  return throwError(new Error('marked(): input parameter is undefined or null'));
@@ -60760,8 +60531,9 @@
60760
60531
  return throwError(e);
60761
60532
  }
60762
60533
  };
60534
+ return parse;
60763
60535
  }
60764
- #onError(silent, async) {
60536
+ onError(silent, async) {
60765
60537
  return e => {
60766
60538
  e.message += '\nPlease report this to https://github.com/markedjs/marked.';
60767
60539
  if (silent) {
@@ -86432,10 +86204,59 @@
86432
86204
  add: addEntry
86433
86205
  };
86434
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
+ }
86435
86253
  function GeneralGroup(field, editField, getService) {
86436
86254
  const entries = [...IdEntry({
86437
86255
  field,
86438
86256
  editField
86257
+ }), ...VersionTagEntry({
86258
+ field,
86259
+ editField
86439
86260
  }), ...LabelEntry({
86440
86261
  field,
86441
86262
  editField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-playground",
3
- "version": "1.9.2",
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.2",
49
- "@bpmn-io/form-js-viewer": "^1.9.2",
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",
@@ -71,5 +71,5 @@
71
71
  "rollup-plugin-css-only": "^4.5.2",
72
72
  "style-loader": "^4.0.0"
73
73
  },
74
- "gitHead": "74ba40e6fad356dad63315d3270b4ee61aec4058"
74
+ "gitHead": "50d5de8e46f342a99ce238231f958610ad2c6ae4"
75
75
  }