powerpagestoolkit 2.7.1401 → 2.7.1403
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 → dist_n}/bundle.js +4 -9
- package/{dist → dist_n}/types/core/DOMNodeReference.d.ts +12 -1
- package/{dist → dist_n}/types/core/DOMNodeReferenceArray.d.ts +1 -1
- package/{dist → dist_n}/types/core/bindForm.d.ts +2 -2
- package/{dist → dist_n}/types/core/createDOMNodeReferences.d.ts +21 -2
- package/{dist → dist_n}/types/errors/errors.d.ts +1 -1
- package/dist_n/types/index.d.ts +5 -0
- package/{dist → dist_n}/types/managers/ReferenceManager.d.ts +1 -1
- package/{dist → dist_n}/types/utils/enhanceArray.d.ts +2 -2
- package/package.json +18 -23
- package/assets/infoIconExample.gif +0 -0
- package/dist/bundle.css +0 -36
- package/dist/types/index.d.ts +0 -18
- /package/{dist → dist_n}/types/constants/eventMapping.d.ts +0 -0
- /package/{dist → dist_n}/types/constants/symbols.d.ts +0 -0
- /package/{dist → dist_n}/types/core/API.d.ts +0 -0
- /package/{dist → dist_n}/types/core/waitFor.d.ts +0 -0
- /package/{dist → dist_n}/types/utils/createInfoElement.d.ts +0 -0
- /package/{dist → dist_n}/types/utils/safeAjax.d.ts +0 -0
|
@@ -106,7 +106,7 @@ var API_default = API;
|
|
|
106
106
|
function waitFor(target, root = document, multiple = false, debounceTime2) {
|
|
107
107
|
return new Promise((resolve, reject) => {
|
|
108
108
|
if (multiple) {
|
|
109
|
-
let
|
|
109
|
+
let timeout;
|
|
110
110
|
const observedElements = [];
|
|
111
111
|
const observedSet = /* @__PURE__ */ new Set();
|
|
112
112
|
if (debounceTime2 < 1) {
|
|
@@ -122,8 +122,8 @@ function waitFor(target, root = document, multiple = false, debounceTime2) {
|
|
|
122
122
|
observedElements.push(element);
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
clearTimeout(
|
|
126
|
-
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
timeout = setTimeout(() => {
|
|
127
127
|
if (observedElements.length > 0) {
|
|
128
128
|
observer.disconnect();
|
|
129
129
|
resolve(observedElements);
|
|
@@ -1335,22 +1335,17 @@ function createReferenceString(tagName, datafieldname) {
|
|
|
1335
1335
|
return `[data-name="${datafieldname}"]`;
|
|
1336
1336
|
return null;
|
|
1337
1337
|
}
|
|
1338
|
-
|
|
1339
|
-
// src/index.ts
|
|
1340
|
-
var toolkit = { API: API_default, createRef: createDOMNodeReference, waitFor, bindForm };
|
|
1341
|
-
var src_default = toolkit;
|
|
1342
1338
|
export {
|
|
1343
1339
|
API_default as API,
|
|
1344
1340
|
bindForm,
|
|
1345
1341
|
createDOMNodeReference as createRef,
|
|
1346
|
-
src_default as default,
|
|
1347
1342
|
waitFor
|
|
1348
1343
|
};
|
|
1349
1344
|
|
|
1350
1345
|
|
|
1351
1346
|
(function() {
|
|
1352
1347
|
const style = document.createElement('style');
|
|
1353
|
-
style.textContent = "
|
|
1348
|
+
style.textContent = ".info-icon {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.info-icon .fa-info-circle {\r\n cursor: pointer; /* Ensures the icon is recognized as interactive */\r\n}\r\n\r\n.info-icon .flyout-content {\r\n max-width: calc(100vw - 20px); /* 20px margin on both sides */\r\n display: none; /* Initially hidden */\r\n position: absolute;\r\n left: 50%; /* Center horizontally */\r\n transform: translateX(-50%); /* Adjust positioning */\r\n color: #000;\r\n background-color: #f9f9f9;\r\n padding: 10px;\r\n border: 1px solid #ddd;\r\n z-index: 1;\r\n min-width: 200px; /* Minimum width for better readability */\r\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);\r\n border-radius: 4px; /* Rounded corners */\r\n}\r\n\r\n@media (max-width: 600px) {\r\n .info-icon .flyout-content {\r\n max-width: 95vw;\r\n padding: 12px;\r\n font-size: 0.9em;\r\n display: block;\r\n right: auto;\r\n }\r\n}\r\n\r\n.required-field::after {\r\n content: \" *\" !important;\r\n color: #f00 !important;\r\n}\r\n";
|
|
1354
1349
|
document.head.appendChild(style);
|
|
1355
1350
|
})();
|
|
1356
1351
|
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import * as s from "
|
|
1
|
+
import * as s from "../constants/symbols.ts";
|
|
2
|
+
declare interface ElementValue {
|
|
3
|
+
value: any;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare type RadioType = "truthy" | "falsy";
|
|
7
|
+
declare interface BoundEventListener {
|
|
8
|
+
element: Element;
|
|
9
|
+
event: keyof HTMLElementEventMap;
|
|
10
|
+
handler: (e: Event) => unknown;
|
|
11
|
+
}
|
|
12
|
+
declare type FormElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLSpanElement | HTMLButtonElement | HTMLFieldSetElement;
|
|
2
13
|
declare type BusinessRule = {
|
|
3
14
|
/**
|
|
4
15
|
* @param condition A function that returns a boolean to determine
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DOMNodeReference from "./DOMNodeReference.
|
|
1
|
+
import type DOMNodeReference from "./DOMNodeReference.ts";
|
|
2
2
|
export default class DOMNodeReferenceArray extends Array<DOMNodeReference> {
|
|
3
3
|
/**
|
|
4
4
|
* Hides all the containers of the DOMNodeReference instances in the array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import DOMNodeReference from "./DOMNodeReference.
|
|
2
|
-
import DOMNodeReferenceArray from "./DOMNodeReferenceArray.
|
|
1
|
+
import type DOMNodeReference from "./DOMNodeReference.ts";
|
|
2
|
+
import type DOMNodeReferenceArray from "./DOMNodeReferenceArray.ts";
|
|
3
3
|
declare type BoundForm = DOMNodeReferenceArray & Record<string, DOMNodeReference>;
|
|
4
4
|
/**
|
|
5
5
|
* Get all controls related to the form for manipulating with the
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import DOMNodeReference from "./DOMNodeReference.
|
|
2
|
-
import DOMNodeReferenceArray from "./DOMNodeReferenceArray.
|
|
1
|
+
import DOMNodeReference from "./DOMNodeReference.ts";
|
|
2
|
+
import type DOMNodeReferenceArray from "./DOMNodeReferenceArray.ts";
|
|
3
|
+
declare interface CreationOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Should this call return an array of instantiated references, or just a single?
|
|
6
|
+
* Defaults to false, returning a single instance.
|
|
7
|
+
*/
|
|
8
|
+
multiple?: (() => boolean) | boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Optionally specify the element within which to search for the element targeted by 'target'.
|
|
11
|
+
* Defaults to 'document.body'.
|
|
12
|
+
*/
|
|
13
|
+
root?: HTMLElement;
|
|
14
|
+
/**
|
|
15
|
+
* Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
|
|
16
|
+
* Useful for async DOM loading. Relies on MutationObserver.
|
|
17
|
+
* WARNING: Implementing multiple references with timeout can result in infinite loading.
|
|
18
|
+
*/
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
}
|
|
3
21
|
/**
|
|
4
22
|
* Creates and initializes a DOMNodeReference instance.
|
|
5
23
|
* @see {@link CreationOptions}
|
|
@@ -81,3 +99,4 @@ export declare function validateOptions(options: Partial<CreationOptions>): void
|
|
|
81
99
|
export declare function createProxyHandler(): {
|
|
82
100
|
get: (target: DOMNodeReference, prop: string | symbol) => any;
|
|
83
101
|
};
|
|
102
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DOMNodeReference from "
|
|
1
|
+
import type DOMNodeReference from "../core/DOMNodeReference.ts";
|
|
2
2
|
export default abstract class ReferenceManager {
|
|
3
3
|
static instances: Set<DOMNodeReference>;
|
|
4
4
|
static getInstance<T>(target: T): DOMNodeReference | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import DOMNodeReferenceArray from "../core/DOMNodeReferenceArray.ts";
|
|
2
|
+
import type DOMNodeReference from "../core/DOMNodeReference.ts";
|
|
3
3
|
export default function enhanceArray<T extends string>(array: DOMNodeReference[]): DOMNodeReferenceArray & Record<T, DOMNodeReference>;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerpagestoolkit",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1403",
|
|
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
|
-
"main": "./
|
|
6
|
-
"module": "./
|
|
7
|
-
"types": "./
|
|
5
|
+
"main": "./dist_n/bundle.js",
|
|
6
|
+
"module": "./dist_n/bundle.js",
|
|
7
|
+
"types": "./dist_n/types/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
"*": {
|
|
10
10
|
"*": [
|
|
11
|
-
"./
|
|
11
|
+
"./dist_n/types/*"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"unpkg": "./
|
|
16
|
-
"jsdelivr": "./
|
|
17
|
-
"browser": "./
|
|
15
|
+
"unpkg": "./dist_n/bundle.js",
|
|
16
|
+
"jsdelivr": "./dist_n/bundle.js",
|
|
17
|
+
"browser": "./dist_n/bundle.js",
|
|
18
18
|
"author": "KeatonBrewster",
|
|
19
19
|
"license": "AGPL-3.0-only",
|
|
20
20
|
"type": "module",
|
|
@@ -23,36 +23,31 @@
|
|
|
23
23
|
"url": "https://github.com/Keaton-Brewster/PowerPagesToolKit"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
|
-
"
|
|
27
|
-
"dist/bundle.css",
|
|
28
|
-
"dist/types/**/*.d.ts",
|
|
29
|
-
"assets/**"
|
|
26
|
+
"dist_n"
|
|
30
27
|
],
|
|
31
28
|
"exports": {
|
|
32
29
|
".": {
|
|
33
|
-
"types": "./
|
|
34
|
-
"import": "./
|
|
35
|
-
},
|
|
36
|
-
"./createDOMNodeReference": {
|
|
37
|
-
"import": "./dist/createDOMNodeReference.js",
|
|
38
|
-
"types": "./dist/createDOMNodeReference.d.ts"
|
|
39
|
-
},
|
|
40
|
-
"./style.css": {
|
|
41
|
-
"import": "./dist/bundle.css"
|
|
30
|
+
"types": "./dist_n/types/index.d.ts",
|
|
31
|
+
"import": "./dist_n/bundle.js"
|
|
42
32
|
}
|
|
43
33
|
},
|
|
44
34
|
"scripts": {
|
|
45
35
|
"typecheck": "tsc",
|
|
46
36
|
"node:build": "node build.js",
|
|
47
|
-
"clean": "rimraf dist",
|
|
48
|
-
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir ./
|
|
37
|
+
"clean": "rimraf dist_n && rimraf dist",
|
|
38
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist_n/types",
|
|
49
39
|
"build": "npm run clean && npm run build:types && npm run node:build",
|
|
40
|
+
"build:all": "npm run build && deno run build:all",
|
|
50
41
|
"dev": "tsc --watch"
|
|
51
42
|
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"esbuild-plugin-copy": "^2.1.1"
|
|
45
|
+
},
|
|
52
46
|
"devDependencies": {
|
|
53
47
|
"@babel/preset-env": "^7.25.8",
|
|
54
48
|
"@types/node": "^22.8.6",
|
|
55
49
|
"@typescript-eslint/parser": "^8.20.0",
|
|
50
|
+
"buffer": "^6.0.3",
|
|
56
51
|
"css-loader": "^7.1.2",
|
|
57
52
|
"esbuild": "^0.24.2",
|
|
58
53
|
"esbuild-css-modules-plugin": "^3.1.2",
|
|
Binary file
|
package/dist/bundle.css
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* src/style.css */
|
|
2
|
-
.info-icon {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: inline-block;
|
|
5
|
-
}
|
|
6
|
-
.info-icon .fa-info-circle {
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
}
|
|
9
|
-
.info-icon .flyout-content {
|
|
10
|
-
max-width: calc(100vw - 20px);
|
|
11
|
-
display: none;
|
|
12
|
-
position: absolute;
|
|
13
|
-
left: 50%;
|
|
14
|
-
transform: translateX(-50%);
|
|
15
|
-
color: #000;
|
|
16
|
-
background-color: #f9f9f9;
|
|
17
|
-
padding: 10px;
|
|
18
|
-
border: 1px solid #ddd;
|
|
19
|
-
z-index: 1;
|
|
20
|
-
min-width: 200px;
|
|
21
|
-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
22
|
-
border-radius: 4px;
|
|
23
|
-
}
|
|
24
|
-
@media (max-width: 600px) {
|
|
25
|
-
.info-icon .flyout-content {
|
|
26
|
-
max-width: 95vw;
|
|
27
|
-
padding: 12px;
|
|
28
|
-
font-size: 0.9em;
|
|
29
|
-
display: block;
|
|
30
|
-
right: auto;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
.required-field::after {
|
|
34
|
-
content: " *" !important;
|
|
35
|
-
color: #f00 !important;
|
|
36
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "./style.css";
|
|
2
|
-
import API from "./core/API.js";
|
|
3
|
-
import createRef from "./core/createDOMNodeReferences.js";
|
|
4
|
-
import waitFor from "./core/waitFor.js";
|
|
5
|
-
import bindForm from "./core/bindForm.js";
|
|
6
|
-
export { API, createRef, waitFor, bindForm };
|
|
7
|
-
declare const toolkit: {
|
|
8
|
-
API: {
|
|
9
|
-
createRecord(tableSetName: string, data: object): Promise<string>;
|
|
10
|
-
getRecord<T>(tableSetName: string, recordID: string, selectColumns?: string): Promise<T>;
|
|
11
|
-
getMultiple(tableSetName: string, queryParameters?: string): Promise<Array<object>>;
|
|
12
|
-
updateRecord(tableSetName: string, recordId: string, data: object): Promise<any>;
|
|
13
|
-
};
|
|
14
|
-
createRef: typeof createRef;
|
|
15
|
-
waitFor: typeof waitFor;
|
|
16
|
-
bindForm: typeof bindForm;
|
|
17
|
-
};
|
|
18
|
-
export default toolkit;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|