buildgrid-ui 1.15.32 → 1.17.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/README.md +39 -5
- package/dist/blocks/html-text-editor/html-text-area.d.ts +21 -2
- package/dist/blocks/index.d.ts +1 -0
- package/dist/buildgrid-ui.css +1 -1
- package/dist/buildgrid-ui.es.js +8499 -7703
- package/dist/buildgrid-ui.umd.js +89 -88
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/use-sanitized-html.d.ts +47 -0
- package/package.json +149 -143
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import DOMPurify from 'dompurify';
|
|
2
|
+
export interface UseSanitizedHtmlOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Custom DOMPurify configuration options
|
|
5
|
+
*/
|
|
6
|
+
sanitizeOptions?: DOMPurify.Config;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to allow all HTML tags and attributes (less secure)
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
allowAll?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Hook to sanitize HTML content using DOMPurify
|
|
15
|
+
*
|
|
16
|
+
* @param htmlContent - The HTML string to sanitize
|
|
17
|
+
* @param options - Sanitization options
|
|
18
|
+
* @returns Sanitized HTML string
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const sanitizedHtml = useSanitizedHtml('<p>Hello <script>alert("xss")</script></p>')
|
|
23
|
+
* // Returns: '<p>Hello </p>'
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const useSanitizedHtml: (htmlContent: string, options?: UseSanitizedHtmlOptions) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Predefined sanitization presets for common use cases
|
|
29
|
+
*/
|
|
30
|
+
export declare const sanitizePresets: {
|
|
31
|
+
/**
|
|
32
|
+
* Basic text formatting only (p, br, strong, em, u)
|
|
33
|
+
*/
|
|
34
|
+
basic: DOMPurify.Config;
|
|
35
|
+
/**
|
|
36
|
+
* Rich text with headings and lists
|
|
37
|
+
*/
|
|
38
|
+
rich: DOMPurify.Config;
|
|
39
|
+
/**
|
|
40
|
+
* Full content including links and media
|
|
41
|
+
*/
|
|
42
|
+
full: DOMPurify.Config;
|
|
43
|
+
/**
|
|
44
|
+
* Comments and user-generated content (very restrictive)
|
|
45
|
+
*/
|
|
46
|
+
comments: DOMPurify.Config;
|
|
47
|
+
};
|
package/package.json
CHANGED
|
@@ -1,145 +1,151 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
2
|
+
"name": "buildgrid-ui",
|
|
3
|
+
"version": "1.17.0",
|
|
4
|
+
"homepage": "http://adrianomaringolo.github.io/buildgrid-ui",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/buildgrid-ui.umd.js",
|
|
9
|
+
"module": "dist/buildgrid-ui.es.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/buildgrid-ui.es.js",
|
|
21
|
+
"require": "./dist/buildgrid-ui.umd.js"
|
|
22
|
+
},
|
|
23
|
+
"./theme": "./dist/buildgrid-ui.css",
|
|
24
|
+
"./components/*": {
|
|
25
|
+
"types": "./dist/components/*/index.d.ts",
|
|
26
|
+
"import": "./dist/components/*/index.js",
|
|
27
|
+
"require": "./dist/components/*/index.umd.js"
|
|
28
|
+
},
|
|
29
|
+
"./blocks/*": {
|
|
30
|
+
"types": "./dist/blocks/*/index.d.ts",
|
|
31
|
+
"import": "./dist/blocks/*/index.js",
|
|
32
|
+
"require": "./dist/blocks/*/index.umd.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "vitest",
|
|
37
|
+
"test:watch": "vitest --watch",
|
|
38
|
+
"test:ui": "vitest --ui",
|
|
39
|
+
"build": "vite build && npm run build:types",
|
|
40
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
41
|
+
"build:link": "npm run build && npm link",
|
|
42
|
+
"storybook": "storybook dev -p 6006",
|
|
43
|
+
"sb": "storybook dev -p 6006",
|
|
44
|
+
"build:storybook": "storybook build",
|
|
45
|
+
"predeploy": "npm run build:storybook",
|
|
46
|
+
"deploy-storybook": "gh-pages -d storybook-static",
|
|
47
|
+
"release": "semantic-release",
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
49
|
+
"build:publish": "npm run build && npm publish",
|
|
50
|
+
"build-storybook": "storybook build",
|
|
51
|
+
"serve-storybook": "npm run build-storybook -- -o ./storybook-static && npx http-server ./storybook-static",
|
|
52
|
+
"chromatic": "npx chromatic --project-token=chpt_af05c4ee3fa4b80"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [],
|
|
55
|
+
"author": "",
|
|
56
|
+
"license": "ISC",
|
|
57
|
+
"description": "",
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@radix-ui/react-accordion": "^1.2.11",
|
|
60
|
+
"@radix-ui/react-alert-dialog": "^1.1.7",
|
|
61
|
+
"@radix-ui/react-avatar": "^1.1.4",
|
|
62
|
+
"@radix-ui/react-checkbox": "^1.1.5",
|
|
63
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
64
|
+
"@radix-ui/react-dialog": "^1.1.14",
|
|
65
|
+
"@radix-ui/react-dropdown-menu": "^2.1.7",
|
|
66
|
+
"@radix-ui/react-label": "^2.1.3",
|
|
67
|
+
"@radix-ui/react-navigation-menu": "^1.2.13",
|
|
68
|
+
"@radix-ui/react-popover": "^1.1.7",
|
|
69
|
+
"@radix-ui/react-progress": "^1.1.3",
|
|
70
|
+
"@radix-ui/react-radio-group": "^1.2.4",
|
|
71
|
+
"@radix-ui/react-select": "^2.1.7",
|
|
72
|
+
"@radix-ui/react-separator": "^1.1.3",
|
|
73
|
+
"@radix-ui/react-slider": "^1.3.5",
|
|
74
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
75
|
+
"@radix-ui/react-switch": "^1.1.4",
|
|
76
|
+
"@radix-ui/react-tabs": "^1.1.12",
|
|
77
|
+
"@radix-ui/react-toggle": "^1.1.3",
|
|
78
|
+
"@radix-ui/react-toggle-group": "^1.1.3",
|
|
79
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
80
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
81
|
+
"class-variance-authority": "^0.7.1",
|
|
82
|
+
"clsx": "^2.1.1",
|
|
83
|
+
"cmdk": "^1.1.1",
|
|
84
|
+
"compressorjs": "^1.2.1",
|
|
85
|
+
"cva-extended": "^2.0.0",
|
|
86
|
+
"date-fns": "^4.1.0",
|
|
87
|
+
"date-fns-tz": "^3.2.0",
|
|
88
|
+
"dompurify": "^3.3.1",
|
|
89
|
+
"embla-carousel-react": "^8.6.0",
|
|
90
|
+
"highlight.js": "^11.11.1",
|
|
91
|
+
"lucide-react": "^0.539.0",
|
|
92
|
+
"react-day-picker": "^9.8.1",
|
|
93
|
+
"react-dropzone": "^14.3.8",
|
|
94
|
+
"sonner": "^1.7.1",
|
|
95
|
+
"tailwind-merge": "^3.3.1",
|
|
96
|
+
"tw-animate-css": "^1.3.6"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"react": "^19.0.0",
|
|
100
|
+
"react-dom": "^19.0.0"
|
|
101
|
+
},
|
|
102
|
+
"devDependencies": {
|
|
103
|
+
"@commitlint/cli": "^19.8.1",
|
|
104
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
105
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
106
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
107
|
+
"@semantic-release/git": "^10.0.1",
|
|
108
|
+
"@semantic-release/npm": "^12.0.2",
|
|
109
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
110
|
+
"@shadcn/ui": "^0.0.4",
|
|
111
|
+
"@storybook/addon-docs": "^10.1.10",
|
|
112
|
+
"@storybook/addon-onboarding": "^10.1.10",
|
|
113
|
+
"@storybook/react-vite": "^10.1.10",
|
|
114
|
+
"@testing-library/jest-dom": "^6.6.4",
|
|
115
|
+
"@testing-library/react": "^16.3.0",
|
|
116
|
+
"@types/dompurify": "^3.0.5",
|
|
117
|
+
"@types/jest": "^30.0.0",
|
|
118
|
+
"@types/node": "^24.2.1",
|
|
119
|
+
"@types/react": "^19.1.9",
|
|
120
|
+
"@types/react-dom": "^19.1.7",
|
|
121
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
122
|
+
"@vitest/ui": "^3.2.4",
|
|
123
|
+
"autoprefixer": "^10.4.21",
|
|
124
|
+
"chromatic": "^13.3.4",
|
|
125
|
+
"eslint": "^9.33.0",
|
|
126
|
+
"eslint-config-next": "^15.4.6",
|
|
127
|
+
"eslint-config-prettier": "^10.1.8",
|
|
128
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
129
|
+
"eslint-plugin-storybook": "^10.1.10",
|
|
130
|
+
"gh-pages": "^6.3.0",
|
|
131
|
+
"http-server": "^14.1.1",
|
|
132
|
+
"husky": "^9.1.7",
|
|
133
|
+
"jsdom": "^26.1.0",
|
|
134
|
+
"postcss": "^8.5.6",
|
|
135
|
+
"prettier": "^3.6.2",
|
|
136
|
+
"prettier-plugin-organize-imports": "^4.2.0",
|
|
137
|
+
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
138
|
+
"pretty-quick": "^4.2.2",
|
|
139
|
+
"react": "^19.1.1",
|
|
140
|
+
"react-dom": "^19.1.1",
|
|
141
|
+
"semantic-release": "^24.2.7",
|
|
142
|
+
"storybook": "^10.1.10",
|
|
143
|
+
"tailwindcss": "^4.1.11",
|
|
144
|
+
"tailwindcss-animate": "^1.0.7",
|
|
145
|
+
"tailwindcss-animated": "^2.0.0",
|
|
146
|
+
"typescript": "^5.9.2",
|
|
147
|
+
"vite": "^7.1.1",
|
|
148
|
+
"vite-plugin-dts": "^4.5.4",
|
|
149
|
+
"vitest": "^3.2.4"
|
|
150
|
+
}
|
|
145
151
|
}
|