@phillips/seldon 1.38.3 → 1.38.4
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/_commonjsHelpers.js +13 -15
- package/dist/_virtual/index4.js +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +35 -37
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/scss/_allPartials.scss +0 -1
- package/dist/scss/_type.scss +33 -0
- package/dist/scss/_typography.scss +0 -33
- package/dist/scss/componentStyles.scss +2 -0
- package/package.json +1 -1
- package/dist/_virtual/attributes-to-props.js +0 -4
- package/dist/_virtual/constants.js +0 -4
- package/dist/_virtual/dom-to-react.js +0 -4
- package/dist/_virtual/domparser.js +0 -4
- package/dist/_virtual/html-to-dom.js +0 -4
- package/dist/_virtual/index10.js +0 -4
- package/dist/_virtual/index6.js +0 -4
- package/dist/_virtual/index7.js +0 -4
- package/dist/_virtual/index8.js +0 -4
- package/dist/_virtual/index9.js +0 -4
- package/dist/_virtual/node.js +0 -4
- package/dist/_virtual/possibleStandardNamesOptimized.js +0 -4
- package/dist/_virtual/utilities.js +0 -4
- package/dist/_virtual/utilities2.js +0 -4
- package/dist/_virtual/utilities3.js +0 -4
- package/dist/components/HTMLParser/HTMLParser.d.ts +0 -24
- package/dist/components/HTMLParser/HTMLParser.js +0 -21
- package/dist/components/HTMLParser/index.d.ts +0 -1
- package/dist/components/HTMLParser/utils.d.ts +0 -7
- package/dist/components/HTMLParser/utils.js +0 -31
- package/dist/components/Link/index.d.ts +0 -2
- package/dist/node_modules/domelementtype/lib/index.js +0 -12
- package/dist/node_modules/domhandler/lib/index.js +0 -84
- package/dist/node_modules/domhandler/lib/node.js +0 -356
- package/dist/node_modules/dompurify/dist/purify.es.js +0 -522
- package/dist/node_modules/html-dom-parser/lib/client/constants.js +0 -38
- package/dist/node_modules/html-dom-parser/lib/client/domparser.js +0 -56
- package/dist/node_modules/html-dom-parser/lib/client/html-to-dom.js +0 -20
- package/dist/node_modules/html-dom-parser/lib/client/utilities.js +0 -55
- package/dist/node_modules/html-react-parser/esm/index.js +0 -7
- package/dist/node_modules/html-react-parser/lib/attributes-to-props.js +0 -40
- package/dist/node_modules/html-react-parser/lib/dom-to-react.js +0 -60
- package/dist/node_modules/html-react-parser/lib/index.js +0 -42
- package/dist/node_modules/html-react-parser/lib/utilities.js +0 -58
- package/dist/node_modules/inline-style-parser/index.js +0 -86
- package/dist/node_modules/react-property/lib/index.js +0 -440
- package/dist/node_modules/react-property/lib/possibleStandardNamesOptimized.js +0 -493
- package/dist/node_modules/style-to-js/cjs/index.js +0 -19
- package/dist/node_modules/style-to-js/cjs/utilities.js +0 -16
- package/dist/node_modules/style-to-object/cjs/index.js +0 -21
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
function f(e) {
|
|
1
|
+
function n(e) {
|
|
3
2
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
3
|
}
|
|
5
|
-
function
|
|
4
|
+
function c(e) {
|
|
6
5
|
if (e.__esModule) return e;
|
|
7
|
-
var
|
|
8
|
-
if (typeof
|
|
9
|
-
var t = function
|
|
10
|
-
return this instanceof
|
|
6
|
+
var o = e.default;
|
|
7
|
+
if (typeof o == "function") {
|
|
8
|
+
var t = function r() {
|
|
9
|
+
return this instanceof r ? Reflect.construct(o, arguments, this.constructor) : o.apply(this, arguments);
|
|
11
10
|
};
|
|
12
|
-
t.prototype =
|
|
11
|
+
t.prototype = o.prototype;
|
|
13
12
|
} else t = {};
|
|
14
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(t,
|
|
13
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
|
14
|
+
var u = Object.getOwnPropertyDescriptor(e, r);
|
|
15
|
+
Object.defineProperty(t, r, u.get ? u : {
|
|
17
16
|
enumerable: !0,
|
|
18
17
|
get: function() {
|
|
19
|
-
return e[
|
|
18
|
+
return e[r];
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
21
|
}), t;
|
|
23
22
|
}
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
f as getDefaultExportFromCjs
|
|
24
|
+
c as getAugmentedNamespace,
|
|
25
|
+
n as getDefaultExportFromCjs
|
|
28
26
|
};
|
package/dist/_virtual/index4.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ export { default as Modal, type ModalProps } from './components/Modal/Modal';
|
|
|
31
31
|
export { default as Drawer } from './components/Drawer/Drawer';
|
|
32
32
|
export { default as StatefulViewingsList, type StatefulViewingsListProps, } from './components/ViewingsList/StatefulViewingsList';
|
|
33
33
|
export * from './components/Text';
|
|
34
|
-
export * from './components/HTMLParser';
|
|
35
34
|
export * from './components/Accordion';
|
|
36
35
|
export { default as UserManagement, type UserManagementProps } from './components/UserManagement/UserManagement';
|
|
37
36
|
export { AuthState } from './components/UserManagement/types';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { PaddingTokens as a, defaultYear as f, emailValidation as m, encodeURLSearchParams as p, findChildrenOfType as
|
|
1
|
+
import { PaddingTokens as a, defaultYear as f, emailValidation as m, encodeURLSearchParams as p, findChildrenOfType as d, generatePaddingClassName as s, getCommonProps as u, noOp as i, px as l, useNormalizedInputProps as x } from "./utils/index.js";
|
|
2
2
|
import { default as g } from "./pages/Page.js";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as S } from "./components/Button/Button.js";
|
|
4
4
|
import { ButtonVariants as I } from "./components/Button/types.js";
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as P } from "./components/IconButton/IconButton.js";
|
|
6
6
|
import { default as N } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
7
|
-
import { default as
|
|
7
|
+
import { default as T } from "./components/Footer/Footer.js";
|
|
8
8
|
import { Grid as h } from "./components/Grid/Grid.js";
|
|
9
9
|
import { default as w } from "./components/Header/Header.js";
|
|
10
10
|
import { default as C } from "./components/Navigation/Navigation.js";
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
11
|
+
import { default as y } from "./components/Navigation/NavigationItem/NavigationItem.js";
|
|
12
|
+
import { default as M } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
|
|
13
13
|
import { default as R } from "./components/Navigation/NavigationList/NavigationList.js";
|
|
14
14
|
import { default as z } from "./components/HeroBanner/HeroBanner.js";
|
|
15
15
|
import { default as E } from "./components/Input/Input.js";
|
|
@@ -23,50 +23,48 @@ import { GridItemAlign as re } from "./components/GridItem/types.js";
|
|
|
23
23
|
import { default as oe } from "./components/Search/Search.js";
|
|
24
24
|
import { default as fe } from "./components/Select/Select.js";
|
|
25
25
|
import { default as pe } from "./components/SplitPanel/SplitPanel.js";
|
|
26
|
-
import { default as
|
|
27
|
-
import { SubscriptionState as
|
|
26
|
+
import { default as se } from "./components/Subscribe/Subscribe.js";
|
|
27
|
+
import { SubscriptionState as ie } from "./components/Subscribe/types.js";
|
|
28
28
|
import { default as xe } from "./components/Social/Social.js";
|
|
29
29
|
import { default as ge } from "./components/ViewingsList/ViewingsList.js";
|
|
30
|
-
import { default as
|
|
30
|
+
import { default as Se } from "./components/Modal/Modal.js";
|
|
31
31
|
import { default as Ie } from "./components/Drawer/Drawer.js";
|
|
32
|
-
import { default as
|
|
32
|
+
import { default as Pe } from "./components/ViewingsList/StatefulViewingsList.js";
|
|
33
33
|
import { TextVariants as Ne } from "./components/Text/types.js";
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as he } from "./components/
|
|
36
|
-
import { default as we } from "./components/Accordion/
|
|
37
|
-
import { default as Ce } from "./components/
|
|
38
|
-
import { default as He } from "./components/UserManagement/UserManagement.js";
|
|
34
|
+
import { default as Te } from "./components/Text/Text.js";
|
|
35
|
+
import { default as he } from "./components/Accordion/Accordion.js";
|
|
36
|
+
import { default as we } from "./components/Accordion/AccordionItem.js";
|
|
37
|
+
import { default as Ce } from "./components/UserManagement/UserManagement.js";
|
|
39
38
|
import { AuthState as ye } from "./components/UserManagement/types.js";
|
|
40
|
-
import { SupportedLanguages as
|
|
41
|
-
import { default as
|
|
39
|
+
import { SupportedLanguages as Me } from "./types/commonTypes.js";
|
|
40
|
+
import { default as Re } from "./components/Breadcrumb/Breadcrumb.js";
|
|
42
41
|
import "react/jsx-runtime";
|
|
43
42
|
import "./node_modules/classnames/index.js";
|
|
44
43
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
he as Accordion,
|
|
45
|
+
we as AccordionItem,
|
|
47
46
|
ye as AuthState,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
Re as Breadcrumb,
|
|
48
|
+
S as Button,
|
|
50
49
|
I as ButtonVariants,
|
|
51
50
|
Ie as Drawer,
|
|
52
51
|
N as ErrorBoundary,
|
|
53
|
-
|
|
52
|
+
T as Footer,
|
|
54
53
|
h as Grid,
|
|
55
54
|
$ as GridItem,
|
|
56
55
|
re as GridItemAlign,
|
|
57
|
-
he as HTMLParser,
|
|
58
56
|
w as Header,
|
|
59
57
|
z as HeroBanner,
|
|
60
|
-
|
|
58
|
+
P as IconButton,
|
|
61
59
|
E as Input,
|
|
62
60
|
Y as Link,
|
|
63
61
|
K as LinkBlock,
|
|
64
62
|
W as LinkList,
|
|
65
63
|
q as LinkVariants,
|
|
66
|
-
|
|
64
|
+
Se as Modal,
|
|
67
65
|
C as Navigation,
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
y as NavigationItem,
|
|
67
|
+
M as NavigationItemTrigger,
|
|
70
68
|
R as NavigationList,
|
|
71
69
|
a as PaddingTokens,
|
|
72
70
|
g as Page,
|
|
@@ -75,21 +73,21 @@ export {
|
|
|
75
73
|
fe as Select,
|
|
76
74
|
xe as Social,
|
|
77
75
|
pe as SplitPanel,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
Pe as StatefulViewingsList,
|
|
77
|
+
se as Subscribe,
|
|
78
|
+
ie as SubscriptionState,
|
|
79
|
+
Me as SupportedLanguages,
|
|
80
|
+
Te as Text,
|
|
83
81
|
Ne as TextVariants,
|
|
84
|
-
|
|
82
|
+
Ce as UserManagement,
|
|
85
83
|
ge as ViewingsList,
|
|
86
84
|
f as defaultYear,
|
|
87
85
|
m as emailValidation,
|
|
88
86
|
p as encodeURLSearchParams,
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
d as findChildrenOfType,
|
|
88
|
+
s as generatePaddingClassName,
|
|
91
89
|
u as getCommonProps,
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
i as noOp,
|
|
91
|
+
l as px,
|
|
94
92
|
x as useNormalizedInputProps
|
|
95
93
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index5.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
4
|
var r;
|
package/dist/scss/_type.scss
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
@use './vars' as *;
|
|
2
2
|
|
|
3
|
+
@mixin headerText {
|
|
4
|
+
@include DistinctDisplay;
|
|
5
|
+
|
|
6
|
+
color: $primary-black;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin bodyText {
|
|
11
|
+
color: $soft-black;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin DistinctItalic {
|
|
15
|
+
font-family: Distinct, sans-serif;
|
|
16
|
+
font-style: italic;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@mixin DistinctDisplay {
|
|
20
|
+
font-family: DistinctDisplay, sans-serif;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin DistinctDisplayItalic {
|
|
24
|
+
font-family: DistinctDisplay, sans-serif;
|
|
25
|
+
font-style: italic;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin Montserrat {
|
|
29
|
+
font-family: Montserrat, sans-serif;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin DistinctText {
|
|
33
|
+
font-family: Distinct, sans-serif;
|
|
34
|
+
}
|
|
35
|
+
|
|
3
36
|
@mixin underline($padding: 0, $width: 0.0625rem, $color: $cta-blue) {
|
|
4
37
|
border-bottom: $width solid $color;
|
|
5
38
|
padding-bottom: $padding;
|
|
@@ -32,10 +32,6 @@ body {
|
|
|
32
32
|
src: url('@phillips/seldon/dist/fonts/Distinct-Display.woff2') format('woff2');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
@mixin DistinctDisplay {
|
|
36
|
-
font-family: DistinctDisplay, sans-serif;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
35
|
@font-face {
|
|
40
36
|
font-family: DistinctDisplay;
|
|
41
37
|
font-style: italic;
|
|
@@ -43,11 +39,6 @@ body {
|
|
|
43
39
|
src: url('@phillips/seldon/dist/fonts/Distinct-DisplayItalic.woff2') format('woff2');
|
|
44
40
|
}
|
|
45
41
|
|
|
46
|
-
@mixin DistinctDisplayItalic {
|
|
47
|
-
font-family: DistinctDisplay, sans-serif;
|
|
48
|
-
font-style: italic;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
42
|
/** Fonts **/
|
|
52
43
|
@font-face {
|
|
53
44
|
font-family: Montserrat;
|
|
@@ -55,39 +46,15 @@ body {
|
|
|
55
46
|
src: url('@phillips/seldon/dist/fonts/Montserrat.woff2') format('woff2');
|
|
56
47
|
}
|
|
57
48
|
|
|
58
|
-
@mixin Montserrat {
|
|
59
|
-
font-family: Montserrat, sans-serif;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
49
|
@font-face {
|
|
63
50
|
font-family: Distinct;
|
|
64
51
|
src: url('@phillips/seldon/dist/fonts/Distinct-Text.woff') format('woff');
|
|
65
52
|
src: url('@phillips/seldon/dist/fonts/Distinct-Text.woff2') format('woff2');
|
|
66
53
|
}
|
|
67
54
|
|
|
68
|
-
@mixin DistinctText {
|
|
69
|
-
font-family: Distinct, sans-serif;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
55
|
@font-face {
|
|
73
56
|
font-family: Distinct;
|
|
74
57
|
font-style: italic;
|
|
75
58
|
src: url('@phillips/seldon/dist/fonts/Distinct-Italic.woff') format('woff');
|
|
76
59
|
src: url('@phillips/seldon/dist/fonts/Distinct-Italic.woff2') format('woff2');
|
|
77
60
|
}
|
|
78
|
-
|
|
79
|
-
@mixin DistinctItalic {
|
|
80
|
-
font-family: Distinct, sans-serif;
|
|
81
|
-
font-style: italic;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@mixin headerText {
|
|
85
|
-
@include DistinctDisplay;
|
|
86
|
-
|
|
87
|
-
color: $primary-black;
|
|
88
|
-
font-weight: 400;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@mixin bodyText {
|
|
92
|
-
color: $soft-black;
|
|
93
|
-
}
|
package/package.json
CHANGED
package/dist/_virtual/index10.js
DELETED
package/dist/_virtual/index6.js
DELETED
package/dist/_virtual/index7.js
DELETED
package/dist/_virtual/index8.js
DELETED
package/dist/_virtual/index9.js
DELETED
package/dist/_virtual/node.js
DELETED
|
@@ -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 N = ({ 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
|
-
N as default
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as HTMLParser, type HTMLParserProps } from './HTMLParser';
|
|
@@ -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 m } 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/index4.js";
|
|
9
|
-
const a = {
|
|
10
|
-
replace({ attribs: s, children: t, name: o }) {
|
|
11
|
-
if (o === "h1")
|
|
12
|
-
return /* @__PURE__ */ i(n, { variant: e.display1, 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, ...p } = s, c = r.attributesToProps(p);
|
|
25
|
-
return /* @__PURE__ */ i(d, { variant: m.inline, ...c, 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/index9.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/index7.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/index9.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);
|