@aitronos/freddy-plugins 0.4.57 → 0.4.58

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.4.58 (2025-11-24)
2
+
3
+ **Updating vite.config, exports to improve the feature**
4
+
5
+ ### Commit Details
6
+ - **Commit Message:** Updating vite.config, exports to improve the feature
7
+ - **Branch:** `improvisation-pack` (Other)
8
+ - **Commit Hash:** `73c95b3`
9
+ - **Author:** asif-mn-aitronos
10
+ - **Date:** 2025-11-24
11
+ - **Version Type:** patch
12
+
13
+ ### Changes
14
+ - Updating vite.config, exports to improve the feature
15
+
1
16
  ## 0.4.57 (2025-11-24)
2
17
 
3
18
  **emoving services, fix component usage and commenting assistants export to check all working or not.**
package/README.md CHANGED
@@ -473,67 +473,264 @@ The Storybook provides:
473
473
  - Animation showcases
474
474
  - Utility function documentation
475
475
 
476
- ## 🟢 Vue Usage
476
+ ## 🟢 Usage in Vue 3 and Nuxt 3
477
477
 
478
- ### **Security Features**
479
-
480
- - ✅ **HTTPS only** - All traffic encrypted
481
- - ✅ **Security headers** - XSS, CSRF protection
482
- - ✅ **Content Security Policy** - Resource restrictions
483
- - ✅ **No sensitive data** - Public component library
484
478
  ### Installation
485
479
 
486
- ### **Performance Optimizations**
487
-
488
- - ✅ **Gzip compression** - Reduced transfer size
489
- - ✅ **Static asset caching** - 1-year cache headers
490
- - ✅ **CDN distribution** - Global edge locations
491
- - ✅ **Auto-scaling** - Handles traffic spikes
492
480
  ```bash
493
481
  npm install @aitronos/freddy-plugins
482
+ # or
483
+ yarn add @aitronos/freddy-plugins
484
+ # or
485
+ pnpm add @aitronos/freddy-plugins
486
+ ```
487
+
488
+ ### Vue 3 Usage
489
+
490
+ #### Basic Setup
491
+
492
+ 1. **Import CSS** - Always import the CSS file first:
493
+ ```typescript
494
+ import "@aitronos/freddy-plugins/freddy-plugins.css";
494
495
  ```
495
496
 
496
- ### Using in Vue 3
497
+ 2. **Register Plugin** - In your `main.ts`:
498
+ ```typescript
499
+ // main.ts
500
+ import { createApp } from 'vue';
501
+ import App from './App.vue';
502
+ import FreddyPlugin from '@aitronos/freddy-plugins';
503
+ import '@aitronos/freddy-plugins/freddy-plugins.css';
504
+
505
+ const app = createApp(App);
506
+ app.use(FreddyPlugin);
507
+ app.mount('#app');
508
+ ```
509
+
510
+ #### Using Components
497
511
 
498
- ### **DNS Configuration**
512
+ After registering the plugin, all components and icons are available globally:
499
513
 
500
- Add these CNAME records in Hostpoint.ch:
501
514
  ```vue
502
- <!-- App.vue -->
515
+ <!-- MyComponent.vue -->
503
516
  <template>
504
517
  <div>
505
- <h1>My Vue App</h1>
506
- <freddy-button @click="handleClick">Click me!</freddy-button>
507
- <icon-search></icon-search>
518
+ <!-- Use components directly -->
519
+ <BaseButton @click="handleClick">Click Me</BaseButton>
520
+ <InputField v-model="inputValue" placeholder="Enter text" />
521
+
522
+ <!-- Use icons directly -->
523
+ <IconSearch />
524
+ <IconUser />
525
+ <IconSettings />
526
+
527
+ <!-- Use other components -->
528
+ <ModalBox v-model="showModal">
529
+ <p>Modal content</p>
530
+ </ModalBox>
508
531
  </div>
509
532
  </template>
510
533
 
511
534
  <script setup lang="ts">
512
- import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
535
+ import { ref } from 'vue';
513
536
 
514
- const handleClick = (event: CustomEvent) => {
515
- console.log("Button clicked:", event.detail);
537
+ const inputValue = ref('');
538
+ const showModal = ref(false);
539
+
540
+ const handleClick = (): void => {
541
+ console.log('Button clicked');
516
542
  };
517
543
  </script>
518
544
  ```
519
545
 
520
- ### Using Vue Components (Alternative)
546
+ #### Importing Individual Components (Tree-shaking)
547
+
548
+ If you prefer to import components individually for better tree-shaking:
521
549
 
522
550
  ```vue
523
551
  <!-- MyComponent.vue -->
524
552
  <template>
525
553
  <div>
526
- <Button>Vue Component</Button>
554
+ <BaseButton>Click Me</BaseButton>
527
555
  <IconSearch />
528
556
  </div>
529
557
  </template>
530
558
 
531
559
  <script setup lang="ts">
532
- import { Button, IconSearch } from "@aitronos/freddy-plugins";
533
- import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
560
+ import { BaseButton, IconSearch } from '@aitronos/freddy-plugins';
561
+ import '@aitronos/freddy-plugins/freddy-plugins.css';
534
562
  </script>
535
563
  ```
536
564
 
565
+ #### Using Directives
566
+
567
+ ```vue
568
+ <template>
569
+ <div>
570
+ <!-- Use fr-sanitize directive -->
571
+ <div v-fr-sanitize="htmlContent"></div>
572
+
573
+ <!-- Use icon-style directive -->
574
+ <IconSearch v-icon-style="{ color: 'blue', size: '24px' }" />
575
+ </div>
576
+ </template>
577
+
578
+ <script setup lang="ts">
579
+ import { ref } from 'vue';
580
+ import '@aitronos/freddy-plugins/freddy-plugins.css';
581
+
582
+ const htmlContent = ref('<p>Safe HTML content</p>');
583
+ </script>
584
+ ```
585
+
586
+ ### Nuxt 3 Usage
587
+
588
+ #### Basic Setup
589
+
590
+ 1. **Install the package** (if not already installed):
591
+ ```bash
592
+ npm install @aitronos/freddy-plugins
593
+ ```
594
+
595
+ 2. **Add CSS to `nuxt.config.ts`**:
596
+ ```typescript
597
+ // nuxt.config.ts
598
+ export default defineNuxtConfig({
599
+ css: [
600
+ '@aitronos/freddy-plugins/freddy-plugins.css'
601
+ ],
602
+ // ... other config
603
+ });
604
+ ```
605
+
606
+ 3. **Create a plugin file** - Create `plugins/freddy-plugins.client.ts`:
607
+ ```typescript
608
+ // plugins/freddy-plugins.client.ts
609
+ export default defineNuxtPlugin(async (nuxtApp) => {
610
+ // Import and register the plugin on client side
611
+ const { default: FreddyPlugin } = await import('@aitronos/freddy-plugins');
612
+ nuxtApp.vueApp.use(FreddyPlugin);
613
+ });
614
+ ```
615
+
616
+ **Note**: The `.client.ts` suffix ensures the plugin only runs on the client side, which is recommended for SSR compatibility.
617
+
618
+ #### Using Components in Nuxt 3
619
+
620
+ After setting up the plugin, components are available globally:
621
+
622
+ ```vue
623
+ <!-- pages/index.vue -->
624
+ <template>
625
+ <div>
626
+ <BaseButton @click="handleClick">Click Me</BaseButton>
627
+ <InputField v-model="inputValue" placeholder="Enter text" />
628
+ <IconSearch />
629
+ </div>
630
+ </template>
631
+
632
+ <script setup lang="ts">
633
+ import { ref } from 'vue';
634
+
635
+ const inputValue = ref('');
636
+
637
+ const handleClick = (): void => {
638
+ console.log('Button clicked');
639
+ };
640
+ </script>
641
+ ```
642
+
643
+ #### Alternative: Import Individual Components
644
+
645
+ For better tree-shaking and explicit imports:
646
+
647
+ ```vue
648
+ <!-- pages/about.vue -->
649
+ <template>
650
+ <div>
651
+ <BaseButton>Click Me</BaseButton>
652
+ <IconUser />
653
+ </div>
654
+ </template>
655
+
656
+ <script setup lang="ts">
657
+ import { BaseButton, IconUser } from '@aitronos/freddy-plugins';
658
+ </script>
659
+ ```
660
+
661
+ #### Using Directives in Nuxt 3
662
+
663
+ ```vue
664
+ <!-- components/MyComponent.vue -->
665
+ <template>
666
+ <div>
667
+ <!-- fr-sanitize directive -->
668
+ <div v-fr-sanitize="sanitizedHtml"></div>
669
+
670
+ <!-- icon-style directive -->
671
+ <IconSearch v-icon-style="{ color: 'blue' }" />
672
+ </div>
673
+ </template>
674
+
675
+ <script setup lang="ts">
676
+ import { ref } from 'vue';
677
+
678
+ const sanitizedHtml = ref('<p>Safe HTML</p>');
679
+ </script>
680
+ ```
681
+
682
+ #### SSR-Safe Plugin Registration
683
+
684
+ If you need SSR support, you can register the plugin conditionally:
685
+
686
+ ```typescript
687
+ // plugins/freddy-plugins.ts
688
+ export default defineNuxtPlugin(async (nuxtApp) => {
689
+ // Only load on client side for SSR compatibility
690
+ if (process.client) {
691
+ const { default: FreddyPlugin } = await import('@aitronos/freddy-plugins');
692
+ nuxtApp.vueApp.use(FreddyPlugin);
693
+ }
694
+ });
695
+ ```
696
+
697
+ ### TypeScript Support
698
+
699
+ The library includes full TypeScript definitions. Make sure your `tsconfig.json` includes:
700
+
701
+ ```json
702
+ {
703
+ "compilerOptions": {
704
+ "types": ["@aitronos/freddy-plugins"]
705
+ }
706
+ }
707
+ ```
708
+
709
+ ### Available Exports
710
+
711
+ ```typescript
712
+ // Main plugin (default export)
713
+ import FreddyPlugin from '@aitronos/freddy-plugins';
714
+
715
+ // Individual plugins
716
+ import { frSanitizePlugin, iconStylePlugin } from '@aitronos/freddy-plugins';
717
+
718
+ // Directives
719
+ import { IconStyleDirective, vFrSanitize } from '@aitronos/freddy-plugins';
720
+
721
+ // Components
722
+ import { BaseButton, InputField, ModalBox } from '@aitronos/freddy-plugins';
723
+
724
+ // Icons
725
+ import { IconSearch, IconUser, IconSettings } from '@aitronos/freddy-plugins';
726
+
727
+ // Composables
728
+ import { useErrorHandler, usePerformance } from '@aitronos/freddy-plugins';
729
+
730
+ // Helpers
731
+ import { sanitizeHTML, formatDate } from '@aitronos/freddy-plugins';
732
+ ```
733
+
537
734
  ### **SSL Certificates**
538
735
 
539
736
  - Automatically managed by Google Cloud