@knime/kds-rich-text-editor 14.1.0 → 14.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @knime/kds-rich-text-editor
2
2
 
3
+ ## 14.2.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [53de24c, 19a480b, 5c14e1a]
8
+ - @knime/kds-components@14.2.0
9
+ - @knime/utils@4.0.0
10
+ - @knime/kds-styles@14.2.0
11
+
12
+ ## 14.1.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [fd99132]
17
+ - @knime/kds-components@14.1.1
18
+ - @knime/kds-styles@14.1.1
19
+
3
20
  ## 14.1.0
4
21
 
5
22
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2555,78 +2555,25 @@ var __exportAll = (all, no_symbols) => {
2555
2555
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
2556
2556
  return target;
2557
2557
  };
2558
- Object.assign({}, ...[
2559
- {
2560
- id: "search",
2561
- normalize(searchTerm, caseSensitiveSearch) {
2562
- return caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();
2563
- },
2564
- test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {
2565
- const matches = (caseSensitiveSearch ? text : text.toLowerCase()).includes(normalizedSearchTerm);
2566
- return inverseSearch ? !matches : matches;
2567
- }
2568
- },
2569
- {
2570
- id: "wildcard",
2571
- normalize(searchTerm, caseSensitiveSearch) {
2572
- if (searchTerm.length > 0) searchTerm = `^${searchTerm.replace(/[-[\]{}()+.,\\^$|#\s]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".?")}$`;
2573
- else return { test: () => false };
2574
- try {
2575
- return new RegExp(searchTerm, caseSensitiveSearch ? "" : "i");
2576
- } catch (_error) {
2577
- return /$^/;
2578
- }
2579
- },
2580
- test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {
2581
- const matches = normalizedSearchTerm.test(text);
2582
- return inverseSearch ? !matches : matches;
2583
- }
2584
- },
2585
- {
2586
- id: "regex",
2587
- normalize(searchTerm, caseSensitiveSearch) {
2588
- try {
2589
- const flags = caseSensitiveSearch ? "" : "i";
2590
- return new RegExp(`^(${searchTerm})$`, flags);
2591
- } catch (_error) {
2592
- return /$^/;
2593
- }
2594
- },
2595
- test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {
2596
- const matches = normalizedSearchTerm.test(text);
2597
- return inverseSearch ? !matches : matches;
2598
- }
2599
- },
2600
- {
2601
- id: "type",
2602
- normalize(selectedTypes) {
2603
- return { test: (type) => selectedTypes.includes(type) };
2604
- },
2605
- test(type, normalizedSearchTerm) {
2606
- if (typeof type === "undefined") return false;
2607
- return normalizedSearchTerm.test(type);
2608
- }
2609
- }
2610
- ].map((obj) => ({ [obj.id]: obj })));
2611
- var yearsPart = "(\\d+)\\s*y(?:ears?)?";
2612
- var monthsPart = "(\\d+)\\s*m(?:o(?:nths?)?)?";
2613
- var weeksPart = "(\\d+)\\s*w(?:eeks?)?";
2614
- var daysPart = "(\\d+)\\s*d(?:ays?)?";
2615
- var hoursPart = "(\\d+)\\s*h(?:ours?)?";
2616
- var minutesPart = "(\\d+)\\s*m(?:in(?:s|utes?)?)?";
2617
- var secondsPart = "(\\d+)(?:[,.](\\d{1,3}))?\\s*s(?:ec(?:s|onds?)?)?";
2618
- /**
2619
- * Matches a human readable period string, e.g. "1y 2mo 3weeks 4day" (each part is optional)
2620
- */
2621
- var humanReadablePeriodRegex = new RegExp(`^(?:${yearsPart})?\\s*(?:${monthsPart})?\\s*(?:${weeksPart})?\\s*(?:${daysPart})?\\s*$`, "i");
2558
+ var caseFormat = {
2559
+ CUSTOM_FORMAT: "customFormat",
2560
+ KEBAB_FORMAT: "kebabFormat",
2561
+ SNAKE_FORMAT: "snakeFormat",
2562
+ CAMEL_PASCAL_CASE: "camelPascalCase"
2563
+ };
2564
+ Object.values(caseFormat);
2622
2565
  /**
2623
- * Matches a human readable duration string, e.g. "1h 2m 3.456s" (each part is optional)
2566
+ * Uppercases first letter of string
2567
+ * @param input string to be capitalized, e.g. "workflow"
2568
+ * @returns Capitalized String, e.g. "Workflow"
2624
2569
  */
2625
- var humanReadableDurationRegex = new RegExp(`^(?:${hoursPart})?\\s*(?:${minutesPart})?\\s*(?:${secondsPart})?$`, "i");
2626
- new RegExp(`^\\s*-\\s*\\(\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, "")}\\s*\\)\\s*$`, "i");
2627
- new RegExp(`^\\s*-\\s*(?:\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\s*$`, "i");
2628
- new RegExp(`^\\s*-\\s*\\(\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, "")}\\s*\\)\\s*$`, "i");
2629
- new RegExp(`^\\s*-\\s*(?:\\s*${hoursPart}|${minutesPart}|${secondsPart})\\s*$`, "i");
2570
+ var capitalize = (input) => input.charAt(0).toUpperCase() + input.substring(1);
2571
+ var formats = {
2572
+ [caseFormat.CUSTOM_FORMAT]: (input, delimiter) => capitalize(input.replace(delimiter, " ").toLowerCase()),
2573
+ [caseFormat.KEBAB_FORMAT]: (input) => formats[caseFormat.CUSTOM_FORMAT](input, "-"),
2574
+ [caseFormat.SNAKE_FORMAT]: (input) => formats[caseFormat.CUSTOM_FORMAT](input, "_"),
2575
+ [caseFormat.CAMEL_PASCAL_CASE]: (input) => capitalize((input.match(/([A-Z]?[^A-Z]*)/g) ?? []).slice(0, -1).join(" ").toLowerCase())
2576
+ };
2630
2577
  /**
2631
2578
  * Gets the file extension
2632
2579
  * @param nameOrPath can take a full file name (e.g "file.txt") or a path to a file
@@ -2662,6 +2609,18 @@ Object.freeze({
2662
2609
  return file.name.replace(`.${this.extension}`, "");
2663
2610
  }
2664
2611
  });
2612
+ var filterMode = {
2613
+ SEARCH: "search",
2614
+ WILDCARD: "wildcard",
2615
+ REGEX: "regex",
2616
+ TYPE: "type"
2617
+ };
2618
+ Object.values(filterMode);
2619
+ filterMode.SEARCH;
2620
+ filterMode.WILDCARD;
2621
+ filterMode.REGEX;
2622
+ filterMode.TYPE;
2623
+ filterMode.SEARCH, filterMode.WILDCARD, filterMode.REGEX, filterMode.TYPE;
2665
2624
  /**
2666
2625
  * Platforms that influence how modifier keys are rendered. macOS substitutes
2667
2626
  * dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual
@@ -2671,7 +2630,7 @@ var hotkeyPlatform = {
2671
2630
  MAC_OS: "macOS",
2672
2631
  OTHER: "other"
2673
2632
  };
2674
- Object.values(hotkeyPlatform);
2633
+ var hotkeyPlatforms = Object.values(hotkeyPlatform);
2675
2634
  var navigator_exports = /* @__PURE__ */ __exportAll({
2676
2635
  isMac: () => isMac,
2677
2636
  isWindows: () => isWindows
@@ -2680,12 +2639,12 @@ var navigator_exports = /* @__PURE__ */ __exportAll({
2680
2639
  *
2681
2640
  * @returns true if the platform of the user is Mac
2682
2641
  */
2683
- var isMac = () => navigator?.userAgent?.toLowerCase()?.includes("mac");
2642
+ var isMac = () => navigator?.userAgent?.toLowerCase()?.includes("mac") ?? false;
2684
2643
  /**
2685
2644
  *
2686
2645
  * @returns true if the platform of the user is Windows
2687
2646
  */
2688
- var isWindows = () => navigator?.userAgent?.toLowerCase()?.includes("windows");
2647
+ var isWindows = () => navigator?.userAgent?.toLowerCase()?.includes("windows") ?? false;
2689
2648
  var globalKeyMap = {
2690
2649
  ArrowUp: "↑",
2691
2650
  ArrowDown: "↓",
@@ -2695,7 +2654,7 @@ var globalKeyMap = {
2695
2654
  " ": "Space",
2696
2655
  CtrlOrCmd: "Ctrl"
2697
2656
  };
2698
- var MacOSkeyMap = {
2657
+ var macOSKeyMap = {
2699
2658
  Shift: "⇧",
2700
2659
  Delete: "⌫",
2701
2660
  CtrlOrCmd: "⌘",
@@ -2720,8 +2679,8 @@ var formatHotkey = (hotkey, platform) => {
2720
2679
  * Pipe function implementation. Receives a list of functions to execute in order
2721
2680
  * and will pipe the parameter passed at the end to each function returning the final output
2722
2681
  */
2723
- const pipe = (...fns) => fns.reduce((f, g) => (arg) => g(f(arg)), (arg) => arg);
2724
- const macKeyFormatter = pipe(mapSymbols(MacOSkeyMap), mapSymbols(globalKeyMap));
2682
+ const pipe = (...functions) => functions.reduce((previous, next) => (arg) => next(previous(arg)), (arg) => arg);
2683
+ const macKeyFormatter = pipe(mapSymbols(macOSKeyMap), mapSymbols(globalKeyMap));
2725
2684
  const generalKeyFormatter = mapSymbols(globalKeyMap);
2726
2685
  return (platform === void 0 ? isMac() : platform === hotkeyPlatform.MAC_OS) ? macKeyFormatter(hotkey) : generalKeyFormatter(hotkey);
2727
2686
  };
@@ -2786,6 +2745,7 @@ var hotkeys = {
2786
2745
  formatHotkey,
2787
2746
  getDefaultSeparator,
2788
2747
  hotkeyPlatform,
2748
+ hotkeyPlatforms,
2789
2749
  textWithHotkeys,
2790
2750
  match
2791
2751
  };