@descope/flow-components 3.26.1 → 3.26.3

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.
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.26.1",
8
+ "buildVersion": "3.26.3",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
@@ -5,7 +5,7 @@
5
5
  "name": "flowComponents",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "3.26.1",
8
+ "buildVersion": "3.26.3",
9
9
  "buildName": "@descope/flow-components"
10
10
  },
11
11
  "remoteEntry": {
package/dist/index.cjs.js CHANGED
@@ -9923,6 +9923,14 @@ function requireIndex_cjs$1 () {
9923
9923
  var QUOTE_TEST_RE = /['"]/;
9924
9924
  var QUOTE_RE = /['"]/g;
9925
9925
  var APOSTROPHE = "’";
9926
+ var MAX_OPENERS = 1e3;
9927
+ function truncateStack(stack, heads, length) {
9928
+ while (stack.length > length) {
9929
+ const item = stack.pop();
9930
+ if (item.isSingleQuote) heads.single = item.prevSameQuoteIdx;
9931
+ else heads.double = item.prevSameQuoteIdx;
9932
+ }
9933
+ }
9926
9934
  function addReplacement(replacements, tokenIdx, pos, ch) {
9927
9935
  if (!replacements[tokenIdx]) replacements[tokenIdx] = [];
9928
9936
  replacements[tokenIdx].push({
@@ -9944,12 +9952,16 @@ function requireIndex_cjs$1 () {
9944
9952
  function process_inlines(tokens, state) {
9945
9953
  let j;
9946
9954
  const stack = [];
9955
+ const heads = {
9956
+ single: -1,
9957
+ double: -1
9958
+ };
9947
9959
  const replacements = {};
9948
9960
  for (let i = 0; i < tokens.length; i++) {
9949
9961
  const token = tokens[i];
9950
9962
  const thisLevel = tokens[i].level;
9951
9963
  for (j = stack.length - 1; j >= 0; j--) if (stack[j].level <= thisLevel) break;
9952
- stack.length = j + 1;
9964
+ truncateStack(stack, heads, j + 1);
9953
9965
  if (token.type !== "text") continue;
9954
9966
  const text = token.content;
9955
9967
  let pos = 0;
@@ -10001,11 +10013,10 @@ function requireIndex_cjs$1 () {
10001
10013
  if (isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
10002
10014
  continue;
10003
10015
  }
10004
- if (canClose) for (j = stack.length - 1; j >= 0; j--) {
10005
- let item = stack[j];
10006
- if (stack[j].level < thisLevel) break;
10007
- if (item.single === isSingle && stack[j].level === thisLevel) {
10008
- item = stack[j];
10016
+ if (canClose) {
10017
+ j = isSingle ? heads.single : heads.double;
10018
+ if (j >= 0 && stack[j].level === thisLevel) {
10019
+ const item = stack[j];
10009
10020
  let openQuote;
10010
10021
  let closeQuote;
10011
10022
  if (isSingle) {
@@ -10016,18 +10027,23 @@ function requireIndex_cjs$1 () {
10016
10027
  closeQuote = state.md.options.quotes[1];
10017
10028
  }
10018
10029
  addReplacement(replacements, i, t.index, closeQuote);
10019
- addReplacement(replacements, item.token, item.pos, openQuote);
10020
- stack.length = j;
10030
+ addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote);
10031
+ truncateStack(stack, heads, j);
10021
10032
  continue OUTER;
10022
10033
  }
10023
10034
  }
10024
- if (canOpen) stack.push({
10025
- token: i,
10026
- pos: t.index,
10027
- single: isSingle,
10028
- level: thisLevel
10029
- });
10030
- else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
10035
+ if (canOpen) {
10036
+ if (stack.length >= MAX_OPENERS) return;
10037
+ stack.push({
10038
+ tokenIdx: i,
10039
+ contentPos: t.index,
10040
+ isSingleQuote: isSingle,
10041
+ level: thisLevel,
10042
+ prevSameQuoteIdx: isSingle ? heads.single : heads.double
10043
+ });
10044
+ if (isSingle) heads.single = stack.length - 1;
10045
+ else heads.double = stack.length - 1;
10046
+ } else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
10031
10047
  }
10032
10048
  }
10033
10049
  Object.keys(replacements).forEach(function(tokenIdx) {
@@ -10690,129 +10706,141 @@ function requireIndex_cjs$1 () {
10690
10706
  }
10691
10707
  //#endregion
10692
10708
  //#region lib/rules_block/reference.mjs
10709
+ var MAX_LABEL_LENGTH = 999;
10710
+ function countCodePoints(str) {
10711
+ let length = str.length;
10712
+ for (let i = 0; i < str.length - 1; i++) {
10713
+ const high = str.charCodeAt(i);
10714
+ if (high < 55296 || high > 56319) continue;
10715
+ const low = str.charCodeAt(i + 1);
10716
+ if (low >= 56320 && low <= 57343) {
10717
+ length--;
10718
+ i++;
10719
+ }
10720
+ }
10721
+ return length;
10722
+ }
10723
+ function lineEnd(state, line) {
10724
+ return Math.min(state.eMarks[line] + 1, state.src.length);
10725
+ }
10726
+ function getNextLinePos(state, nextLine) {
10727
+ const endLine = state.lineMax;
10728
+ if (nextLine >= endLine || state.isEmpty(nextLine)) return -1;
10729
+ let isContinuation = false;
10730
+ if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
10731
+ if (state.sCount[nextLine] < 0) isContinuation = true;
10732
+ if (!isContinuation) {
10733
+ const terminatorRules = state.md.block.ruler.getRules("reference");
10734
+ const oldParentType = state.parentType;
10735
+ state.parentType = "reference";
10736
+ let terminate = false;
10737
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
10738
+ terminate = true;
10739
+ break;
10740
+ }
10741
+ state.parentType = oldParentType;
10742
+ if (terminate) return -1;
10743
+ }
10744
+ return state.bMarks[nextLine] + state.tShift[nextLine];
10745
+ }
10693
10746
  function reference(state, startLine, _endLine, silent) {
10747
+ const src = state.src;
10694
10748
  let pos = state.bMarks[startLine] + state.tShift[startLine];
10695
- let max = state.eMarks[startLine];
10696
10749
  let nextLine = startLine + 1;
10697
10750
  if (state.sCount[startLine] - state.blkIndent >= 4) return false;
10698
- if (state.src.charCodeAt(pos) !== 91) return false;
10699
- function getNextLine(nextLine) {
10700
- const endLine = state.lineMax;
10701
- if (nextLine >= endLine || state.isEmpty(nextLine)) return null;
10702
- let isContinuation = false;
10703
- if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
10704
- if (state.sCount[nextLine] < 0) isContinuation = true;
10705
- if (!isContinuation) {
10706
- const terminatorRules = state.md.block.ruler.getRules("reference");
10707
- const oldParentType = state.parentType;
10708
- state.parentType = "reference";
10709
- let terminate = false;
10710
- for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
10711
- terminate = true;
10712
- break;
10713
- }
10714
- state.parentType = oldParentType;
10715
- if (terminate) return null;
10716
- }
10717
- const pos = state.bMarks[nextLine] + state.tShift[nextLine];
10718
- const max = state.eMarks[nextLine];
10719
- return state.src.slice(pos, max + 1);
10720
- }
10721
- let str = state.src.slice(pos, max + 1);
10722
- max = str.length;
10751
+ if (src.charCodeAt(pos) !== 91) return false;
10752
+ let max = lineEnd(state, startLine);
10753
+ let rawLabel = "";
10723
10754
  let labelEnd = -1;
10724
- for (pos = 1; pos < max; pos++) {
10725
- const ch = str.charCodeAt(pos);
10755
+ let segmentStart = ++pos;
10756
+ while (pos < max) {
10757
+ if (rawLabel.length + pos - segmentStart > MAX_LABEL_LENGTH * 2) return false;
10758
+ let ch = src.charCodeAt(pos);
10726
10759
  if (ch === 91) return false;
10727
- else if (ch === 93) {
10760
+ if (ch === 93) {
10728
10761
  labelEnd = pos;
10729
10762
  break;
10730
- } else if (ch === 10) {
10731
- const lineContent = getNextLine(nextLine);
10732
- if (lineContent !== null) {
10733
- str += lineContent;
10734
- max = str.length;
10735
- nextLine++;
10736
- }
10737
- } else if (ch === 92) {
10738
- pos++;
10739
- if (pos < max && str.charCodeAt(pos) === 10) {
10740
- const lineContent = getNextLine(nextLine);
10741
- if (lineContent !== null) {
10742
- str += lineContent;
10743
- max = str.length;
10744
- nextLine++;
10745
- }
10746
- }
10747
10763
  }
10764
+ if (ch === 92) ch = src.charCodeAt(++pos);
10765
+ if (ch === 10 && pos < max) {
10766
+ const nextPos = getNextLinePos(state, nextLine);
10767
+ if (nextPos < 0) return false;
10768
+ rawLabel += src.slice(segmentStart, max);
10769
+ pos = segmentStart = nextPos;
10770
+ max = lineEnd(state, nextLine++);
10771
+ continue;
10772
+ }
10773
+ pos++;
10748
10774
  }
10749
- if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) return false;
10750
- for (pos = labelEnd + 2; pos < max; pos++) {
10751
- const ch = str.charCodeAt(pos);
10775
+ if (labelEnd < 0 || src.charCodeAt(labelEnd + 1) !== 58) return false;
10776
+ rawLabel += src.slice(segmentStart, labelEnd);
10777
+ if (rawLabel.length > MAX_LABEL_LENGTH && countCodePoints(rawLabel) > MAX_LABEL_LENGTH) return false;
10778
+ pos = labelEnd + 2;
10779
+ while (pos < max) {
10780
+ const ch = src.charCodeAt(pos);
10752
10781
  if (ch === 10) {
10753
- const lineContent = getNextLine(nextLine);
10754
- if (lineContent !== null) {
10755
- str += lineContent;
10756
- max = str.length;
10757
- nextLine++;
10758
- }
10759
- } else if (isSpace(ch)) ; else break;
10782
+ const nextPos = getNextLinePos(state, nextLine);
10783
+ if (nextPos < 0) break;
10784
+ pos = nextPos;
10785
+ max = lineEnd(state, nextLine++);
10786
+ } else if (isSpace(ch)) pos++;
10787
+ else break;
10760
10788
  }
10761
- const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
10789
+ const destRes = state.md.helpers.parseLinkDestination(src, pos, max);
10762
10790
  if (!destRes.ok) return false;
10763
10791
  const href = state.md.normalizeLink(destRes.str);
10764
10792
  if (!state.md.validateLink(href)) return false;
10765
10793
  pos = destRes.pos;
10766
10794
  const destEndPos = pos;
10795
+ const destEndMax = max;
10767
10796
  const destEndLineNo = nextLine;
10768
- const start = pos;
10769
- for (; pos < max; pos++) {
10770
- const ch = str.charCodeAt(pos);
10797
+ while (pos < max) {
10798
+ const ch = src.charCodeAt(pos);
10771
10799
  if (ch === 10) {
10772
- const lineContent = getNextLine(nextLine);
10773
- if (lineContent !== null) {
10774
- str += lineContent;
10775
- max = str.length;
10776
- nextLine++;
10777
- }
10778
- } else if (isSpace(ch)) ; else break;
10800
+ const nextPos = getNextLinePos(state, nextLine);
10801
+ if (nextPos < 0) break;
10802
+ pos = nextPos;
10803
+ max = lineEnd(state, nextLine++);
10804
+ } else if (isSpace(ch)) pos++;
10805
+ else break;
10779
10806
  }
10780
- let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
10807
+ const titleStart = pos;
10808
+ let titleRes = state.md.helpers.parseLinkTitle(src, pos, max);
10781
10809
  while (titleRes.can_continue) {
10782
- const lineContent = getNextLine(nextLine);
10783
- if (lineContent === null) break;
10784
- str += lineContent;
10785
- pos = max;
10786
- max = str.length;
10787
- nextLine++;
10788
- titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
10810
+ const nextPos = getNextLinePos(state, nextLine);
10811
+ if (nextPos < 0) break;
10812
+ pos = nextPos;
10813
+ max = lineEnd(state, nextLine++);
10814
+ titleRes = state.md.helpers.parseLinkTitle(src, pos, max, titleRes);
10789
10815
  }
10790
10816
  let title;
10791
- if (pos < max && start !== pos && titleRes.ok) {
10817
+ if (titleStart !== destEndPos && titleRes.ok) {
10792
10818
  title = titleRes.str;
10793
10819
  pos = titleRes.pos;
10794
10820
  } else {
10795
10821
  title = "";
10796
10822
  pos = destEndPos;
10823
+ max = destEndMax;
10797
10824
  nextLine = destEndLineNo;
10798
10825
  }
10799
10826
  while (pos < max) {
10800
- if (!isSpace(str.charCodeAt(pos))) break;
10827
+ if (!isSpace(src.charCodeAt(pos))) break;
10801
10828
  pos++;
10802
10829
  }
10803
- if (pos < max && str.charCodeAt(pos) !== 10) {
10830
+ if (pos < max && src.charCodeAt(pos) !== 10) {
10804
10831
  if (title) {
10805
10832
  title = "";
10806
10833
  pos = destEndPos;
10834
+ max = destEndMax;
10807
10835
  nextLine = destEndLineNo;
10808
10836
  while (pos < max) {
10809
- if (!isSpace(str.charCodeAt(pos))) break;
10837
+ if (!isSpace(src.charCodeAt(pos))) break;
10810
10838
  pos++;
10811
10839
  }
10812
10840
  }
10813
10841
  }
10814
- if (pos < max && str.charCodeAt(pos) !== 10) return false;
10815
- const label = normalizeReference(str.slice(1, labelEnd));
10842
+ if (pos < max && src.charCodeAt(pos) !== 10) return false;
10843
+ const label = normalizeReference(rawLabel);
10816
10844
  if (!label) return false;
10817
10845
  /* istanbul ignore if */
10818
10846
  if (silent) return true;
@@ -10892,7 +10920,6 @@ function requireIndex_cjs$1 () {
10892
10920
  ];
10893
10921
  //#endregion
10894
10922
  //#region lib/common/html_re.mjs
10895
- var HTML_TAG_RE = /* @__PURE__ */ new RegExp("^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)");
10896
10923
  var HTML_OPEN_CLOSE_TAG_RE = /* @__PURE__ */ new RegExp("^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)");
10897
10924
  //#endregion
10898
10925
  //#region lib/rules_block/html_block.mjs
@@ -11227,6 +11254,7 @@ function requireIndex_cjs$1 () {
11227
11254
  this._prev_delimiters = [];
11228
11255
  this.backticks = {};
11229
11256
  this.backticksScanned = false;
11257
+ this.skipHtmlSpecial = false;
11230
11258
  this.linkLevel = 0;
11231
11259
  }
11232
11260
  StateInline.prototype.pushPending = function() {
@@ -11851,22 +11879,53 @@ function requireIndex_cjs$1 () {
11851
11879
  const lc = ch | 32;
11852
11880
  return lc >= 97 && lc <= 122;
11853
11881
  }
11882
+ function scanSpecial(state, pos) {
11883
+ const src = state.src;
11884
+ let start;
11885
+ let terminator;
11886
+ if (src.startsWith("<!--", pos)) {
11887
+ if (src.startsWith(">", pos + 4)) return pos + 5;
11888
+ if (src.startsWith("->", pos + 4)) return pos + 6;
11889
+ start = pos + 4;
11890
+ terminator = "-->";
11891
+ } else if (src.startsWith("<![CDATA[", pos)) {
11892
+ start = pos + 9;
11893
+ terminator = "]]>";
11894
+ } else if (src.charCodeAt(pos + 1) === 63) {
11895
+ start = pos + 2;
11896
+ terminator = "?>";
11897
+ } else if (isLetter(src.charCodeAt(pos + 2))) {
11898
+ start = pos + 3;
11899
+ terminator = ">";
11900
+ } else return -1;
11901
+ if (state.skipHtmlSpecial) return -1;
11902
+ const end = src.indexOf(terminator, start);
11903
+ if (end < 0) {
11904
+ state.skipHtmlSpecial = true;
11905
+ return -1;
11906
+ }
11907
+ return end + terminator.length;
11908
+ }
11854
11909
  function html_inline(state, silent) {
11855
11910
  if (!state.md.options.html) return false;
11856
11911
  const max = state.posMax;
11857
11912
  const pos = state.pos;
11858
11913
  if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) return false;
11914
+ let end;
11859
11915
  const ch = state.src.charCodeAt(pos + 1);
11860
- if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) return false;
11861
- const match = state.src.slice(pos).match(HTML_TAG_RE);
11862
- if (!match) return false;
11916
+ if (ch === 33 || ch === 63) end = scanSpecial(state, pos);
11917
+ else if (ch === 47 || isLetter(ch)) {
11918
+ const match = state.src.slice(pos).match(HTML_OPEN_CLOSE_TAG_RE);
11919
+ end = match ? pos + match[0].length : -1;
11920
+ } else return false;
11921
+ if (end < 0) return false;
11863
11922
  if (!silent) {
11864
11923
  const token = state.push("html_inline", "", 0);
11865
- token.content = match[0];
11924
+ token.content = state.src.slice(pos, end);
11866
11925
  if (isLinkOpen(token.content)) state.linkLevel++;
11867
11926
  if (isLinkClose(token.content)) state.linkLevel--;
11868
11927
  }
11869
- state.pos += match[0].length;
11928
+ state.pos = end;
11870
11929
  return true;
11871
11930
  }
11872
11931
  //#endregion
@@ -104085,7 +104144,7 @@ descope-enriched-text {
104085
104144
  :host::after {
104086
104145
  background-color: transparent;
104087
104146
  }
104088
- :host::part(input-field)::after {
104147
+ vaadin-text-field::part(input-field)::after {
104089
104148
  background-color: transparent;
104090
104149
  }
104091
104150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "3.26.1",
3
+ "version": "3.26.3",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -98,7 +98,7 @@
98
98
  "webpack-subresource-integrity": "5.2.0-rc.1"
99
99
  },
100
100
  "dependencies": {
101
- "@descope/web-components-ui": "3.26.1"
101
+ "@descope/web-components-ui": "3.26.3"
102
102
  },
103
103
  "peerDependencies": {
104
104
  "react": ">= 18"