plugins: exposed misc functions

Massimo Melina committed Feb 14, 2024 at 22:39 UTC 27349af1cc355e4937e210b4f668c68445ee74b1
3 files changed +5 -2
dev-plugins.md
+2
@@ -388,6 +388,8 @@ Eg: `HFS.t('filter_count', {n:filteredVariable}, "{n} filtered")`
388
389 ## API version history
390
391 +- 8.7 (v0.52.0)
392 + - exposed "misc" functions
393 - 8.65 (v0.51.0)
394 - plugin's own hfs-lang files
395 - HFS.state.props.can_overwrite
frontend/src/misc.ts
+2 -1
@@ -5,6 +5,7 @@ import { Spinner } from './components'
5 import { newDialog } from './dialog'
6 import { Icon } from './icons'
7 import { Dict, getHFS, HTTP_MESSAGES, useBatch } from '@hfs/shared'
8 +import * as misc from '../../src/cross'
9 import { apiCall, useApi } from '@hfs/shared/api'
10 import { state } from './state'
11 import { t } from './i18n'
@@ -55,7 +56,7 @@ export function hfsEvent(name: string, params?:Dict) {
56 return output
57 }
58
58 -const tools = { h, React, state, t, _, dialogLib, apiCall, useApi, reloadList, logout, Icon, hIcon, useBatch, fileShow,
59 +const tools = { misc, h, React, state, t, _, dialogLib, apiCall, useApi, reloadList, logout, Icon, hIcon, useBatch, fileShow,
60 watchState(k: string, cb: (v: any) => void) {
61 const up = k.split('upload.')[1]
62 return subscribeKey(up ? uploadState : state as any, up || k, cb, true)
src/const.ts
+1 -1
@@ -7,7 +7,7 @@ import { mkdirSync } from 'fs'
7 import { basename, dirname, join } from 'path'
8 export * from './cross-const'
9
10 -export const API_VERSION = 8.65
10 +export const API_VERSION = 8.7
11 export const COMPATIBLE_API_VERSION = 1 // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
12 export const HFS_REPO = 'rejetto/hfs'
13