{"_id":"@capytale/capytale-md-editor","_rev":"2-3429e89cb42b90e9d3b511c69d75307a","name":"@capytale/capytale-md-editor","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@capytale/capytale-md-editor","version":"0.2.0","author":{"name":"Maverick Chardet"},"_id":"@capytale/capytale-md-editor@0.2.0","maintainers":[{"name":"capytale-bot","email":"contact@capytale.fr"},{"name":"tjaisson","email":"thomas.jaisson@ac-paris.fr"},{"name":"chardetm","email":"chardetm@gmail.com"},{"name":"casatir","email":"romain.casati@basthon.fr"}],"dist":{"shasum":"b7d80b4f9635f1ddc4ab7113d5fdc7a1e3911239","tarball":"https://registry.npmjs.org/@capytale/capytale-md-editor/-/capytale-md-editor-0.2.0.tgz","fileCount":149,"integrity":"sha512-RXAgsUkkU2LDJif8Xutt3Efy7AUUXseHpE+/UdykO13qhLWWF43bn0Fh64MhhA0cLytUI/DQ4JMokHOyLfedOA==","signatures":[{"sig":"MEUCIEZepUCQ7hn0XDDTpaONdrrBM482/bWVCH6fLkkVLs3jAiEAjqAxS6z/rUFqMZGaoQUABFaCOjjJm/2+YOlSTr1hY38=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5374481},"main":"dist/capytale-md-editor.umd.cjs","type":"module","module":"dist/capytale-md-editor.js","exports":{".":{"import":"./dist/capytale-md-editor.js","require":"./dist/capytale-md-editor.umd.cjs"},"./style.css":"./dist/style.css"},"gitHead":"0339fdbc752d8dc566c5cd72fceaf8bc1126e9d8","scripts":{"dev":"vite","lint":"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0","build":"tsc && vite build","preview":"vite preview","builddev":"tsc && vite build -m development","publish_major":"git push origin $(npm version major)","publish_minor":"git push origin $(npm version minor)","publish_patch":"git push origin $(npm version patch)"},"typings":"dist/capytale-md-editor.d.ts","_npmUser":{"name":"chardetm","email":"chardetm@gmail.com"},"_npmVersion":"9.8.1","description":"Capytale anti-cheat.","directories":{},"_nodeVersion":"18.18.0","dependencies":{"rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","remark-math":"^6.0.0","rehype-katex":"^7.0.0","react-markdown":"^9.0.1","react-bootstrap":"^2.7.0","remark-directive":"^3.0.0","@codemirror/commands":"^6.3.3","@codemirror/language":"^6.9.2","@uiw/react-codemirror":"^4.21.24","remark-directive-rehype":"^0.4.2","@codemirror/language-data":"^6.3.1","@fortawesome/react-fontawesome":"^0.2.0","@fortawesome/free-solid-svg-icons":"^6.5.1"},"_hasShrinkwrap":false,"devDependencies":{"sass":"^1.72.0","vite":"^4.5.0","react":"^18.2.0","eslint":"^8.45.0","prettier":"^3.0.3","bootstrap":"^5.3.2","react-dom":"^18.2.0","typescript":"^5.0.2","@types/node":"^20.6.3","@types/react":"^18.2.15","vite-plugin-dts":"^3.5.4","@types/react-dom":"^18.2.7","react-html-props":"^2.0.9","@vitejs/plugin-react":"^4.0.3","@typescript-eslint/parser":"^6.0.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/capytale-md-editor_0.2.0_1716999848289_0.40358371492111855","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-05-29T16:24:08.176Z","modified":"2026-02-27T17:26:34.797Z","0.2.0":"2024-05-29T16:24:08.567Z"},"author":{"name":"Maverick Chardet"},"description":"Capytale anti-cheat.","maintainers":[{"email":"romain.casati@basthon.fr","name":"casatir"},{"email":"thomas.jaisson@ac-paris.fr","name":"tjaisson"},{"email":"chardetm@gmail.com","name":"chardetm"},{"email":"corentin.martinot-lagarde@ac-paris.fr","name":"corentin_martinot"},{"email":"contact@capytale.fr","name":"capytale-bot"}],"readme":"# Capytale anti-cheat\n\nCapytale anti-cheat.\n\n# Test\n\n```bash\nnpm install\nnpm run dev\n```\n\n# Build\n\n```bash\nnpm install\nnpm run build\n```\n\n# How to use\n\n## Import\n\n```javascript\nimport {\n  CapytaleAntiCheat,\n  ContentHidingMethod,\n  ExitDetectionMethod,\n} from \"@capytale/capytale-anti-cheat\";\n```\n\n## Use\n\n```javascript\n<CapytaleAntiCheat\n// props\n>\n  Content to protect\n</CapytaleAntiCheat>\n```\n\n### Mandatory props\n\n#### Related to the activity\n\n- `isDirty` (`boolean`): When `true`, indicates that the activity has not been\n  saved by the student: this shows a warning before the link allowing the student\n  to leave the activity.\n- `startLocked` (`boolean`): Whether the activity should start locked. If set to\n  `true`, the activity will have to be unlocked before the student is able to\n  see the content. This is intended to be used when the activity has already\n  been opened by the student before.\n\n#### Related to the anti-cheat\n\n- `enabled` (`boolean`): Whether the anti-cheat is enabled. If set to `false`,\n  the content will be rendered directly.\n- `contentHidingMethod` (`enum ContentHidingMethod`): The method used to hide the content. Possible values are `ContentHidingMethod.REMOVE_FROM_DOM` (0) and `ContentHidingMethod.DISPLAY_NONE` (1).\n- `exitDetectionMethod` (`enum ExitDetectionMethod`): The method used to detect\n  exits. Possible values are `ExitDetectionMethod.BLUR` (0) and\n  `ExitDetectionMethod.VISIBILITY_CHANGE` (1).\n- `disableExitDetection` (`boolean`): Whether to disable exit detection. If set\n  to `true`, the user will be able to exit the activity without being flagged as\n  cheating.\n- `lockDelayMs` (`number`): The delay (in milliseconds) before the activity is\n  locked. This is intended to allow the program to disable the exit detection\n  if the focus went to an iframe controlled by the activity, for example.\n- `hashedPassword` (`string`): The hashed password of the user (using the Bcrypt\n  algorithm).\n\n#### Related to the server\n\n- `dbTouchFunction` (`() => Promise<any>`): The function to call when the user\n  is about to start the activity for the first time, intended to set a flag in\n  the database to remember that the user has started the activity. This function must return a promise that resolves when the flag has been set. If the promise rejects, the activity will not be rendered.\n\n### Optional props\n\n#### Related to the activity\n\n- `activityTitle` (`string`): The title of the activity.\n- `studentName` (`string`): The name of the student.\n- `returnUrl` (`string`): The URL to lead the student to when they exit the\n  activity.\n\n#### Related to the server\n\n- `dbTouchTimeoutMs` (`number`): The timeout (in milliseconds) for the promise\n  returned when `dbTouchFunction` is called (default: 10000). If the promise\n  does not resolve before the timeout, the promise will be considered rejected.\n\n#### Related to styling\n\n- `antiCheatClassName` (`string`): The class name of the anti-cheat container.\n- `contentClassName` (`string`): The class name of the content container.\n\n// Mandatory parameters\nactivityTitle={activityTitle}\ncontentHidingMethod={contentHidingMethod}\ndbTouchFunction={dbTouchFunction}\ndisableExitDetection={disableExitDetection}\nenabled={true}\nexitDetectionMethod={exitDetectionMethod}\nhashedPassword={hashedPassword}\nisDirty={isDirty}\nlockDelayMs={lockDelayMs}\nstartLocked={startLocked}\nstudentName={studentName}\n// Optional parameters\nantiCheatClassName=\"anti-cheat\"\ncontentClassName=\"content\"\nreturnUrl={hasReturnUrl ? returnUrl : undefined}\n","readmeFilename":"README.md"}