@phillips/seldon 1.67.0 → 1.67.1

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 (43) hide show
  1. package/dist/components/Search/SearchResults/SearchResults.js +17 -21
  2. package/dist/scss/componentStyles.scss +0 -1
  3. package/package.json +1 -1
  4. package/dist/_virtual/attributes-to-props.js +0 -4
  5. package/dist/_virtual/constants.js +0 -4
  6. package/dist/_virtual/dom-to-react.js +0 -4
  7. package/dist/_virtual/domparser.js +0 -4
  8. package/dist/_virtual/html-to-dom.js +0 -4
  9. package/dist/_virtual/index10.js +0 -4
  10. package/dist/_virtual/index11.js +0 -4
  11. package/dist/_virtual/index7.js +0 -4
  12. package/dist/_virtual/index8.js +0 -4
  13. package/dist/_virtual/index9.js +0 -4
  14. package/dist/_virtual/node.js +0 -4
  15. package/dist/_virtual/possibleStandardNamesOptimized.js +0 -4
  16. package/dist/_virtual/utilities.js +0 -4
  17. package/dist/_virtual/utilities2.js +0 -4
  18. package/dist/_virtual/utilities3.js +0 -4
  19. package/dist/components/HTMLParser/HTMLParser.d.ts +0 -24
  20. package/dist/components/HTMLParser/HTMLParser.js +0 -21
  21. package/dist/components/HTMLParser/index.d.ts +0 -1
  22. package/dist/components/HTMLParser/utils.d.ts +0 -7
  23. package/dist/components/HTMLParser/utils.js +0 -31
  24. package/dist/node_modules/domelementtype/lib/index.js +0 -12
  25. package/dist/node_modules/domhandler/lib/index.js +0 -84
  26. package/dist/node_modules/domhandler/lib/node.js +0 -356
  27. package/dist/node_modules/dompurify/dist/purify.es.js +0 -522
  28. package/dist/node_modules/html-dom-parser/lib/client/constants.js +0 -38
  29. package/dist/node_modules/html-dom-parser/lib/client/domparser.js +0 -56
  30. package/dist/node_modules/html-dom-parser/lib/client/html-to-dom.js +0 -20
  31. package/dist/node_modules/html-dom-parser/lib/client/utilities.js +0 -55
  32. package/dist/node_modules/html-react-parser/esm/index.js +0 -7
  33. package/dist/node_modules/html-react-parser/lib/attributes-to-props.js +0 -40
  34. package/dist/node_modules/html-react-parser/lib/dom-to-react.js +0 -60
  35. package/dist/node_modules/html-react-parser/lib/index.js +0 -42
  36. package/dist/node_modules/html-react-parser/lib/utilities.js +0 -58
  37. package/dist/node_modules/inline-style-parser/index.js +0 -86
  38. package/dist/node_modules/react-property/lib/index.js +0 -440
  39. package/dist/node_modules/react-property/lib/possibleStandardNamesOptimized.js +0 -493
  40. package/dist/node_modules/style-to-js/cjs/index.js +0 -19
  41. package/dist/node_modules/style-to-js/cjs/utilities.js +0 -16
  42. package/dist/node_modules/style-to-object/cjs/index.js +0 -21
  43. package/dist/scss/components/HTMLParser/_htmlParser.scss +0 -5
@@ -1,31 +1,27 @@
1
- import { jsx as s, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
2
  import { px as a } from "../../../utils/index.js";
3
3
  import u from "../../Link/Link.js";
4
- import { LinkVariants as p } from "../../Link/types.js";
5
- import f from "../../HTMLParser/HTMLParser.js";
6
- const b = ({
4
+ import { LinkVariants as L } from "../../Link/types.js";
5
+ const w = ({
7
6
  autoCompleteResults: e = [],
8
- isLoading: l,
9
- children: n,
10
- loadingText: i = "Loading...",
11
- onKeyDown: t,
12
- userInputValue: c = ""
7
+ isLoading: i,
8
+ children: c,
9
+ loadingText: t = "Loading...",
10
+ onKeyDown: o,
11
+ userInputValue: h = ""
13
12
  }) => {
14
- const h = Array.isArray(e) && e.length > 0;
15
- function o(r, m) {
16
- return /* @__PURE__ */ s(
17
- f,
18
- {
19
- html: `<span class='${a}-search__result__label'>${r.replace(new RegExp(m, "gi"), (_) => `<strong>${_}</strong>`)}</span>`
20
- }
13
+ const m = Array.isArray(e) && e.length > 0;
14
+ function d(s, n) {
15
+ return s.split(new RegExp(`(${n})`, "gi")).map(
16
+ (l, _) => l.toLocaleLowerCase() === n.toLocaleLowerCase() ? /* @__PURE__ */ r("strong", { children: l }, _) : l
21
17
  );
22
18
  }
23
- return /* @__PURE__ */ s("div", { className: `${a}-search__results`, children: /* @__PURE__ */ d("ul", { "data-testid": "search-results", className: `${a}-search__results-container`, children: [
24
- l ? /* @__PURE__ */ s("li", { className: `${a}-search__result`, children: i }) : null,
25
- h && e.map((r) => /* @__PURE__ */ s("li", { className: `${a}-search__result`, children: /* @__PURE__ */ s(u, { href: r.url, onKeyDown: t, variant: p.snwFlyoutLink, children: o(r.label, c) }) }, r.id)),
26
- n
19
+ return /* @__PURE__ */ r("div", { className: `${a}-search__results`, children: /* @__PURE__ */ p("ul", { "data-testid": "search-results", className: `${a}-search__results-container`, children: [
20
+ i ? /* @__PURE__ */ r("li", { className: `${a}-search__result`, children: t }) : null,
21
+ m && e.map((s) => /* @__PURE__ */ r("li", { className: `${a}-search__result`, children: /* @__PURE__ */ r(u, { href: s.url, onKeyDown: o, variant: L.snwFlyoutLink, children: /* @__PURE__ */ r("span", { className: "${px}-search__result__label", children: d(s.label, h) }) }) }, s.id)),
22
+ c
27
23
  ] }) });
28
24
  };
29
25
  export {
30
- b as default
26
+ w as default
31
27
  };
@@ -30,7 +30,6 @@
30
30
  @use 'components/Accordion/accordion';
31
31
  @use 'components/Breadcrumb/breadcrumb';
32
32
  @use 'components/Drawer/drawer';
33
- @use 'components/HTMLParser/htmlParser';
34
33
  @use 'components/Dropdown/dropdown';
35
34
  @use 'components/Video/video';
36
35
  @use 'components/Pagination/pagination';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.67.0",
3
+ "version": "1.67.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var s = {};
2
- export {
3
- s as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var o = {};
2
- export {
3
- o as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var o = {};
2
- export {
3
- o as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var e = {};
2
- export {
3
- e as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var a = {};
2
- export {
3
- a as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,4 +0,0 @@
1
- var t = {};
2
- export {
3
- t as __exports
4
- };
@@ -1,24 +0,0 @@
1
- export interface HTMLParserProps extends React.HTMLAttributes<HTMLDivElement> {
2
- /**
3
- * Rich Text content to be displayed
4
- */
5
- html: string;
6
- /**
7
- * Optional flag to only sanitize the content and bypass the transforms to our components
8
- */
9
- isOnlySanitize?: boolean;
10
- /**
11
- * Optional class name to add to the component
12
- */
13
- className?: string;
14
- }
15
- /**
16
- * ## Overview
17
- *
18
- * A component for taking in rich text content from CMS and safely rendering the content in a consistent manner.
19
- *
20
- *
21
- * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-htmlparser--overview)
22
- */
23
- declare const HTMLParser: ({ className, html, isOnlySanitize, ...props }: HTMLParserProps) => import("react/jsx-runtime").JSX.Element;
24
- export default HTMLParser;
@@ -1,21 +0,0 @@
1
- import { jsx as o, Fragment as c } from "react/jsx-runtime";
2
- import n from "../../node_modules/classnames/index.js";
3
- import f from "../../node_modules/dompurify/dist/purify.es.js";
4
- import p from "../../node_modules/html-react-parser/esm/index.js";
5
- import { getCommonProps as d } from "../../utils/index.js";
6
- import { options as g } from "./utils.js";
7
- const M = ({ className: s, html: r, isOnlySanitize: i = !1, ...e }) => {
8
- const { className: t, ...a } = d(e, "HTMLParser"), m = f.sanitize(r), l = p(m, g);
9
- return /* @__PURE__ */ o(c, { children: typeof r == "string" && r.length > 0 ? i ? /* @__PURE__ */ o(
10
- "div",
11
- {
12
- ...a,
13
- className: n(`${t}`, s),
14
- ...e,
15
- dangerouslySetInnerHTML: { __html: m }
16
- }
17
- ) : /* @__PURE__ */ o("div", { ...a, className: n(`${t}`, s), ...e, children: l }) : null });
18
- };
19
- export {
20
- M as default
21
- };
@@ -1 +0,0 @@
1
- export { default as HTMLParser, type HTMLParserProps } from './HTMLParser';
@@ -1,7 +0,0 @@
1
- export declare const options: {
2
- replace({ attribs, children, name }: {
3
- attribs: Record<string, string>;
4
- children: React.ReactNode;
5
- name: string;
6
- }): import("react/jsx-runtime").JSX.Element | undefined;
7
- };
@@ -1,31 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import "../../node_modules/html-react-parser/esm/index.js";
3
- import { TextVariants as e } from "../Text/types.js";
4
- import n from "../Text/Text.js";
5
- import { LinkVariants as p } from "../Link/types.js";
6
- import d from "../Link/Link.js";
7
- import "../../node_modules/html-react-parser/lib/index.js";
8
- import { __exports as r } from "../../_virtual/index7.js";
9
- const a = {
10
- replace({ attribs: s, children: t, name: o }) {
11
- if (o === "h1")
12
- return /* @__PURE__ */ i(n, { variant: e.heading1, children: r.domToReact(t, a) });
13
- if (o === "h2")
14
- return /* @__PURE__ */ i(n, { variant: e.heading2, children: r.domToReact(t, a) });
15
- if (o === "h3")
16
- return /* @__PURE__ */ i(n, { variant: e.heading3, children: r.domToReact(t, a) });
17
- if (o === "h4")
18
- return /* @__PURE__ */ i(n, { variant: e.heading4, children: r.domToReact(t, a) });
19
- if (o === "blockquote")
20
- return /* @__PURE__ */ i(n, { variant: e.blockquote, children: r.domToReact(t, a) });
21
- if (o === "p")
22
- return /* @__PURE__ */ i(n, { variant: e.body1, children: r.domToReact(t, a) });
23
- if (o === "a") {
24
- const { class: f, ...c } = s, m = r.attributesToProps(c);
25
- return /* @__PURE__ */ i(d, { variant: p.link, ...m, children: r.domToReact(t, a) });
26
- }
27
- }
28
- };
29
- export {
30
- a as options
31
- };
@@ -1,12 +0,0 @@
1
- import { __exports as D } from "../../../_virtual/index10.js";
2
- (function(i) {
3
- Object.defineProperty(i, "__esModule", { value: !0 }), i.Doctype = i.CDATA = i.Tag = i.Style = i.Script = i.Comment = i.Directive = i.Text = i.Root = i.isTag = i.ElementType = void 0;
4
- var t;
5
- (function(c) {
6
- c.Root = "root", c.Text = "text", c.Directive = "directive", c.Comment = "comment", c.Script = "script", c.Style = "style", c.Tag = "tag", c.CDATA = "cdata", c.Doctype = "doctype";
7
- })(t = i.ElementType || (i.ElementType = {}));
8
- function a(c) {
9
- return c.type === t.Tag || c.type === t.Script || c.type === t.Style;
10
- }
11
- i.isTag = a, i.Root = t.Root, i.Text = t.Text, i.Directive = t.Directive, i.Comment = t.Comment, i.Script = t.Script, i.Style = t.Style, i.Tag = t.Tag, i.CDATA = t.CDATA, i.Doctype = t.Doctype;
12
- })(D);
@@ -1,84 +0,0 @@
1
- import { commonjsGlobal as a } from "../../../_virtual/_commonjsHelpers.js";
2
- import { __exports as c } from "../../../_virtual/index8.js";
3
- import "../../domelementtype/lib/index.js";
4
- import "./node.js";
5
- import { __exports as p } from "../../../_virtual/node.js";
6
- import { __exports as m } from "../../../_virtual/index10.js";
7
- (function(r) {
8
- var u = a && a.__createBinding || (Object.create ? function(i, t, e, n) {
9
- n === void 0 && (n = e);
10
- var o = Object.getOwnPropertyDescriptor(t, e);
11
- (!o || ("get" in o ? !t.__esModule : o.writable || o.configurable)) && (o = { enumerable: !0, get: function() {
12
- return t[e];
13
- } }), Object.defineProperty(i, n, o);
14
- } : function(i, t, e, n) {
15
- n === void 0 && (n = e), i[n] = t[e];
16
- }), f = a && a.__exportStar || function(i, t) {
17
- for (var e in i) e !== "default" && !Object.prototype.hasOwnProperty.call(t, e) && u(t, i, e);
18
- };
19
- Object.defineProperty(r, "__esModule", { value: !0 }), r.DomHandler = void 0;
20
- var d = m, s = p;
21
- f(p, r);
22
- var l = {
23
- withStartIndices: !1,
24
- withEndIndices: !1,
25
- xmlMode: !1
26
- }, h = (
27
- /** @class */
28
- function() {
29
- function i(t, e, n) {
30
- this.dom = [], this.root = new s.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof e == "function" && (n = e, e = l), typeof t == "object" && (e = t, t = void 0), this.callback = t != null ? t : null, this.options = e != null ? e : l, this.elementCB = n != null ? n : null;
31
- }
32
- return i.prototype.onparserinit = function(t) {
33
- this.parser = t;
34
- }, i.prototype.onreset = function() {
35
- this.dom = [], this.root = new s.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
36
- }, i.prototype.onend = function() {
37
- this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
38
- }, i.prototype.onerror = function(t) {
39
- this.handleCallback(t);
40
- }, i.prototype.onclosetag = function() {
41
- this.lastNode = null;
42
- var t = this.tagStack.pop();
43
- this.options.withEndIndices && (t.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(t);
44
- }, i.prototype.onopentag = function(t, e) {
45
- var n = this.options.xmlMode ? d.ElementType.Tag : void 0, o = new s.Element(t, e, void 0, n);
46
- this.addNode(o), this.tagStack.push(o);
47
- }, i.prototype.ontext = function(t) {
48
- var e = this.lastNode;
49
- if (e && e.type === d.ElementType.Text)
50
- e.data += t, this.options.withEndIndices && (e.endIndex = this.parser.endIndex);
51
- else {
52
- var n = new s.Text(t);
53
- this.addNode(n), this.lastNode = n;
54
- }
55
- }, i.prototype.oncomment = function(t) {
56
- if (this.lastNode && this.lastNode.type === d.ElementType.Comment) {
57
- this.lastNode.data += t;
58
- return;
59
- }
60
- var e = new s.Comment(t);
61
- this.addNode(e), this.lastNode = e;
62
- }, i.prototype.oncommentend = function() {
63
- this.lastNode = null;
64
- }, i.prototype.oncdatastart = function() {
65
- var t = new s.Text(""), e = new s.CDATA([t]);
66
- this.addNode(e), t.parent = e, this.lastNode = t;
67
- }, i.prototype.oncdataend = function() {
68
- this.lastNode = null;
69
- }, i.prototype.onprocessinginstruction = function(t, e) {
70
- var n = new s.ProcessingInstruction(t, e);
71
- this.addNode(n);
72
- }, i.prototype.handleCallback = function(t) {
73
- if (typeof this.callback == "function")
74
- this.callback(t, this.dom);
75
- else if (t)
76
- throw t;
77
- }, i.prototype.addNode = function(t) {
78
- var e = this.tagStack[this.tagStack.length - 1], n = e.children[e.children.length - 1];
79
- this.options.withStartIndices && (t.startIndex = this.parser.startIndex), this.options.withEndIndices && (t.endIndex = this.parser.endIndex), e.children.push(t), n && (t.prev = n, n.next = t), t.parent = e, this.lastNode = null;
80
- }, i;
81
- }()
82
- );
83
- r.DomHandler = h, r.default = h;
84
- })(c);