sprintify-ui 0.11.7 → 0.11.9

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.
@@ -1,20 +1,22 @@
1
1
  import { Breadcrumb, ActionItem } from '@/types';
2
2
  import BaseBadge from './BaseBadge.vue';
3
- import { RouteRecordRaw } from 'vue-router';
3
+ import { RouteLocationRaw } from 'vue-router';
4
4
  type BaseBadgeProps = InstanceType<typeof BaseBadge>["$props"] & {
5
5
  label: string;
6
6
  };
7
+ interface HeaderAttribute {
8
+ icon?: string;
9
+ label: string;
10
+ tooltip?: string;
11
+ to?: RouteLocationRaw;
12
+ href?: string;
13
+ action?: () => Promise<void> | void;
14
+ target?: string;
15
+ }
7
16
  type __VLS_Props = {
8
17
  title: string;
9
18
  subtitle?: string;
10
- attributes?: {
11
- icon?: string;
12
- label: string;
13
- tooltip?: string;
14
- to?: RouteRecordRaw;
15
- href?: string;
16
- target?: string;
17
- }[];
19
+ attributes?: HeaderAttribute[];
18
20
  actions?: ActionItem[];
19
21
  badge?: BaseBadgeProps;
20
22
  layout?: 'default' | 'compact';
@@ -26,14 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
26
28
  maxActions: number;
27
29
  breadcrumbs: Breadcrumb[];
28
30
  layout: "default" | "compact";
29
- attributes: {
30
- icon?: string;
31
- label: string;
32
- tooltip?: string;
33
- to?: RouteRecordRaw;
34
- href?: string;
35
- target?: string;
36
- }[];
31
+ attributes: HeaderAttribute[];
37
32
  subtitle: string;
38
33
  badge: BaseBadgeProps;
39
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && vue-tsc && vite build",
@@ -46,6 +46,11 @@ body {
46
46
  @apply text-base leading-relaxed;
47
47
  margin: 1em 0;
48
48
  }
49
+
50
+ p:has(+ ol),
51
+ p:has(+ ul) {
52
+ margin-bottom: 0;
53
+ }
49
54
 
50
55
  h1,
51
56
  h2,
@@ -299,4 +304,4 @@ body .tiptap {
299
304
  height: 0;
300
305
  pointer-events: none;
301
306
  }
302
- }
307
+ }
@@ -54,3 +54,19 @@
54
54
  border-radius: 0;
55
55
  }
56
56
  }
57
+
58
+ /** prose overwrites */
59
+
60
+ body .prose {
61
+
62
+ line-height: 1.5;
63
+
64
+ & p:has(+ ol),
65
+ & p:has(+ ul) {
66
+ margin-bottom: 0;
67
+ }
68
+
69
+ ul, ol {
70
+ margin-top: 0;
71
+ }
72
+ }
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script lang="ts" setup>
16
- import { ClassicEditor, InlineEditor, BalloonEditor, Essentials, SourceEditing, MediaEmbed, Paragraph, Bold, Italic, List, Link, Autoformat, Heading, Underline, Code, CodeBlock, Table, TableToolbar, Image, ImageResize, ImageStyle, ImageToolbar, ImageInsert, AutoImage, Base64UploadAdapter, PasteFromOffice, BlockToolbar, Font, FindAndReplace, RemoveFormat } from 'ckeditor5';
16
+ import { ClassicEditor, InlineEditor, BalloonEditor, Essentials, SourceEditing, MediaEmbed, Paragraph, Bold, Italic, List, Link, Autoformat, Heading, Underline, Code, CodeBlock, Indent, IndentBlock, Table, TableToolbar, Image, ImageResize, ImageStyle, ImageToolbar, ImageInsert, AutoImage, Base64UploadAdapter, PasteFromOffice, BlockToolbar, Font, FindAndReplace, RemoveFormat } from 'ckeditor5';
17
17
  import { Ckeditor } from '@ckeditor/ckeditor5-vue';
18
18
  import { Size } from '@/utils/sizes';
19
19
  import { ToolbarOption } from '@/types/ToolbarOption';
@@ -33,11 +33,11 @@ const props = withDefaults(defineProps<{
33
33
  'undo',
34
34
  'redo',
35
35
  '|',
36
- 'sourceEditing',
37
36
  'heading',
38
37
  'bold',
39
38
  'italic',
40
39
  'underline',
40
+ 'fontBackgroundColor',
41
41
  '|',
42
42
  'link',
43
43
  'insertImage',
@@ -45,9 +45,6 @@ const props = withDefaults(defineProps<{
45
45
  'numberedList',
46
46
  'bulletedList',
47
47
  '|',
48
- 'code',
49
- 'codeblock',
50
- '|',
51
48
  'insertTable'
52
49
  ] as ToolbarOption[];
53
50
  },
@@ -99,6 +96,8 @@ const config = computed(() => {
99
96
  Code,
100
97
  CodeBlock,
101
98
  List,
99
+ Indent,
100
+ IndentBlock,
102
101
  Link,
103
102
  Autoformat,
104
103
  Heading,
@@ -42,6 +42,25 @@ const attributes = [
42
42
  tooltip: "Anywhere",
43
43
  to: '/articles'
44
44
  },
45
+ {
46
+ label: 'URL',
47
+ icon: 'heroicons:link-solid',
48
+ href: 'https://example.com'
49
+ },
50
+ {
51
+ label: 'URL (new tab)',
52
+ icon: 'heroicons:link-solid',
53
+ href: 'https://example.com',
54
+ target: '_blank'
55
+ },
56
+ {
57
+ label: 'Action',
58
+ icon: 'heroicons:play-solid',
59
+ tooltip: 'Run action',
60
+ action() {
61
+ alert('Action');
62
+ }
63
+ }
45
64
  ];
46
65
 
47
66
  const actions = [
@@ -51,11 +51,13 @@
51
51
  :delay="400"
52
52
  >
53
53
  <component
54
- :is="attribute.to ? 'router-link' : (attribute.href ? 'a' : 'div')"
54
+ :is="attribute.to ? 'router-link' : (attribute.href ? 'a' : (attribute.action ? 'button' : 'div'))"
55
55
  :to="attribute.to"
56
56
  :href="attribute.href"
57
+ :type="attribute.action && !attribute.to && !attribute.href ? 'button' : undefined"
57
58
  :target="attribute.target ?? undefined"
58
59
  class="flex items-center gap-1.5"
60
+ @click="attribute.action && !attribute.to && !attribute.href ? onAttributeClick(attribute.action) : undefined"
59
61
  >
60
62
  <BaseIcon
61
63
  v-if="attribute.icon"
@@ -98,17 +100,27 @@ import { BaseBreadcrumbs, BaseIcon } from '..';
98
100
  import BaseBadge from './BaseBadge.vue';
99
101
  import BaseTooltip from './BaseTooltip.vue';
100
102
  import BaseActionButtons from './BaseActionButtons.vue';
101
- import { RouteRecordRaw } from 'vue-router';
103
+ import { RouteLocationRaw } from 'vue-router';
102
104
 
103
105
  type BaseBadgeProps = InstanceType<typeof BaseBadge>["$props"] & {
104
106
  label: string;
105
107
  };
106
108
 
109
+ interface HeaderAttribute {
110
+ icon?: string;
111
+ label: string;
112
+ tooltip?: string;
113
+ to?: RouteLocationRaw;
114
+ href?: string;
115
+ action?: () => Promise<void> | void;
116
+ target?: string;
117
+ }
118
+
107
119
  const props = withDefaults(
108
120
  defineProps<{
109
121
  title: string;
110
122
  subtitle?: string;
111
- attributes?: { icon?: string; label: string; tooltip?: string, to?: RouteRecordRaw, href?: string, target?: string }[];
123
+ attributes?: HeaderAttribute[];
112
124
  actions?: ActionItem[];
113
125
  badge?: BaseBadgeProps;
114
126
  layout?: 'default' | 'compact';
@@ -140,4 +152,8 @@ const compactLayout = computed(() => {
140
152
  return width.value < 500;
141
153
  });
142
154
 
155
+ async function onAttributeClick(action: () => Promise<void> | void) {
156
+ await action();
157
+ }
158
+
143
159
  </script>
@@ -42,6 +42,7 @@ const Template = (args) => ({
42
42
  },
43
43
  template: `
44
44
  <BaseRichText v-model="value" v-bind="args" class="w-full"></BaseRichText>
45
+ <div class="prose" v-html="value"></div>
45
46
  <ShowValue :value="value" />
46
47
  `,
47
48
  });