powerpagestoolkit 3.0.403 → 3.0.404

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "3.0.403",
3
+ "version": "3.0.404",
4
4
  "description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
5
5
  "main": "./dist/src/index.js",
6
6
  "module": "./dist/src/index.js",
@@ -41,7 +41,6 @@
41
41
  "dev": "tsc --watch"
42
42
  },
43
43
  "devDependencies": {
44
- "esbuild-plugin-copy": "^2.1.1",
45
44
  "@babel/preset-env": "^7.25.8",
46
45
  "@types/node": "^22.8.6",
47
46
  "@typescript-eslint/parser": "^8.20.0",
@@ -49,6 +48,7 @@
49
48
  "css-loader": "^7.1.2",
50
49
  "esbuild": "^0.24.2",
51
50
  "esbuild-css-modules-plugin": "^3.1.2",
51
+ "esbuild-plugin-copy": "^2.1.1",
52
52
  "eslint": "^8.57.1",
53
53
  "eslint-plugin-import": "^2.31.0",
54
54
  "globals": "^15.14.0",
@@ -79,5 +79,8 @@
79
79
  "form-management",
80
80
  "frontend",
81
81
  "web-development"
82
- ]
82
+ ],
83
+ "dependencies": {
84
+ "dompurify": "^3.2.4"
85
+ }
83
86
  }
@@ -1,195 +0,0 @@
1
- /// <reference path="../core/PowerPagesElement.ts"/>
2
-
3
- declare type EventCallback = () => any;
4
-
5
- declare interface CreationOptions {
6
- /**
7
- * Should this call return an array of instantiated references, or just a single?
8
- * Defaults to false, returning a single instance.
9
- */
10
- multiple?: (() => boolean) | boolean;
11
-
12
- /**
13
- * Optionally specify the element within which to search for the element targeted by 'target'.
14
- * Defaults to 'document.body'.
15
- */
16
- root?: HTMLElement;
17
-
18
- /**
19
- * Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
20
- * Useful for async DOM loading. Relies on MutationObserver.
21
- * WARNING: Implementing multiple references with timeout can result in infinite loading.
22
- */
23
- timeoutMs?: number;
24
- }
25
-
26
- declare interface SystemForm extends Object {
27
- "@odata.context": string;
28
- "@odata.etag": string;
29
- "overwritetime@OData.Community.Display.V1.FormattedValue": string;
30
- overwritetime: Date;
31
- "isdesktopenabled@OData.Community.Display.V1.FormattedValue": string;
32
- isdesktopenabled: boolean;
33
- "publishedon@OData.Community.Display.V1.FormattedValue": Date;
34
- publishedon: Date;
35
- "_organizationid_value@OData.Community.Display.V1.FormattedValue": string;
36
- "_organizationid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": string;
37
- "_organizationid_value@Microsoft.Dynamics.CRM.lookuplogicalname": string;
38
- _organizationid_value: string;
39
- formxml: string;
40
- introducedversion: string;
41
- "isairmerged@OData.Community.Display.V1.FormattedValue": string;
42
- isairmerged: boolean;
43
- "istabletenabled@OData.Community.Display.V1.FormattedValue": string;
44
- istabletenabled: boolean;
45
- solutionid: string;
46
- formidunique: string;
47
- "ismanaged@OData.Community.Display.V1.FormattedValue": string;
48
- ismanaged: boolean;
49
- "isdefault@OData.Community.Display.V1.FormattedValue": string;
50
- isdefault: boolean;
51
- "objecttypecode@OData.Community.Display.V1.FormattedValue": string;
52
- objecttypecode: string;
53
- "type@OData.Community.Display.V1.FormattedValue": string;
54
- type: number;
55
- "componentstate@OData.Community.Display.V1.FormattedValue": string;
56
- componentstate: number;
57
- "formpresentation@OData.Community.Display.V1.FormattedValue": string;
58
- formpresentation: number;
59
- "formactivationstate@OData.Community.Display.V1.FormattedValue": string;
60
- formactivationstate: number;
61
- name: string;
62
- "versionnumber@OData.Community.Display.V1.FormattedValue": string;
63
- versionnumber: number;
64
- formjson: string;
65
- description: string;
66
- formid: string;
67
- }
68
-
69
- declare interface Form extends Partial<SystemForm> {
70
- formxml: string;
71
- }
72
-
73
- declare interface BusinessRule {
74
- /**
75
- * @param condition A function that returns a boolean to determine
76
- * the visibility of the target element. If `condition()` returns true, the element is shown;
77
- * otherwise, it is hidden.
78
-
79
- */
80
- setVisibility?: (this: PowerPagesElement) => boolean;
81
- /**
82
- * Configuration function for determining the required level, and field validity of the given fields
83
- * @param isRequired - Function determining if field is required
84
- * @param isRequired.this - Reference to this PowerPagesElement
85
- * @param isValid - Function validating field input.
86
- * @param isValid.this - Reference to this PowerPagesElement
87
- * @param isValid.isRequiredResult - Only available if 'isRequired' is also returned from the configuration function
88
- */
89
- setRequirements?: () => {
90
- isRequired?: (this: PowerPagesElement) => boolean;
91
- isValid?: (this: PowerPagesElement, isRequiredResult?: boolean) => boolean;
92
- };
93
-
94
- /**
95
- * @param condition A function to determine if the value provided should be applied to this field
96
- * @param value The value to set for the HTML element.
97
- * for parents of boolean radios, pass true or false as value, or
98
- * an expression returning a boolean
99
- */
100
- setValue?: () => {
101
- condition: (this: PowerPagesElement) => boolean;
102
- value: (() => any) | any;
103
- };
104
- /**
105
- * @param condition A function to determine if this field
106
- * should be enabled in a form, or disabled. True || 1 = disabled. False || 0 = enabled
107
- */
108
- setDisabled?: (this: PowerPagesElement) => boolean;
109
- }
110
-
111
- // This helper checks that an array type has at least one element.
112
- // If T is empty, it “fails” by evaluating to a string literal.
113
- type NonEmptyArray<T extends unknown[]> = T extends []
114
- ? "Error: Dependency array must have at least one element"
115
- : T;
116
-
117
- // Now, define DependencyArray so that it is essentially [T, ...T[]]
118
- // but if someone passes an empty array (i.e. []), the type becomes a custom error.
119
- declare type DependencyArray<T> = NonEmptyArray<[T, ...T[]]>;
120
-
121
- declare interface CreationOptions {
122
- /**
123
- * Should this call return an array of instantiated references, or just a single?
124
- * Defaults to false, returning a single instance.
125
- */
126
- multiple?: (() => boolean) | boolean;
127
-
128
- /**
129
- * Optionally specify the element within which to search for the element targeted by 'target'.
130
- * Defaults to 'document.body'.
131
- */
132
- root?: HTMLElement;
133
-
134
- /**
135
- * Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
136
- * Useful for async DOM loading. Relies on MutationObserver.
137
- * WARNING: Implementing multiple references with timeout can result in infinite loading.
138
- */
139
- timeoutMs?: number;
140
- }
141
-
142
- declare type DependencyHandler = () => void;
143
-
144
- declare interface BusinessRuleHandler extends DependencyHandler {}
145
-
146
- declare type Dependents = Map<PowerPagesElement, DependencyHandler>;
147
-
148
- declare type ValueElement =
149
- | HTMLInputElement
150
- | HTMLSelectElement
151
- | HTMLTextAreaElement
152
- | HTMLOptionElement;
153
-
154
- declare const Page_Validators: any[];
155
-
156
- declare interface ElementValue {
157
- value: any;
158
- checked?: boolean;
159
- }
160
-
161
- declare type RadioType = "truthy" | "falsy";
162
-
163
- declare interface BoundEventListener {
164
- element: Element;
165
- event: keyof HTMLElementEventMap;
166
- handler: (e: Event) => unknown;
167
- }
168
-
169
- declare type FormElement =
170
- | HTMLInputElement
171
- | HTMLSelectElement
172
- | HTMLTextAreaElement
173
- | HTMLSpanElement
174
- | HTMLButtonElement
175
- | HTMLFieldSetElement;
176
-
177
- declare type PhoneNumberFormats =
178
- | "xxx-xxx-xxxx"
179
- | "(xxx) xxx-xxxx"
180
- | "xxx xxx-xxxx"
181
- | "xxx.xxx.xxxx";
182
-
183
- declare type CountryCodeFormats = "+" | "()";
184
-
185
- declare type CurrencySymbol = "$" | "€" | "£" | "¥" | "¢";
186
-
187
- declare interface InputMaskOptions {
188
- format?: PhoneNumberFormats;
189
- countryCode?: CountryCodeFormats;
190
- prefix?: CurrencySymbol; // Currency symbol (e.g., "$")
191
- decimalPlaces?: number; // Number of decimal places (default: 2)
192
- thousandsSeparator?: string; // Character for separating thousands (e.g., ",")
193
- decimalSeparator?: string; // Character for decimal point (e.g., ".")
194
- allowNegative?: boolean; // Whether to allow negative values
195
- }