From 20f897fa660d2a792a256af5f9704e96b4cf68b8 Mon Sep 17 00:00:00 2001 From: nikholas117 Date: Wed, 5 Feb 2025 13:16:54 -0500 Subject: [PATCH] Fix: macOS drag and drop issue --- package-lock.json | 663 +++++++++++++++++++------------------------- package.json | 2 +- src/docs.js | 686 ++++++++++++---------------------------------- 3 files changed, 462 insertions(+), 889 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15bd7108..03aeb049 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "flowbite", - "version": "3.0.0", + "version": "3.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "flowbite", - "version": "3.0.0", + "version": "3.1.1", "license": "MIT", "dependencies": { "@popperjs/core": "^2.9.3", @@ -17,8 +17,8 @@ "devDependencies": { "@babel/core": "^7.14.8", "@babel/preset-env": "^7.14.8", - "@docsearch/js": "^3.0.0-alpha.42", - "@tailwindcss/cli": "^4.0.0-beta.10", + "@docsearch/js": "^3.8.3", + "@tailwindcss/cli": "^4.0.0", "@tailwindcss/postcss": "^4.0.0", "@typescript-eslint/eslint-plugin": "^5.46.1", "@typescript-eslint/parser": "^5.46.1", @@ -55,19 +55,37 @@ } }, "node_modules/@algolia/autocomplete-core": { - "version": "1.7.2", + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.9.tgz", + "integrity": "sha512-O7BxrpLDPJWWHv/DLA9DRFWs+iY1uOJZkqUwjS5HSZAGcl0hIVCQ97LTLewiZmZ402JYUrun+8NqFP+hCknlbQ==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-plugin-algolia-insights": "1.17.9", + "@algolia/autocomplete-shared": "1.17.9" + } + }, + "node_modules/@algolia/autocomplete-plugin-algolia-insights": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.9.tgz", + "integrity": "sha512-u1fEHkCbWF92DBeB/KHeMacsjsoI0wFhjZtlCq2ddZbAehshbZST6Hs0Avkc0s+4UyBGbMDnSuXHLuvRWK5iDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@algolia/autocomplete-shared": "1.17.9" + }, + "peerDependencies": { + "search-insights": ">= 1 < 3" } }, "node_modules/@algolia/autocomplete-preset-algolia": { - "version": "1.7.2", + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.9.tgz", + "integrity": "sha512-Na1OuceSJeg8j7ZWn5ssMu/Ax3amtOwk76u4h5J4eK2Nx2KB5qt0Z4cOapCsxot9VcEN11ADV5aUSlQF4RhGjQ==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/autocomplete-shared": "1.7.2" + "@algolia/autocomplete-shared": "1.17.9" }, "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", @@ -75,123 +93,207 @@ } }, "node_modules/@algolia/autocomplete-shared": { - "version": "1.7.2", + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.9.tgz", + "integrity": "sha512-iDf05JDQ7I0b7JEA/9IektxN/80a2MZ1ToohfmNS3rfeuQnIKI3IJlIafD0xu4StbtQTghx9T3Maa97ytkXenQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peerDependencies": { + "@algolia/client-search": ">= 4.9.1 < 6", + "algoliasearch": ">= 4.9.1 < 6" + } }, - "node_modules/@algolia/cache-browser-local-storage": { - "version": "4.14.2", + "node_modules/@algolia/client-abtesting": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.20.1.tgz", + "integrity": "sha512-73pnrUixMVnfjgldxhRi5eYLraMt95/MhQHevoFtqwy+t2hfayxYBZXJ2k6JJDld8UmjcWwq3wXnvZJCOm7vZA==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/cache-common": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/cache-common": { - "version": "4.14.2", - "dev": true, - "license": "MIT" - }, - "node_modules/@algolia/cache-in-memory": { - "version": "4.14.2", + "node_modules/@algolia/client-analytics": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.20.1.tgz", + "integrity": "sha512-BRiyL+AwPfGTlo3HbrFDMeTK2z5SaJmB8PBd1JI66d6MeP85+38Mux2FFw+nvDOfBwlGaN/uw2AQTOZ9r4JYtA==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/cache-common": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/client-account": { - "version": "4.14.2", + "node_modules/@algolia/client-common": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.20.1.tgz", + "integrity": "sha512-Dk4RhklaAbqLzOeJO/MoIFUjcKYGECiAJYYqDzmE/sbXICk5Uo6dGlv8w4z09lmvsASpNUoMvGYHGBK+WkEGpA==", "dev": true, "license": "MIT", - "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/transporter": "4.14.2" + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/client-analytics": { - "version": "4.14.2", + "node_modules/@algolia/client-insights": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.20.1.tgz", + "integrity": "sha512-eu5vhmyYgzZjFIPmkoLo/TU4s+IdsjQ+bEfLj2jcMvyfBD4DcqySKp03TrXjdrHPGO2I3fF7dPZOoCgEi1j2/g==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/client-common": { - "version": "4.14.2", + "node_modules/@algolia/client-personalization": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.20.1.tgz", + "integrity": "sha512-TrUCJ0nVqE0PnOGoRG/RCirxWZ6pF+skZgaaESN2IBnJtk/In14xVmoj8Yzck81bGUY/UI+5dUUOOS7YTSVEhQ==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/client-personalization": { - "version": "4.14.2", + "node_modules/@algolia/client-query-suggestions": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.20.1.tgz", + "integrity": "sha512-rHHX/30R3Kkx2aZeR7/8+jU0s6h1cNPMAKOvcMUGVmoiuh46F1sxzmiswHLg6CuLrQ0ikhpdhn3ehFSJwHgp2Q==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, "node_modules/@algolia/client-search": { - "version": "4.14.2", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.20.1.tgz", + "integrity": "sha512-YzHD0Nqp7AjvzbFrMIjhCUl6apHkWfZxKDSlMqf80mXkuG52wY289zFlvTfHjHK1nEiDslH3uHYAR/poOOa21Q==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/client-common": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/logger-common": { - "version": "4.14.2", + "node_modules/@algolia/ingestion": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.20.1.tgz", + "integrity": "sha512-sHNZ8b5tK7TvXMiiKK+89UsXnFthnAZc0vpwvDKygdTqvsfmfJPhthx36eHTAVYfh7NnA1+eqZsT/hMUGeZFkQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" + } }, - "node_modules/@algolia/logger-console": { - "version": "4.14.2", + "node_modules/@algolia/monitoring": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.20.1.tgz", + "integrity": "sha512-+fHd1U3gSeszCH03UtyUZmprpmcJH6aJKyUTOfY73lKKRR7hVofmV812ahScR0T4xUkBlGjTLeGnsKY0IG6K6Q==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/logger-common": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/requester-browser-xhr": { - "version": "4.14.2", + "node_modules/@algolia/recommend": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.20.1.tgz", + "integrity": "sha512-+IuiUv3OSOFFKoXFMlZHfFzXGqEQbKhncpAcRSAtJmN4pupY4aNblvJ9Wv0SMm7/MSFRy2JLIoYWRSBpSV2yEg==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/requester-common": "4.14.2" + "@algolia/client-common": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/requester-common": { - "version": "4.14.2", + "node_modules/@algolia/requester-browser-xhr": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.20.1.tgz", + "integrity": "sha512-+RaJa5MpJqPHaSbBw0nrHeyIAd5C4YC9C1LfDbZJqrn5ZwOvHMUTod852XmzX/1S8oi1jTynB4FjicmauZIKwA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@algolia/client-common": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" + } }, - "node_modules/@algolia/requester-node-http": { - "version": "4.14.2", + "node_modules/@algolia/requester-fetch": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.20.1.tgz", + "integrity": "sha512-4l1cba8t02rNkLeX/B7bmgDg3CwuRunmuCSgN2zORDtepjg9YAU1qcyRTyc/rAuNJ54AduRfoBplmKXjowYzbQ==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/requester-common": "4.14.2" + "@algolia/client-common": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, - "node_modules/@algolia/transporter": { - "version": "4.14.2", + "node_modules/@algolia/requester-node-http": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.20.1.tgz", + "integrity": "sha512-4npKo1qpLG5xusFoFUj4xIIR/6y3YoCuS/uhagv2blGFotDj+D6OLTML3Pp6JCVcES4zDbkoY7pmNBA8ARtidQ==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/cache-common": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/requester-common": "4.14.2" + "@algolia/client-common": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, "node_modules/@alloc/quick-lru": { @@ -1708,33 +1810,40 @@ } }, "node_modules/@docsearch/css": { - "version": "3.3.0", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.8.3.tgz", + "integrity": "sha512-1nELpMV40JDLJ6rpVVFX48R1jsBFIQ6RnEQDsLFGmzOjPWTOMlZqUcXcvRx8VmYV/TqnS1l784Ofz+ZEb+wEOQ==", "dev": true, "license": "MIT" }, "node_modules/@docsearch/js": { - "version": "3.3.0", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.8.3.tgz", + "integrity": "sha512-CQsX1zeoPJIWxN3IGoDSWOqzRc0JsOE9Bclegf9llwjYN2rzzJF93zagGcT3uI3tF31oCqTuUOVGW/mVFb7arw==", "dev": true, "license": "MIT", "dependencies": { - "@docsearch/react": "3.3.0", + "@docsearch/react": "3.8.3", "preact": "^10.0.0" } }, "node_modules/@docsearch/react": { - "version": "3.3.0", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.8.3.tgz", + "integrity": "sha512-6UNrg88K7lJWmuS6zFPL/xgL+n326qXqZ7Ybyy4E8P/6Rcblk3GE8RXxeol4Pd5pFpKMhOhBhzABKKwHtbJCIg==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/autocomplete-core": "1.7.2", - "@algolia/autocomplete-preset-algolia": "1.7.2", - "@docsearch/css": "3.3.0", - "algoliasearch": "^4.0.0" + "@algolia/autocomplete-core": "1.17.9", + "@algolia/autocomplete-preset-algolia": "1.17.9", + "@docsearch/css": "3.8.3", + "algoliasearch": "^5.14.2" }, "peerDependencies": { "@types/react": ">= 16.8.0 < 19.0.0", "react": ">= 16.8.0 < 19.0.0", - "react-dom": ">= 16.8.0 < 19.0.0" + "react-dom": ">= 16.8.0 < 19.0.0", + "search-insights": ">= 1 < 3" }, "peerDependenciesMeta": { "@types/react": { @@ -1745,6 +1854,9 @@ }, "react-dom": { "optional": true + }, + "search-insights": { + "optional": true } } }, @@ -2350,274 +2462,42 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@tailwindcss/cli": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/cli/-/cli-4.0.0-beta.10.tgz", - "integrity": "sha512-bv+EGp2Y+0UeTvEJqmuocT0pkJq10ZDGviPKOtmlllSPXBlZy9ykrkk2hWz0BNNrd48AtWln9cUqEC+8X1H8pg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.0.3.tgz", + "integrity": "sha512-EPmuqS5e1yax6Qe1vRoWFbCCttMS/Thc+yFGSE/nzYe/BdYDlUc+OoE7D5DawAz4sI5H8v8Zx/mYyEdy+saB0w==", "dev": true, "license": "MIT", "dependencies": { "@parcel/watcher": "^2.5.0", - "@tailwindcss/node": "4.0.0-beta.10", - "@tailwindcss/oxide": "4.0.0-beta.10", + "@tailwindcss/node": "^4.0.3", + "@tailwindcss/oxide": "^4.0.3", "enhanced-resolve": "^5.18.0", "lightningcss": "^1.29.1", "mri": "^1.2.0", "picocolors": "^1.1.1", - "tailwindcss": "4.0.0-beta.10" + "tailwindcss": "4.0.3" }, "bin": { "tailwindcss": "dist/index.mjs" } }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/node": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/node/-/node-4.0.0-beta.10.tgz", - "integrity": "sha512-CQq+iQC0MZNv3Jc4DBew1J1fxwYRXYsNWTQokmUfVFHNyy+tOWDaFsOq5ZbUj1UsMRfPiSHSalkX2ZCoznDing==", - "dev": true, - "license": "MIT", - "dependencies": { - "enhanced-resolve": "^5.18.0", - "jiti": "^2.4.2", - "tailwindcss": "4.0.0-beta.10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide/-/oxide-4.0.0-beta.10.tgz", - "integrity": "sha512-r6tfUMqtkdX2Bwuhury6/wHfrWK2R8aRHMAVcppCKr1/SE2uIlPCGcOzkuybWlRU9OwjHk1t+dVgEcC0igSZ7g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - }, - "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.0.0-beta.10", - "@tailwindcss/oxide-darwin-arm64": "4.0.0-beta.10", - "@tailwindcss/oxide-darwin-x64": "4.0.0-beta.10", - "@tailwindcss/oxide-freebsd-x64": "4.0.0-beta.10", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.0-beta.10", - "@tailwindcss/oxide-linux-arm64-gnu": "4.0.0-beta.10", - "@tailwindcss/oxide-linux-arm64-musl": "4.0.0-beta.10", - "@tailwindcss/oxide-linux-x64-gnu": "4.0.0-beta.10", - "@tailwindcss/oxide-linux-x64-musl": "4.0.0-beta.10", - "@tailwindcss/oxide-win32-arm64-msvc": "4.0.0-beta.10", - "@tailwindcss/oxide-win32-x64-msvc": "4.0.0-beta.10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.0.0-beta.10.tgz", - "integrity": "sha512-wQ3NcFTToQlippJqxNsPtUjkzldcL+RciGvW5tDRGq7yXt/giND292+joshNp55Bi51rXRLXfAU19PV0JP9IGQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.0.0-beta.10.tgz", - "integrity": "sha512-g65kSY1n0AdhhWXchTqmyv+jblDMM+eXM2SJaBidcGicz3wYm0a548i0lVIn3Lt8f72akhftz9YKHaL3riq5AA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.0.0-beta.10.tgz", - "integrity": "sha512-edQRV1hucPU5pIh1j4pXcqnwdxjme0i4P2tMqBvSTM9UTGQmvxn6/QM2oos7htn3dfgqIkvMBb0y6u1mnBLwKw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.0.0-beta.10.tgz", - "integrity": "sha512-okok/IcX9jh85T9mzLOYGr8996KNm+ZU0t1mwibWvW36jBM0oIfq3TVw3xI3M3OkuYj1XpALfcO4Kr8ZZrt2cw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.0.0-beta.10.tgz", - "integrity": "sha512-gfjDqO/3fWkKPd2Lv3rj0vW2CMHRmWH50qFJ29vAkhtteg7oPB/NU1Z4K5YkSpul0Pgcfixv6YfPQpzBkrM7Nw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.0.0-beta.10.tgz", - "integrity": "sha512-/LgdJ+XBZK5ZgyvxiMEJTrMj36GMEhRGTtuHGJmxJDcvv4VFbCzDmNN8H/YC9dtCF0OEOfsCCQxEeKTfUYIuJg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.0.0-beta.10.tgz", - "integrity": "sha512-pIoXoN6BZ3gDDDBBW2mZtLLNMTB3UW1F/uRGMTuPUYl8cERUlXOYek4v2veCMwzTNf5l4FrgwPm8G5rsx9qNiw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.0.0-beta.10.tgz", - "integrity": "sha512-mVXCIesysMgzU7XerH2VWN6R9LEdr+MUZ1LAvUx1wDcjawMPGWbzjyVWzbRNgWxQLPi71YuFT9hU3Srewfb6dw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.0.0-beta.10.tgz", - "integrity": "sha512-TPszoPUQbXTy76kgi38ohCpT9SFMjxHaLKO3z6SUZis2+HURl7H6Z8rS/PlZwNCawv5Dg+UKsYfh1UwvfepXmQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.0.0-beta.10.tgz", - "integrity": "sha512-Gq4bQm1QsaMIX95/zkpnI3J+8CMAgZSWLIYeAq2ehom9AG/Qe9AaT7dDzIzI68uovqwScnKWiJJLo1SfHveoRA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.0.0-beta.10.tgz", - "integrity": "sha512-rzKGE0TvLyADYaAq50oYVGtFXZ9QZEZfeaEqrRdUkK4HMNr5kv66bv7k46JN9260/K8cHp60ISPwLObHloi3zA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@tailwindcss/cli/node_modules/jiti": { - "version": "2.4.2", - "resolved": "https://registry.npmmirror.com/jiti/-/jiti-2.4.2.tgz", - "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", - "dev": true, - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, "node_modules/@tailwindcss/cli/node_modules/tailwindcss": { - "version": "4.0.0-beta.10", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.0-beta.10.tgz", - "integrity": "sha512-QphgB58oviLYkSWu74+5S2FU8sREus9wBEzWWi5iSxnBrgzfVFp7pIeAPbQ7gq1WXnbllCipsTjK3yT+Do4y0Q==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.3.tgz", + "integrity": "sha512-ImmZF0Lon5RrQpsEAKGxRvHwCvMgSC4XVlFRqmbzTEDb/3wvin9zfEZrMwgsa3yqBbPqahYcVI6lulM2S7IZAA==", "dev": true, "license": "MIT" }, "node_modules/@tailwindcss/node": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.0.0.tgz", - "integrity": "sha512-tfG2uBvo6j6kDIPmntxwXggCOZAt7SkpAXJ6pTIYirNdk5FBqh/CZZ9BZPpgcl/tNFLs6zc4yghM76sqiELG9g==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.0.3.tgz", + "integrity": "sha512-QsVJokOl0pJ4AbJV33D2npvLcHGPWi5MOSZtrtE0GT3tSx+3D0JE2lokLA8yHS1x3oCY/3IyRyy7XX6tmzid7A==", "dev": true, "license": "MIT", "dependencies": { "enhanced-resolve": "^5.18.0", "jiti": "^2.4.2", - "tailwindcss": "4.0.0" + "tailwindcss": "4.0.3" } }, "node_modules/@tailwindcss/node/node_modules/jiti": { @@ -2630,33 +2510,40 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/@tailwindcss/node/node_modules/tailwindcss": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.0.3.tgz", + "integrity": "sha512-ImmZF0Lon5RrQpsEAKGxRvHwCvMgSC4XVlFRqmbzTEDb/3wvin9zfEZrMwgsa3yqBbPqahYcVI6lulM2S7IZAA==", + "dev": true, + "license": "MIT" + }, "node_modules/@tailwindcss/oxide": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.0.0.tgz", - "integrity": "sha512-W3FjpJgy4VV1JiL7iBYDf2n/WkeDg1Il+0Q7eWnqPyvkPPCo/Mbwc5BiaT7dfBNV6tQKAhVE34rU5xl8pSl50w==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.0.3.tgz", + "integrity": "sha512-FFcp3VNvRjjmFA39ORM27g2mbflMQljhvM7gxBAujHxUy4LXlKa6yMF9wbHdTbPqTONiCyyOYxccvJyVyI/XBg==", "dev": true, "license": "MIT", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.0.0", - "@tailwindcss/oxide-darwin-arm64": "4.0.0", - "@tailwindcss/oxide-darwin-x64": "4.0.0", - "@tailwindcss/oxide-freebsd-x64": "4.0.0", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.0", - "@tailwindcss/oxide-linux-arm64-gnu": "4.0.0", - "@tailwindcss/oxide-linux-arm64-musl": "4.0.0", - "@tailwindcss/oxide-linux-x64-gnu": "4.0.0", - "@tailwindcss/oxide-linux-x64-musl": "4.0.0", - "@tailwindcss/oxide-win32-arm64-msvc": "4.0.0", - "@tailwindcss/oxide-win32-x64-msvc": "4.0.0" + "@tailwindcss/oxide-android-arm64": "4.0.3", + "@tailwindcss/oxide-darwin-arm64": "4.0.3", + "@tailwindcss/oxide-darwin-x64": "4.0.3", + "@tailwindcss/oxide-freebsd-x64": "4.0.3", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.0.3", + "@tailwindcss/oxide-linux-arm64-gnu": "4.0.3", + "@tailwindcss/oxide-linux-arm64-musl": "4.0.3", + "@tailwindcss/oxide-linux-x64-gnu": "4.0.3", + "@tailwindcss/oxide-linux-x64-musl": "4.0.3", + "@tailwindcss/oxide-win32-arm64-msvc": "4.0.3", + "@tailwindcss/oxide-win32-x64-msvc": "4.0.3" } }, "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.0.0.tgz", - "integrity": "sha512-EAhjU0+FIdyGPR+7MbBWubLLPtmOu+p7c2egTTFBRk/n//zYjNvVK0WhcBK5Y7oUB5mo4EjA2mCbY7dcEMWSRw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.0.3.tgz", + "integrity": "sha512-S8XOTQuMnpijZRlPm5HBzPJjZ28quB+40LSRHjRnQF6rRYKsvpr1qkY7dfwsetNdd+kMLOMDsvmuT8WnqqETvg==", "cpu": [ "arm64" ], @@ -2671,9 +2558,9 @@ } }, "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.0.0.tgz", - "integrity": "sha512-hdz4xnSWS11cIp+7ye+3dGHqs0X33z+BXXTtgPOguDWVa+TdXUzwxonklSzf5wlJFuot3dv5eWzhlNai0oYYQg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.0.3.tgz", + "integrity": "sha512-smrY2DpzhXvgDhZtQlYAl8+vxJ04lv2/64C1eiRxvsRT2nkw/q+zA1/eAYKvUHat6cIuwqDku3QucmrUT6pCeg==", "cpu": [ "arm64" ], @@ -2688,9 +2575,9 @@ } }, "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.0.0.tgz", - "integrity": "sha512-+dOUUaXTkPKKhtUI9QtVaYg+MpmLh2CN0dHohiYXaBirEyPMkjaT0zbRgzQlNnQWjCVVXPQluIEb0OMEjSTH+Q==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.0.3.tgz", + "integrity": "sha512-NTz8x/LcGUjpZAWUxz0ZuzHao90Wj9spoQgomwB+/hgceh5gcJDfvaBYqxLFpKzVglpnbDSq1Fg0p0zI4oa5Pg==", "cpu": [ "x64" ], @@ -2705,9 +2592,9 @@ } }, "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.0.0.tgz", - "integrity": "sha512-CJhGDhxnrmu4SwyC62fA+wP24MhA/TZlIhRHqg1kRuIHoGoVR2uSSm1qxTxU37tSSZj8Up0q6jsBJCAP4k7rgQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.0.3.tgz", + "integrity": "sha512-yQc9Q0JCOp3kkAV8gKgDctXO60IkQhHpqGB+KgOccDtD5UmN6Q5+gd+lcsDyQ7N8dRuK1fAud51xQpZJgKfm7g==", "cpu": [ "x64" ], @@ -2722,9 +2609,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.0.0.tgz", - "integrity": "sha512-Wy7Av0xzXfY2ujZBcYy4+7GQm25/J1iHvlQU2CfwdDCuPWfIjYzR6kggz+uVdSJyKV2s64znchBxRE8kV4uXSA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.0.3.tgz", + "integrity": "sha512-e1ivVMLSnxTOU1O3npnxN16FEyWM/g3SuH2pP6udxXwa0/SnSAijRwcAYRpqIlhVKujr158S8UeHxQjC4fGl4w==", "cpu": [ "arm" ], @@ -2739,9 +2626,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.0.0.tgz", - "integrity": "sha512-srwBo2l6pvM0swBntc1ucuhGsfFOLkqPRFQ3dWARRTfSkL1U9nAsob2MKc/n47Eva/W9pZZgMOuf7rDw8pK1Ew==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.0.3.tgz", + "integrity": "sha512-PLrToqQqX6sdJ9DmMi8IxZWWrfjc9pdi9AEEPTrtMts3Jm9HBi1WqEeF1VwZZ2aW9TXloE5OwA35zuuq1Bhb/Q==", "cpu": [ "arm64" ], @@ -2756,9 +2643,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.0.0.tgz", - "integrity": "sha512-abhusswkduYWuezkBmgo0K0/erGq3M4Se5xP0fhc/0dKs0X/rJUYYCFWntHb3IGh3aVzdQ0SXJs93P76DbUqtw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.0.3.tgz", + "integrity": "sha512-YlzRxx7N1ampfgSKzEDw0iwDkJXUInR4cgNEqmR4TzHkU2Vhg59CGPJrTI7dxOBofD8+O35R13Nk9Ytyv0JUFg==", "cpu": [ "arm64" ], @@ -2773,9 +2660,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.0.0.tgz", - "integrity": "sha512-hGtRYIUEx377/HlU49+jvVKKwU1MDSKYSMMs0JFO2Wp7LGxk5+0j5+RBk9NFnmp/lbp32yPTgIOO5m1BmDq36A==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.0.3.tgz", + "integrity": "sha512-Xfc3z/li6XkuD7Hs+Uk6pjyCXnfnd9zuQTKOyDTZJ544xc2yoMKUkuDw6Et9wb31MzU2/c0CIUpTDa71lL9KHw==", "cpu": [ "x64" ], @@ -2790,9 +2677,9 @@ } }, "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.0.0.tgz", - "integrity": "sha512-7xgQgSAThs0I14VAgmxpJnK6XFSZBxHMGoDXkLyYkEnu+8WRQMbCP93dkCUn2PIv+Q+JulRgc00PJ09uORSLXQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.0.3.tgz", + "integrity": "sha512-ugKVqKzwa/cjmqSQG17aS9DYrEcQ/a5NITcgmOr3JLW4Iz64C37eoDlkC8tIepD3S/Td/ywKAolTQ8fKbjEL4g==", "cpu": [ "x64" ], @@ -2807,9 +2694,9 @@ } }, "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.0.0.tgz", - "integrity": "sha512-qEcgTIPcWY5ZE7f6VxQ/JPrSFMcehzVIlZj7sGE3mVd5YWreAT+Fl1vSP8q2pjnWXn0avZG3Iw7a2hJQAm+fTQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.0.3.tgz", + "integrity": "sha512-qHPDMl+UUwsk1RMJMgAXvhraWqUUT+LR/tkXix5RA39UGxtTrHwsLIN1AhNxI5i2RFXAXfmFXDqZCdyQ4dWmAQ==", "cpu": [ "arm64" ], @@ -2824,9 +2711,9 @@ } }, "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.0.0.tgz", - "integrity": "sha512-bqT0AY8RXb8GMDy28JtngvqaOSB2YixbLPLvUo6I6lkvvUwA6Eqh2Tj60e2Lh7O/k083f8tYiB0WEK4wmTI7Jg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.0.3.tgz", + "integrity": "sha512-+ujwN4phBGyOsPyLgGgeCyUm4Mul+gqWVCIGuSXWgrx9xVUnf6LVXrw0BDBc9Aq1S2qMyOTX4OkCGbZeoIo8Qw==", "cpu": [ "x64" ], @@ -3537,24 +3424,28 @@ } }, "node_modules/algoliasearch": { - "version": "4.14.2", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.20.1.tgz", + "integrity": "sha512-SiCOCVBCQUg/aWkfMnjT+8TQxNNFlPZTI7v8y4+aZXzJg6zDIzKy9KcYVS4sc+xk5cwW5hyJ+9z836f4+wvgzA==", "dev": true, "license": "MIT", "dependencies": { - "@algolia/cache-browser-local-storage": "4.14.2", - "@algolia/cache-common": "4.14.2", - "@algolia/cache-in-memory": "4.14.2", - "@algolia/client-account": "4.14.2", - "@algolia/client-analytics": "4.14.2", - "@algolia/client-common": "4.14.2", - "@algolia/client-personalization": "4.14.2", - "@algolia/client-search": "4.14.2", - "@algolia/logger-common": "4.14.2", - "@algolia/logger-console": "4.14.2", - "@algolia/requester-browser-xhr": "4.14.2", - "@algolia/requester-common": "4.14.2", - "@algolia/requester-node-http": "4.14.2", - "@algolia/transporter": "4.14.2" + "@algolia/client-abtesting": "5.20.1", + "@algolia/client-analytics": "5.20.1", + "@algolia/client-common": "5.20.1", + "@algolia/client-insights": "5.20.1", + "@algolia/client-personalization": "5.20.1", + "@algolia/client-query-suggestions": "5.20.1", + "@algolia/client-search": "5.20.1", + "@algolia/ingestion": "1.20.1", + "@algolia/monitoring": "1.20.1", + "@algolia/recommend": "5.20.1", + "@algolia/requester-browser-xhr": "5.20.1", + "@algolia/requester-fetch": "5.20.1", + "@algolia/requester-node-http": "5.20.1" + }, + "engines": { + "node": ">= 14.0.0" } }, "node_modules/ansi-html-community": { @@ -9163,6 +9054,14 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/search-insights": { + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.3.tgz", + "integrity": "sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/select-hose": { "version": "2.0.0", "dev": true, diff --git a/package.json b/package.json index 4e7209cf..7b96ac37 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "devDependencies": { "@babel/core": "^7.14.8", "@babel/preset-env": "^7.14.8", - "@docsearch/js": "^3.0.0-alpha.42", + "@docsearch/js": "^3.8.3", "@tailwindcss/cli": "^4.0.0", "@tailwindcss/postcss": "^4.0.0", "@typescript-eslint/eslint-plugin": "^5.46.1", diff --git a/src/docs.js b/src/docs.js index a86dc867..3bdca32c 100644 --- a/src/docs.js +++ b/src/docs.js @@ -1,559 +1,233 @@ -// css for docs import docsearch from '@docsearch/js'; // Algolia docsearch -docsearch({ - container: '#docsearch', +const initDocSearch = () => { + const searchConfig = { appId: 'JUWZAHYJQ9', indexName: 'flowbite', apiKey: '63250f7f96b4ea48c49dbd149aab687c', placeholder: 'Search documentation', -}); + }; -docsearch({ - container: '#docsearch-mobile', - appId: 'JUWZAHYJQ9', - indexName: 'flowbite', - apiKey: '63250f7f96b4ea48c49dbd149aab687c', - placeholder: 'Search documentation', -}); + docsearch({ ...searchConfig, container: '#docsearch' }); + docsearch({ ...searchConfig, container: '#docsearch-mobile' }); +}; -// copy to clipboard +// Fallback for older browsers const fallbackCopyTextToClipboard = (text) => { - var textArea = document.createElement('textarea'); - textArea.value = text; - - // Avoid scrolling to bottom - textArea.style.top = '0'; - textArea.style.left = '0'; - textArea.style.position = 'fixed'; - - document.body.appendChild(textArea); - textArea.focus(); - textArea.select(); - - try { - var successful = document.execCommand('copy'); - var msg = successful ? 'successful' : 'unsuccessful'; - console.log('Fallback: Copying text command was ' + msg); - } catch (err) { - console.error('Fallback: Oops, unable to copy', err); - } - - document.body.removeChild(textArea); + const textArea = document.createElement('textarea'); + textArea.value = text; + textArea.style.position = 'fixed'; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + + try { + const successful = document.execCommand('copy'); + console.log(`Fallback: Copying text command was ${successful ? 'successful' : 'unsuccessful'}`); + } catch (err) { + console.error('Fallback: Oops, unable to copy', err); + } + + document.body.removeChild(textArea); }; const copyTextToClipboard = (text) => { - if (!navigator.clipboard) { - fallbackCopyTextToClipboard(text); - return; - } - navigator.clipboard.writeText(text).then( - function () { - console.log('Async: Copying to clipboard was successful!'); - }, - function (err) { - console.error('Async: Could not copy text: ', err); - } - ); + if (!navigator.clipboard) { + fallbackCopyTextToClipboard(text); + return; + } + + navigator.clipboard.writeText(text) + .then(() => console.log('Async: Copying to clipboard was successful!')) + .catch((err) => console.error('Async: Could not copy text: ', err)); }; +// Clipboard copy function initialization const initiateCopyToClipboard = (element) => { - var button = element.getElementsByClassName('copy-to-clipboard-button')[0]; + const button = element.querySelector('.copy-to-clipboard-button'); + const alert = document.getElementById('copied-code-alert'); + const copyText = button.querySelector('.copy-text'); - var alert = document.getElementById('copied-code-alert'); - var copyText = button.getElementsByClassName('copy-text')[0]; - button.addEventListener('click', function () { - var textToCopy = ''; - if ( - button.getAttribute('data-clipboard-content-type') === 'javascript' - ) { - textToCopy = element - .querySelector('[data-clipboard-content-javascript]') - .getAttribute('data-clipboard-content-javascript'); - } else { - textToCopy = element - .querySelector('[data-clipboard-content-html]') - .getAttribute('data-clipboard-content-html'); - } - copyTextToClipboard(textToCopy); - alert.classList.remove('opacity-0', 'hidden'); - alert.classList.add('opacity-100', 'flex'); - copyText.innerHTML = 'Copied'; + button.addEventListener('click', () => { + const contentType = button.getAttribute('data-clipboard-content-type'); + const textToCopy = element.querySelector(`[data-clipboard-content-${contentType}]`).getAttribute(`data-clipboard-content-${contentType}`); - setTimeout(function () { - alert.classList.add('opacity-0', 'hidden'); - alert.classList.remove('opacity-100', 'flex'); - copyText.innerHTML = 'Copy'; - }, 3000); - }); + copyTextToClipboard(textToCopy); + alert.classList.remove('opacity-0', 'hidden'); + alert.classList.add('opacity-100', 'flex'); + copyText.innerHTML = 'Copied'; + + setTimeout(() => { + alert.classList.add('opacity-0', 'hidden'); + alert.classList.remove('opacity-100', 'flex'); + copyText.innerHTML = 'Copy'; + }, 3000); + }); }; +// Toggle code between HTML/JS const initiateToggleCodeTabs = (element) => { - const toggleHTMLCodeButton = element.querySelector( - '[data-toggle-html-code' - ); - const toggleJavaScriptCodeButton = element.querySelector( - '[data-toggle-javascript-code' - ); - const htmlCodeWrapper = element.querySelector('[data-code-wrapper-html]'); - const javaScriptCodeWrapper = element.querySelector( - '[data-code-wrapper-javascript]' - ); - const copyClipboardButton = element.getElementsByClassName( - 'copy-to-clipboard-button' - )[0]; - - if (toggleJavaScriptCodeButton) { - toggleHTMLCodeButton.addEventListener('click', () => { - javaScriptCodeWrapper.classList.add('hidden'); - htmlCodeWrapper.classList.remove('hidden'); - copyClipboardButton.setAttribute( - 'data-clipboard-content-type', - 'html' - ); - toggleHTMLCodeButton.classList.add( - '!bg-gray-200', - 'dark:!bg-gray-700' - ); - toggleJavaScriptCodeButton.classList.remove( - '!bg-gray-200', - 'dark:!bg-gray-700' - ); - expandCode(element); - }); + const toggleHTMLCodeButton = element.querySelector('[data-toggle-html-code]'); + const toggleJavaScriptCodeButton = element.querySelector('[data-toggle-javascript-code]'); + const htmlCodeWrapper = element.querySelector('[data-code-wrapper-html]'); + const javaScriptCodeWrapper = element.querySelector('[data-code-wrapper-javascript]'); + const copyClipboardButton = element.querySelector('.copy-to-clipboard-button'); + + if (toggleJavaScriptCodeButton) { + toggleHTMLCodeButton.addEventListener('click', () => { + javaScriptCodeWrapper.classList.add('hidden'); + htmlCodeWrapper.classList.remove('hidden'); + copyClipboardButton.setAttribute('data-clipboard-content-type', 'html'); + toggleHTMLCodeButton.classList.add('!bg-gray-200', 'dark:!bg-gray-700'); + toggleJavaScriptCodeButton.classList.remove('!bg-gray-200', 'dark:!bg-gray-700'); + expandCode(element); + }); - toggleJavaScriptCodeButton.addEventListener('click', () => { - htmlCodeWrapper.classList.add('hidden'); - javaScriptCodeWrapper.classList.remove('hidden'); - copyClipboardButton.setAttribute( - 'data-clipboard-content-type', - 'javascript' - ); - toggleHTMLCodeButton.classList.remove( - '!bg-gray-200', - 'dark:!bg-gray-700' - ); - toggleJavaScriptCodeButton.classList.add( - '!bg-gray-200', - 'dark:!bg-gray-700' - ); - expandCode(element); - }); - } + toggleJavaScriptCodeButton.addEventListener('click', () => { + htmlCodeWrapper.classList.add('hidden'); + javaScriptCodeWrapper.classList.remove('hidden'); + copyClipboardButton.setAttribute('data-clipboard-content-type', 'javascript'); + toggleHTMLCodeButton.classList.remove('!bg-gray-200', 'dark:!bg-gray-700'); + toggleJavaScriptCodeButton.classList.add('!bg-gray-200', 'dark:!bg-gray-700'); + expandCode(element); + }); + } }; +// Expand code block const expandCode = (element) => { - var expandCodeButton = element.querySelector('[data-expand-code]'); - var codeWrapperEl = element.querySelector('[data-code-wrapper]'); - - expandCodeButton.classList.remove('hidden'); - codeWrapperEl.classList.remove('max-h-72'); - expandCodeButton.classList.add('hidden'); + const expandCodeButton = element.querySelector('[data-expand-code]'); + const codeWrapperEl = element.querySelector('[data-code-wrapper]'); + expandCodeButton.classList.remove('hidden'); + codeWrapperEl.classList.remove('max-h-72'); + expandCodeButton.classList.add('hidden'); }; const initiateExpandCode = (element) => { - var expandCodeButton = element.querySelector('[data-expand-code]'); - var codeWrapperEl = element.querySelector('[data-code-wrapper]'); - var codeWrapperHeight = codeWrapperEl.offsetHeight; + const expandCodeButton = element.querySelector('[data-expand-code]'); + const codeWrapperEl = element.querySelector('[data-code-wrapper]'); + const codeWrapperHeight = codeWrapperEl.offsetHeight; - if (codeWrapperHeight > 250) { - expandCodeButton.classList.remove('hidden'); - } + if (codeWrapperHeight > 250) { + expandCodeButton.classList.remove('hidden'); + } - expandCodeButton.addEventListener('click', () => { - codeWrapperEl.classList.remove('max-h-72'); - expandCodeButton.classList.add('hidden'); - }); + expandCodeButton.addEventListener('click', () => { + codeWrapperEl.classList.remove('max-h-72'); + expandCodeButton.classList.add('hidden'); + }); }; +// Dark mode and RTL updates const updateiFrameDarkMode = (iFrame, theme) => { - let html = iFrame.contentDocument.querySelector('html'); - - if (theme === 'dark') { - html.classList.add('dark'); - } else { - html.classList.remove('dark'); - } + const html = iFrame.contentDocument.querySelector('html'); + html.classList.toggle('dark', theme === 'dark'); }; const updateiFrameRTL = (iFrame, direction) => { - let html = iFrame.contentDocument.querySelector('html'); - - if (direction === 'rtl') { - html.setAttribute('dir', 'rtl'); - } else { - html.removeAttribute('dir'); - } + const html = iFrame.contentDocument.querySelector('html'); + html.setAttribute('dir', direction === 'rtl' ? 'rtl' : ''); }; +// Initialize dark mode toggle for previews const updatePreviewThemeToggleButton = (darkModeButtonEl, theme) => { - const moonIconEl = darkModeButtonEl.querySelector( - '[data-toggle-icon="moon"]' - ); - const sunIconEl = darkModeButtonEl.querySelector( - '[data-toggle-icon="sun"]' - ); - const tooltipId = darkModeButtonEl.getAttribute('data-tooltip-target'); - let buttonTextEl = null; - if (tooltipId) { - buttonTextEl = document.getElementById( - darkModeButtonEl.getAttribute('data-tooltip-target') - ); - } - - if (theme === 'dark') { - darkModeButtonEl.setAttribute('data-toggle-dark', 'dark'); - moonIconEl.classList.add('hidden'); - sunIconEl.classList.remove('hidden'); - if (tooltipId) { - buttonTextEl.querySelector('.tooltip-text').textContent = - 'Toggle light mode'; - } - } else { - darkModeButtonEl.setAttribute('data-toggle-dark', 'light'); - moonIconEl.classList.remove('hidden'); - sunIconEl.classList.add('hidden'); - if (tooltipId) { - buttonTextEl.querySelector('.tooltip-text').textContent = - 'Toggle dark mode'; - } - } -}; - -const initiatePreviewState = (element) => { - var codePreviewWrapper = element.getElementsByClassName( - 'code-preview-wrapper' - )[0]; - var iframeCodeEl = element.getElementsByClassName('iframe-code')[0]; - var darkModeButton = element.getElementsByClassName( - 'toggle-dark-state-example' - )[0]; - var fullViewButton = element.getElementsByClassName('toggle-full-view')[0]; - var tabletViewButton = - element.getElementsByClassName('toggle-tablet-view')[0]; - var mobileViewButton = - element.getElementsByClassName('toggle-mobile-view')[0]; - var RTLButton = element.getElementsByClassName('toggle-rtl')[0]; - - if (RTLButton) { - RTLButton.addEventListener('click', () => { - var RTLstate = RTLButton.getAttribute('data-toggle-direction'); - - if (RTLstate === 'ltr') { - RTLButton.setAttribute('data-toggle-direction', 'rtl'); - updateiFrameRTL(iframeCodeEl, 'rtl'); - RTLButton.textContent = 'LTR'; - RTLButton.nextElementSibling.querySelector( - '.tooltip-text' - ).textContent = 'Toggle LTR mode'; - } - - if (RTLstate === 'rtl') { - RTLButton.setAttribute('data-toggle-direction', 'ltr'); - updateiFrameRTL(iframeCodeEl, 'ltr'); - RTLButton.textContent = 'RTL'; - RTLButton.nextElementSibling.querySelector( - '.tooltip-text' - ).textContent = 'Toggle RTL mode'; - } - }); + const moonIconEl = darkModeButtonEl.querySelector('[data-toggle-icon="moon"]'); + const sunIconEl = darkModeButtonEl.querySelector('[data-toggle-icon="sun"]'); + const tooltipId = darkModeButtonEl.getAttribute('data-tooltip-target'); + const buttonTextEl = tooltipId ? document.getElementById(tooltipId) : null; + + if (theme === 'dark') { + darkModeButtonEl.setAttribute('data-toggle-dark', 'dark'); + moonIconEl.classList.add('hidden'); + sunIconEl.classList.remove('hidden'); + if (buttonTextEl) { + buttonTextEl.querySelector('.tooltip-text').textContent = 'Toggle light mode'; } - - if (darkModeButton) { - darkModeButton.addEventListener('click', function () { - var state = darkModeButton.getAttribute('data-toggle-dark'); - - if (state === 'light') { - codePreviewWrapper.classList.add('dark'); - updatePreviewThemeToggleButton(darkModeButton, 'dark'); - updateiFrameDarkMode(iframeCodeEl, 'dark'); - } - if (state === 'dark') { - codePreviewWrapper.classList.remove('dark'); - updatePreviewThemeToggleButton(darkModeButton, 'light'); - updateiFrameDarkMode(iframeCodeEl, 'light'); - } - }); - } - - if (mobileViewButton) { - mobileViewButton.addEventListener('click', () => { - const theme = darkModeButton.getAttribute('data-toggle-dark'); - const direction = RTLButton.getAttribute('data-toggle-direction'); - iframeCodeEl.classList.add('max-w-sm'); - iframeCodeEl.classList.add('max-w-lg'); - iframeCodeEl.contentWindow.location.reload(); - iframeCodeEl.classList.add('opacity-0'); - iframeCodeEl.onload = () => { - updateiFrameHeight(iframeCodeEl); - updateiFrameDarkMode(iframeCodeEl, theme); - updateiFrameRTL(iframeCodeEl, direction); - }; - setTimeout(() => { - iframeCodeEl.classList.remove('opacity-0'); - }, 500); - }); - } - if (tabletViewButton) { - tabletViewButton.addEventListener('click', () => { - const theme = darkModeButton.getAttribute('data-toggle-dark'); - const direction = RTLButton.getAttribute('data-toggle-direction'); - iframeCodeEl.classList.add('max-w-lg'); - iframeCodeEl.classList.remove('max-w-sm'); - iframeCodeEl.contentWindow.location.reload(); - iframeCodeEl.classList.add('opacity-0'); - iframeCodeEl.onload = () => { - updateiFrameHeight(iframeCodeEl); - updateiFrameDarkMode(iframeCodeEl, theme); - updateiFrameRTL(iframeCodeEl, direction); - }; - setTimeout(() => { - iframeCodeEl.classList.remove('opacity-0'); - }, 500); - }); - } - if (fullViewButton) { - fullViewButton.addEventListener('click', () => { - const theme = darkModeButton.getAttribute('data-toggle-dark'); - const direction = RTLButton.getAttribute('data-toggle-direction'); - iframeCodeEl.classList.remove('max-w-sm', 'max-w-lg'); - iframeCodeEl.contentWindow.location.reload(); - iframeCodeEl.classList.add('opacity-0'); - iframeCodeEl.onload = () => { - updateiFrameHeight(iframeCodeEl); - updateiFrameDarkMode(iframeCodeEl, theme); - updateiFrameRTL(iframeCodeEl, direction); - }; - setTimeout(() => { - iframeCodeEl.classList.remove('opacity-0'); - }, 500); - }); + } else { + darkModeButtonEl.setAttribute('data-toggle-dark', 'light'); + moonIconEl.classList.remove('hidden'); + sunIconEl.classList.add('hidden'); + if (buttonTextEl) { + buttonTextEl.querySelector('.tooltip-text').textContent = 'Toggle dark mode'; } -}; - -const updateiFrameHeight = (iFrame) => { - setTimeout(() => { - iFrame.nextElementSibling.classList.add('hidden'); - iFrame.style.height = - iFrame.contentWindow.document.body.scrollHeight + 'px'; - }, 500); -}; - -const updateiFrameCodeElsDarkMode = (theme) => { - const iframeCodeEls = document.querySelectorAll('.iframe-code'); - iframeCodeEls.forEach((i) => { - updateiFrameDarkMode(i, theme); - }); -}; - -const initializeCodeExamples = (theme) => { - const codeExampleEls = document.querySelectorAll('.code-example'); - - codeExampleEls.forEach((c) => { - const iframe = c.querySelector('.iframe-code'); - updateiFrameHeight(iframe); - updateiFrameDarkMode(iframe, theme); - initiateCopyToClipboard(c); - initiateExpandCode(c); - initiateToggleCodeTabs(c); - }); + } }; const updateButtonThemeToggleEls = (theme) => { - const buttonThemeToggleEls = document.querySelectorAll( - '.toggle-dark-state-example' - ); - buttonThemeToggleEls.forEach((b) => { - updatePreviewThemeToggleButton(b, theme); - }); + document.querySelectorAll('.toggle-dark-state-example').forEach((b) => { + updatePreviewThemeToggleButton(b, theme); + }); }; -window.addEventListener('load', () => { - // set menu item location scroll - const currentHref = window.location.href; - const sidebarItemEls = document.querySelectorAll('[data-sidebar-item]'); - const sidenav = document.getElementById('navWrapper'); - const sidenavHeight = sidenav.clientHeight; - - sidebarItemEls.forEach((s) => { - if (s.href === currentHref) { - const itemHeight = s.clientHeight; - sidenav.scrollTop = - s.offsetTop - sidenavHeight / 2 + itemHeight / 2; - } +// Initialize preview and theme management +const initializePreviewState = (element) => { + const codePreviewWrapper = element.querySelector('.code-preview-wrapper'); + const iframeCodeEl = element.querySelector('.iframe-code'); + const darkModeButton = element.querySelector('.toggle-dark-state-example'); + const fullViewButton = element.querySelector('.toggle-full-view'); + const tabletViewButton = element.querySelector('.toggle-tablet-view'); + const mobileViewButton = element.querySelector('.toggle-mobile-view'); + const RTLButton = element.querySelector('.toggle-rtl'); + + if (darkModeButton) { + darkModeButton.addEventListener('click', () => { + const state = darkModeButton.getAttribute('data-toggle-dark'); + const newTheme = state === 'light' ? 'dark' : 'light'; + document.documentElement.classList.toggle('dark', newTheme === 'dark'); + localStorage.setItem('color-theme', newTheme); + updateiFrameCodeElsDarkMode(newTheme); + updateButtonThemeToggleEls(newTheme); }); - - // toggle dark mode - var themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon'); - var themeToggleLightIcon = document.getElementById( - 'theme-toggle-light-icon' - ); - - // Change the icons inside the button based on previous settings - if ( - localStorage.getItem('color-theme') === 'dark' || - (!('color-theme' in localStorage) && - window.matchMedia('(prefers-color-scheme: dark)').matches) - ) { - themeToggleLightIcon.classList.remove('hidden'); - initializeCodeExamples('dark'); - updateButtonThemeToggleEls('dark'); - } else { - themeToggleDarkIcon.classList.remove('hidden'); - initializeCodeExamples('light'); - updateButtonThemeToggleEls('light'); - } - - var themeToggleBtn = document.getElementById('theme-toggle'); - - themeToggleBtn.addEventListener('click', function () { - // toggle icons - themeToggleDarkIcon.classList.toggle('hidden'); - themeToggleLightIcon.classList.toggle('hidden'); - - // if set via local storage previously - if (localStorage.getItem('color-theme')) { - if (localStorage.getItem('color-theme') === 'light') { - document.documentElement.classList.add('dark'); - localStorage.setItem('color-theme', 'dark'); - updateiFrameCodeElsDarkMode('dark'); - updateButtonThemeToggleEls('dark'); - } else { - document.documentElement.classList.remove('dark'); - localStorage.setItem('color-theme', 'light'); - updateiFrameCodeElsDarkMode('light'); - updateButtonThemeToggleEls('light'); - } - - // if NOT set via local storage previously - } else { - if (document.documentElement.classList.contains('dark')) { - document.documentElement.classList.remove('dark'); - localStorage.setItem('color-theme', 'light'); - updateiFrameCodeElsDarkMode('light'); - updateButtonThemeToggleEls('light'); - } else { - document.documentElement.classList.add('dark'); - localStorage.setItem('color-theme', 'dark'); - updateiFrameCodeElsDarkMode('dark'); - updateButtonThemeToggleEls('dark'); - } - } - }); - - // sidebar functionality - const sidebar = document.getElementById('sidebar'); - - const toggleSidebarMobile = ( - sidebar, - sidebarBackdrop, - toggleSidebarMobileHamburger, - toggleSidebarMobileClose - ) => { - sidebar.classList.toggle('hidden'); - sidebarBackdrop.classList.toggle('hidden'); - toggleSidebarMobileHamburger.classList.toggle('hidden'); - toggleSidebarMobileClose.classList.toggle('hidden'); - }; - - const toggleSidebarMobileEl = document.getElementById( - 'toggleSidebarMobile' - ); - const sidebarBackdrop = document.getElementById('sidebarBackdrop'); - const toggleSidebarMobileHamburger = document.getElementById( - 'toggleSidebarMobileHamburger' - ); - const toggleSidebarMobileClose = document.getElementById( - 'toggleSidebarMobileClose' - ); - - toggleSidebarMobileEl.addEventListener('click', () => { - toggleSidebarMobile( - sidebar, - sidebarBackdrop, - toggleSidebarMobileHamburger, - toggleSidebarMobileClose - ); + } + + if (mobileViewButton) { + mobileViewButton.addEventListener('click', () => { + iframeCodeEl.classList.add('max-w-sm'); + iframeCodeEl.classList.remove('max-w-lg'); + iframeCodeEl.contentWindow.location.reload(); + iframeCodeEl.onload = () => { + updateiFrameHeight(iframeCodeEl); + updateiFrameDarkMode(iframeCodeEl, darkModeButton.getAttribute('data-toggle-dark')); + updateiFrameRTL(iframeCodeEl, RTLButton.getAttribute('data-toggle-direction')); + }; }); - - sidebarBackdrop.addEventListener('click', () => { - toggleSidebarMobile( - sidebar, - sidebarBackdrop, - toggleSidebarMobileHamburger, - toggleSidebarMobileClose - ); + } + + if (tabletViewButton) { + tabletViewButton.addEventListener('click', () => { + iframeCodeEl.classList.add('max-w-lg'); + iframeCodeEl.classList.remove('max-w-sm'); + iframeCodeEl.contentWindow.location.reload(); + iframeCodeEl.onload = () => { + updateiFrameHeight(iframeCodeEl); + updateiFrameDarkMode(iframeCodeEl, darkModeButton.getAttribute('data-toggle-dark')); + updateiFrameRTL(iframeCodeEl, RTLButton.getAttribute('data-toggle-direction')); + }; }); - - // current year - document.getElementById('currentYear').textContent = - new Date().getFullYear(); - - // copy to clipboard - var codeExamples = document.querySelectorAll('.code-example'); - codeExamples.forEach((c) => { - initiatePreviewState(c); - }); - // toc menu item activation - const deactivateMenuEl = (el) => { - el.classList.remove( - '!border-blue-700', - '!after:opacity-100', - '!text-blue-700', - 'dark:!border-blue-500', - 'dark:!text-blue-500' - ); - }; - - const allMenuEls = document.querySelectorAll('#TableOfContents [href]'); - const activateMenuEl = (el) => { - allMenuEls.forEach((el) => { - deactivateMenuEl(el); - }); - el.classList.add( - '!border-blue-700', - '!after:opacity-100', - '!text-blue-700', - 'dark:!border-blue-500', - 'dark:!text-blue-500' - ); - }; - - // anchor change activate menu element - let anchorChanged = false; - window.addEventListener('hashchange', () => { - anchorChanged = true; - const menuEl = document.querySelector( - `#TableOfContents [href="${location.hash}"]` - ); - activateMenuEl(menuEl); - setTimeout(() => { - anchorChanged = false; - }, 99); + } + + if (fullViewButton) { + fullViewButton.addEventListener('click', () => { + iframeCodeEl.classList.remove('max-w-sm', 'max-w-lg'); + iframeCodeEl.contentWindow.location.reload(); + iframeCodeEl.onload = () => { + updateiFrameHeight(iframeCodeEl); + updateiFrameDarkMode(iframeCodeEl, darkModeButton.getAttribute('data-toggle-dark')); + updateiFrameRTL(iframeCodeEl, RTLButton.getAttribute('data-toggle-direction')); + }; }); + } +}; - // toc on scroll activation - const contentAnchorTags = document.querySelectorAll( - '#mainContent > h2 > span[id], #mainContent > h3 > span[id], #mainContent > h4 > span[id], #mainContent > h5 > span[id], #mainContent > h6 > span[id]' - ); - contentAnchorTags.forEach((anchorEl) => { - window.addEventListener('scroll', () => { - var element = anchorEl; - var position = element.getBoundingClientRect(); +const updateiFrameHeight = (iFrame) => { + setTimeout(() => { + iFrame.nextElementSibling.classList.add('hidden'); + iFrame.style.height = `${iFrame.contentWindow.document.body.scrollHeight}px`; + }, 100); +}; - // checking whether fully visible - if ( - position.top + 140 >= 0 && - position.bottom + 140 <= window.innerHeight - ) { - const menuEl = document.querySelector( - `#TableOfContents [href="#${element.id}"]` - ); - if (!anchorChanged) { - activateMenuEl(menuEl); - } - } - }); - }); +// DOM Content Loaded Event +document.addEventListener('DOMContentLoaded', () => { + initDocSearch(); });