@phillips/seldon 1.66.0 → 1.67.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/dist/_virtual/attributes-to-props.js +4 -0
- package/dist/_virtual/constants.js +4 -0
- package/dist/_virtual/dom-to-react.js +4 -0
- package/dist/_virtual/domparser.js +4 -0
- package/dist/_virtual/html-to-dom.js +4 -0
- package/dist/_virtual/index10.js +4 -0
- package/dist/_virtual/index11.js +4 -0
- package/dist/_virtual/index7.js +4 -0
- package/dist/_virtual/index8.js +4 -0
- package/dist/_virtual/index9.js +4 -0
- package/dist/_virtual/node.js +4 -0
- package/dist/_virtual/possibleStandardNamesOptimized.js +4 -0
- package/dist/_virtual/utilities.js +4 -0
- package/dist/_virtual/utilities2.js +4 -0
- package/dist/_virtual/utilities3.js +4 -0
- package/dist/components/HTMLParser/HTMLParser.d.ts +24 -0
- package/dist/components/HTMLParser/HTMLParser.js +21 -0
- package/dist/components/HTMLParser/index.d.ts +1 -0
- package/dist/components/HTMLParser/utils.d.ts +7 -0
- package/dist/components/HTMLParser/utils.js +31 -0
- package/dist/components/Search/Search.js +23 -22
- package/dist/components/Search/SearchResults/SearchResults.d.ts +2 -1
- package/dist/components/Search/SearchResults/SearchResults.js +26 -16
- package/dist/node_modules/domelementtype/lib/index.js +12 -0
- package/dist/node_modules/domhandler/lib/index.js +84 -0
- package/dist/node_modules/domhandler/lib/node.js +356 -0
- package/dist/node_modules/dompurify/dist/purify.es.js +522 -0
- package/dist/node_modules/html-dom-parser/lib/client/constants.js +38 -0
- package/dist/node_modules/html-dom-parser/lib/client/domparser.js +56 -0
- package/dist/node_modules/html-dom-parser/lib/client/html-to-dom.js +20 -0
- package/dist/node_modules/html-dom-parser/lib/client/utilities.js +55 -0
- package/dist/node_modules/html-react-parser/esm/index.js +7 -0
- package/dist/node_modules/html-react-parser/lib/attributes-to-props.js +40 -0
- package/dist/node_modules/html-react-parser/lib/dom-to-react.js +60 -0
- package/dist/node_modules/html-react-parser/lib/index.js +42 -0
- package/dist/node_modules/html-react-parser/lib/utilities.js +58 -0
- package/dist/node_modules/inline-style-parser/index.js +86 -0
- package/dist/node_modules/react-property/lib/index.js +440 -0
- package/dist/node_modules/react-property/lib/possibleStandardNamesOptimized.js +493 -0
- package/dist/node_modules/style-to-js/cjs/index.js +19 -0
- package/dist/node_modules/style-to-js/cjs/utilities.js +16 -0
- package/dist/node_modules/style-to-object/cjs/index.js +21 -0
- package/dist/scss/components/Search/SearchResults/_searchResults.scss +4 -0
- package/dist/scss/components/Search/_search.scss +17 -2
- package/dist/scss/components/Search/_searchButton.scss +15 -5
- package/dist/scss/site-furniture/Header/_header.scss +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HTMLParser, type HTMLParserProps } from './HTMLParser';
|
|
@@ -0,0 +1,31 @@
|
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import i, { useEffect as y } from "react";
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import { getCommonProps as V, px as j, encodeURLSearchParams as g } from "../../utils/index.js";
|
|
4
|
+
import f from "../../node_modules/classnames/index.js";
|
|
5
|
+
import D from "../Input/Input.js";
|
|
6
|
+
import H from "../Link/Link.js";
|
|
7
|
+
import O from "./SearchResults/SearchResults.js";
|
|
8
8
|
import { TextVariants as A } from "../Text/types.js";
|
|
9
9
|
import F from "../Text/Text.js";
|
|
10
10
|
import { useOnClickOutside as K } from "../../node_modules/usehooks-ts/dist/index.js";
|
|
@@ -12,11 +12,11 @@ import { HeaderContext as M } from "../../site-furniture/Header/Header.js";
|
|
|
12
12
|
import { SearchButton as U } from "./SearchButton.js";
|
|
13
13
|
import q from "../../node_modules/react-transition-group/esm/CSSTransition.js";
|
|
14
14
|
const ne = ({
|
|
15
|
-
onSearch:
|
|
15
|
+
onSearch: p,
|
|
16
16
|
searchResults: C = [],
|
|
17
17
|
state: c = "idle",
|
|
18
|
-
defaultValue:
|
|
19
|
-
className:
|
|
18
|
+
defaultValue: I = "",
|
|
19
|
+
className: E,
|
|
20
20
|
placeholder: R = "",
|
|
21
21
|
searchButtonText: l = "Search",
|
|
22
22
|
loadingText: b = "Search In Progress...",
|
|
@@ -26,8 +26,8 @@ const ne = ({
|
|
|
26
26
|
...S
|
|
27
27
|
}) => {
|
|
28
28
|
var N;
|
|
29
|
-
const { className: e, "data-testid": d, ...L } =
|
|
30
|
-
|
|
29
|
+
const { className: e, "data-testid": d, ...L } = V(S, "Search"), o = i.useContext(M), m = i.useRef(null), h = i.useRef(null), v = i.useRef(null), t = o.isSearchExpanded, n = (N = m.current) == null ? void 0 : N.value, T = p ? (r) => {
|
|
30
|
+
p(r.target.value);
|
|
31
31
|
} : void 0;
|
|
32
32
|
K(v, () => $(!1));
|
|
33
33
|
const x = (r) => {
|
|
@@ -52,7 +52,7 @@ const ne = ({
|
|
|
52
52
|
var s;
|
|
53
53
|
o.setIsSearchExpanded(r), (s = h.current) == null || s.reset();
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */ a("div", { className: `${e}__container`, children: /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ a("div", { className: `${e}__container`, children: /* @__PURE__ */ u(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
onClick: () => o.setIsSearchExpanded(!0),
|
|
@@ -64,23 +64,23 @@ const ne = ({
|
|
|
64
64
|
"div",
|
|
65
65
|
{
|
|
66
66
|
...L,
|
|
67
|
-
className:
|
|
67
|
+
className: f(e, E, { [`${e}--active`]: t }),
|
|
68
68
|
"data-testid": d,
|
|
69
69
|
role: "search",
|
|
70
70
|
...S,
|
|
71
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ u(
|
|
72
72
|
"form",
|
|
73
73
|
{
|
|
74
74
|
"data-testid": `${d}-form`,
|
|
75
|
-
className:
|
|
75
|
+
className: f(`${e}__form`, {
|
|
76
76
|
[`${e}__form--active`]: t
|
|
77
77
|
}),
|
|
78
78
|
ref: h,
|
|
79
79
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ u(
|
|
81
81
|
"div",
|
|
82
82
|
{
|
|
83
|
-
className:
|
|
83
|
+
className: f(`${e}__content-wrapper`, {
|
|
84
84
|
[`${e}__content-wrapper--active`]: t
|
|
85
85
|
}),
|
|
86
86
|
role: "combobox",
|
|
@@ -90,11 +90,11 @@ const ne = ({
|
|
|
90
90
|
q,
|
|
91
91
|
{
|
|
92
92
|
in: t,
|
|
93
|
-
classNames: `${
|
|
93
|
+
classNames: `${j}-input`,
|
|
94
94
|
addEndListener: () => {
|
|
95
95
|
},
|
|
96
96
|
children: /* @__PURE__ */ a(
|
|
97
|
-
|
|
97
|
+
D,
|
|
98
98
|
{
|
|
99
99
|
"aria-hidden": !t,
|
|
100
100
|
className: `${e}__input`,
|
|
@@ -103,7 +103,7 @@ const ne = ({
|
|
|
103
103
|
labelText: l,
|
|
104
104
|
placeholder: t ? R : "",
|
|
105
105
|
type: "text",
|
|
106
|
-
defaultValue:
|
|
106
|
+
defaultValue: I,
|
|
107
107
|
invalid: c === "invalid",
|
|
108
108
|
invalidText: w,
|
|
109
109
|
onKeyDown: x,
|
|
@@ -128,14 +128,15 @@ const ne = ({
|
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
130
|
n && n.length > 2 ? /* @__PURE__ */ a(
|
|
131
|
-
|
|
131
|
+
O,
|
|
132
132
|
{
|
|
133
133
|
autoCompleteResults: C,
|
|
134
134
|
isLoading: c === "loading",
|
|
135
135
|
loadingText: b,
|
|
136
136
|
onKeyDown: x,
|
|
137
|
+
userInputValue: n,
|
|
137
138
|
children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
|
|
138
|
-
|
|
139
|
+
H,
|
|
139
140
|
{
|
|
140
141
|
href: ((r) => g(_(r)))(n),
|
|
141
142
|
children: /* @__PURE__ */ a("p", { children: k(n) })
|
|
@@ -10,6 +10,7 @@ export interface SearchResultsProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
loadingText?: string;
|
|
12
12
|
onKeyDown?: (event: React.KeyboardEvent<HTMLAnchorElement>) => void;
|
|
13
|
+
userInputValue?: string;
|
|
13
14
|
}
|
|
14
|
-
declare const SearchResults: ({ autoCompleteResults, isLoading, children, loadingText, onKeyDown, }: React.PropsWithChildren<SearchResultsProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const SearchResults: ({ autoCompleteResults, isLoading, children, loadingText, onKeyDown, userInputValue, }: React.PropsWithChildren<SearchResultsProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default SearchResults;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { px as
|
|
3
|
-
import
|
|
4
|
-
import { LinkVariants as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as s, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { px as a } from "../../../utils/index.js";
|
|
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 = ({
|
|
7
|
+
autoCompleteResults: e = [],
|
|
8
|
+
isLoading: l,
|
|
9
|
+
children: n,
|
|
10
|
+
loadingText: i = "Loading...",
|
|
11
|
+
onKeyDown: t,
|
|
12
|
+
userInputValue: c = ""
|
|
11
13
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
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
|
|
17
27
|
] }) });
|
|
18
28
|
};
|
|
19
29
|
export {
|
|
20
|
-
|
|
30
|
+
b as default
|
|
21
31
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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);
|
|
@@ -0,0 +1,84 @@
|
|
|
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);
|