Commit 4 of 130:
52b025ff05
chore: wip
previous
next
whole branch
Review threads live on the whole diff, not on one commit, so
none are shown here - a thread's line means something in the
branch's final form, and painting it into an intermediate
step would put it on code it is not about.
docs/.vitepress/theme/components/QRDemo.vue modified +2 -2 Changes to docs/.vitepress/theme/components/QRDemo.vue @@ -1,10 +1,10 @@ 1 1 < script setup > 2 - import { QRCode } from '@stacksjs/qrx' 2 + import { QRCode , QRErrorCorrectLevel } from '@stacksjs/qrx' 3 3 import { onMounted , ref , watch } from 'vue' 4 4 5 5 6 6 const text = ref ( 'Hello World!' ) 7 - const errorLevel = ref ( '2' ) 7 + const errorLevel = ref ( QRErrorCorrectLevel . H ) 8 8 const useSVG = ref ( true ) 9 9 const qrContainer = ref ( null ) 10 10 let qrCode = null
docs/.vitepress/vite.config.ts modified +4 -0 Changes to docs/.vitepress/vite.config.ts ⋯ 12 lines Show the 12 lines above this hunk @@ -13,10 +13,14 @@ export default defineConfig({ 13 13 output : { 14 14 assetFileNames : 'assets/[name].[hash][extname]' , 15 15 } , 16 + external : [ 'path' , 'process' , 'bunfig' ] , 16 17 } , 17 18 } , 18 19 19 20 resolve : { 21 + alias : { 22 + '@stacksjs/qrx' : resolve ( __dirname , '../../packages/qrx/src/index.ts' ) , 23 + } , 20 24 dedupe : [ 21 25 'vue' , 22 26 '@vue/runtime-core' ,
packages/qrx/src/qr/index.ts modified +4 -3 Changes to packages/qrx/src/qr/index.ts @@ -1,7 +1,9 @@ 1 - import type { QRCodeOptions , RSBlock } from './types' 2 - import { QRErrorCorrectLevel , QRMaskPattern , QRMode } from './types' 1 + import type { QRCodeOptions , RSBlock } from '. . /types' 2 + import { QRErrorCorrectLevel , QRMaskPattern , QRMode } from '. . /types' 3 3 import { getAndroid , getUTF8Length , isSupportCanvas } from './utils' 4 4 5 + export * from './utils' 6 + 5 7 6 8 7 9 ⋯ 1,537 lines Show the 1,537 lines above this hunk @@ -1545,7 +1547,6 @@ export class QRCode { 1545 1547 1546 1548 1547 1549 1548 - 1549 1550 1550 1551 1551 1552
packages/qrx/src/qr/types.ts deleted +0 -57 Changes to packages/qrx/src/qr/types.ts @@ -1,57 +0,0 @@ 1 - 2 - 3 - 4 - export enum QRMode { 5 - MODE_NUMBER = 1 , 6 - MODE_ALPHA_NUM = 2 , 7 - MODE_8BIT_BYTE = 4 , 8 - MODE_KANJI = 8 , 9 - } 10 - 11 - 12 - 13 - 14 - export enum QRErrorCorrectLevel { 15 - L = 1 , 16 - M = 0 , 17 - Q = 3 , 18 - H = 2 , 19 - } 20 - 21 - 22 - 23 - 24 - export enum QRMaskPattern { 25 - PATTERN000 = 0 , 26 - PATTERN001 = 1 , 27 - PATTERN010 = 2 , 28 - PATTERN011 = 3 , 29 - PATTERN100 = 4 , 30 - PATTERN101 = 5 , 31 - PATTERN110 = 6 , 32 - PATTERN111 = 7 , 33 - } 34 - 35 - 36 - 37 - 38 - export interface RSBlock { 39 - totalCount : number 40 - dataCount : number 41 - errorCount : number 42 - } 43 - 44 - 45 - 46 - 47 - export interface QRCodeConfig { 48 - text : string 49 - width : number 50 - height : number 51 - colorDark : string 52 - colorLight : string 53 - correctLevel : QRErrorCorrectLevel 54 - useSVG : boolean 55 - } 56 - 57 - export type QRCodeOptions = Partial < QRCodeConfig >
packages/qrx/src/types.ts modified +58 -3 Changes to packages/qrx/src/types.ts @@ -1,6 +1,3 @@ 1 - export interface QRCodeOptions { } 2 - interface QRCodeConfig { } 3 - 4 1 export interface QrxConfig { 5 2 type : 'bar' | 'qr' 6 3 options : BarcodeConfig | QRCodeConfig ⋯ 87 lines Show the 87 lines above this hunk @@ -94,3 +91,61 @@ export interface Barcode { 94 91 Pharmacode : ( value : string , options ? : BarcodeConfig ) => Barcode 95 92 Codabar : ( value : string , options ? : BarcodeConfig ) => Barcode 96 93 } 94 + 95 + 96 + 97 + 98 + export enum QRMode { 99 + MODE_NUMBER = 1 , 100 + MODE_ALPHA_NUM = 2 , 101 + MODE_8BIT_BYTE = 4 , 102 + MODE_KANJI = 8 , 103 + } 104 + 105 + 106 + 107 + 108 + export enum QRErrorCorrectLevel { 109 + L = 1 , 110 + M = 0 , 111 + Q = 3 , 112 + H = 2 , 113 + } 114 + 115 + 116 + 117 + 118 + export enum QRMaskPattern { 119 + PATTERN000 = 0 , 120 + PATTERN001 = 1 , 121 + PATTERN010 = 2 , 122 + PATTERN011 = 3 , 123 + PATTERN100 = 4 , 124 + PATTERN101 = 5 , 125 + PATTERN110 = 6 , 126 + PATTERN111 = 7 , 127 + } 128 + 129 + 130 + 131 + 132 + export interface RSBlock { 133 + totalCount : number 134 + dataCount : number 135 + errorCount : number 136 + } 137 + 138 + 139 + 140 + 141 + export interface QRCodeConfig { 142 + text : string 143 + width : number 144 + height : number 145 + colorDark : string 146 + colorLight : string 147 + correctLevel : QRErrorCorrectLevel 148 + useSVG : boolean 149 + } 150 + 151 + export type QRCodeOptions = Partial < QRCodeConfig >