Skip to content

Commit

Permalink
add layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Nov 23, 2023
1 parent 9043e74 commit 3d8a453
Show file tree
Hide file tree
Showing 28 changed files with 1,466 additions and 5 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"devDependencies": {
"@modern-js/eslint-config": "^2.35.1",
"@modern-js/tsconfig": "^2.35.1",
"@types/jquery": "^3.5.29",
"@types/node": "^20.7.1",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
Expand All @@ -61,6 +62,8 @@
"@mind-elixir/export-html": "^3.0.0",
"@mind-elixir/export-xmind": "^2.0.1",
"file-saver": "^2.0.5",
"golden-layout": "^2.6.0",
"jquery": "^3.7.1",
"jszip": "^3.10.1",
"mind-elixir": "^3.2.6",
"mind-elixir-ts": "^1.1.11",
Expand Down
27 changes: 27 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ChatGPT/chatgpt-widget.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
HTMLTags,
IParseTreeNode,
IWidgetInitialiseOptions,
Expand Down
57 changes: 57 additions & 0 deletions src/layouts/defaultConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"root": {
"type": "stack",
"content": [
{
"type": "component",
"size": "1fr",
"id": "",
"maximised": false,
"isClosable": true,
"reorderEnabled": true,
"title": "Guide",
"componentType": "tiddler",
"componentState": {
"title": "$:/plugins/Gk0Wk/layout/readme",
"className": "gk0wk-gl-tiddler-container"
}
}
],
"size": "1fr",
"id": "",
"maximised": false,
"isClosable": true,
"activeItemIndex": 0
},
"openPopouts": [],
"settings": {
"constrainDragToContainer": false,
"reorderEnabled": true,
"popoutWholeStack": false,
"blockedPopoutsThrowError": true,
"closePopoutsOnUnload": true,
"responsiveMode": "none",
"tabOverlapAllowance": 0,
"reorderOnTabMenuClick": true,
"tabControlOffset": 10,
"popInOnClose": true
},
"dimensions": {
"borderWidth": 3,
"borderGrabWidth": 3,
"defaultMinItemHeight": "0px",
"defaultMinItemWidth": "10px",
"headerHeight": 20,
"dragProxyWidth": 300,
"dragProxyHeight": 200
},
"header": {
"show": "top",
"popout": "open in new window",
"dock": "dock",
"close": "close",
"maximise": "maximise",
"minimise": "minimise",
"tabDropdown": "additional tabs"
}
}
2 changes: 2 additions & 0 deletions src/layouts/defaultConfig.json.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: $:/plugins/Gk0Wk/layout/defaultConfig.json
type: application/json
41 changes: 41 additions & 0 deletions src/layouts/modals/addTiddler.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
title: $:/plugins/Gk0Wk/layout/modals/add-tiddler
type: text/vnd.tiddlywiki
code-body: yes
subtitle: <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[添加条目]else[Add Tiddler]] }}} />

<$let
chinese={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[yes]else[no]] }}}
stateTiddler="$:/temp/Gk0Wk/layout/new-tiddler-info"
>
<div class="tc-control-panel">

<$list filter="[<chinese>match[yes]]" variable="t">

| !条目 | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:title" /> |
| !标题 | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:caption" placeholder="不写则自动识别" /> |
| !类名 | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:className" /> |
| !字段 | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:field" /> |
| !模板 | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:template" /> |

</$list>

<$list filter="[<chinese>!match[yes]]" variable="t">

| !Tiddler | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:title" /> |
| !Caption | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:caption" placeholder="Auto detect if empty" /> |
| !Class Name | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:className" /> |
| !Field | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:field" /> |
| !Template | <$edit-text tag="input" tiddler=<<stateTiddler>> field="layout:template" /> |

</$list>

</div>

<$button class="tc-btn-big-green tc-primary-btn" message="tm-close-tiddler">
<$action-sendmessage $message="gk0wk-layout-add-tiddler" />
{{$:/core/images/new-button}}
&#32;
<$text text={{{ [<chinese>match[yes]then[添加条目]else[ADd Tiddler]] }}} />
</$button>

</$let>
9 changes: 9 additions & 0 deletions src/layouts/plugin.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"title": "$:/plugins/Gk0Wk/layout",
"name": "layout",
"author": "Gk0Wk",
"description": "powerful layout view for TiddlyWiki",
"plugin-type": "plugin",
"version": "0.0.1-alpha1",
"list": "readme LICENSE"
}
3 changes: 3 additions & 0 deletions src/layouts/readme.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/plugins/Gk0Wk/layout/readme
type: text/vnd.tiddlywiki
caption: layout-readme
Loading

0 comments on commit 3d8a453

Please sign in to comment.