add nanoid

This commit is contained in:
hufeixiong
2021-07-13 11:21:55 +08:00
parent 09e69a9239
commit 04ff764a82
12 changed files with 175 additions and 26 deletions

View File

@@ -0,0 +1,49 @@
---
title: CHANGELOG
order: 1
---
## 0.3.1
1、由uuid更换为nanoid。
2、control组件增加标尺控制。
## 0.3.0
1、增加标尺ContainerWrapper需要传递config才可使用。
2、修改容器最小拖动667。修复画布缩放下拖拽时与鼠标距离不一致。
3、innerContainerDragUp需要传递config。
## 0.2.0
commander的传递进行修改可以获得config了commander不再从index中导出 需要使用时从config中获取。增加左侧类名方便自定义。
## 0.1.10
修改eslint依赖推荐
## 0.1.9
增加全局body设置
## 0.1.8
增加弹窗设置移除modalContainer
## 0.1.7
修改预览特殊条件显示删除console
## 0.1.6
调整初始缩放,画布初始比例,增加回正画布功能。
## 0.1.5
删除未作按钮增加fixed配置
## 0.1.4
基础功能

View File

@@ -14,6 +14,7 @@
const home = base + '/';
const docs = base + '/docs';
const api = base + '/api';
const changelog = base +'/changelog'
</script>
<header>
@@ -32,6 +33,9 @@
<div class:active={$page.path === '/api'}>
<Button href={api} color={$page.path === '/api' ? '#4569d4' : '#4d5164'}>API</Button>
</div>
<div class:active={$page.path === '/changelog'}>
<Button href={changelog} color={$page.path === '/changelog' ? '#4569d4' : '#4d5164'}>更新</Button>
</div>
<div class:active={$page.path === '/about'}>
<Button>Github</Button>
</div>

View File

@@ -0,0 +1,18 @@
/*
* @Author: yehuozhili
* @Date: 2021-07-13 11:11:17
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-13 11:11:42
* @FilePath: \dooringx\packages\dooringx-doc\src\routes\changelog\index.json.ts
*/
// 必须建立json否则不生成json文件
import type { RequestHandler } from '@sveltejs/kit';
import { api } from '../docs/_api';
export const get: RequestHandler = async (request) => {
const param = request.query;
const name = param.get('name');
const response = await api(name);
return response;
};

View File

@@ -0,0 +1,64 @@
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
import type { MarkDownItemProps } from '../docs/_api';
import { base } from '$app/paths';
export const load: Load = async ({ fetch }) => {
const path = `${base}/api.json?name=changelog`;
const res = await fetch(path);
if (res.ok) {
const files: MarkDownItemProps[] = await res.json();
return {
props: { files: files }
};
}
const { message } = await res.json();
return {
error: new Error(message)
};
};
</script>
<script lang="ts">
import DocRender from '$lib/DocRender/index.svelte';
import { getContext } from 'svelte';
import type { Writable } from 'svelte/store';
export let files: MarkDownItemProps[];
const lang = getContext<Writable<string>>('lang');
let sections = new Map<string, MarkDownItemProps[]>();
lang.subscribe((la) => {
sections = new Map<string, MarkDownItemProps[]>();
let tmp = files.filter((v) => {
const name = v.file;
const sp = name.split('.');
if (Array.isArray(sp) && sp.length > 1 && sp[sp.length - 2] === 'EN') {
return la === 'en';
} else {
return la === 'cn';
}
});
tmp.forEach((v) => {
const stitle = v.sTitle || 'default';
const value = sections.get(stitle);
if (value) {
value.push(v);
} else {
sections.set(stitle, [v]);
}
});
});
let active = '';
</script>
<svelte:head>
<title>API Docs • Svelte</title>
<meta name="twitter:title" content="Svelte API docs" />
<meta name="twitter:description" content="Cybernetically enhanced web apps" />
<meta name="Description" content="Cybernetically enhanced web apps" />
</svelte:head>
<DocRender {active} {sections} />
<style lang="scss">
</style>