@a5gard/asgard 0.0.1
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/.env +2 -0
- package/.gitignore copy +6 -0
- package/.vscode/ntrsync/.vscode/ocrmnavigator/id.txt +1 -0
- package/.vscode/ntrsync/.vscode/ocrmnavigator.code-snippets +3664 -0
- package/.vscode/ntrsync/00002_CRM URGENT_todo.md +79 -0
- package/.vscode/ntrsync/10005_notes repo url.md +3 -0
- package/.vscode/ntrsync/10012_vscode_color_settings.md +133 -0
- package/.vscode/ntrsync/10013_Googles Snapchat Upload Hack note.md +11 -0
- package/.vscode/ntrsync/10014_APP IDEA - Lawyer CRM.md +229 -0
- package/.vscode/ntrsync/10015_APP IDEA - Onlyfans.md +293 -0
- package/.vscode/ntrsync/10016_notes repo url.md +3 -0
- package/.vscode/ntrsync/10504_adhd symptom.md +3 -0
- package/.vscode/ntrsync/10505_APP IDEA - GMAIL.md +39 -0
- package/.vscode/ntrsync/10506_container home - build mats.md +18 -0
- package/.vscode/ntrsync/10507_cleint facing site meta and loader function.md +25 -0
- package/.vscode/ntrsync/10508_Sabaak VSCode 1-8 players - private teams, solo q, duos q.md +11 -0
- package/.vscode/ntrsync/10509_schema dump.md +80 -0
- package/.vscode/ntrsync/10510_APPT BEACONHILL_reminder.md +7 -0
- package/.vscode/ntrsync/10512_clipboard very usefull should use asap within all apps.md +101 -0
- package/.vscode/ntrsync/10516_DevStack_todo.md +130 -0
- package/.vscode/ntrsync/10517_CRM_todo.md +95 -0
- package/.vscode/ntrsync/10518_Catalyst POS_todo.md +73 -0
- package/.vscode/ntrsync/10519_Catalyst Software_todo.md +497 -0
- package/.vscode/ntrsync/10523_new note.md +6 -0
- package/.vscode/ntrsync/10524_New Reminder_reminder.md +5 -0
- package/.vscode/ntrsync/10525_Mobile - Notes, To-Dos And Things_todo.md +4 -0
- package/.vscode/ntrsync/90002_COMPLETED_todo.md +97 -0
- package/.vscode/ntrsync/README.md +1 -0
- package/.vscode/ocrmnavigator/id.txt +1 -0
- package/.vscode/ocrmnavigator.code-snippets +349 -0
- package/.vscode/settings.json +1 -0
- package/CHANGELOG.md +6 -0
- package/LICENSE.md +21 -0
- package/README.md +1612 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +17 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/config.asgard +8 -0
- package/dist/commands/add-source.d.ts +9 -0
- package/dist/commands/add-source.d.ts.map +1 -0
- package/dist/commands/add-source.js +68 -0
- package/dist/commands/add-source.js.map +1 -0
- package/dist/commands/baldr.d.ts +5 -0
- package/dist/commands/baldr.d.ts.map +1 -0
- package/dist/commands/baldr.js +35 -0
- package/dist/commands/baldr.js.map +1 -0
- package/dist/commands/combine-timelines.d.ts +5 -0
- package/dist/commands/combine-timelines.d.ts.map +1 -0
- package/dist/commands/combine-timelines.js +53 -0
- package/dist/commands/combine-timelines.js.map +1 -0
- package/dist/commands/create-project.d.ts +10 -0
- package/dist/commands/create-project.d.ts.map +1 -0
- package/dist/commands/create-project.js +195 -0
- package/dist/commands/create-project.js.map +1 -0
- package/dist/commands/create-timeline.d.ts +8 -0
- package/dist/commands/create-timeline.d.ts.map +1 -0
- package/dist/commands/create-timeline.js +54 -0
- package/dist/commands/create-timeline.js.map +1 -0
- package/dist/commands/delete-project.d.ts +5 -0
- package/dist/commands/delete-project.d.ts.map +1 -0
- package/dist/commands/delete-project.js +47 -0
- package/dist/commands/delete-project.js.map +1 -0
- package/dist/commands/delete-source.d.ts +8 -0
- package/dist/commands/delete-source.d.ts.map +1 -0
- package/dist/commands/delete-source.js +57 -0
- package/dist/commands/delete-source.js.map +1 -0
- package/dist/commands/delete-timeline.d.ts +8 -0
- package/dist/commands/delete-timeline.d.ts.map +1 -0
- package/dist/commands/delete-timeline.js +54 -0
- package/dist/commands/delete-timeline.js.map +1 -0
- package/dist/commands/delete-version.d.ts +8 -0
- package/dist/commands/delete-version.d.ts.map +1 -0
- package/dist/commands/delete-version.js +65 -0
- package/dist/commands/delete-version.js.map +1 -0
- package/dist/commands/download-file.d.ts +17 -0
- package/dist/commands/download-file.d.ts.map +1 -0
- package/dist/commands/download-file.js +87 -0
- package/dist/commands/download-file.js.map +1 -0
- package/dist/commands/download-folder.d.ts +18 -0
- package/dist/commands/download-folder.d.ts.map +1 -0
- package/dist/commands/download-folder.js +111 -0
- package/dist/commands/download-folder.js.map +1 -0
- package/dist/commands/download-source.d.ts +12 -0
- package/dist/commands/download-source.d.ts.map +1 -0
- package/dist/commands/download-source.js +46 -0
- package/dist/commands/download-source.js.map +1 -0
- package/dist/commands/gh-setup.d.ts +7 -0
- package/dist/commands/gh-setup.d.ts.map +1 -0
- package/dist/commands/gh-setup.js +106 -0
- package/dist/commands/gh-setup.js.map +1 -0
- package/dist/commands/load-project.d.ts +5 -0
- package/dist/commands/load-project.d.ts.map +1 -0
- package/dist/commands/load-project.js +56 -0
- package/dist/commands/load-project.js.map +1 -0
- package/dist/commands/menu.d.ts +5 -0
- package/dist/commands/menu.d.ts.map +1 -0
- package/dist/commands/menu.js +41 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/midgardr.d.ts +5 -0
- package/dist/commands/midgardr.d.ts.map +1 -0
- package/dist/commands/midgardr.js +24 -0
- package/dist/commands/midgardr.js.map +1 -0
- package/dist/commands/publish-project.d.ts +5 -0
- package/dist/commands/publish-project.d.ts.map +1 -0
- package/dist/commands/publish-project.js +102 -0
- package/dist/commands/publish-project.js.map +1 -0
- package/dist/commands/replace-timeline.d.ts +8 -0
- package/dist/commands/replace-timeline.d.ts.map +1 -0
- package/dist/commands/replace-timeline.js +63 -0
- package/dist/commands/replace-timeline.js.map +1 -0
- package/dist/commands/restore-version.d.ts +8 -0
- package/dist/commands/restore-version.d.ts.map +1 -0
- package/dist/commands/restore-version.js +67 -0
- package/dist/commands/restore-version.js.map +1 -0
- package/dist/commands/save-project.d.ts +8 -0
- package/dist/commands/save-project.d.ts.map +1 -0
- package/dist/commands/save-project.js +43 -0
- package/dist/commands/save-project.js.map +1 -0
- package/dist/commands/set-source.d.ts +9 -0
- package/dist/commands/set-source.d.ts.map +1 -0
- package/dist/commands/set-source.js +59 -0
- package/dist/commands/set-source.js.map +1 -0
- package/dist/commands/switch-timeline.d.ts +8 -0
- package/dist/commands/switch-timeline.d.ts.map +1 -0
- package/dist/commands/switch-timeline.js +61 -0
- package/dist/commands/switch-timeline.js.map +1 -0
- package/dist/commands/sync-source.d.ts +5 -0
- package/dist/commands/sync-source.d.ts.map +1 -0
- package/dist/commands/sync-source.js +29 -0
- package/dist/commands/sync-source.js.map +1 -0
- package/dist/commands/upload-project+++.d.ts +5 -0
- package/dist/commands/upload-project+++.d.ts.map +1 -0
- package/dist/commands/upload-project+++.js +32 -0
- package/dist/commands/upload-project+++.js.map +1 -0
- package/dist/commands/upload-project++.d.ts +5 -0
- package/dist/commands/upload-project++.d.ts.map +1 -0
- package/dist/commands/upload-project++.js +33 -0
- package/dist/commands/upload-project++.js.map +1 -0
- package/dist/commands/upload-project+.d.ts +5 -0
- package/dist/commands/upload-project+.d.ts.map +1 -0
- package/dist/commands/upload-project+.js +40 -0
- package/dist/commands/upload-project+.js.map +1 -0
- package/dist/commands/upload-project.d.ts +5 -0
- package/dist/commands/upload-project.d.ts.map +1 -0
- package/dist/commands/upload-project.js +29 -0
- package/dist/commands/upload-project.js.map +1 -0
- package/dist/commands/view-timeline.d.ts +5 -0
- package/dist/commands/view-timeline.d.ts.map +1 -0
- package/dist/commands/view-timeline.js +39 -0
- package/dist/commands/view-timeline.js.map +1 -0
- package/dist/commands/view-versions.d.ts +5 -0
- package/dist/commands/view-versions.d.ts.map +1 -0
- package/dist/commands/view-versions.js +45 -0
- package/dist/commands/view-versions.js.map +1 -0
- package/dist/git/helpers.d.ts +10 -0
- package/dist/git/helpers.d.ts.map +1 -0
- package/dist/git/helpers.js +300 -0
- package/dist/git/helpers.js.map +1 -0
- package/dist/git/sync-repo.d.ts +2 -0
- package/dist/git/sync-repo.d.ts.map +1 -0
- package/dist/git/sync-repo.js +17 -0
- package/dist/git/sync-repo.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/box.d.ts +11 -0
- package/dist/utils/box.d.ts.map +1 -0
- package/dist/utils/box.js +158 -0
- package/dist/utils/box.js.map +1 -0
- package/ideas.md +46 -0
- package/package.json +53 -0
- package/src/commands/add-source.js +72 -0
- package/src/commands/baldr.js +38 -0
- package/src/commands/combine-timelines.js +65 -0
- package/src/commands/create-project.js +216 -0
- package/src/commands/create-timeline.js +60 -0
- package/src/commands/delete-project.js +54 -0
- package/src/commands/delete-source.js +63 -0
- package/src/commands/delete-timeline.js +63 -0
- package/src/commands/delete-version.js +74 -0
- package/src/commands/download-file.js +101 -0
- package/src/commands/download-folder.js +123 -0
- package/src/commands/download-source.js +51 -0
- package/src/commands/gh-setup.js +77 -0
- package/src/commands/load-project.js +63 -0
- package/src/commands/menu.js +46 -0
- package/src/commands/midgardr.js +25 -0
- package/src/commands/publish-project.js +167 -0
- package/src/commands/replace-timeline.js +76 -0
- package/src/commands/restore-version.js +80 -0
- package/src/commands/save-project.js +48 -0
- package/src/commands/set-source.js +65 -0
- package/src/commands/switch-timeline.js +69 -0
- package/src/commands/sync-source.js +32 -0
- package/src/commands/upload-project+++.js +34 -0
- package/src/commands/upload-project++.js +35 -0
- package/src/commands/upload-project+.js +47 -0
- package/src/commands/upload-project.js +31 -0
- package/src/commands/view-timeline.js +43 -0
- package/src/commands/view-versions.js +50 -0
- package/src/git/helpers.js +333 -0
- package/src/git/sync-repo.js +16 -0
- package/src/index.js +2 -0
- package/src/utils/box.js +282 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Error_Checking_Action": {
|
|
3
|
+
"prefix": "error-checking-action",
|
|
4
|
+
"body": [
|
|
5
|
+
"// needs to be contained in a <Form method='post' > or else it wont work no fetcher no anything",
|
|
6
|
+
"const phone = formPayload.phone;",
|
|
7
|
+
"const phoneRegex = /^[2-9]\\d{2}[2-9]\\d{2}\\d{4}$/;",
|
|
8
|
+
"const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.(ca|com)$/;",
|
|
9
|
+
"const errors = {",
|
|
10
|
+
" username: formPayload.username ? null : \"Full name is required...\",",
|
|
11
|
+
" year: formPayload.year.length === 4 ? null : \"Year needs to be a length of 4...\", ",
|
|
12
|
+
" email: formPayload.email ? null : \"Email is required...\",",
|
|
13
|
+
" phone: phoneRegex.test(phone) ? null : \"Phone must be in the format 4164164164\",",
|
|
14
|
+
" position: formPayload.userRole ? null : 'Position / Role is required...',",
|
|
15
|
+
" dept: formPayload.dept ? null : 'Dept is required...',",
|
|
16
|
+
" emailFormat: emailRegex.test(formPayload.email) ? null : 'Incorrect email format...',",
|
|
17
|
+
" phoneLength: phone.replace(/\\D/g, \"\").length === 10 ? null : 'Incorrect phone # length...', ",
|
|
18
|
+
"};",
|
|
19
|
+
"const hasErrors = Object.values(errors).some((errorMessage) => errorMessage);",
|
|
20
|
+
"if (hasErrors) { return json(errors); }",
|
|
21
|
+
"{errors?.username ? (<p className=\"text-[#ff0202] flex items-center\">{errors.username}</p>) : null}",
|
|
22
|
+
"{errors?.email ? (<p className=\"text-[#ff0202] flex items-center\">{errors.email}</p>) : null}",
|
|
23
|
+
"{errors?.phone ? (<p className=\"text-[#ff0202] flex items-center\">{errors.phone}</p>) : null}",
|
|
24
|
+
"{errors?.position ? (<p className=\"text-[#ff0202] flex items-center\">{errors.position}</p>) : null}",
|
|
25
|
+
"{errors?.dept ? (<p className=\"text-[#ff0202] flex items-center\">{errors.dept}</p>) : null}",
|
|
26
|
+
"{errors?.phoneLength ? (<p className=\"text-[#ff0202] flex items-center\">{errors.phoneLength}</p>) : null}",
|
|
27
|
+
"{errors?.emailFormat ? (<p className=\"text-[#ff0202] flex items-center\">{errors.emailFormat}</p>) : null}"
|
|
28
|
+
],
|
|
29
|
+
"description": "Custom snippet from error-checking-action.snippet.tsx",
|
|
30
|
+
"scope": "typescript,typescriptreact"
|
|
31
|
+
},
|
|
32
|
+
"map_function": {
|
|
33
|
+
"prefix": "map_function",
|
|
34
|
+
"body": [
|
|
35
|
+
"{categories.map((item, index) => {",
|
|
36
|
+
" return (",
|
|
37
|
+
" <SelectItem key={index} value={item.value}>",
|
|
38
|
+
" {item.name}",
|
|
39
|
+
" </SelectItem>",
|
|
40
|
+
" );",
|
|
41
|
+
"})}",
|
|
42
|
+
" <div className='grid gap-4'>",
|
|
43
|
+
" {customerCard.map((item, index) => {",
|
|
44
|
+
" return (",
|
|
45
|
+
" <div className=\"relative mr-3\" key={index}>",
|
|
46
|
+
" <Input value={item.value} name={item.name} className='w-full' />",
|
|
47
|
+
" <label className=\" text-sm absolute left-3 rounded-full -top-3 px-2 bg-background transition-all peer-placeholder-shown:top-2.5 peer-placeholder-shown:text-gray-400 peer-focus:-top-3 peer-focus:text-blue-500\">",
|
|
48
|
+
" {item.placeholder}",
|
|
49
|
+
" </label>",
|
|
50
|
+
" </div>",
|
|
51
|
+
" );",
|
|
52
|
+
" })}",
|
|
53
|
+
" <Button",
|
|
54
|
+
" size=\"sm\"",
|
|
55
|
+
" variant=\"outline\"",
|
|
56
|
+
" className='ml-auto'",
|
|
57
|
+
" type='submit'",
|
|
58
|
+
" name='intent'",
|
|
59
|
+
" value='editProduct'",
|
|
60
|
+
" >",
|
|
61
|
+
" Save",
|
|
62
|
+
" </Button>",
|
|
63
|
+
" </div>"
|
|
64
|
+
],
|
|
65
|
+
"description": "Custom snippet from map-function.snippet.tsx",
|
|
66
|
+
"scope": "typescript,typescriptreact"
|
|
67
|
+
},
|
|
68
|
+
"toggle_prev_state": {
|
|
69
|
+
"prefix": "toggle_prev_state",
|
|
70
|
+
"body": [
|
|
71
|
+
"(prev) => !prev"
|
|
72
|
+
],
|
|
73
|
+
"description": "Custom snippet from toggle-prev-state.snippet.tsx",
|
|
74
|
+
"scope": "typescript,typescriptreact"
|
|
75
|
+
},
|
|
76
|
+
"links_function": {
|
|
77
|
+
"prefix": "links_function",
|
|
78
|
+
"body": [
|
|
79
|
+
"export const links: LinksFunction = () => {\r\n return [\r\n { rel: \"stylesheet\", href: \"/styles/page.css\" },\r\n { rel: \"preload\", href: \"/images/hero.jpg\", as: \"image\" },\r\n ];\r\n};"
|
|
80
|
+
],
|
|
81
|
+
"description": "",
|
|
82
|
+
"scope": "jsx / tsx"
|
|
83
|
+
},
|
|
84
|
+
"headers": {
|
|
85
|
+
"prefix": "headers",
|
|
86
|
+
"body": [
|
|
87
|
+
"export const headers = ({ loaderHeaders, parentHeaders }) => {",
|
|
88
|
+
" return {",
|
|
89
|
+
" \"Cache-Control\": \"no-store\",",
|
|
90
|
+
" \"Custom-Header\": \"value\",",
|
|
91
|
+
" };",
|
|
92
|
+
"};"
|
|
93
|
+
],
|
|
94
|
+
"description": "Custom snippet from headers.snippet.tsx",
|
|
95
|
+
"scope": "typescript,typescriptreact"
|
|
96
|
+
},
|
|
97
|
+
"action": {
|
|
98
|
+
"prefix": "action",
|
|
99
|
+
"body": [
|
|
100
|
+
"import { json, redirect, type LoaderArgs, type ActionArgs } from \"@remix-run/node\";\r\nimport { prisma } from \"~/libs\";\r\nimport { authSessionStorage } from \"~/sessions/auth-session.server\";\r\nimport eP from \"~/utils/ext.server\";\r\nimport axios from \"axios\";\r\n\r\nexport async function action({ request }: ActionArgs) {\r\n const session = await authSessionStorage.getSession(request.headers.get(\"Cookie\"));\r\n const email = session.get(\"email\");\r\n const user = await eP.user.simple(email)\r\n if (!user) { return redirect(process.env.LOGIN); }\r\n\r\n const d = Object.fromEntries(await request.formData());\r\n const intent = d.intent\r\n\r\n try {\r\n if (intent === 'createFunction') {\r\n const result = await prisma.Function.create({\r\n data: {\r\n ...data\r\n }\r\n });\r\n return json({ success: true, result });\r\n } else if (intent === 'updateFunction') {\r\n const result = await prisma.Function.update({\r\n where: { id: String(id) },\r\n data\r\n });\r\n return json({ success: true, result });\r\n } else if (intent === 'deleteFunction') {\r\n const result = await prisma.Function.delete ({\r\n where: { id: String(id) },\r\n\r\n });\r\n return json({ success: true, result });\r\n } else {\r\n return json({ success: false, error: \"Invalid intent\" }, { status: 400 });\r\n }\r\n\r\n } catch (error) {\r\n return json({\r\n success: false,\r\n error: error instanceof Error ? error.message : \"Unknown error\"\r\n }, { status: 500 });\r\n }\r\n}"
|
|
101
|
+
],
|
|
102
|
+
"description": "",
|
|
103
|
+
"scope": "jsx / tsx"
|
|
104
|
+
},
|
|
105
|
+
"session_loader": {
|
|
106
|
+
"prefix": "session-loader",
|
|
107
|
+
"body": [
|
|
108
|
+
"import { type LoaderFunction, json, redirect } from \"@remix-run/node\";",
|
|
109
|
+
"import { getSession, commitSession } from \"~/sessions/auth-session.server\";",
|
|
110
|
+
"export async function loader({ request }: LoaderFunction) {",
|
|
111
|
+
" const session = await getSession(request.headers.get(\"Cookie\"));",
|
|
112
|
+
" const user = session.get(\"user\");",
|
|
113
|
+
" if (!user) {",
|
|
114
|
+
" return redirect(\"/login\", {",
|
|
115
|
+
" headers: {",
|
|
116
|
+
" \"Set-Cookie\": await commitSession(session),",
|
|
117
|
+
" },",
|
|
118
|
+
" });",
|
|
119
|
+
" }",
|
|
120
|
+
" return json({ user }, {",
|
|
121
|
+
" headers: {",
|
|
122
|
+
" \"Set-Cookie\": await commitSession(session),",
|
|
123
|
+
" },",
|
|
124
|
+
" });",
|
|
125
|
+
"}"
|
|
126
|
+
],
|
|
127
|
+
"description": "Custom snippet from session-loader.snippet.tsx",
|
|
128
|
+
"scope": "typescript,typescriptreact"
|
|
129
|
+
},
|
|
130
|
+
"seo_handle": {
|
|
131
|
+
"prefix": "seo_handle",
|
|
132
|
+
"body": [
|
|
133
|
+
"export const handle: SEOHandle = {\n getSitemapEntries: () => {\n return [\n { url: \"/home\", changefreq: \"daily\", priority: 1.0 },\n { url: \"/about\", changefreq: \"monthly\", priority: 0.8 },\n ];\n },\n};"
|
|
134
|
+
],
|
|
135
|
+
"description": "Custom snippet from seo-handle.snippet.tsx",
|
|
136
|
+
"scope": "typescript,typescriptreact"
|
|
137
|
+
},
|
|
138
|
+
"handle_for_use_with_usematches": {
|
|
139
|
+
"prefix": "handle-for-use-with-usematches",
|
|
140
|
+
"body": [
|
|
141
|
+
"export const handle = {",
|
|
142
|
+
" $1,",
|
|
143
|
+
"};"
|
|
144
|
+
],
|
|
145
|
+
"description": "Custom snippet from handle-for-use-with-usematches.snippet.tsx",
|
|
146
|
+
"scope": "typescript,typescriptreact"
|
|
147
|
+
},
|
|
148
|
+
"error_boundary": {
|
|
149
|
+
"prefix": "error_boundary",
|
|
150
|
+
"body": [
|
|
151
|
+
"export function ErrorBoundary() {\r\n const error = useRouteError();\r\n \r\n if (isRouteErrorResponse(error)) {\r\n return (\r\n <div className=\"error-container\">\r\n <h1>\r\n {error.status} {error.statusText}\r\n </h1>\r\n <p>{error.data}</p>\r\n </div>\r\n );\r\n }\r\n \r\n return (\r\n <div className=\"error-container\">\r\n <h1>Something went wrong</h1>\r\n <p>{error?.message || 'Unknown error occurred'}</p>\r\n </div>\r\n );\r\n}"
|
|
152
|
+
],
|
|
153
|
+
"description": "",
|
|
154
|
+
"scope": "jsx / tsx"
|
|
155
|
+
},
|
|
156
|
+
"meta_function": {
|
|
157
|
+
"prefix": "meta_function",
|
|
158
|
+
"body": [
|
|
159
|
+
"export const meta: MetaFunction<typeof loader> = ({ data, params }) => {\r\n return [\r\n { title: \"Page Title\" },\r\n { name: \"description\", content: \"Page description\" },\r\n { name: \"keywords\", content: \"remix, react, typescript\" },\r\n { property: \"og:title\", content: \"Page Title\" },\r\n { property: \"og:description\", content: \"Page description\" },\r\n { property: \"og:type\", content: \"website\" },\r\n ];\r\n};"
|
|
160
|
+
],
|
|
161
|
+
"description": "",
|
|
162
|
+
"scope": "jsx / tsx"
|
|
163
|
+
},
|
|
164
|
+
"headers_function": {
|
|
165
|
+
"prefix": "headers-function-static",
|
|
166
|
+
"body": [
|
|
167
|
+
"export const headers = ({ loaderHeaders, parentHeaders }) => {",
|
|
168
|
+
" return {",
|
|
169
|
+
" \"Content-Type\": \"application/json\",",
|
|
170
|
+
" };",
|
|
171
|
+
"};export const headers = ({ loaderHeaders, parentHeaders }) => {",
|
|
172
|
+
" return {",
|
|
173
|
+
" \"Content-Type\": \"application/json\",",
|
|
174
|
+
" };",
|
|
175
|
+
" };"
|
|
176
|
+
],
|
|
177
|
+
"description": "Custom snippet from headers-function.snippet.tsx",
|
|
178
|
+
"scope": "typescript,typescriptreact"
|
|
179
|
+
},
|
|
180
|
+
"Display_Date_with_options": {
|
|
181
|
+
"prefix": "Display_Date_with_options",
|
|
182
|
+
"body": [
|
|
183
|
+
"const options = { weekday: \"short\", year: \"numeric\", month: \"short\", day: \"numeric\", hour: \"2-digit\", minute: \"2-digit\" };\nnew Date(d).toLocaleDateString(\"en-US\", options)"
|
|
184
|
+
],
|
|
185
|
+
"description": "Description_for_new_snippet",
|
|
186
|
+
"scope": "javascript, typescript"
|
|
187
|
+
},
|
|
188
|
+
"load_dynamic_data_into_meta_function": {
|
|
189
|
+
"prefix": "load_dynamic_data_into_meta_function",
|
|
190
|
+
"body": [
|
|
191
|
+
"import { type LoaderFunction, type MetaFunction, json } from '@remix-run/node';",
|
|
192
|
+
"import { dealerSelection, fullUserSelection } from '~/utils/loader.server';",
|
|
193
|
+
"import { prisma } from '~/libs';",
|
|
194
|
+
"",
|
|
195
|
+
"export async function loader({ request, params }: LoaderFunction) {",
|
|
196
|
+
" const d = await prisma.dealer.findUnique({ where: { id: 1 }, select: { dealerName: true, metaDesc: true} });",
|
|
197
|
+
" const URLS = { page: 'About Us' };",
|
|
198
|
+
" return json({",
|
|
199
|
+
" data: {",
|
|
200
|
+
" d: d,",
|
|
201
|
+
" URLS: URLS",
|
|
202
|
+
" }",
|
|
203
|
+
" });",
|
|
204
|
+
"}",
|
|
205
|
+
"",
|
|
206
|
+
"export const meta: MetaFunction<typeof loader> = ({ data }) => {",
|
|
207
|
+
" const { d, URLS } = data;",
|
|
208
|
+
" return [",
|
|
209
|
+
" { title: `${URLS.page} - ${d.dealerName}` },",
|
|
210
|
+
" { name: \"description\", keywords: \"Automotive Sales, dealership sales, automotive CRM, Service Center, Parts Department, Accessories Department, CRM, Dealership.\", content: d.metaDesc }",
|
|
211
|
+
" ];",
|
|
212
|
+
"};",
|
|
213
|
+
""
|
|
214
|
+
],
|
|
215
|
+
"description": "client_site_meta_and_loader",
|
|
216
|
+
"scope": "javascript, typescript"
|
|
217
|
+
},
|
|
218
|
+
"filter": {
|
|
219
|
+
"prefix": "filter",
|
|
220
|
+
"body": [
|
|
221
|
+
"const filter = Highlight?.filter(h => h.model.model === modelH);"
|
|
222
|
+
],
|
|
223
|
+
"description": "Description_for_new_snippet",
|
|
224
|
+
"scope": "javascript, typescript"
|
|
225
|
+
},
|
|
226
|
+
"draggable_responsive_dialog_drawer": {
|
|
227
|
+
"prefix": "draggable_responsive_dialog_drawer",
|
|
228
|
+
"body": [
|
|
229
|
+
"export default function MainFunction() {\r\n const { isMobile } = useSidebar()\r\n const [isDialogOpen, setIsDialogOpen] = useState(false);\r\n // DRAGGING\r\n const [position, setPosition] = useState({ x: -200, y: -450 });\r\n const [isDragging, setIsDragging] = useState(false);\r\n const dragRef = useRef<HTMLDivElement>(null);\r\n const startPosRef = useRef<{ x: number; y: number } | null>(null);\r\n const shadowPosRef = useRef<{ x: number; y: number }>({ x: -350, y: -850 });\r\n\r\n const handleMouseMove = useCallback((e: MouseEvent) => {\r\n if (!isDragging || !startPosRef.current) return;\r\n\r\n const shadowX = e.clientX - (startPosRef.current?.x || 0);\r\n const shadowY = e.clientY - (startPosRef.current?.y || 0);\r\n\r\n shadowPosRef.current = { x: shadowX, y: shadowY };\r\n\r\n if (dragRef.current) {\r\n dragRef.current.style.transform = \\`translate($ {shadowX}px, $ {shadowY}px)\\`;\r\n }\r\n }, [isDragging]);\r\n\r\n const handleMouseUp = useCallback(() => {\r\n // Set final position when dragging ends\r\n setPosition(shadowPosRef.current);\r\n\r\n // Reset dragging state\r\n setIsDragging(false);\r\n startPosRef.current = null;\r\n\r\n // Remove visual transform\r\n if (dragRef.current) {\r\n dragRef.current.style.transform = 'none';\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n // Only add listeners when dragging\r\n if (isDragging) {\r\n document.addEventListener('mousemove', handleMouseMove, { passive: true });\r\n document.addEventListener('mouseup', handleMouseUp, { passive: true });\r\n }\r\n\r\n // Cleanup function\r\n return () => {\r\n document.removeEventListener('mousemove', handleMouseMove);\r\n document.removeEventListener('mouseup', handleMouseUp);\r\n };\r\n }, [isDragging, handleMouseMove, handleMouseUp]);\r\n\r\n const handleRef = useRef<HTMLButtonElement>(null);\r\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\r\n // Ensure we're dragging from the handle\r\n if (e.target !== handleRef.current) return;\r\n\r\n e.preventDefault();\r\n\r\n // Capture initial mouse position\r\n startPosRef.current = {\r\n x: e.clientX - position.x,\r\n y: e.clientY - position.y\r\n };\r\n\r\n // Initialize shadow position to current position\r\n shadowPosRef.current = { ...position };\r\n\r\n setIsDragging(true);\r\n }, [position.x, position.y]);\r\n\r\n return (\r\n <>\r\n <OpenButton setIsDialogOpen={setIsDialogOpen} />\r\n <ResponsiveDialogDrawer\r\n setIsDialogOpen={setIsDialogOpen}\r\n isDialogOpen={isDialogOpen}\r\n isMobile={isMobile}\r\n position={position}\r\n isDragging={isDragging}\r\n dragRef={dragRef}\r\n />\r\n </>\r\n )\r\n}\r\nfunction OpenButton({ setIsDialogOpen }) {\r\n return (\r\n <ButtonStyled\r\n primary={false}\r\n className=\" mr-auto ml-3 w-[150px] text-xs h-7 \"\r\n onClick={() => { setIsDialogOpen(true); }} >\r\n Open\r\n </ButtonStyled>\r\n )\r\n}\r\nfunction MoveButton({ handleMouseDown, handleRef }) {\r\n return (\r\n <Button\r\n ref={handleRef}\r\n size=\"icon\"\r\n variant=\"ghost\"\r\n type='button'\r\n onMouseDown={handleMouseDown}\r\n className=' cursor-move'\r\n >\r\n <Move />\r\n </Button>\r\n )\r\n}\r\nfunction ResponsiveDialogDrawer({ isDialogOpen, setIsDialogOpen, isMobile, position, isDragging, dragRef, }) {\r\n\r\n if (isMobile === false) {\r\n return (\r\n <Dialog\r\n open={isDialogOpen}\r\n onOpenChange={setIsDialogOpen}\r\n modal={false} >\r\n <DialogContent\r\n onInteractOutside={(e) => { e.preventDefault(); }}\r\n ref={dragRef}\r\n className={cn(\r\n isDragging ? \"pointer-events-none\" : \"\",\r\n isMobile === false ?\r\n \"absolute z-[100] bg-background border border-border border-dashed text-foreground shadow-md max-h-[90vh] h-auto\" :\r\n \"w-full h-full fixed bottom-0 left-0 right-0 z-[100] bg-background border-none border-dashed\"\r\n )}\r\n style={{\r\n ...(isMobile === false ? {\r\n transform: \\`translate($ {position.x}px, $ {position.y}px)\\`,\r\n transition: isDragging ? 'none' : 'transform 0.1s ease-out',\r\n willChange: 'transform',\r\n width: small ? '325px' : '750px'\r\n } : {\r\n transform: 'none',\r\n transition: 'none',\r\n })\r\n }}\r\n >\r\n <Content />\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n }\r\n\r\n return (\r\n <Drawer open={isDialogOpen} onOpenChange={setIsDialogOpen}>\r\n <DrawerContent>\r\n <Content />\r\n <DrawerFooter className=\"pt-2\">\r\n <DrawerClose asChild>\r\n <Button variant=\"outline\">Cancel</Button>\r\n </DrawerClose>\r\n </DrawerFooter>\r\n </DrawerContent>\r\n </Drawer>\r\n )\r\n}\r\nfunction Content({ handleMouseDown, handleRef }) {\r\n return (\r\n <div className='grid grid-cols-1 gap-3' >\r\n <div className=\"flex justify-between items-center gap-1 p-2\">\r\n <div>\r\n\r\n </div>\r\n <div className='flex items-center gap-1'>\r\n <MoveButton handleRef={handleRef} handleMouseDown={handleMouseDown} />\r\n <Button\r\n size=\"icon\"\r\n variant=\"ghost\"\r\n type='button'\r\n onClick={() => setIsDialogOpen(false)}\r\n >\r\n <X />\r\n </Button>\r\n\r\n </div>\r\n </div>\r\n <div className='grid grid-cols-1 gap-3' >\r\n <div className=\"p-4 max-h-[75vh] h-auto overflow-y-auto\">\r\n \r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}"
|
|
230
|
+
],
|
|
231
|
+
"description": "",
|
|
232
|
+
"scope": "jsx / tsx"
|
|
233
|
+
},
|
|
234
|
+
"dob": {
|
|
235
|
+
"prefix": "dob",
|
|
236
|
+
"body": [
|
|
237
|
+
"\"use client\"",
|
|
238
|
+
"",
|
|
239
|
+
"import * as React from \"react\"",
|
|
240
|
+
"import { ChevronDownIcon } from \"lucide-react\"",
|
|
241
|
+
"",
|
|
242
|
+
"import { Button } from \"~/components/catalyst-ui/components/button\"",
|
|
243
|
+
"import { Calendar } from \"~/components/catalyst-ui/components/calendar\"",
|
|
244
|
+
"import { Label } from \"~/components/catalyst-ui/components/label\"",
|
|
245
|
+
"import {",
|
|
246
|
+
" Popover,",
|
|
247
|
+
" PopoverContent,",
|
|
248
|
+
" PopoverTrigger,",
|
|
249
|
+
"} from \"~/components/catalyst-ui/components/popover\"",
|
|
250
|
+
"",
|
|
251
|
+
"export function DOB() {",
|
|
252
|
+
" const [open, setOpen] = React.useState(false)",
|
|
253
|
+
" const [date, setDate] = React.useState<Date | undefined>(undefined)",
|
|
254
|
+
"",
|
|
255
|
+
" return (",
|
|
256
|
+
" <div className=\"flex flex-col gap-3\">",
|
|
257
|
+
" <Label htmlFor=\"date\" className=\"px-1\">",
|
|
258
|
+
" Date of birth",
|
|
259
|
+
" </Label>",
|
|
260
|
+
" <Popover open={open} onOpenChange={setOpen}>",
|
|
261
|
+
" <PopoverTrigger asChild>",
|
|
262
|
+
" <Button",
|
|
263
|
+
" variant=\"outline\"",
|
|
264
|
+
" id=\"date\"",
|
|
265
|
+
" className=\"w-48 justify-between font-normal\"",
|
|
266
|
+
" >",
|
|
267
|
+
" {date ? date.toLocaleDateString() : \"Select date\"}",
|
|
268
|
+
" <ChevronDownIcon />",
|
|
269
|
+
" </Button>",
|
|
270
|
+
" </PopoverTrigger>",
|
|
271
|
+
" <PopoverContent className=\"w-auto overflow-hidden p-0\" align=\"start\">",
|
|
272
|
+
" <Calendar",
|
|
273
|
+
" mode=\"single\"",
|
|
274
|
+
" selected={date}",
|
|
275
|
+
" captionLayout=\"dropdown\"",
|
|
276
|
+
" onSelect={(date) => {",
|
|
277
|
+
" setDate(date)",
|
|
278
|
+
" setOpen(false)",
|
|
279
|
+
" }}",
|
|
280
|
+
" />",
|
|
281
|
+
" </PopoverContent>",
|
|
282
|
+
" </Popover>",
|
|
283
|
+
" </div>",
|
|
284
|
+
" )",
|
|
285
|
+
"}",
|
|
286
|
+
""
|
|
287
|
+
],
|
|
288
|
+
"description": "Description for dob",
|
|
289
|
+
"scope": "javascript,typescript"
|
|
290
|
+
},
|
|
291
|
+
"with_presets": {
|
|
292
|
+
"prefix": "with_presets",
|
|
293
|
+
"body": [
|
|
294
|
+
"\"use client\"",
|
|
295
|
+
"",
|
|
296
|
+
"import * as React from \"react\"",
|
|
297
|
+
"import { addDays } from \"date-fns\"",
|
|
298
|
+
"",
|
|
299
|
+
"import { Button } from \"~/components/catalyst-ui/components/button\"",
|
|
300
|
+
"import { Calendar } from \"~/components/catalyst-ui/components/calendar\"",
|
|
301
|
+
"import { Card, CardContent, CardFooter } from \"~/components/catalyst-ui/components/card\"",
|
|
302
|
+
"",
|
|
303
|
+
"export function WithPresets() {",
|
|
304
|
+
" const [date, setDate] = React.useState<Date | undefined>(",
|
|
305
|
+
" new Date(2025, 5, 12)",
|
|
306
|
+
" )",
|
|
307
|
+
"",
|
|
308
|
+
" return (",
|
|
309
|
+
" <Card className=\"max-w-[300px] py-4\">",
|
|
310
|
+
" <CardContent className=\"px-4\">",
|
|
311
|
+
" <Calendar",
|
|
312
|
+
" mode=\"single\"",
|
|
313
|
+
" selected={date}",
|
|
314
|
+
" onSelect={setDate}",
|
|
315
|
+
" defaultMonth={date}",
|
|
316
|
+
" className=\"bg-transparent p-0 [--cell-size:--spacing(9.5)]\"",
|
|
317
|
+
" />",
|
|
318
|
+
" </CardContent>",
|
|
319
|
+
" <CardFooter className=\"flex flex-wrap gap-2 border-t px-4 !pt-4\">",
|
|
320
|
+
" {[",
|
|
321
|
+
" { label: \"Today\", value: 0 },",
|
|
322
|
+
" { label: \"Tomorrow\", value: 1 },",
|
|
323
|
+
" { label: \"In 3 days\", value: 3 },",
|
|
324
|
+
" { label: \"In a week\", value: 7 },",
|
|
325
|
+
" { label: \"In 2 weeks\", value: 14 },",
|
|
326
|
+
" ].map((preset) => (",
|
|
327
|
+
" <Button",
|
|
328
|
+
" key={preset.value}",
|
|
329
|
+
" variant=\"outline\"",
|
|
330
|
+
" size=\"sm\"",
|
|
331
|
+
" className=\"flex-1\"",
|
|
332
|
+
" onClick={() => {",
|
|
333
|
+
" const newDate = addDays(new Date(), preset.value)",
|
|
334
|
+
" setDate(newDate)",
|
|
335
|
+
" }}",
|
|
336
|
+
" >",
|
|
337
|
+
" {preset.label}",
|
|
338
|
+
" </Button>",
|
|
339
|
+
" ))}",
|
|
340
|
+
" </CardFooter>",
|
|
341
|
+
" </Card>",
|
|
342
|
+
" )",
|
|
343
|
+
"}",
|
|
344
|
+
""
|
|
345
|
+
],
|
|
346
|
+
"description": "Description for with presets",
|
|
347
|
+
"scope": "javascript,typescript"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/CHANGELOG.md
ADDED
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 8an3
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|