@phill-component/icons 1.10.3 → 1.10.6

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.
Files changed (69) hide show
  1. package/dist/mobile/uvue/icon-attachment/attachment.png +0 -0
  2. package/dist/mobile/uvue/{icon-edit/icon-edit.uvue → icon-attachment/icon-attachment.uvue} +2 -2
  3. package/dist/mobile/uvue/icon-brush/brush.png +0 -0
  4. package/dist/mobile/vue/{icon-filter.vue → icon-attachment.vue} +2 -2
  5. package/dist/web/vue/{Copy.vue → Attachment.vue} +1 -1
  6. package/dist/web/vue/index.js +2 -16
  7. package/package.json +23 -21
  8. package/scripts/build.js +1 -1
  9. package/dist/mobile/uvue/icon-calendar/calendar.png +0 -0
  10. package/dist/mobile/uvue/icon-calendar/icon-calendar.uvue +0 -75
  11. package/dist/mobile/uvue/icon-copy/copy.png +0 -0
  12. package/dist/mobile/uvue/icon-copy/icon-copy.uvue +0 -75
  13. package/dist/mobile/uvue/icon-edit/edit.png +0 -0
  14. package/dist/mobile/uvue/icon-file-fold/file_fold.png +0 -0
  15. package/dist/mobile/uvue/icon-file-fold/icon-file-fold.uvue +0 -75
  16. package/dist/mobile/uvue/icon-filter/filter.png +0 -0
  17. package/dist/mobile/uvue/icon-filter/icon-filter.uvue +0 -75
  18. package/dist/mobile/uvue/icon-find-replace/find-replace.png +0 -0
  19. package/dist/mobile/uvue/icon-find-replace/icon-find-replace.uvue +0 -75
  20. package/dist/mobile/uvue/icon-h6/h6.png +0 -0
  21. package/dist/mobile/uvue/icon-h6/icon-h6.uvue +0 -75
  22. package/dist/mobile/uvue/icon-highlight/highlight.png +0 -0
  23. package/dist/mobile/uvue/icon-highlight/icon-highlight.uvue +0 -75
  24. package/dist/mobile/uvue/icon-home/home.png +0 -0
  25. package/dist/mobile/uvue/icon-home/icon-home.uvue +0 -75
  26. package/dist/mobile/uvue/icon-oblique-line/icon-oblique-line.uvue +0 -75
  27. package/dist/mobile/uvue/icon-oblique-line/oblique-line.png +0 -0
  28. package/dist/mobile/uvue/icon-original-size/icon-original-size.uvue +0 -75
  29. package/dist/mobile/uvue/icon-original-size/original-size.png +0 -0
  30. package/dist/mobile/uvue/icon-setting/icon-setting.uvue +0 -75
  31. package/dist/mobile/uvue/icon-setting/setting.png +0 -0
  32. package/dist/mobile/uvue/icon-task/icon-task.uvue +0 -75
  33. package/dist/mobile/uvue/icon-task/task.png +0 -0
  34. package/dist/mobile/uvue/icon-to-landscape/icon-to-landscape.uvue +0 -75
  35. package/dist/mobile/uvue/icon-to-landscape/to_landscape.png +0 -0
  36. package/dist/mobile/uvue/icon-zoom-in/icon-zoom-in.uvue +0 -75
  37. package/dist/mobile/uvue/icon-zoom-in/zoom-in.png +0 -0
  38. package/dist/mobile/vue/icon-calendar.vue +0 -58
  39. package/dist/mobile/vue/icon-copy.vue +0 -58
  40. package/dist/mobile/vue/icon-edit.vue +0 -58
  41. package/dist/mobile/vue/icon-file-fold.vue +0 -58
  42. package/dist/mobile/vue/icon-find-replace.vue +0 -58
  43. package/dist/mobile/vue/icon-h6.vue +0 -58
  44. package/dist/mobile/vue/icon-highlight.vue +0 -58
  45. package/dist/mobile/vue/icon-home.vue +0 -58
  46. package/dist/mobile/vue/icon-oblique-line.vue +0 -58
  47. package/dist/mobile/vue/icon-original-size.vue +0 -58
  48. package/dist/mobile/vue/icon-setting.vue +0 -58
  49. package/dist/mobile/vue/icon-task.vue +0 -58
  50. package/dist/mobile/vue/icon-to-landscape.vue +0 -58
  51. package/dist/mobile/vue/icon-zoom-in.vue +0 -58
  52. package/dist/web/vue/Calendar.vue +0 -53
  53. package/dist/web/vue/Edit.vue +0 -53
  54. package/dist/web/vue/FileFold.vue +0 -53
  55. package/dist/web/vue/Filter.vue +0 -53
  56. package/dist/web/vue/FindReplace.vue +0 -53
  57. package/dist/web/vue/H6.vue +0 -53
  58. package/dist/web/vue/Highlight.vue +0 -53
  59. package/dist/web/vue/Home.vue +0 -53
  60. package/dist/web/vue/ObliqueLine.vue +0 -53
  61. package/dist/web/vue/OriginalSize.vue +0 -53
  62. package/dist/web/vue/Setting.vue +0 -53
  63. package/dist/web/vue/Task.vue +0 -53
  64. package/dist/web/vue/ToLandscape.vue +0 -53
  65. package/dist/web/vue/ZoomIn.vue +0 -53
  66. package/scripts/fetch.js +0 -47
  67. package/scripts/jenkins-server.js +0 -198
  68. package/scripts/publish.js +0 -155
  69. package/scripts/sync.js +0 -201
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="2" d="M6 19h10m0 0h26m-26 0V9m0 10v10m0 0v10m0-10H6m10 0h26M6 9h36v30H6z"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="2" d="M29.506 6.502 18.494 41.498"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="2" d="M34 11.5 39 9h1v32"/><path fill="currentColor" d="M24 17h1v1h-1zm0 13h1v1h-1z"/><path stroke="currentColor" stroke-width="2" d="M24 17h1v1h-1zm0 13h1v1h-1zM5.5 11.5l5-2.5h1v32"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M12 8a4 4 0 1 1 0 8.001 4 4 0 0 1 0-8m0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M10.539 2.634a2 2 0 0 1 2.922 0l1.675 1.793 2.453-.083a2 2 0 0 1 2.066 2.067l-.082 2.453 1.792 1.675a2 2 0 0 1 0 2.922l-1.792 1.675.082 2.452a2 2 0 0 1-2.067 2.067l-2.452-.082-1.675 1.792a2 2 0 0 1-2.922 0l-1.675-1.792-2.453.082a2 2 0 0 1-2.067-2.066l.083-2.453-1.793-1.675a2 2 0 0 1 0-2.922l1.793-1.675-.083-2.453a2 2 0 0 1 2.067-2.067l2.453.083zm-.214 3.158a2 2 0 0 1-1.53.634l-2.452-.083.083 2.452a2 2 0 0 1-.634 1.53L4 12l1.792 1.675a2 2 0 0 1 .634 1.53l-.083 2.453 2.452-.084a2 2 0 0 1 1.53.633L12 20l1.675-1.793a2 2 0 0 1 1.53-.633l2.453.084-.084-2.454a2 2 0 0 1 .633-1.529L20 12l-1.793-1.675a2 2 0 0 1-.633-1.53l.084-2.452-2.454.083a2 2 0 0 1-1.529-.634L12 4z" clip-rule="evenodd"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M18.059 12.905a2 2 0 0 1 1.6 3.199h.001c-.01.014-.544.747-.595 1.514l-.003 1.258 1.712.383a1.645 1.645 0 0 1 1.287 1.605v.65a.275.275 0 0 1-.274.275h-7.45a.275.275 0 0 1-.274-.274v-.653c0-.77.534-1.437 1.285-1.605l1.714-.386.003-1.14h-.004a2.6 2.6 0 0 0-.5-1.501 2.001 2.001 0 0 1 1.498-3.324"/><path fill="currentColor" d="M6.96 3.387c0-.598.431-1.082.962-1.082h5.77c.53 0 .96.484.96 1.082 0 .597-.43 1.082-.96 1.082h-5.77c-.53 0-.961-.485-.961-1.082"/><path fill="currentColor" d="M6.157 3.062q-.019.132-.02.27c0 1.046.824 1.895 1.842 1.895h5.524c1.017 0 1.842-.849 1.842-1.895a2 2 0 0 0-.02-.27h1.222c1.205 0 2.182.976 2.183 2.181v6.197a3.363 3.363 0 0 0-3.235 5.47c.11.163.272.473.272.849v.24l-.87.195a2.99 2.99 0 0 0-2.332 2.724H4.932a2.18 2.18 0 0 1-2.182-2.182V5.243c0-1.205.977-2.181 2.182-2.181z"/><path fill="currentColor" d="M6.95 3.332c0-.598.424-1.082.947-1.082h5.688c.523 0 .948.484.948 1.082s-.425 1.082-.948 1.082H7.897c-.523 0-.948-.484-.948-1.082"/><path fill="currentColor" fill-rule="evenodd" d="M14.604 8.9a.77.77 0 0 1 .169 1.11l-3.103 3.975c-1.133 1.468-2.234 1.071-3.128.217l-1.487-1.42a.77.77 0 0 1 0-1.12.857.857 0 0 1 1.173 0l1.487 1.42c.178.17.474.15.625-.044l3.103-3.976a.855.855 0 0 1 1.16-.162" clip-rule="evenodd"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M20 11a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2zM4 20h16v-7H4zm6-18a2 2 0 0 1 2 2v5a1 1 0 1 1-2 0V4H4v5a1 1 0 0 1-2 0V4a2 2 0 0 1 2-2zm8 0a1 1 0 0 1 1 .998l.006 3.23.954-.953a1 1 0 0 1 1.414 1.415l-2.657 2.657a1 1 0 0 1-1.414 0L14.646 6.69a1.001 1.001 0 0 1 1.415-1.415l.945.946L17.002 4H14.5a1 1 0 1 1 0-2z"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
@@ -1,53 +0,0 @@
1
- <template>
2
- <view class="icon" @tap="onTap" :hover-class="hoverClass" :style="[wrapStyle, iconStyle]">
3
- <svg v-bind="$attrs" :style="iconStyle" :width="iconW" :height="iconH" fill="none" viewBox="0 0 48 48"><path stroke="currentColor" stroke-width="2" d="M32.607 32.607A14.95 14.95 0 0 0 37 22c0-8.284-6.716-15-15-15S7 13.716 7 22s6.716 15 15 15c4.142 0 7.892-1.679 10.607-4.393zm0 0L41.5 41.5M29 22H15m7 7V15"/></svg>
4
- <text v-if="label !== ''" class="icon__label" :style="labelStyle">{{ label }}</text>
5
- </view>
6
- </template>
7
- <script setup>
8
- import { computed } from 'vue'
9
- const props = defineProps({
10
- size: { type: [String, Number], default: '1em' },
11
- color: { type: String, default: 'inherit' },
12
- label: { type: [String, Number], default: '' },
13
- labelPos: { type: String, default: 'right' },
14
- labelSize: { type: [String, Number], default: '15px' },
15
- labelColor: { type: String, default: '' },
16
- space: { type: [String, Number], default: '3px' },
17
- width: { type: [String, Number], default: '' },
18
- height: { type: [String, Number], default: '' },
19
- hoverClass: { type: String, default: '' },
20
- index: { type: [String, Number], default: '' },
21
- stop: { type: Boolean, default: false }
22
- })
23
- const emit = defineEmits(['click'])
24
- const toPx = (v) => typeof v === 'number' ? (v + 'px') : (String(v||''));
25
- const iconW = computed(() => props.width ? toPx(props.width) : toPx(props.size))
26
- const iconH = computed(() => props.height ? toPx(props.height) : toPx(props.size))
27
- const iconBoxStyle = computed(() => ({ width: iconW.value, height: iconH.value }))
28
- const iconStyle = computed(() => {
29
- return { color: props.color || 'inherit' }
30
- })
31
- const wrapStyle = computed(() => {
32
- const dirMap = { right: 'row', left: 'row-reverse', top: 'column-reverse', bottom: 'column' }
33
- return { display: 'flex', alignItems: 'center', flexDirection: dirMap[props.labelPos] || 'row' }
34
- })
35
- const labelStyle = computed(() => {
36
- return {
37
- color: props.labelColor || '',
38
- fontSize: toPx(props.labelSize),
39
- marginLeft: props.labelPos === 'right' ? toPx(props.space) : 0,
40
- marginTop: props.labelPos === 'bottom' ? toPx(props.space) : 0,
41
- marginRight: props.labelPos === 'left' ? toPx(props.space) : 0,
42
- marginBottom: props.labelPos === 'top' ? toPx(props.space) : 0
43
- }
44
- })
45
- const imgSrc = '__IMG_SRC__'
46
- function onTap(e) {
47
- emit('click', props.index)
48
- if (props.stop && e && e.stopPropagation) e.stopPropagation()
49
- }
50
- </script>
51
- <style scoped>
52
- .icon__label { line-height: 1; }
53
- </style>
package/scripts/fetch.js DELETED
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * fetch.js - 生成 icons manifest 并输出到 stdout
4
- *
5
- * 用途:B 服务器运行此脚本,生成当前 SVG 目录的 manifest
6
- * A 服务器通过 HTTP 请求获取此 manifest,用于比较差异
7
- *
8
- * 输出格式:
9
- * {
10
- * "icons": {
11
- * "home": "sha256:abc123...",
12
- * "edit": "sha256:def456..."
13
- * }
14
- * }
15
- */
16
- const fs = require('fs');
17
- const path = require('path');
18
- const crypto = require('crypto');
19
-
20
- function getSvgHash(filePath) {
21
- const content = fs.readFileSync(filePath);
22
- return crypto.createHash('sha256').update(content).digest('hex');
23
- }
24
-
25
- function main() {
26
- const pkgDir = process.cwd();
27
- const svgDir = path.join(pkgDir, 'svg');
28
-
29
- if (!fs.existsSync(svgDir)) {
30
- console.error('[fetch-icons] 未找到 svg 目录。');
31
- process.exit(1);
32
- }
33
-
34
- const files = fs.readdirSync(svgDir).filter(f => f.endsWith('.svg'));
35
- const manifest = { icons: {} };
36
-
37
- for (const file of files) {
38
- const name = file.replace('.svg', '');
39
- const hash = getSvgHash(path.join(svgDir, file));
40
- manifest.icons[name] = `sha256:${hash}`;
41
- }
42
-
43
- // 输出 JSON 到 stdout
44
- console.log(JSON.stringify(manifest, null, 2));
45
- }
46
-
47
- main();
@@ -1,198 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * jenkins-server.js - 模拟 Jenkins 服务器
4
- *
5
- * 用途:接收 A 服务器 (Icon Portal) 的请求,执行 sync 和 release 脚本
6
- *
7
- * 环境变量:
8
- * - PORT - 服务器端口 (默认 3001)
9
- */
10
- const http = require('http');
11
- const fs = require('fs');
12
- const path = require('path');
13
- const cp = require('child_process');
14
-
15
- const PORT = process.env.PORT || 3001;
16
-
17
- // 临时目录用于存储接收到的数据
18
- const tempDir = path.join(__dirname, '..', '.temp');
19
- if (!fs.existsSync(tempDir)) {
20
- fs.mkdirSync(tempDir, { recursive: true });
21
- }
22
-
23
- function parseBody(req) {
24
- return new Promise((resolve, reject) => {
25
- let body = '';
26
- req.on('data', chunk => { body += chunk; });
27
- req.on('end', () => {
28
- try {
29
- resolve(JSON.parse(body));
30
- } catch {
31
- reject(new Error('Invalid JSON'));
32
- }
33
- });
34
- req.on('error', reject);
35
- });
36
- }
37
-
38
- function execScript(script, args = [], env = {}) {
39
- return new Promise((resolve, reject) => {
40
- const pkgDir = path.join(__dirname, '..');
41
- const child = cp.spawn('node', [path.join(__dirname, script), ...args], {
42
- cwd: pkgDir,
43
- stdio: ['pipe', 'pipe', 'pipe'],
44
- env: { ...process.env, ...env }
45
- });
46
-
47
- let stdout = '';
48
- let stderr = '';
49
-
50
- child.stdout.on('data', data => { stdout += data; });
51
- child.stderr.on('data', data => { stderr += data; });
52
-
53
- child.on('close', code => {
54
- if (code === 0) {
55
- resolve({ stdout, stderr });
56
- } else {
57
- reject(new Error(`Script ${script} exited with code ${code}: ${stderr}`));
58
- }
59
- });
60
-
61
- child.on('error', reject);
62
- });
63
- }
64
-
65
- const server = http.createServer(async (req, res) => {
66
- const url = new URL(req.url, `http://localhost:${PORT}`);
67
-
68
- // CORS headers
69
- res.setHeader('Access-Control-Allow-Origin', '*');
70
- res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
71
- res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
72
-
73
- if (req.method === 'OPTIONS') {
74
- res.writeHead(204);
75
- res.end();
76
- return;
77
- }
78
-
79
- try {
80
- // GET /health - 健康检查
81
- if (req.method === 'GET' && url.pathname === '/health') {
82
- res.writeHead(200, { 'Content-Type': 'application/json' });
83
- res.end(JSON.stringify({ status: 'ok' }));
84
- return;
85
- }
86
-
87
- // GET /manifest - 获取当前 manifest (对应 fetch.js)
88
- if (req.method === 'GET' && url.pathname === '/manifest') {
89
- console.log('[Jenkins] Fetching current manifest...');
90
- const result = await execScript('fetch.js');
91
- res.writeHead(200, { 'Content-Type': 'application/json' });
92
- res.end(result.stdout);
93
- return;
94
- }
95
-
96
- // GET /svg/:name - 获取 SVG 文件内容
97
- if (req.method === 'GET' && url.pathname.startsWith('/svg/')) {
98
- const name = url.pathname.replace('/svg/', '').replace('.svg', '');
99
- const svgPath = path.join(__dirname, '..', 'svg', `${name}.svg`);
100
- if (fs.existsSync(svgPath)) {
101
- res.writeHead(200, { 'Content-Type': 'image/svg+xml' });
102
- res.end(fs.readFileSync(svgPath, 'utf-8'));
103
- } else {
104
- res.writeHead(404, { 'Content-Type': 'application/json' });
105
- res.end(JSON.stringify({ error: 'SVG not found' }));
106
- }
107
- return;
108
- }
109
-
110
- // POST /sync - 接收 added/modified/deleted 数据并执行同步
111
- if (req.method === 'POST' && url.pathname === '/sync') {
112
- const body = await parseBody(req);
113
- const { added, modified, deleted, version } = body;
114
-
115
- // 保存数据到临时文件
116
- const dataPath = path.join(tempDir, 'sync-data.json');
117
- fs.writeFileSync(dataPath, JSON.stringify({ added, modified, deleted }, null, 2));
118
-
119
- console.log(`[Jenkins] Received sync request:`);
120
- console.log(` Added: ${Object.keys(added || {}).length} icons`);
121
- console.log(` Modified: ${Object.keys(modified || {}).length} icons`);
122
- console.log(` Deleted: ${(deleted || []).length} icons`);
123
- console.log(` Version: ${version || 'not specified'}`);
124
-
125
- // 执行 sync 脚本
126
- const syncArgs = ['--data', dataPath];
127
- if (version) {
128
- syncArgs.push('--version', version);
129
- }
130
-
131
- console.log(`[Jenkins] Running sync.js ${syncArgs.join(' ')}`);
132
- const syncResult = await execScript('sync.js', syncArgs);
133
- console.log('[Jenkins] Sync output:', syncResult.stdout);
134
-
135
- // 解析 sync 输出,查找 changed 字段
136
- let syncOutput;
137
- try {
138
- // 查找 JSON 输出行
139
- const lines = syncResult.stdout.trim().split('\n');
140
- const jsonLine = lines.find(line => line.startsWith('{'));
141
- if (jsonLine) {
142
- syncOutput = JSON.parse(jsonLine);
143
- }
144
- } catch (e) {
145
- console.log('[Jenkins] Failed to parse sync output:', e.message);
146
- }
147
-
148
- const hasChanges = syncOutput?.changed !== false;
149
-
150
- if (!hasChanges) {
151
- console.log('[Jenkins] No changes detected, skipping release.');
152
- res.writeHead(200, { 'Content-Type': 'application/json' });
153
- res.end(JSON.stringify({
154
- success: true,
155
- changed: false,
156
- message: 'No changes detected'
157
- }));
158
- return;
159
- }
160
-
161
- console.log('[Jenkins] Changes detected, running release...');
162
-
163
- // 如果指定了版本,执行 release
164
- if (version) {
165
- console.log(`[Jenkins] Running release for version ${version}`);
166
- const releaseResult = await execScript('publish.js', [], { PHILLUI_PUBLISH: '1' });
167
- console.log('[Jenkins] Release completed:', releaseResult.stdout);
168
- }
169
-
170
- res.writeHead(200, { 'Content-Type': 'application/json' });
171
- res.end(JSON.stringify({
172
- success: true,
173
- changed: true,
174
- version: version || null,
175
- message: 'Sync and release completed',
176
- syncOutput
177
- }));
178
- return;
179
- }
180
-
181
- // 404
182
- res.writeHead(404, { 'Content-Type': 'application/json' });
183
- res.end(JSON.stringify({ error: 'Not found' }));
184
- } catch (err) {
185
- console.error('[Jenkins] Error:', err.message);
186
- res.writeHead(500, { 'Content-Type': 'application/json' });
187
- res.end(JSON.stringify({ error: err.message }));
188
- }
189
- });
190
-
191
- server.listen(PORT, () => {
192
- console.log(`[Jenkins] Mock server running on http://localhost:${PORT}`);
193
- console.log(`[Jenkins] Available endpoints:`);
194
- console.log(` GET /health - Health check`);
195
- console.log(` GET /manifest - Get current manifest (fetch.js)`);
196
- console.log(` GET /svg/:name - Get SVG file content`);
197
- console.log(` POST /sync - Sync icons and release (sync.js + publish.js)`);
198
- });