@limetech/lime-elements 39.44.3 → 39.44.5

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 (29) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/limel-form.cjs.entry.js +2575 -936
  3. package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
  4. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-table.cjs.entry.js +346 -112
  6. package/dist/cjs/{markdown-parser-F3YRMjcy.js → markdown-parser-ChnRAxpZ.js} +22 -6
  7. package/dist/collection/components/form/form.test-schemas.js +15 -0
  8. package/dist/collection/components/markdown/markdown-parser.js +5 -0
  9. package/dist/collection/components/markdown/markdown.js +2 -1
  10. package/dist/collection/components/markdown/sanitize-style.js +17 -6
  11. package/dist/collection/components/table/table.css +6 -0
  12. package/dist/esm/limel-form.entry.js +2568 -929
  13. package/dist/esm/limel-markdown.entry.js +2 -2
  14. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  15. package/dist/esm/limel-table.entry.js +346 -112
  16. package/dist/esm/{markdown-parser-Blt6ZFY0.js → markdown-parser-BSQKleVw.js} +22 -6
  17. package/dist/lime-elements/lime-elements.esm.js +1 -1
  18. package/dist/lime-elements/p-1fb4bfa9.entry.js +13 -0
  19. package/dist/lime-elements/p-31713caf.entry.js +1 -0
  20. package/dist/lime-elements/{p-224e80b5.entry.js → p-3ea159fd.entry.js} +1 -1
  21. package/dist/lime-elements/{p-4512a7b1.entry.js → p-845cfda7.entry.js} +1 -1
  22. package/dist/lime-elements/{p-DnPeu2SH.js → p-B0qhUema.js} +1 -1
  23. package/dist/types/components/form/form.test-schemas.d.ts +1 -0
  24. package/dist/types/components/markdown/markdown.d.ts +1 -0
  25. package/dist/types/components/markdown/sanitize-style.d.ts +9 -5
  26. package/dist/types/components.d.ts +4 -0
  27. package/package.json +7 -7
  28. package/dist/lime-elements/p-7f1de09b.entry.js +0 -13
  29. package/dist/lime-elements/p-c1ceade7.entry.js +0 -1
@@ -33792,26 +33792,31 @@ function sanitizeStyle(node) {
33792
33792
  var _a;
33793
33793
  if (node.tagName && ((_a = node.properties) === null || _a === void 0 ? void 0 : _a.style)) {
33794
33794
  // Sanitize the 'style' attribute of the node.
33795
- node.properties.style = sanitizeStyleValue(node.properties.style);
33795
+ node.properties.style = sanitizeStyleValue(node.properties.style, node.tagName);
33796
33796
  }
33797
33797
  }
33798
33798
  /**
33799
33799
  * Applies a whitelist to the CSS properties in the input string.
33800
33800
  * Any CSS properties not in the whitelist will be removed.
33801
33801
  *
33802
+ * A zero width is also removed from `table` elements. Some HTML sources
33803
+ * (e.g. Google Sheets) set `width: 0px` on the table element and define
33804
+ * the real column widths in `colgroup`; a zero width forces the table
33805
+ * down to its min-content size, crushing every column to its longest
33806
+ * word. A zero width on a table can only ever harm rendering, since
33807
+ * auto layout already floors the table at min-content.
33808
+ *
33802
33809
  * @param styleValue - a string with CSS properties and values
33810
+ * @param tagName - tag name of the element the style belongs to
33803
33811
  * @returns a sanitized version of the input string
33804
33812
  */
33805
- /**
33806
- *
33807
- * @param styleValue
33808
- */
33809
- function sanitizeStyleValue(styleValue) {
33813
+ function sanitizeStyleValue(styleValue, tagName) {
33810
33814
  try {
33811
33815
  const css = StyleToObject(styleValue);
33812
33816
  const normalizedCss = normalizeBackgroundColor(css);
33813
33817
  return Object.entries(normalizedCss)
33814
33818
  .filter(([key]) => allowedCssProperties.includes(key))
33819
+ .filter(([key, value]) => !isCollapsedTableWidth(tagName, key, value))
33815
33820
  .map(([key, value]) => `${key}: ${value}`)
33816
33821
  .join('; ');
33817
33822
  }
@@ -33820,6 +33825,12 @@ function sanitizeStyleValue(styleValue) {
33820
33825
  return '';
33821
33826
  }
33822
33827
  }
33828
+ function isCollapsedTableWidth(tagName, property, value) {
33829
+ return tagName === 'table' && property === 'width' && isZeroLength(value);
33830
+ }
33831
+ function isZeroLength(value) {
33832
+ return Number.parseFloat(value) === 0;
33833
+ }
33823
33834
  /**
33824
33835
  * Returns a copy of the input object with the `background` property removed.
33825
33836
  * If the `background` property's value was a valid CSS color value, the
@@ -34119,6 +34130,11 @@ function getWhiteList(allowedComponents) {
34119
34130
  // elements only.
34120
34131
  clobberPrefix: '', strip: [...((_b = index$2.defaultSchema.strip) !== null && _b !== void 0 ? _b : []), 'style'], tagNames: [
34121
34132
  ...(index$2.defaultSchema.tagNames || []),
34133
+ // Table column definitions carry the column widths for tables
34134
+ // from sources like Google Sheets, where the table element
34135
+ // itself has no usable width.
34136
+ 'colgroup',
34137
+ 'col',
34122
34138
  ...allowedComponents.map((component) => component.tagName),
34123
34139
  ], attributes: Object.assign(Object.assign({}, index$2.defaultSchema.attributes), { p: [
34124
34140
  ...((_c = index$2.defaultSchema.attributes.p) !== null && _c !== void 0 ? _c : []),
@@ -376,6 +376,21 @@ export const topLevelStringCustomComponentSchema = {
376
376
  },
377
377
  },
378
378
  };
379
+ export const stringWithDefaultCustomComponentSchema = {
380
+ type: 'object',
381
+ properties: {
382
+ icon: {
383
+ type: 'string',
384
+ title: 'Icon',
385
+ default: 'decision',
386
+ lime: { component: { name: 'limel-input-field' } },
387
+ },
388
+ name: {
389
+ type: 'string',
390
+ title: 'Name',
391
+ },
392
+ },
393
+ };
379
394
  export const arrayItemWithDependenciesSchema = {
380
395
  type: 'object',
381
396
  properties: {
@@ -107,6 +107,11 @@ function getWhiteList(allowedComponents) {
107
107
  // elements only.
108
108
  clobberPrefix: '', strip: [...((_b = defaultSchema.strip) !== null && _b !== void 0 ? _b : []), 'style'], tagNames: [
109
109
  ...(defaultSchema.tagNames || []),
110
+ // Table column definitions carry the column widths for tables
111
+ // from sources like Google Sheets, where the table element
112
+ // itself has no usable width.
113
+ 'colgroup',
114
+ 'col',
110
115
  ...allowedComponents.map((component) => component.tagName),
111
116
  ], attributes: Object.assign(Object.assign({}, defaultSchema.attributes), { p: [
112
117
  ...((_c = defaultSchema.attributes.p) !== null && _c !== void 0 ? _c : []),
@@ -28,6 +28,7 @@ import { adaptColorContrast } from "../../util/adapt-color-contrast";
28
28
  * @exampleComponent limel-example-markdown-code
29
29
  * @exampleComponent limel-example-markdown-footnotes
30
30
  * @exampleComponent limel-example-markdown-tables
31
+ * @exampleComponent limel-example-markdown-html-tables
31
32
  * @exampleComponent limel-example-markdown-html
32
33
  * @exampleComponent limel-example-markdown-keys
33
34
  * @exampleComponent limel-example-markdown-blockquotes
@@ -143,7 +144,7 @@ export class Markdown {
143
144
  this.cleanupImageIntersectionObserver();
144
145
  }
145
146
  render() {
146
- return (h(Host, { key: '79583ca7783472254c84899b2709d20e21bb442f' }, h("div", { key: 'd06c81a4098a25b97a6ed56d2830205228933c6e', id: "markdown", ref: (el) => (this.rootElement = el) })));
147
+ return (h(Host, { key: '527dafa3c663a214860ebf7bae33f568f21d4b2d' }, h("div", { key: '79a0d02a4118e94723c6ddfbb94a91875dfe3d2b', id: "markdown", ref: (el) => (this.rootElement = el) })));
147
148
  }
148
149
  setupImageIntersectionObserver() {
149
150
  if (this.lazyLoadImages) {
@@ -10,26 +10,31 @@ export function sanitizeStyle(node) {
10
10
  var _a;
11
11
  if (node.tagName && ((_a = node.properties) === null || _a === void 0 ? void 0 : _a.style)) {
12
12
  // Sanitize the 'style' attribute of the node.
13
- node.properties.style = sanitizeStyleValue(node.properties.style);
13
+ node.properties.style = sanitizeStyleValue(node.properties.style, node.tagName);
14
14
  }
15
15
  }
16
16
  /**
17
17
  * Applies a whitelist to the CSS properties in the input string.
18
18
  * Any CSS properties not in the whitelist will be removed.
19
19
  *
20
+ * A zero width is also removed from `table` elements. Some HTML sources
21
+ * (e.g. Google Sheets) set `width: 0px` on the table element and define
22
+ * the real column widths in `colgroup`; a zero width forces the table
23
+ * down to its min-content size, crushing every column to its longest
24
+ * word. A zero width on a table can only ever harm rendering, since
25
+ * auto layout already floors the table at min-content.
26
+ *
20
27
  * @param styleValue - a string with CSS properties and values
28
+ * @param tagName - tag name of the element the style belongs to
21
29
  * @returns a sanitized version of the input string
22
30
  */
23
- /**
24
- *
25
- * @param styleValue
26
- */
27
- export function sanitizeStyleValue(styleValue) {
31
+ export function sanitizeStyleValue(styleValue, tagName) {
28
32
  try {
29
33
  const css = parse(styleValue);
30
34
  const normalizedCss = normalizeBackgroundColor(css);
31
35
  return Object.entries(normalizedCss)
32
36
  .filter(([key]) => allowedCssProperties.includes(key))
37
+ .filter(([key, value]) => !isCollapsedTableWidth(tagName, key, value))
33
38
  .map(([key, value]) => `${key}: ${value}`)
34
39
  .join('; ');
35
40
  }
@@ -38,6 +43,12 @@ export function sanitizeStyleValue(styleValue) {
38
43
  return '';
39
44
  }
40
45
  }
46
+ function isCollapsedTableWidth(tagName, property, value) {
47
+ return tagName === 'table' && property === 'width' && isZeroLength(value);
48
+ }
49
+ function isZeroLength(value) {
50
+ return Number.parseFloat(value) === 0;
51
+ }
41
52
  /**
42
53
  * Returns a copy of the input object with the `background` property removed.
43
54
  * If the `background` property's value was a valid CSS color value, the
@@ -701,6 +701,12 @@
701
701
  text-overflow: ellipsis;
702
702
  outline: none;
703
703
  }
704
+ .tabulator-row .tabulator-cell .tabulator-tick {
705
+ fill: #2DC214;
706
+ }
707
+ .tabulator-row .tabulator-cell .tabulator-cross {
708
+ fill: #CE1515;
709
+ }
704
710
  .tabulator-row .tabulator-cell.tabulator-row-header {
705
711
  border-right: 1px solid #999;
706
712
  border-bottom: 1px solid #aaa;