diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index e14c1e0..88b00a3 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -47,4 +47,4 @@ jobs: steps: - name: Deploy id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v2 diff --git a/package.json b/package.json index 673ebfa..cfadbc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@airlookjs/svelte-sequence-editor", - "version": "3.0.0", + "version": "4.0.0", "author": "Johan Bichel Lindegaard ", "license": "MIT", "homepage": "https://github.com/airlookjs/svelte-sequence-editor#readme", @@ -44,13 +44,14 @@ "@semantic-release/commit-analyzer": "^11.1.0", "@semantic-release/git": "^10.0.1", "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "^2.3.0", + "@sveltejs/kit": "^2.3.2", "@sveltejs/package": "^2.2.5", "@sveltejs/vite-plugin-svelte": "^3.0.1", - "@typescript-eslint/eslint-plugin": "^6.18.1", - "@typescript-eslint/parser": "^6.18.1", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", "autoprefixer": "^10.4.16", "conventional-changelog-eslint": "^5.0.0", + "dayjs": "^1.11.10", "dequal": "^2.0.3", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", @@ -59,11 +60,11 @@ "flowbite-svelte": "^0.44.22", "lodash": "^4.17.21", "postcss": "^8.4.33", - "prettier": "^3.1.1", + "prettier": "^3.2.2", "prettier-plugin-svelte": "^3.1.2", "semantic-release": "^22.0.12", "svelte": "^4.2.8", - "svelte-check": "^3.6.2", + "svelte-check": "^3.6.3", "svelte-preprocess": "^5.1.3", "tailwindcss": "^3.4.1", "tslib": "^2.6.2", @@ -71,7 +72,7 @@ "vite": "^5.0.11" }, "peerDependencies": { - "svelte": "^4.1.2" + "svelte": "^4.2.8" }, "type": "module", "exports": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdb3104..92bbe35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,10 +19,10 @@ devDependencies: version: 10.0.1(semantic-release@22.0.12) '@sveltejs/adapter-static': specifier: ^3.0.1 - version: 3.0.1(@sveltejs/kit@2.3.0) + version: 3.0.1(@sveltejs/kit@2.3.2) '@sveltejs/kit': - specifier: ^2.3.0 - version: 2.3.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11) + specifier: ^2.3.2 + version: 2.3.2(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11) '@sveltejs/package': specifier: ^2.2.5 version: 2.2.5(svelte@4.2.8)(typescript@5.3.3) @@ -30,17 +30,20 @@ devDependencies: specifier: ^3.0.1 version: 3.0.1(svelte@4.2.8)(vite@5.0.11) '@typescript-eslint/eslint-plugin': - specifier: ^6.18.1 - version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.19.0 + version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: ^6.18.1 - version: 6.18.1(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.19.0 + version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) autoprefixer: specifier: ^10.4.16 version: 10.4.16(postcss@8.4.33) conventional-changelog-eslint: specifier: ^5.0.0 version: 5.0.0 + dayjs: + specifier: ^1.11.10 + version: 1.11.10 dequal: specifier: ^2.0.3 version: 2.0.3 @@ -66,11 +69,11 @@ devDependencies: specifier: ^8.4.33 version: 8.4.33 prettier: - specifier: ^3.1.1 - version: 3.1.1 + specifier: ^3.2.2 + version: 3.2.2 prettier-plugin-svelte: specifier: ^3.1.2 - version: 3.1.2(prettier@3.1.1)(svelte@4.2.8) + version: 3.1.2(prettier@3.2.2)(svelte@4.2.8) semantic-release: specifier: ^22.0.12 version: 22.0.12(typescript@5.3.3) @@ -78,8 +81,8 @@ devDependencies: specifier: ^4.2.8 version: 4.2.8 svelte-check: - specifier: ^3.6.2 - version: 3.6.2(postcss@8.4.33)(svelte@4.2.8) + specifier: ^3.6.3 + version: 3.6.3(postcss@8.4.33)(svelte@4.2.8) svelte-preprocess: specifier: ^5.1.3 version: 5.1.3(postcss@8.4.33)(svelte@4.2.8)(typescript@5.3.3) @@ -113,7 +116,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 dev: true /@babel/code-frame@7.23.5: @@ -451,7 +454,7 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 dev: true /@jridgewell/resolve-uri@3.1.1: @@ -468,8 +471,8 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.20: - resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==} + /@jridgewell/trace-mapping@0.3.21: + resolution: {integrity: sha512-SRfKmRe1KvYnxjEMtxEr+J4HIeMX5YBg/qhRHpxEIGjhX1rshcHlnFUE9K0GazhVKWM7B+nARSkV8LuvJdJ5/g==} dependencies: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 @@ -637,104 +640,104 @@ packages: resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} dev: true - /@rollup/rollup-android-arm-eabi@4.9.4: - resolution: {integrity: sha512-ub/SN3yWqIv5CWiAZPHVS1DloyZsJbtXmX4HxUTIpS0BHm9pW5iYBo2mIZi+hE3AeiTzHz33blwSnhdUo+9NpA==} + /@rollup/rollup-android-arm-eabi@4.9.5: + resolution: {integrity: sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.9.4: - resolution: {integrity: sha512-ehcBrOR5XTl0W0t2WxfTyHCR/3Cq2jfb+I4W+Ch8Y9b5G+vbAecVv0Fx/J1QKktOrgUYsIKxWAKgIpvw56IFNA==} + /@rollup/rollup-android-arm64@4.9.5: + resolution: {integrity: sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.9.4: - resolution: {integrity: sha512-1fzh1lWExwSTWy8vJPnNbNM02WZDS8AW3McEOb7wW+nPChLKf3WG2aG7fhaUmfX5FKw9zhsF5+MBwArGyNM7NA==} + /@rollup/rollup-darwin-arm64@4.9.5: + resolution: {integrity: sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.9.4: - resolution: {integrity: sha512-Gc6cukkF38RcYQ6uPdiXi70JB0f29CwcQ7+r4QpfNpQFVHXRd0DfWFidoGxjSx1DwOETM97JPz1RXL5ISSB0pA==} + /@rollup/rollup-darwin-x64@4.9.5: + resolution: {integrity: sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.9.4: - resolution: {integrity: sha512-g21RTeFzoTl8GxosHbnQZ0/JkuFIB13C3T7Y0HtKzOXmoHhewLbVTFBQZu+z5m9STH6FZ7L/oPgU4Nm5ErN2fw==} + /@rollup/rollup-linux-arm-gnueabihf@4.9.5: + resolution: {integrity: sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.9.4: - resolution: {integrity: sha512-TVYVWD/SYwWzGGnbfTkrNpdE4HON46orgMNHCivlXmlsSGQOx/OHHYiQcMIOx38/GWgwr/po2LBn7wypkWw/Mg==} + /@rollup/rollup-linux-arm64-gnu@4.9.5: + resolution: {integrity: sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.9.4: - resolution: {integrity: sha512-XcKvuendwizYYhFxpvQ3xVpzje2HHImzg33wL9zvxtj77HvPStbSGI9czrdbfrf8DGMcNNReH9pVZv8qejAQ5A==} + /@rollup/rollup-linux-arm64-musl@4.9.5: + resolution: {integrity: sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.9.4: - resolution: {integrity: sha512-LFHS/8Q+I9YA0yVETyjonMJ3UA+DczeBd/MqNEzsGSTdNvSJa1OJZcSH8GiXLvcizgp9AlHs2walqRcqzjOi3A==} + /@rollup/rollup-linux-riscv64-gnu@4.9.5: + resolution: {integrity: sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.9.4: - resolution: {integrity: sha512-dIYgo+j1+yfy81i0YVU5KnQrIJZE8ERomx17ReU4GREjGtDW4X+nvkBak2xAUpyqLs4eleDSj3RrV72fQos7zw==} + /@rollup/rollup-linux-x64-gnu@4.9.5: + resolution: {integrity: sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.9.4: - resolution: {integrity: sha512-RoaYxjdHQ5TPjaPrLsfKqR3pakMr3JGqZ+jZM0zP2IkDtsGa4CqYaWSfQmZVgFUCgLrTnzX+cnHS3nfl+kB6ZQ==} + /@rollup/rollup-linux-x64-musl@4.9.5: + resolution: {integrity: sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.9.4: - resolution: {integrity: sha512-T8Q3XHV+Jjf5e49B4EAaLKV74BbX7/qYBRQ8Wop/+TyyU0k+vSjiLVSHNWdVd1goMjZcbhDmYZUYW5RFqkBNHQ==} + /@rollup/rollup-win32-arm64-msvc@4.9.5: + resolution: {integrity: sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.9.4: - resolution: {integrity: sha512-z+JQ7JirDUHAsMecVydnBPWLwJjbppU+7LZjffGf+Jvrxq+dVjIE7By163Sc9DKc3ADSU50qPVw0KonBS+a+HQ==} + /@rollup/rollup-win32-ia32-msvc@4.9.5: + resolution: {integrity: sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.9.4: - resolution: {integrity: sha512-LfdGXCV9rdEify1oxlN9eamvDSjv9md9ZVMAbNHA87xqIfFCxImxan9qZ8+Un54iK2nnqPlbnSi4R54ONtbWBw==} + /@rollup/rollup-win32-x64-msvc@4.9.5: + resolution: {integrity: sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ==} cpu: [x64] os: [win32] requiresBuild: true @@ -881,16 +884,16 @@ packages: engines: {node: '>=18'} dev: true - /@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.3.0): + /@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.3.2): resolution: {integrity: sha512-6lMvf7xYEJ+oGeR5L8DFJJrowkefTK6ZgA4JiMqoClMkKq0s6yvsd3FZfCFvX1fQ0tpCD7fkuRVHsnUVgsHyNg==} peerDependencies: '@sveltejs/kit': ^2.0.0 dependencies: - '@sveltejs/kit': 2.3.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11) + '@sveltejs/kit': 2.3.2(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11) dev: true - /@sveltejs/kit@2.3.0(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11): - resolution: {integrity: sha512-A6/aQTVFONDDv8nRLINNiXrERq6VeAdHT+/gHPBUSDt4+b6oBKTEF3oiGzNmxspcWDgHzBpypFO7NWtkoUK67g==} + /@sveltejs/kit@2.3.2(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11): + resolution: {integrity: sha512-AzGWV1TyUSkBuciy06E5NegXndIEgTthDtllv80qynEJFh8bZD62ZxLajiQLOsKGqRDilEQyshDARQxjIqiaqg==} engines: {node: '>=18.13'} hasBin: true requiresBuild: true @@ -993,8 +996,8 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true - /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==} + /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1005,11 +1008,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.18.1(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/type-utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -1022,8 +1025,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.18.1(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==} + /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1032,10 +1035,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -1043,16 +1046,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.18.1: - resolution: {integrity: sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw==} + /@typescript-eslint/scope-manager@6.19.0: + resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 dev: true - /@typescript-eslint/type-utils@6.18.1(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==} + /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1061,8 +1064,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -1071,13 +1074,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.18.1: - resolution: {integrity: sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw==} + /@typescript-eslint/types@6.19.0: + resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.18.1(typescript@5.3.3): - resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==} + /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): + resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1085,8 +1088,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/visitor-keys': 6.18.1 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1098,8 +1101,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.18.1(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==} + /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1107,9 +1110,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -1117,11 +1120,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.18.1: - resolution: {integrity: sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA==} + /@typescript-eslint/visitor-keys@6.19.0: + resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.18.1 + '@typescript-eslint/types': 6.19.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1288,7 +1291,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.2 - caniuse-lite: 1.0.30001576 + caniuse-lite: 1.0.30001577 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1344,8 +1347,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001576 - electron-to-chromium: 1.4.628 + caniuse-lite: 1.0.30001577 + electron-to-chromium: 1.4.632 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) dev: true @@ -1364,8 +1367,8 @@ packages: engines: {node: '>= 6'} dev: true - /caniuse-lite@1.0.30001576: - resolution: {integrity: sha512-ff5BdakGe2P3SQsMsiqmt1Lc8221NR1VzHj5jXN5vBny9A6fpze94HiVV/n7XRosOlsShJcvMv5mdnpjOGCEgg==} + /caniuse-lite@1.0.30001577: + resolution: {integrity: sha512-rs2ZygrG1PNXMfmncM0B5H1hndY5ZCC9b5TkFaVNfZ+AUlyqcMyVIQtc3fsezi0NUCk5XZfDf9WS6WxMxnfdrg==} dev: true /cardinal@2.1.1: @@ -1598,6 +1601,10 @@ packages: hasBin: true dev: true + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} + dev: true + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1685,8 +1692,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.628: - resolution: {integrity: sha512-2k7t5PHvLsufpP6Zwk0nof62yLOsCf032wZx7/q0mv8gwlXjhcxI3lz6f0jBr0GrnWKcm3burXzI3t5IrcdUxw==} + /electron-to-chromium@1.4.632: + resolution: {integrity: sha512-JGmudTwg7yxMYvR/gWbalqqQiyu7WTFv2Xu3vw4cJHXPFxNgAk0oy8UHaer8nLF4lZJa+rNoj6GsrKIVJTV6Tw==} dev: true /emoji-regex@8.0.0: @@ -3313,18 +3320,18 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-plugin-svelte@3.1.2(prettier@3.1.1)(svelte@4.2.8): + /prettier-plugin-svelte@3.1.2(prettier@3.2.2)(svelte@4.2.8): resolution: {integrity: sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==} peerDependencies: prettier: ^3.0.0 svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0 dependencies: - prettier: 3.1.1 + prettier: 3.2.2 svelte: 4.2.8 dev: true - /prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} + /prettier@3.2.2: + resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==} engines: {node: '>=14'} hasBin: true dev: true @@ -3462,26 +3469,26 @@ packages: glob: 7.2.3 dev: true - /rollup@4.9.4: - resolution: {integrity: sha512-2ztU7pY/lrQyXSCnnoU4ICjT/tCG9cdH3/G25ERqE3Lst6vl2BCM5hL2Nw+sslAvAf+ccKsAq1SkKQALyqhR7g==} + /rollup@4.9.5: + resolution: {integrity: sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.9.4 - '@rollup/rollup-android-arm64': 4.9.4 - '@rollup/rollup-darwin-arm64': 4.9.4 - '@rollup/rollup-darwin-x64': 4.9.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.9.4 - '@rollup/rollup-linux-arm64-gnu': 4.9.4 - '@rollup/rollup-linux-arm64-musl': 4.9.4 - '@rollup/rollup-linux-riscv64-gnu': 4.9.4 - '@rollup/rollup-linux-x64-gnu': 4.9.4 - '@rollup/rollup-linux-x64-musl': 4.9.4 - '@rollup/rollup-win32-arm64-msvc': 4.9.4 - '@rollup/rollup-win32-ia32-msvc': 4.9.4 - '@rollup/rollup-win32-x64-msvc': 4.9.4 + '@rollup/rollup-android-arm-eabi': 4.9.5 + '@rollup/rollup-android-arm64': 4.9.5 + '@rollup/rollup-darwin-arm64': 4.9.5 + '@rollup/rollup-darwin-x64': 4.9.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.5 + '@rollup/rollup-linux-arm64-gnu': 4.9.5 + '@rollup/rollup-linux-arm64-musl': 4.9.5 + '@rollup/rollup-linux-riscv64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-gnu': 4.9.5 + '@rollup/rollup-linux-x64-musl': 4.9.5 + '@rollup/rollup-win32-arm64-msvc': 4.9.5 + '@rollup/rollup-win32-ia32-msvc': 4.9.5 + '@rollup/rollup-win32-x64-msvc': 4.9.5 fsevents: 2.3.3 dev: true @@ -3805,13 +3812,13 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte-check@3.6.2(postcss@8.4.33)(svelte@4.2.8): - resolution: {integrity: sha512-E6iFh4aUCGJLRz6QZXH3gcN/VFfkzwtruWSRmlKrLWQTiO6VzLsivR6q02WYLGNAGecV3EocqZuCDrC2uttZ0g==} + /svelte-check@3.6.3(postcss@8.4.33)(svelte@4.2.8): + resolution: {integrity: sha512-Q2nGnoysxUnB9KjnjpQLZwdjK62DHyW6nuH/gm2qteFnDk0lCehe/6z8TsIvYeKjC6luKaWxiNGyOcWiLLPSwA==} hasBin: true peerDependencies: svelte: ^3.55.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 dependencies: - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 chokidar: 3.5.3 fast-glob: 3.3.2 import-fresh: 3.3.0 @@ -3924,7 +3931,7 @@ packages: dependencies: '@ampproject/remapping': 2.2.1 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.20 + '@jridgewell/trace-mapping': 0.3.21 acorn: 8.11.3 aria-query: 5.3.0 axobject-query: 3.2.1 @@ -4252,7 +4259,7 @@ packages: dependencies: esbuild: 0.19.11 postcss: 8.4.33 - rollup: 4.9.4 + rollup: 4.9.5 optionalDependencies: fsevents: 2.3.3 dev: true diff --git a/src/lib/Block.ts b/src/lib/Block.ts index 4da1eb9..59d97e9 100644 --- a/src/lib/Block.ts +++ b/src/lib/Block.ts @@ -17,6 +17,17 @@ const DEFAULT_VALIDATION_OPTIONS: Required = { } }; +type ISetTimeOptions = { + maintainDuration?: boolean; + snap?: boolean; + snapTimes?: number[]; + snapThreshold?: number; +}; + +const DEFAULT_SET_TIME_OPTIONS = { + snapThreshold: 150 +}; + export class Block implements ISequenceChild { layers: Layer[]; index: number; @@ -26,7 +37,7 @@ export class Block implements ISequenceChild { data?: { [key: string]: unknown; }; - markers: { time: number; label: string }[] = []; + markers: { time: number; title?: string }[] = []; errors: { type: string; message: string }[] = []; private _inTime?: number; @@ -194,18 +205,12 @@ export class Block implements ISequenceChild { this.setOutTime(this._outTime as number); } - public setInTime( - value: number, - options: { maintainDuration?: boolean; snap?: boolean; snapTimes?: number[] } = {} - ) { + public setInTime(value: number, options: ISetTimeOptions = DEFAULT_SET_TIME_OPTIONS) { const res = this.setTimeCommon(value, tHandles.inTime, options); return res.apply(); } - public setOutTime( - value: number, - options: { maintainDuration?: boolean; snap?: boolean; snapTimes?: number[] } = {} - ) { + public setOutTime(value: number, options: ISetTimeOptions = DEFAULT_SET_TIME_OPTIONS) { const res = this.setTimeCommon(value, tHandles.outTime, options); return res.apply(); } @@ -223,11 +228,18 @@ export class Block implements ISequenceChild { protected setTimeCommon( inputValue: number, prop: tHandles, - options: { maintainDuration?: boolean; snap?: boolean; snapTimes?: number[] } = {}, + options: ISetTimeOptions = DEFAULT_SET_TIME_OPTIONS, depth = 0 ) { depth++; + const { + maintainDuration, + snap, + snapTimes, + snapThreshold = DEFAULT_SET_TIME_OPTIONS.snapThreshold + } = options; + const value = this.roundTime(inputValue); const propValidation = this.validations[prop]; @@ -278,16 +290,15 @@ export class Block implements ISequenceChild { // if value is within a certain threshold of a value in snapTimes // snap to that value // TODO: parse in value bases on ui pixels - const snapTimeThreshold = 150; - if (options.snapTimes) { - const snaps = options.snapTimes + if (snapTimes) { + const snaps = snapTimes .map((snapTime) => { // make relative return snapTime - this.parent.getAbsoluteInTime(); }) .filter((snapTime) => { - return Math.abs(setT - snapTime) < snapTimeThreshold; + return Math.abs(setT - snapTime) < snapThreshold; }) .sort((a, b) => { return Math.abs(setT - a) - Math.abs(setT - b); @@ -319,7 +330,7 @@ export class Block implements ISequenceChild { const expanding = (fwd && prop == 'outTime') || (!fwd && prop == 'inTime'); - if (options?.maintainDuration) { + if (maintainDuration) { //console.debug(debugPrefix, 'set opposing to maintain duration'); const res = setOp(opC + diff, { maintainDuration: false, snapTimes: [] }); @@ -357,15 +368,10 @@ export class Block implements ISequenceChild { if ((isIn && setT < adj[opProp]) || (!isIn && setT > adj[opProp])) { //console.debug(debugPrefix, 'hits adjacent block'); - if (options.snap) { + if (snap) { setT = adj[opProp]; } else { - const res = adj.setTimeCommon( - setT, - opProp, - { maintainDuration: options.maintainDuration }, - depth - ); + const res = adj.setTimeCommon(setT, opProp, { maintainDuration }, depth); res.apply(); setT = res.v1; } @@ -429,7 +435,7 @@ export class Block implements ISequenceChild { // const lastChild = layer.blocks[layer.blocks.length - 1]; - if (!isIn && setT - this.inTime < lastChild.outTime && !options.maintainDuration) { + if (!isIn && setT - this.inTime < lastChild.outTime && !maintainDuration) { const res = lastChild.setTimeCommon( setT - this.inTime, tHandles.outTime, @@ -440,7 +446,7 @@ export class Block implements ISequenceChild { setT = this.inTime + res.v1; return res; - } else if (isIn && !options.maintainDuration) { + } else if (isIn && !maintainDuration) { if (this.outTime - setT < lastChild.outTime) { const res = lastChild.setTimeCommon( this.outTime - setT, @@ -461,7 +467,10 @@ export class Block implements ISequenceChild { return set(setT); } - public move(delta: number, options: { snap?: boolean; snapTimes?: number[] } = {}) { + public move( + delta: number, + options: Omit = DEFAULT_SET_TIME_OPTIONS + ) { if (delta == 0) return; const res = this.setTimeCommon( diff --git a/src/lib/components/Block.svelte b/src/lib/components/Block.svelte index 8002436..57d7704 100644 --- a/src/lib/components/Block.svelte +++ b/src/lib/components/Block.svelte @@ -120,11 +120,13 @@ } // if user has cursor over a marker or handle on another block then snap to its time if within a certain threshold - let res; + const snapThreshold = 10 * ($duration / $width); // snap to marker if within 10 pixels regardless of screen width and duration + + const opts = { snap, snapTimes: $snapTimes, snapThreshold }; if (handle == 'block') { - res = block.move(accDeltaTime, { snap: snap, snapTimes: $snapTimes }); + res = block.move(accDeltaTime, opts); time.set(block.absoluteInTime); } else if (handle == 'inTime') { /*const snapInDelta = $snapValue && $snapValue - (block.inTime + accDeltaTime); @@ -139,12 +141,12 @@ //snap = true; } else {*/ - res = block.setInTime(block.inTime + accDeltaTime, { snap: snap, snapTimes: $snapTimes }); + res = block.setInTime(block.inTime + accDeltaTime, opts); //} time.set(block.absoluteInTime); } else if (handle == 'outTime') { - res = block.setOutTime(block.outTime + accDeltaTime, { snap: snap, snapTimes: $snapTimes }); + res = block.setOutTime(block.outTime + accDeltaTime, opts); time.set(block.absoluteOutTime); } @@ -176,7 +178,6 @@ //const timeToPixel = (t: number) => (t / $duration) * $width; //$: console.log(accDeltaTime); - export let tag = 'div'; export let noHandles = false; export let disabled = false; @@ -251,7 +252,12 @@ {#if markers.length > 0}
{#each markers as marker, index} - {/each}
diff --git a/src/lib/components/BlockMarker.svelte b/src/lib/components/BlockMarker.svelte index f96ec8b..6d43b39 100644 --- a/src/lib/components/BlockMarker.svelte +++ b/src/lib/components/BlockMarker.svelte @@ -4,13 +4,20 @@ export let time: number; export let index: number; + export let title = `Marker #${index + 1}`; export let disableSnapping = false; export let block: Block; export let tag = 'div'; - const { duration, width, scrubOverride, time: playheadTime } = getSequenceContext(); + const { duration, width, scrubOverride, time: playheadTime, formatTimeFn } = getSequenceContext(); + + //export let format = (value: number) => `${Math.round(value)}`; + + export let formatTitle = () => { + return `${title} (+${formatTimeFn(time)})`; + }; $: timeToPixel = (1 / $duration) * $width; $: absoluteTime = time + block.absoluteInTime; @@ -25,7 +32,7 @@ >
`${Math.round(value)}`; + setSequenceContext({ time, duration, @@ -29,7 +31,8 @@ width, snapTimes, selectedHandle, - scrubOverride + scrubOverride, + formatTimeFn }); $: currentTime = $time; @@ -84,7 +87,7 @@ > - + diff --git a/src/lib/components/SequenceContext.ts b/src/lib/components/SequenceContext.ts index 9740562..034e22d 100644 --- a/src/lib/components/SequenceContext.ts +++ b/src/lib/components/SequenceContext.ts @@ -12,6 +12,7 @@ export type SequenceContext = { snapTimes: Writable; scrubOverride: Writable; sequence: Writable; + formatTimeFn: (time: number) => string; }; export const key = Symbol(); diff --git a/src/lib/components/Timebar.svelte b/src/lib/components/Timebar.svelte index 5b2511d..d7b0948 100644 --- a/src/lib/components/Timebar.svelte +++ b/src/lib/components/Timebar.svelte @@ -4,9 +4,15 @@ import TimebarLabel from './TimebarLabel.svelte'; - const { time, duration, scrubOverride, selectedHandle } = getSequenceContext(); - - export let formatTimeFn = (value: number) => `${Math.round(value)}`; + const { + time, + duration, + scrubOverride, + selectedHandle, + formatTimeFn: sequenceFormatTimeFn + } = getSequenceContext(); + + export let formatTimeFn = sequenceFormatTimeFn; // We could instead have a store for timebarLabels that we loop over to allow showing n number of relevant times and control through context let extraTime: number | null = null; diff --git a/src/lib/components/TimebarLabel.svelte b/src/lib/components/TimebarLabel.svelte index 0b46b31..958a448 100644 --- a/src/lib/components/TimebarLabel.svelte +++ b/src/lib/components/TimebarLabel.svelte @@ -2,9 +2,9 @@ import { uniqueClasses } from '../utils'; import { getSequenceContext } from './SequenceContext'; - const { duration, width } = getSequenceContext(); + const { duration, width, formatTimeFn } = getSequenceContext(); - export let formatFn = (value: number) => `${Math.round(value)}`; + export let formatFn = formatTimeFn; export let time: number; let pos: number; diff --git a/src/lib/types.d.ts b/src/lib/types.d.ts index f8e5d52..3a3b3f0 100644 --- a/src/lib/types.d.ts +++ b/src/lib/types.d.ts @@ -46,7 +46,7 @@ export type TSequenceBlockOptions = ISequenceCommonOptions & { outTime?: number; // Initial outTime as absolute milliseconds validations?: TValidationOptions; layers?: Array; - markers?: Array<{ time: number; label: string }>; + markers?: Array<{ time: number; title?: string }>; }; export interface ISequenceCommon { diff --git a/src/routes/examples/markers/+page.svelte b/src/routes/examples/markers/+page.svelte index e1176e2..e99a5a0 100644 --- a/src/routes/examples/markers/+page.svelte +++ b/src/routes/examples/markers/+page.svelte @@ -5,6 +5,10 @@ import CustomLayer from './CustomLayer.svelte'; import { Label, Input } from 'flowbite-svelte'; + import dayjs from 'dayjs'; + import dayjsDuration from 'dayjs/plugin/duration'; + dayjs.extend(dayjsDuration); + const PromoterBlockTemplate = { key: 'promoter', type: 'promoter', @@ -32,43 +36,40 @@ markers: [ { time: 1000, - label: 'scene 1' + title: 'scene 1' }, { time: 1050, - label: 'scene 2' + title: 'scene 2' }, { - time: 300, - label: 'scene 3' + time: 300 }, { - time: 4000, - label: 'scene 4' + time: 4000 }, { - time: 5000, - label: 'scene 5' + time: 5000 }, { time: 6000, - label: 'scene 6' + title: 'scene 6' }, { time: 7000, - label: 'scene 7' + title: 'scene 7' }, { time: 8000, - label: 'scene 8' + title: 'scene 8' }, { time: 9000, - label: 'scene 9' + title: 'scene 9' }, { time: 10000, - label: 'scene 10' + title: 'scene 10' } ] } @@ -181,6 +182,43 @@ /* TODO: toggle snapping */ + + const millisInSecond = 1000; + const millisInFrame = (framerate: number) => { + return (1 / framerate) * millisInSecond; + }; + + type formatTimeOptions = { + framerate?: number; + format?: string; + }; + const formatTimeFn = (time: number, options?: formatTimeOptions) => { + if (time === undefined || time === null) { + return ''; + } + + time = Math.floor(time); + + let format = options?.format ?? 'HH:mm:ss.SSS'; + const framerate = options?.framerate ?? 25; + + const duration = dayjs.duration(time, 'milliseconds'); + + if (format.includes('FF')) { + // calculate remaining frames after smallest unit in format string + + const millis = duration.milliseconds(); + const frames = Math.floor(millis / millisInFrame(framerate)); + + format = format.replace('FF', `${frames}`.padStart(2, '0')); + } + + if (format.includes('R')) { + format = format.replace('R', `${framerate}`); + } + + return `${duration.format(format)}`; + };
@@ -219,13 +257,10 @@ - `${value}`} - class="dark:bg-gray-900" - /> +