@mframework/ui 0.0.6-beta6 → 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -21
- package/module.ts +0 -72
- package/runtime/assets/config/tailwind.conifg.js +0 -11
- package/runtime/assets/css/tailwind.css +0 -11
- package/runtime/design/tokens.ts +0 -22
- package/runtime/plugins/icon-switcher.ts +0 -32
- package/runtime/plugins/theme.ts +0 -29
- package/runtime/plugins/vuetify.js +0 -12
- package/runtime/plugins/vuetify.ts +0 -64
- package/runtime/search/client.ts +0 -25
- package/runtime/search/components/MSearch.vue +0 -19
- package/runtime/search/plugin.ts +0 -9
- package/tsconfig.json +0 -16
- package/type.d.ts +0 -5
- package/types/ui/api/global-search.js +0 -1
- package/types/ui/api/global-search.ts +0 -8
- package/types/ui/blocks/block-button-group.js +0 -1
- package/types/ui/blocks/block-button-group.ts +0 -7
- package/types/ui/blocks/block-button.js +0 -1
- package/types/ui/blocks/block-button.ts +0 -14
- package/types/ui/blocks/block-column.js +0 -1
- package/types/ui/blocks/block-column.ts +0 -20
- package/types/ui/blocks/block-cta.js +0 -1
- package/types/ui/blocks/block-cta.ts +0 -10
- package/types/ui/blocks/block-divider.js +0 -1
- package/types/ui/blocks/block-divider.ts +0 -4
- package/types/ui/blocks/block-faq.js +0 -1
- package/types/ui/blocks/block-faq.ts +0 -12
- package/types/ui/blocks/block-form.js +0 -1
- package/types/ui/blocks/block-form.ts +0 -8
- package/types/ui/blocks/block-gallery.js +0 -1
- package/types/ui/blocks/block-gallery.ts +0 -14
- package/types/ui/blocks/block-hero.js +0 -1
- package/types/ui/blocks/block-hero.ts +0 -12
- package/types/ui/blocks/block-html.js +0 -1
- package/types/ui/blocks/block-html.ts +0 -4
- package/types/ui/blocks/block-logocloud.js +0 -1
- package/types/ui/blocks/block-logocloud.ts +0 -14
- package/types/ui/blocks/block-quote.js +0 -1
- package/types/ui/blocks/block-quote.ts +0 -11
- package/types/ui/blocks/block-richtext.js +0 -1
- package/types/ui/blocks/block-richtext.ts +0 -7
- package/types/ui/blocks/block-steps.js +0 -1
- package/types/ui/blocks/block-steps.ts +0 -22
- package/types/ui/blocks/block-team.js +0 -1
- package/types/ui/blocks/block-team.ts +0 -6
- package/types/ui/blocks/block-testimonial.js +0 -1
- package/types/ui/blocks/block-testimonial.ts +0 -14
- package/types/ui/blocks/block-video.js +0 -1
- package/types/ui/blocks/block-video.ts +0 -10
- package/types/ui/blocks/block.js +0 -1
- package/types/ui/blocks/block.ts +0 -49
- package/types/ui/blocks/index.js +0 -1
- package/types/ui/blocks/index.ts +0 -18
- package/types/ui/component.js +0 -1
- package/types/ui/component.ts +0 -7
- package/types/ui/content/category.js +0 -1
- package/types/ui/content/category.ts +0 -11
- package/types/ui/content/form.js +0 -1
- package/types/ui/content/form.ts +0 -20
- package/types/ui/content/index.js +0 -1
- package/types/ui/content/index.ts +0 -6
- package/types/ui/content/page.js +0 -1
- package/types/ui/content/page.ts +0 -76
- package/types/ui/content/post.js +0 -1
- package/types/ui/content/post.ts +0 -39
- package/types/ui/content/team.js +0 -1
- package/types/ui/content/team.ts +0 -16
- package/types/ui/content/testimonial.js +0 -1
- package/types/ui/content/testimonial.ts +0 -19
- package/types/ui/env.d.ts +0 -8
- package/types/ui/form.js +0 -1
- package/types/ui/form.ts +0 -17
- package/types/ui/help/index.js +0 -1
- package/types/ui/help/index.ts +0 -53
- package/types/ui/meta/analytics.js +0 -1
- package/types/ui/meta/analytics.ts +0 -18
- package/types/ui/meta/config.js +0 -1
- package/types/ui/meta/config.ts +0 -21
- package/types/ui/meta/globals.js +0 -1
- package/types/ui/meta/globals.ts +0 -30
- package/types/ui/meta/index.js +0 -1
- package/types/ui/meta/index.ts +0 -6
- package/types/ui/meta/navigation.js +0 -1
- package/types/ui/meta/navigation.ts +0 -32
- package/types/ui/meta/redirect.js +0 -1
- package/types/ui/meta/redirect.ts +0 -13
- package/types/ui/meta/seo.js +0 -1
- package/types/ui/meta/seo.ts +0 -19
- package/types/ui/os/contact.js +0 -1
- package/types/ui/os/contact.ts +0 -23
- package/types/ui/os/conversation.js +0 -1
- package/types/ui/os/conversation.ts +0 -25
- package/types/ui/os/index.js +0 -1
- package/types/ui/os/index.ts +0 -16
- package/types/ui/os/organization.js +0 -1
- package/types/ui/os/organization.ts +0 -54
- package/types/ui/os/os-activity.js +0 -1
- package/types/ui/os/os-activity.ts +0 -28
- package/types/ui/os/os-deal.js +0 -1
- package/types/ui/os/os-deal.ts +0 -45
- package/types/ui/os/os-expense.js +0 -1
- package/types/ui/os/os-expense.ts +0 -22
- package/types/ui/os/os-invoice.js +0 -1
- package/types/ui/os/os-invoice.ts +0 -48
- package/types/ui/os/os-item.js +0 -1
- package/types/ui/os/os-item.ts +0 -18
- package/types/ui/os/os-payment.js +0 -1
- package/types/ui/os/os-payment.ts +0 -29
- package/types/ui/os/os-project.js +0 -1
- package/types/ui/os/os-project.ts +0 -47
- package/types/ui/os/os-proposal.js +0 -1
- package/types/ui/os/os-proposal.ts +0 -84
- package/types/ui/os/os-settings.js +0 -1
- package/types/ui/os/os-settings.ts +0 -19
- package/types/ui/os/os-subscription.js +0 -1
- package/types/ui/os/os-subscription.ts +0 -12
- package/types/ui/os/os-task.js +0 -1
- package/types/ui/os/os-task.ts +0 -34
- package/types/ui/os/os-tax-rate.js +0 -1
- package/types/ui/os/os-tax-rate.ts +0 -13
- package/types/ui/pageComponentMap.js +0 -7
- package/types/ui/pageComponentMap.ts +0 -8
- package/types/ui/pagination.js +0 -1
- package/types/ui/pagination.ts +0 -6
- package/types/ui/schema.d.ts +0 -39
- package/types/ui/schema.js +0 -1
- package/types/ui/schema.ts +0 -151
- package/types/ui/state.js +0 -1
- package/types/ui/state.ts +0 -5
- package/types/ui/system/file.js +0 -1
- package/types/ui/system/file.ts +0 -46
- package/types/ui/system/folder.js +0 -1
- package/types/ui/system/folder.ts +0 -8
- package/types/ui/system/index.js +0 -1
- package/types/ui/system/index.ts +0 -4
- package/types/ui/system/role.js +0 -1
- package/types/ui/system/role.ts +0 -21
- package/types/ui/system/user.js +0 -1
- package/types/ui/system/user.ts +0 -56
- package/types/ui.js +0 -1
- package/types/ui.ts +0 -23
- package/utils/color.js +0 -11
- package/utils/color.ts +0 -14
- package/utils/fonts.js +0 -18
- package/utils/fonts.ts +0 -24
- package/utils/formkit.js +0 -59
- package/utils/formkit.ts +0 -75
- package/utils/icons.js +0 -36
- package/utils/icons.ts +0 -62
package/types/ui/schema.ts
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BlockColumn,
|
|
3
|
-
BlockCta,
|
|
4
|
-
BlockFaq,
|
|
5
|
-
BlockForm,
|
|
6
|
-
BlockGallery,
|
|
7
|
-
BlockHero,
|
|
8
|
-
BlockHtml,
|
|
9
|
-
BlockLogocloud,
|
|
10
|
-
BlockQuote,
|
|
11
|
-
BlockRichtext,
|
|
12
|
-
BlockStep,
|
|
13
|
-
BlockTeam,
|
|
14
|
-
BlockTestimonial,
|
|
15
|
-
BlockVideo,
|
|
16
|
-
} from './blocks';
|
|
17
|
-
import type {
|
|
18
|
-
Globals,
|
|
19
|
-
Navigation,
|
|
20
|
-
Redirect,
|
|
21
|
-
SEO,
|
|
22
|
-
ProjectsSettings,
|
|
23
|
-
PageSettings,
|
|
24
|
-
ChatConfig,
|
|
25
|
-
Event,
|
|
26
|
-
Metric,
|
|
27
|
-
} from './meta';
|
|
28
|
-
import type { Page, PageBlock, Category, Form, Post, Team, Testimonial, PagesProjects, PagesBlog } from './content';
|
|
29
|
-
import type { Inbox, HelpArticle, HelpCollection, HelpFeedback } from './help';
|
|
30
|
-
import type { File, User } from './system';
|
|
31
|
-
import type {
|
|
32
|
-
Conversation,
|
|
33
|
-
Message,
|
|
34
|
-
Contact,
|
|
35
|
-
Organization,
|
|
36
|
-
OrganizationAddress,
|
|
37
|
-
OrganizationContact,
|
|
38
|
-
OsActivity,
|
|
39
|
-
OsActivityContact,
|
|
40
|
-
OsDealContact,
|
|
41
|
-
OsDeal,
|
|
42
|
-
OsDealStage,
|
|
43
|
-
OsEmailTemplate,
|
|
44
|
-
OsExpense,
|
|
45
|
-
OsInvoiceItem,
|
|
46
|
-
OsInvoice,
|
|
47
|
-
OsItem,
|
|
48
|
-
OsPayment,
|
|
49
|
-
OsPaymentTerm,
|
|
50
|
-
OsProjectContact,
|
|
51
|
-
OsProjectFile,
|
|
52
|
-
OsProject,
|
|
53
|
-
OsProjectTemplate,
|
|
54
|
-
OsProposalApproval,
|
|
55
|
-
OsProposalBlock,
|
|
56
|
-
OsProposalContact,
|
|
57
|
-
OsProposal,
|
|
58
|
-
OsSettings,
|
|
59
|
-
OsSubscription,
|
|
60
|
-
OsTaskFile,
|
|
61
|
-
OsTask,
|
|
62
|
-
OsTaxRate,
|
|
63
|
-
} from './os';
|
|
64
|
-
|
|
65
|
-
/** Directus Schema for SDK */
|
|
66
|
-
export interface Schema {
|
|
67
|
-
// Routes
|
|
68
|
-
pages: Page[];
|
|
69
|
-
pages_blocks: PageBlock[];
|
|
70
|
-
|
|
71
|
-
// Content
|
|
72
|
-
categories: Category[];
|
|
73
|
-
forms: Form[];
|
|
74
|
-
posts: Post[];
|
|
75
|
-
team: Team[];
|
|
76
|
-
testimonials: Testimonial[];
|
|
77
|
-
pages_projects: PagesProjects;
|
|
78
|
-
pages_blog: PagesBlog;
|
|
79
|
-
|
|
80
|
-
// Blocks
|
|
81
|
-
block_columns: BlockColumn[];
|
|
82
|
-
block_cta: BlockCta[];
|
|
83
|
-
block_faq: BlockFaq[];
|
|
84
|
-
block_form: BlockForm[];
|
|
85
|
-
block_gallery: BlockGallery[];
|
|
86
|
-
block_hero: BlockHero[];
|
|
87
|
-
block_html: BlockHtml[];
|
|
88
|
-
block_logocloud: BlockLogocloud[];
|
|
89
|
-
block_quote: BlockQuote[];
|
|
90
|
-
block_richtext: BlockRichtext[];
|
|
91
|
-
block_steps: BlockStep[];
|
|
92
|
-
block_team: BlockTeam[];
|
|
93
|
-
block_testimonial: BlockTestimonial[];
|
|
94
|
-
block_video: BlockVideo[];
|
|
95
|
-
|
|
96
|
-
// OS
|
|
97
|
-
contacts: Contact[];
|
|
98
|
-
organizations: Organization[];
|
|
99
|
-
organization_addresses: OrganizationAddress[];
|
|
100
|
-
organizations_contacts: OrganizationContact[];
|
|
101
|
-
os_activities: OsActivity[];
|
|
102
|
-
os_activity_contacts: OsActivityContact[];
|
|
103
|
-
os_deal_contacts: OsDealContact[];
|
|
104
|
-
os_deals: OsDeal[];
|
|
105
|
-
os_deal_stages: OsDealStage[];
|
|
106
|
-
os_email_templates: OsEmailTemplate[];
|
|
107
|
-
os_expenses: OsExpense[];
|
|
108
|
-
os_invoice_items: OsInvoiceItem[];
|
|
109
|
-
os_invoices: OsInvoice[];
|
|
110
|
-
os_items: OsItem[];
|
|
111
|
-
os_payments: OsPayment[];
|
|
112
|
-
os_payment_terms: OsPaymentTerm[];
|
|
113
|
-
os_project_contacts: OsProjectContact[];
|
|
114
|
-
os_project_files: OsProjectFile[];
|
|
115
|
-
os_projects: OsProject[];
|
|
116
|
-
os_project_templates: OsProjectTemplate[];
|
|
117
|
-
os_proposal_approvals: OsProposalApproval[];
|
|
118
|
-
os_proposal_blocks: OsProposalBlock[];
|
|
119
|
-
os_proposal_contacts: OsProposalContact[];
|
|
120
|
-
os_proposals: OsProposal[];
|
|
121
|
-
os_settings: OsSettings;
|
|
122
|
-
os_subscriptions: OsSubscription[];
|
|
123
|
-
os_task_files: OsTaskFile[];
|
|
124
|
-
os_tasks: OsTask[];
|
|
125
|
-
os_tax_rates: OsTaxRate[];
|
|
126
|
-
|
|
127
|
-
// Help
|
|
128
|
-
help_collections: HelpCollection[];
|
|
129
|
-
help_articles: HelpArticle[];
|
|
130
|
-
help_feedback: HelpFeedback[];
|
|
131
|
-
inbox: Inbox[];
|
|
132
|
-
conversations: Conversation[];
|
|
133
|
-
messages: Message[];
|
|
134
|
-
|
|
135
|
-
// Meta
|
|
136
|
-
globals: Globals;
|
|
137
|
-
navigation: Navigation[];
|
|
138
|
-
redirects: Redirect[];
|
|
139
|
-
seo: SEO[];
|
|
140
|
-
projects_settings: ProjectsSettings;
|
|
141
|
-
page_settings: PageSettings;
|
|
142
|
-
chat_config: ChatConfig;
|
|
143
|
-
|
|
144
|
-
// Data
|
|
145
|
-
metrics: Metric[];
|
|
146
|
-
events: Event[];
|
|
147
|
-
|
|
148
|
-
// System
|
|
149
|
-
directus_files: File[];
|
|
150
|
-
directus_users: User[];
|
|
151
|
-
}
|
package/types/ui/state.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/state.ts
DELETED
package/types/ui/system/file.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/system/file.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Folder } from './folder.js';
|
|
2
|
-
import type { User } from './user.js';
|
|
3
|
-
|
|
4
|
-
export interface File {
|
|
5
|
-
/** Unique identifier for the file. */
|
|
6
|
-
id: string;
|
|
7
|
-
/** Where the file is stored. Either `local` for the local filesystem or the name of the storage adapter (for example `s3`). */
|
|
8
|
-
storage: string;
|
|
9
|
-
/** Name of the file on disk. By default, Directus uses a random hash for the filename. */
|
|
10
|
-
filename_disk: string;
|
|
11
|
-
/** How you want to the file to be named when it's being downloaded. */
|
|
12
|
-
filename_download: string;
|
|
13
|
-
/** Title for the file. Is extracted from the filename on upload, but can be edited by the user. */
|
|
14
|
-
title: string;
|
|
15
|
-
/** MIME type of the file. */
|
|
16
|
-
type: string;
|
|
17
|
-
/** Virtual folder where this file resides in. */
|
|
18
|
-
folder: string | Folder | null;
|
|
19
|
-
/** Who uploaded the file. */
|
|
20
|
-
uploaded_by: string | User;
|
|
21
|
-
/** When the file was uploaded. */
|
|
22
|
-
uploaded_on: string;
|
|
23
|
-
modified_by: string | User | null;
|
|
24
|
-
modified_on: string;
|
|
25
|
-
/** Character set of the file. */
|
|
26
|
-
charset: string | null;
|
|
27
|
-
/** Size of the file in bytes. */
|
|
28
|
-
filesize: number;
|
|
29
|
-
/** Width of the file in pixels. Only applies to images. */
|
|
30
|
-
width: number | null;
|
|
31
|
-
/** Height of the file in pixels. Only applies to images. */
|
|
32
|
-
height: number | null;
|
|
33
|
-
/** Duration of the file in seconds. Only applies to audio and video. */
|
|
34
|
-
duration: number | null;
|
|
35
|
-
/** Where the file was embedded from. */
|
|
36
|
-
embed: string | null;
|
|
37
|
-
/** Description for the file. */
|
|
38
|
-
description: string | null;
|
|
39
|
-
/** Where the file was created. Is automatically populated based on EXIF data for images. */
|
|
40
|
-
location: string | null;
|
|
41
|
-
/** Tags for the file. Is automatically populated based on EXIF data for images. */
|
|
42
|
-
tags: string[] | null;
|
|
43
|
-
/** IPTC, EXIF, and ICC metadata extracted from file */
|
|
44
|
-
metadata: { [key: string]: any } | null;
|
|
45
|
-
storage_divider: string;
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/system/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/system/index.ts
DELETED
package/types/ui/system/role.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/system/role.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { User } from './user.js';
|
|
2
|
-
|
|
3
|
-
export interface Role {
|
|
4
|
-
/** Unique identifier for the role. */
|
|
5
|
-
id: string;
|
|
6
|
-
/** Name of the role. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** The role's icon. */
|
|
9
|
-
icon: string;
|
|
10
|
-
/** Description of the role. */
|
|
11
|
-
description: string | null;
|
|
12
|
-
/** Array of IP addresses that are allowed to connect to the API as a user of this role. */
|
|
13
|
-
ip_access: string[];
|
|
14
|
-
/** Whether or not this role enforces the use of 2FA. */
|
|
15
|
-
enforce_tfa: boolean;
|
|
16
|
-
/** Admin role. If true, skips all permission checks. */
|
|
17
|
-
admin_access: boolean;
|
|
18
|
-
/** The users in the role are allowed to use the app. */
|
|
19
|
-
app_access: boolean;
|
|
20
|
-
users: string | User[];
|
|
21
|
-
}
|
package/types/ui/system/user.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui/system/user.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Role } from './role.js';
|
|
2
|
-
|
|
3
|
-
export interface User {
|
|
4
|
-
/** Unique identifier for the user. */
|
|
5
|
-
id: string;
|
|
6
|
-
/** First name of the user. */
|
|
7
|
-
first_name: string;
|
|
8
|
-
/** Last name of the user. */
|
|
9
|
-
last_name: string;
|
|
10
|
-
/** Unique email address for the user. */
|
|
11
|
-
email: string;
|
|
12
|
-
/** Password of the user. */
|
|
13
|
-
password: string;
|
|
14
|
-
/** The user's location. */
|
|
15
|
-
location: string | null;
|
|
16
|
-
/** The user's title. */
|
|
17
|
-
title: string | null;
|
|
18
|
-
/** The user's description. */
|
|
19
|
-
description: string | null;
|
|
20
|
-
/** The user's tags. */
|
|
21
|
-
tags: string[] | null;
|
|
22
|
-
/** The user's avatar. */
|
|
23
|
-
avatar: string | File | null;
|
|
24
|
-
/** The user's language used in Directus. */
|
|
25
|
-
language: string;
|
|
26
|
-
/** What theme the user is using. */
|
|
27
|
-
theme: 'light' | 'dark' | 'auto';
|
|
28
|
-
/** The 2FA secret string that's used to generate one time passwords. */
|
|
29
|
-
tfa_secret: string | null;
|
|
30
|
-
/** Status of the user. */
|
|
31
|
-
status: 'active' | 'invited' | 'draft' | 'suspended' | 'deleted';
|
|
32
|
-
/** Unique identifier of the role of this user. */
|
|
33
|
-
role: string | Role;
|
|
34
|
-
/** Static token for the user. */
|
|
35
|
-
token: string | null;
|
|
36
|
-
last_access: string | null;
|
|
37
|
-
/** Last page that the user was on. */
|
|
38
|
-
last_page: string | null;
|
|
39
|
-
provider: string;
|
|
40
|
-
external_identifier: string | null;
|
|
41
|
-
auth_data: { [key: string]: any } | null;
|
|
42
|
-
github: string | null;
|
|
43
|
-
linkedin: string | null;
|
|
44
|
-
start_date: string | null;
|
|
45
|
-
pronouns: string | null;
|
|
46
|
-
nickname: string | null;
|
|
47
|
-
birthday: string | null;
|
|
48
|
-
personal_email: string | null;
|
|
49
|
-
classification: string | null;
|
|
50
|
-
timezone: string | null;
|
|
51
|
-
phone: string | null;
|
|
52
|
-
email_notifications: boolean | null;
|
|
53
|
-
company_info: string;
|
|
54
|
-
preferences_divider: string;
|
|
55
|
-
admin_divider: string;
|
|
56
|
-
}
|
package/types/ui.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/ui.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Image {
|
|
2
|
-
url: string
|
|
3
|
-
alt?: string
|
|
4
|
-
width?: number
|
|
5
|
-
height?: number
|
|
6
|
-
[key: string]: any
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface Product {
|
|
10
|
-
id: string
|
|
11
|
-
name?: string
|
|
12
|
-
price?: number
|
|
13
|
-
images?: Image[]
|
|
14
|
-
[key: string]: any
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface Category {
|
|
18
|
-
id: string
|
|
19
|
-
name?: string
|
|
20
|
-
slug?: string
|
|
21
|
-
image?: string
|
|
22
|
-
[key: string]: any
|
|
23
|
-
}
|
package/utils/color.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function getContrastColor(hexColor) {
|
|
2
|
-
// Convert hex color to RGB format
|
|
3
|
-
const red = parseInt(hexColor.slice(1, 3), 16);
|
|
4
|
-
const green = parseInt(hexColor.slice(3, 5), 16);
|
|
5
|
-
const blue = parseInt(hexColor.slice(5, 7), 16);
|
|
6
|
-
// Calculate relative luminance of the color
|
|
7
|
-
const luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255;
|
|
8
|
-
// Return black or white depending on the luminance value
|
|
9
|
-
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
10
|
-
}
|
|
11
|
-
export { getContrastColor };
|
package/utils/color.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function getContrastColor(hexColor: string) {
|
|
2
|
-
// Convert hex color to RGB format
|
|
3
|
-
const red = parseInt(hexColor.slice(1, 3), 16);
|
|
4
|
-
const green = parseInt(hexColor.slice(3, 5), 16);
|
|
5
|
-
const blue = parseInt(hexColor.slice(5, 7), 16);
|
|
6
|
-
|
|
7
|
-
// Calculate relative luminance of the color
|
|
8
|
-
const luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255;
|
|
9
|
-
|
|
10
|
-
// Return black or white depending on the luminance value
|
|
11
|
-
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { getContrastColor };
|
package/utils/fonts.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const formatFonts = (families, defaultWeights = [400]) => {
|
|
2
|
-
const formatted = [];
|
|
3
|
-
for (const font in families) {
|
|
4
|
-
const formattedFont = font.replace(/ /g, '+'); // Replace spaces with '+'
|
|
5
|
-
const weights = families[font];
|
|
6
|
-
if (weights === true) {
|
|
7
|
-
for (const weight of defaultWeights) {
|
|
8
|
-
formatted.push(`${formattedFont}:${weight}`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
else if (Array.isArray(weights)) {
|
|
12
|
-
for (const weight of weights) {
|
|
13
|
-
formatted.push(`${formattedFont}:${weight}`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return formatted;
|
|
18
|
-
};
|
package/utils/fonts.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type FontFamilies = {
|
|
2
|
-
[font: string]: boolean | number[];
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export const formatFonts = (families: FontFamilies, defaultWeights: number[] = [400]): string[] => {
|
|
6
|
-
const formatted: string[] = [];
|
|
7
|
-
|
|
8
|
-
for (const font in families) {
|
|
9
|
-
const formattedFont = font.replace(/ /g, '+'); // Replace spaces with '+'
|
|
10
|
-
const weights = families[font];
|
|
11
|
-
|
|
12
|
-
if (weights === true) {
|
|
13
|
-
for (const weight of defaultWeights) {
|
|
14
|
-
formatted.push(`${formattedFont}:${weight}`);
|
|
15
|
-
}
|
|
16
|
-
} else if (Array.isArray(weights)) {
|
|
17
|
-
for (const weight of weights) {
|
|
18
|
-
formatted.push(`${formattedFont}:${weight}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return formatted;
|
|
24
|
-
};
|
package/utils/formkit.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { unref } from 'vue';
|
|
2
|
-
function convertBoolean(value) {
|
|
3
|
-
if (value === 'true' || value === 'false') {
|
|
4
|
-
return value === 'true';
|
|
5
|
-
}
|
|
6
|
-
else {
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function mapCondition(condition, target) {
|
|
11
|
-
switch (condition) {
|
|
12
|
-
case 'is_empty':
|
|
13
|
-
return `!$get(${target}).value)`;
|
|
14
|
-
case 'is_filled':
|
|
15
|
-
return `$get(${target}).value)`;
|
|
16
|
-
default:
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export function mapConditions(conditions) {
|
|
21
|
-
// Both $el and $cmp schema nodes can leverage an if property that roughly equates to a v-if in Vue. If the expression assigned to the if property is truthy, the node is rendered, otherwise it is not:
|
|
22
|
-
}
|
|
23
|
-
export function transformSchema(schema) {
|
|
24
|
-
// Loop through the form schema from Directus
|
|
25
|
-
// This is required for FormKit to work
|
|
26
|
-
const items = unref(schema);
|
|
27
|
-
return items.map((item) => {
|
|
28
|
-
const { conditions, field, name, children, ...props } = item;
|
|
29
|
-
// console.log('conditions', conditions);
|
|
30
|
-
// console.log('mapCondition', mapCondition(conditions[0].condition, field));
|
|
31
|
-
const cmpSchema = {
|
|
32
|
-
$cmp: item.$el ? item.$el : 'FormKit',
|
|
33
|
-
children: children,
|
|
34
|
-
// if: conditions ? mapCondition(conditions[0].condition, field) : undefined,
|
|
35
|
-
props: {
|
|
36
|
-
id: name,
|
|
37
|
-
...props,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
// Switch statement to handle item widths
|
|
41
|
-
switch (item.width) {
|
|
42
|
-
case '33':
|
|
43
|
-
cmpSchema.props.outerClass = 'md:col-span-2';
|
|
44
|
-
break;
|
|
45
|
-
case '50':
|
|
46
|
-
cmpSchema.props.outerClass = 'md:col-span-3';
|
|
47
|
-
break;
|
|
48
|
-
case '67':
|
|
49
|
-
cmpSchema.props.outerClass = 'md:col-span-4';
|
|
50
|
-
break;
|
|
51
|
-
case '100':
|
|
52
|
-
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
56
|
-
}
|
|
57
|
-
return cmpSchema;
|
|
58
|
-
});
|
|
59
|
-
}
|
package/utils/formkit.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { unref } from 'vue';
|
|
2
|
-
|
|
3
|
-
export interface Condition {
|
|
4
|
-
field: string;
|
|
5
|
-
action: 'show' | 'hide';
|
|
6
|
-
condition: 'is_empty' | 'is_filled' | 'contains' | 'not_contains' | 'equals' | 'not_equal';
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function convertBoolean(value: string) {
|
|
11
|
-
if (value === 'true' || value === 'false') {
|
|
12
|
-
return value === 'true';
|
|
13
|
-
} else {
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function mapCondition(condition: Condition['condition'], target: string) {
|
|
19
|
-
switch (condition) {
|
|
20
|
-
case 'is_empty':
|
|
21
|
-
return `!$get(${target}).value)`;
|
|
22
|
-
case 'is_filled':
|
|
23
|
-
return `$get(${target}).value)`;
|
|
24
|
-
default:
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function mapConditions(conditions: Condition[]) {
|
|
30
|
-
// Both $el and $cmp schema nodes can leverage an if property that roughly equates to a v-if in Vue. If the expression assigned to the if property is truthy, the node is rendered, otherwise it is not:
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function transformSchema(schema: Array<object>) {
|
|
34
|
-
// Loop through the form schema from Directus
|
|
35
|
-
// This is required for FormKit to work
|
|
36
|
-
const items = unref(schema);
|
|
37
|
-
return items.map((item: any) => {
|
|
38
|
-
const { conditions, field, name, children, ...props } = item;
|
|
39
|
-
|
|
40
|
-
// console.log('conditions', conditions);
|
|
41
|
-
// console.log('mapCondition', mapCondition(conditions[0].condition, field));
|
|
42
|
-
|
|
43
|
-
const cmpSchema = {
|
|
44
|
-
$cmp: item.$el ? item.$el : 'FormKit',
|
|
45
|
-
|
|
46
|
-
children: children,
|
|
47
|
-
// if: conditions ? mapCondition(conditions[0].condition, field) : undefined,
|
|
48
|
-
|
|
49
|
-
props: {
|
|
50
|
-
id: name,
|
|
51
|
-
...props,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Switch statement to handle item widths
|
|
56
|
-
switch (item.width) {
|
|
57
|
-
case '33':
|
|
58
|
-
cmpSchema.props.outerClass = 'md:col-span-2';
|
|
59
|
-
break;
|
|
60
|
-
case '50':
|
|
61
|
-
cmpSchema.props.outerClass = 'md:col-span-3';
|
|
62
|
-
break;
|
|
63
|
-
case '67':
|
|
64
|
-
cmpSchema.props.outerClass = 'md:col-span-4';
|
|
65
|
-
break;
|
|
66
|
-
case '100':
|
|
67
|
-
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
68
|
-
break;
|
|
69
|
-
default:
|
|
70
|
-
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return cmpSchema;
|
|
74
|
-
});
|
|
75
|
-
}
|
package/utils/icons.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const fileIconMap = {
|
|
2
|
-
folder: 'material-symbols:folder',
|
|
3
|
-
// Images
|
|
4
|
-
'image/jpeg': 'material-symbols:image',
|
|
5
|
-
'image/png': 'material-symbols:image',
|
|
6
|
-
'image/gif': 'material-symbols:image',
|
|
7
|
-
'image/svg+xml': 'material-symbols:image',
|
|
8
|
-
'image/webp': 'material-symbols:image',
|
|
9
|
-
// Videos
|
|
10
|
-
'video/mp4': 'material-symbols:smart-display',
|
|
11
|
-
'video/quicktime': 'material-symbols:smart-display',
|
|
12
|
-
// Audio
|
|
13
|
-
'audio/mp3': 'material-symbols:audio-file',
|
|
14
|
-
'audio/aac': 'material-symbols:audio-file',
|
|
15
|
-
'audio/wav': 'material-symbols:audio-file',
|
|
16
|
-
'audio/ogg': 'material-symbols:audio-file',
|
|
17
|
-
// Text
|
|
18
|
-
'text/csv': 'material-symbols:csv',
|
|
19
|
-
'text/plain': 'material-symbols:text-snippet',
|
|
20
|
-
// Files
|
|
21
|
-
'application/pdf': 'material-symbols:picture-as-pdf-sharp',
|
|
22
|
-
'application/vnd.ms-excel': 'material-symbols:sheets',
|
|
23
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'material-symbols:sheets',
|
|
24
|
-
'application/msword': 'material-symbols:docs',
|
|
25
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'material-symbols:docs',
|
|
26
|
-
'application/vnd.ms-powerpoint': 'material-symbols:slides',
|
|
27
|
-
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'material-symbols:slides',
|
|
28
|
-
};
|
|
29
|
-
export function getFileIcon(filetype) {
|
|
30
|
-
if (!filetype)
|
|
31
|
-
return 'material-symbols:attachment';
|
|
32
|
-
if (typeof filetype === 'string' && !(filetype in fileIconMap)) {
|
|
33
|
-
return 'material-symbols:attachment';
|
|
34
|
-
}
|
|
35
|
-
return fileIconMap[filetype];
|
|
36
|
-
}
|
package/utils/icons.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
type FileType =
|
|
2
|
-
| 'folder'
|
|
3
|
-
| 'image/jpeg'
|
|
4
|
-
| 'image/png'
|
|
5
|
-
| 'image/gif'
|
|
6
|
-
| 'image/svg+xml'
|
|
7
|
-
| 'image/webp'
|
|
8
|
-
| 'video/mp4'
|
|
9
|
-
| 'video/quicktime'
|
|
10
|
-
| 'audio/mp3'
|
|
11
|
-
| 'audio/aac'
|
|
12
|
-
| 'audio/wav'
|
|
13
|
-
| 'audio/ogg'
|
|
14
|
-
| 'text/csv'
|
|
15
|
-
| 'text/plain'
|
|
16
|
-
| 'application/pdf'
|
|
17
|
-
| 'application/vnd.ms-excel'
|
|
18
|
-
| 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
19
|
-
| 'application/msword'
|
|
20
|
-
| 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
21
|
-
| 'application/vnd.ms-powerpoint'
|
|
22
|
-
| 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
|
23
|
-
|
|
24
|
-
export const fileIconMap: Record<FileType, string> = {
|
|
25
|
-
folder: 'material-symbols:folder',
|
|
26
|
-
// Images
|
|
27
|
-
'image/jpeg': 'material-symbols:image',
|
|
28
|
-
'image/png': 'material-symbols:image',
|
|
29
|
-
'image/gif': 'material-symbols:image',
|
|
30
|
-
'image/svg+xml': 'material-symbols:image',
|
|
31
|
-
'image/webp': 'material-symbols:image',
|
|
32
|
-
// Videos
|
|
33
|
-
'video/mp4': 'material-symbols:smart-display',
|
|
34
|
-
'video/quicktime': 'material-symbols:smart-display',
|
|
35
|
-
// Audio
|
|
36
|
-
'audio/mp3': 'material-symbols:audio-file',
|
|
37
|
-
'audio/aac': 'material-symbols:audio-file',
|
|
38
|
-
'audio/wav': 'material-symbols:audio-file',
|
|
39
|
-
'audio/ogg': 'material-symbols:audio-file',
|
|
40
|
-
// Text
|
|
41
|
-
'text/csv': 'material-symbols:csv',
|
|
42
|
-
'text/plain': 'material-symbols:text-snippet',
|
|
43
|
-
|
|
44
|
-
// Files
|
|
45
|
-
'application/pdf': 'material-symbols:picture-as-pdf-sharp',
|
|
46
|
-
'application/vnd.ms-excel': 'material-symbols:sheets',
|
|
47
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'material-symbols:sheets',
|
|
48
|
-
'application/msword': 'material-symbols:docs',
|
|
49
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'material-symbols:docs',
|
|
50
|
-
'application/vnd.ms-powerpoint': 'material-symbols:slides',
|
|
51
|
-
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'material-symbols:slides',
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export function getFileIcon(filetype: FileType | string | null | undefined) {
|
|
55
|
-
if (!filetype) return 'material-symbols:attachment';
|
|
56
|
-
|
|
57
|
-
if (typeof filetype === 'string' && !(filetype in fileIconMap)) {
|
|
58
|
-
return 'material-symbols:attachment';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return fileIconMap[filetype as FileType];
|
|
62
|
-
}
|