mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f58670906 | ||
|
|
fc47d36e8d | ||
|
|
cd4e610c46 | ||
|
|
b05c248c44 | ||
|
|
800e218dee | ||
|
|
3b774552af | ||
| b8a02c49f1 | |||
|
|
046a67f22c | ||
| 426f05dfbd | |||
|
|
0addaa0d7f | ||
| 1d5792c966 | |||
|
|
193d3f6f87 | ||
| e9c2b4aada | |||
| b5ac42e6e3 | |||
| 60d002677b | |||
| 3c3ec6881e | |||
|
|
a80155fafc | ||
| 3a814b8390 | |||
| bb522db9a2 | |||
| 201f72ae0e | |||
| be6f192dd8 | |||
| 4ce1019094 | |||
| 095c608511 | |||
| 2d8d7fb11a | |||
| 36725cb699 | |||
|
|
654e7e854d | ||
|
|
fa67f08512 | ||
|
|
7e42ef49a7 | ||
|
|
5a95aa0acc | ||
|
|
ded01ce678 | ||
|
|
3535d9fc70 | ||
|
|
9c93e38aff | ||
|
|
bfde5dfe1a | ||
|
|
d8eb3c8984 | ||
|
|
1cee2b67a6 | ||
|
|
82529ce56a | ||
|
|
70f30f0713 | ||
|
|
24ebb0bf8a | ||
|
|
d7372c7c55 | ||
|
|
f7bcf71020 | ||
|
|
72146afe48 | ||
|
|
9bcdb42edb | ||
|
|
16e0827991 | ||
|
|
863a6fb0dc | ||
|
|
5799ffe79b |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,5 +1,8 @@
|
||||
- Update NotionNext function that
|
||||
- `tags`, `titleicon`, `slug` and `summary` are now optional. You can remove them from the frontmatter if you don't need them.
|
||||
## Features
|
||||
|
||||
- Support WebP format images. 支持 WebP 格式图片。
|
||||
- Support sync with long notes. 支持长文章同步。
|
||||
|
||||
Long articles or notes have been split into multiple parts, and the parts are synchronized in order.
|
||||
长文章同步是通过将长文章或笔记拆分为多个部分,按顺序同步这些部分。
|
||||
|
||||
- 更新 NotionNext 同步功能
|
||||
- `tags`, `titleicon`, `slug` 和 `summary` 现在不是必选项了。你可以从你的模板中删除这些字段。
|
||||
|
||||
531
README.md
531
README.md
@@ -7,125 +7,250 @@
|
||||
|
||||
[//]: # ([](https://GitHub.com/jxpeng98/obsidian-to-NotionNext/releases/))
|
||||
|
||||
[//]: # ([中文文档](README-zh.md))
|
||||
|
||||
[中文文档](README-zh.md)
|
||||
**Now, support All Notion databases, including NotionNext and General Notion databases, and customise the database list.**
|
||||
|
||||
**Now, support both NotionNext and General databases with customised properties.**
|
||||
**现在支持所有Notion数据库,包括NotionNext和一般Notion数据库,以及自定义数据库列表。**
|
||||
|
||||
**现在支持NotionNext和普通Notion数据库,可自定义数据库列表。**
|
||||
## Precautions
|
||||
|
||||
### For customised database users before version 2.3.0
|
||||
|
||||
**⚠️⚠️⚠️: The existing customised database should be recreated if you want to update to version 2.3.0. The new version has a new database structure, and the old database structure is not compatible with the new version to build the index properly.**
|
||||
|
||||
### 在2.3.0版本之前的自定义数据库用户
|
||||
|
||||
**⚠️⚠️⚠️: 如果你想要更新到2.3.0版本,你需要重新创建自定义数据库。新版本有一个新的数据库结构,旧的数据库结构无法构建索引。**
|
||||
|
||||
## TODO List
|
||||
|
||||
- [ ] Modify the Edit function for the custom properties. 改进自定义属性的编辑功能
|
||||
- [ ] Support group upload with one click 支持一键多数据库上传
|
||||
- [x] Modify the Edit function for the custom properties. 改进自定义属性的编辑功能
|
||||
- [x] Support sync with long notes (From `v2.4.0`). 从`v2.4.0`开始支持长笔记同步
|
||||
- [x] Support custom properties for Notion General database. 支持自定义属性
|
||||
- [x] Support preview for database details in plugin settings. 支持预览数据库详情
|
||||
- [x] Support edit for database details in plugin settings. 支持编辑数据库详情
|
||||
- [ ] Support group upload with one click 支持一键多数据库上传
|
||||
|
||||
## How to use
|
||||
You need seven steps to use this plugin in your Obsidian.
|
||||
1. Create a database in your Notion workspace.
|
||||
Open Notion, clink the `+` button on the left side, and 'Add a page' -> select 'Table' -> 'New database'.
|
||||
2. On the right-top corner, click the 'Share' -> 'Publish' -> 'Publish' -> copy the database id from the URL.
|
||||
3. go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and copy the token.
|
||||
4. Go back to your created Notion database, click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
||||
5. Go to obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
||||
6. Create a database in the plugin settings, and fill in the database details and all properties you want to sync (**Note: the name of the properties is case-sensitive.**).
|
||||
- There are three type of database that you can use:
|
||||
- NotionNext: the database for the NotionNext template.(**All the properties are in lowercase**)
|
||||
- General: the database for the general Notion database (**Only have `title` and `tags` columns**)
|
||||
- Custom: the database for the custom properties (You can customise the properties you want to sync)
|
||||
7. Create a new note in Obsidian, and fill in the frontmatter with the properties you want to sync.
|
||||
|
||||
## 使用方法
|
||||
如果你想使用这个插件,你需要完成下边的七个步骤。
|
||||
1. 首先在你的Notion中创建一个数据库。
|
||||
2. 点击右上角的'分享' -> '发布' -> '发布' -> 然后复制URL中的数据库ID。(版本不同,可能id的形式也不同。只需要复制在?之前的纯数字部分应该就可以了)
|
||||
3. 去[Notion API](https://www.notion.com/my-integrations)创建一个新的API,然后复制token。
|
||||
4. 回到你创建的Notion数据库,点击右上角的'...' -> 连接 -> 连接到 -> 把你刚才创建的API绑定到你的数据库
|
||||
5. 回到Obsidian的设置 -> 社区插件 -> 搜索'NotionNext' -> 安装
|
||||
6. 在插件设置中创建一个数据库,然后填写数据库的详情和你想要同步的属性 (**注意:Notion会识别表头的大小写,一定要和notion中的表头保持大小写一致**)。
|
||||
- 你可以使用三种类型的数据库:
|
||||
- NotionNext: 用于NotionNext模板的数据库。(**默认全部小写**)
|
||||
- General: 用于普通的Notion数据库(**只有`title`和`tags`两个属性**)
|
||||
- Custom: 用于自定义属性的数据库(你可以自定义你想要同步的属性)
|
||||
7. 在Obsidian中创建一个新的笔记,然后在frontmatter中写入你想要的属性。
|
||||
If you want to use this plugin, you need to follow the following steps to set up the plugin. The steps can be divided into two parts: setting up the Notion API and setting up the plugin in Obsidian.
|
||||
|
||||
## Example
|
||||
```plain
|
||||
### 1. Setting up the Notion API
|
||||
|
||||
1). Go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
||||
|
||||

|
||||
|
||||
2). Create a database in your Notion workspace.
|
||||
|
||||
Open Notion, click top-left `Create` a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
||||
|
||||

|
||||
|
||||
Rename the database properties to `title` and `tags`.
|
||||
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
||||
|
||||

|
||||
|
||||
3). Add the Notion API integration.
|
||||
|
||||
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
||||
|
||||

|
||||
|
||||
4). Publish the database to the public.
|
||||
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
||||
|
||||

|
||||
|
||||
### 2. Setting up the plugin in Obsidian
|
||||
|
||||
1). Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
||||

|
||||
|
||||
2). Open the plugin settings and create a new database.
|
||||
|
||||

|
||||
|
||||
### 3. Create a database
|
||||
|
||||
**You can create three types of databases:**
|
||||
|
||||
#### 1️⃣ General database
|
||||
|
||||
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lowercase⚠️⚠️**
|
||||
|
||||

|
||||
|
||||
The general is as follows:
|
||||
|
||||
- Full Name: the full name that you would like to give to the database.
|
||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
||||
- Notion tags sync: whether you want to sync the tags column to Notion.
|
||||
- Customise title property: whether you want to change the `title` to another name (e.g., `name`).
|
||||
- Notion API token: the token you copied from the Notion API page.
|
||||
- Notion Database ID: the database ID you copied from the Notion database URL. (e.g., only copy `7158cd3f70ce4f60afd9da5bdf74fd0c` between `site/` and `?`. `https://jxpeng.notion.site/7158cd3f70ce4f60afd9da5bdf74fd0c?v=380317ac5373sadasdas3c13e618f&pvs=4**`)
|
||||
|
||||
After setting, it should look like this:
|
||||
|
||||

|
||||
|
||||
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
||||
|
||||

|
||||
|
||||
#### 2️⃣ NotionNext database
|
||||
|
||||
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||
|
||||

|
||||
|
||||
Like the general database, you need to fill in the following information:
|
||||
|
||||
- Full Name: the full name that you would like to give to the database.
|
||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
||||
- Notion API token: the token you copied from the Notion API page.
|
||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
||||
|
||||
#### 3️⃣ Custom database
|
||||
|
||||
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||
|
||||

|
||||
|
||||
The basic information is identical to the general database and NotionNext database. You need to fill in the following information:
|
||||
|
||||
- Full Name: the full name that you would like to give to the database.
|
||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
||||
- Notion API token: the token you copied from the Notion API page.
|
||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
||||
|
||||
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
||||
|
||||

|
||||
|
||||
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
||||
|
||||

|
||||
|
||||
According to the previously shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|
||||
|
||||

|
||||
|
||||
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
||||
|
||||
### 4. Start syncing
|
||||
|
||||
Create a new note in Obsidian, and fill in the front matter with the properties you want to sync.
|
||||
|
||||
#### 1️⃣ note for general database
|
||||
|
||||
For example, we can create a test note with the following front matter:
|
||||
|
||||
``` markdown
|
||||
---
|
||||
# default value has been set.
|
||||
# for any unwanted value, you can delete it or set it to empty.
|
||||
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
|
||||
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
|
||||
# 例如你不需要密码选项,你可以将password: "1234"删除,或者将它设置为空。
|
||||
# !!!!!!!!!!!!
|
||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
||||
# !!!!!!!!!!!!
|
||||
titleicon: 📎 # emoji icon, default is 📜, 默认是📜
|
||||
date: 2023-07-23 # default is today, 默认是今天。 Format is YYYY-MM-DD, 格式是YYYY-MM-DD
|
||||
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
||||
type: Post # Post or Page, default is Post, 默认是Post
|
||||
slug: test # slug for url, default is empty, 默认是空
|
||||
status: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
||||
category: test # default is 'Obsidian', 默认是'Obsidian'
|
||||
summary: this is a summary for test post # default is empty, 默认是空
|
||||
icon: fa-solid fa-camera # you can ignore this, default is empty, 默认是空,可直接删除
|
||||
password: "1234" # if you donot want to set password, you can delete this line, default is empty, 默认是空,可直接删除
|
||||
# 现在必须开启tags选项,否则会报错
|
||||
tags:
|
||||
- test # tags for post
|
||||
- web # add more tags if you want
|
||||
title: test
|
||||
tags: [test, web]
|
||||
---
|
||||
|
||||
This is a test file.
|
||||
|
||||
```
|
||||
<details> <summary> Update </summary>
|
||||
|
||||
### 2.2.5
|
||||
After creating the note, you can click the `Share to NotionNext` button on the left sidebar to sync the note to Notion.
|
||||
|
||||
- Update NotionNext function that
|
||||
- `tags`, `titleicon`, `slug` and `summary` are now optional. You can remove them from the frontmatter if you don't need them.
|
||||

|
||||
|
||||
#### 2️⃣ note for NotionNext database
|
||||
|
||||
### 2.2.3
|
||||
We use the following front matter for the NotionNext database:
|
||||
|
||||
- Fix a bug that 'text' property cannot be synchronized. 修复了一个无法同步'text'属性的bug。
|
||||
```markdown
|
||||
---
|
||||
title: test-notionnext
|
||||
titleicon: 📎
|
||||
date: 2023-07-23
|
||||
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg
|
||||
type: Post
|
||||
slug: test
|
||||
status: Draft
|
||||
category: test
|
||||
summary: this is a summary for test post
|
||||
icon: fa-solid fa-camera
|
||||
password: "1234"
|
||||
tags:
|
||||
- test
|
||||
- web
|
||||
NotionID-pengjiaxin: 8ba573de-8fdf-4681-b063-c39d26e7860e
|
||||
---
|
||||
|
||||
### 2.2.2
|
||||
this is a test file
|
||||
```
|
||||
|
||||
- Fix the setting description of database. 修复数据库设置的描述错误。
|
||||

|
||||
|
||||
### 2.2.1
|
||||
#### 3️⃣ note for custom database
|
||||
|
||||
- improve the localisation for the custom properties setting. 改进自定义属性设置的本地化。
|
||||
##### sync title and tags
|
||||
|
||||
**Warning: the edit function for the custom properties is not perfect for now. You need to re-enter all the properties if you want to edit the properties.**
|
||||
Use the previously created general database and rename `title` to `Name` and `tags` to `Tags` in Notion.
|
||||
|
||||
**注意:自定义属性的编辑功能现在还不完善。如果你想编辑属性,你需要重新输入所有的属性。**
|
||||

|
||||
|
||||
### 2.2.0 (Big Update)
|
||||
The front matter for the custom database is as follows:
|
||||
|
||||
- add the support for custom properties in the Notion General database. 支持自定义属性
|
||||
- [x] `title`, which is the first column of the database
|
||||
- [x] 'Text'
|
||||
- [x] 'Number'
|
||||
- [x] 'Date'
|
||||
- [x] 'Checkbox'
|
||||
- [x] 'Select'
|
||||
- [x] 'Multi-select'
|
||||
- [x] 'URL'
|
||||
- [x] 'Email'
|
||||
- [x] 'Phone'
|
||||
- [x] 'File' (**Only support external embedded files**)
|
||||
```markdown
|
||||
---
|
||||
Name: test-custom
|
||||
Tags:
|
||||
- test
|
||||
- web
|
||||
---
|
||||
|
||||
</details>
|
||||
This is a test file.
|
||||
```
|
||||
|
||||

|
||||
- Once you create the properties, you can preview the database details in the plugin settings.
|
||||

|
||||

|
||||
|
||||
##### sync more properties
|
||||
|
||||
Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
||||
|
||||
1). Click `Edit` in the plugin settings.
|
||||

|
||||
2). Click `Add` and add the `summary` and `date` property.
|
||||
|
||||

|
||||
|
||||
3). After adding the properties, you can see the properties in the plugin settings.
|
||||

|
||||
4). Add the `summary` and `date` in Notion
|
||||
|
||||

|
||||
|
||||
5). Create a new note with the `summary` and `date` property.
|
||||
|
||||
```markdown
|
||||
---
|
||||
Name: test-custom-more
|
||||
Tags:
|
||||
- test
|
||||
- web
|
||||
summary: this is a summary for test custom
|
||||
date: 2022-05-03
|
||||
---
|
||||
|
||||
This is a test file.
|
||||
```
|
||||
|
||||
6). Sync the note to Notion.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Acknowledgement
|
||||
## Acknowledgment
|
||||
|
||||
Thanks to the [original author](https://github.com/EasyChris/obsidian-to-notion) for developing such a useful plugin that can synchronize Obsidian to Notion. However, the original repository can only sync Name and Tag information. For those like me who use [NotionNext](https://github.com/tangly1024/NotionNext) to set up their website, this presents some limitations. Every time I import, I need to make a lot of modifications.
|
||||
|
||||
@@ -133,242 +258,6 @@ Thus, based on the [original author's work](https://github.com/EasyChris/obsidia
|
||||
|
||||
---
|
||||
|
||||
<details> <summary> Archive Update </summary>
|
||||
|
||||
### 2.1.0
|
||||
|
||||
- add confirmation interface for deleting a database 增加删除数据库的确认界面
|
||||
- fix the typo in the edit database modal 修复编辑数据库界面的标题错误
|
||||
- improve the logic for the database editing 改进数据库编辑界面的逻辑
|
||||
|
||||
### 2.0.1
|
||||
|
||||
- Add the preview and edit function for database details in the plugin settings. 增加插件设置中数据库详情的预览和编辑功能。
|
||||

|
||||
- Preview:
|
||||

|
||||
|
||||
- Edit:
|
||||

|
||||
|
||||
### 2.0.0 (Big Update)
|
||||
|
||||
- redesign the plugin settings UI. From this version, the settings UI will be separated into two parts:
|
||||
- one for general settings: bannerUrl and your notion username (ID)
|
||||
- one for database list: You can add new database or delete the database.
|
||||
- 重新设计了插件设置界面。从这个版本开始,设置界面将被分成两部分:
|
||||
- 一部分是通用设置:bannerUrl和你的notion用户名(ID)
|
||||
- 一部分是数据库列表:你可以添加新的数据库或者删除数据库。
|
||||
|
||||

|
||||
|
||||
- You can add more databases in the plugin settings.
|
||||
- 你可以在插件设置中添加更多的数据库。
|
||||
|
||||

|
||||
|
||||
- You can sync one note to multiple databases.
|
||||
- 你可以将一个笔记同步到多个数据库中。
|
||||
|
||||

|
||||
|
||||
**Note: You need to add your previous database in the new template.**
|
||||
**注意:你需要将之前的数据库添加到新的模板中。**
|
||||
|
||||
### 1.1.2
|
||||
- Fix the typo that you cannot sync the markdown file `status` in the frontmatter to NotionNext. You can use `stats` or `status` to sync the status of the post to NotionNext. This update will not affect the function of syncing to General database.
|
||||
- 修复了一个拼写错误,导致无法同步`status`到NotionNext。现在你可以使用`stats`或者`status`来同步文章的状态到NotionNext。这个更新不会影响到同步到General数据库的功能。
|
||||
- **Both `stats` and `status` will work, but you can only use one of them.**
|
||||
- **`stats`和`status`都可以使用,但是你只能使用其中一个。**
|
||||
|
||||
For example,
|
||||
```yaml
|
||||
stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
||||
# or
|
||||
status: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
||||
# both of them will work, but you can only use one of them.
|
||||
```
|
||||
|
||||
### 1.1.1
|
||||
- Fix the setting display bug in Japanese.
|
||||
- Add Japanese translation.
|
||||
|
||||
### 1.1.0
|
||||
- Fix the custom name setting tab display bug.
|
||||
- Add a toggle to control whether to sync `tags` since the empty tags may cause the syncing error.
|
||||
|
||||
If you switch off the `tags` function in the plugin settings, it will ignore the `tags` in your frontmatter.
|
||||
|
||||
If you prefer to sync tags to Notion database, you can switch on the `tags` function in the plugin settings. **You can only use the following format for tags:**
|
||||
|
||||
```yaml
|
||||
tags: #empty tags, option 1
|
||||
tags: [test,test1,test2] # use the square brackets, option 2
|
||||
tags:
|
||||
- test
|
||||
- test1
|
||||
- test2 # use the dash option 3
|
||||
```
|
||||
|
||||
### 1.0.1
|
||||
|
||||
- Fix the custom name element display bug in the settings.
|
||||
|
||||
### 1.0.0 (Big Update)
|
||||
|
||||
- From this version, you can **modify the first column name (title column, default: 'title')** as you want. (**Note: You need to have the 'tags' column in your Notion General database, and add `tags:` in your markdown frontmatter. If not, you will receive `network error 400`. But you can leave the `tags:` blank.**)
|
||||
|
||||

|
||||
Like this:
|
||||

|
||||
|
||||
- Add a switch button to control whether display the setting tabs in the plugin settings for both NotionNext and Notion General databases.
|
||||
|
||||

|
||||
|
||||
### 0.2.6
|
||||
|
||||
- Add a switch button to control whether to show the upload command in the command palette.
|
||||
|
||||
<!-- 
|
||||
If you turn off the button for the General database, you won't see the option for the General database in the upload command list.
|
||||
|
||||
If you turn off the button for the NotionNext database, you won't see the option for the NotionNext database in the upload command list.
|
||||
|
||||
 -->
|
||||
|
||||
### 0.2.3
|
||||
|
||||
- Fix the bug, now you can update normally.
|
||||
|
||||
### 0.2.2
|
||||
|
||||
- Support both NotionNext and General Notion database.
|
||||
- You can have one NotionNext and one General Notion database.
|
||||
- General Notion database can only have `title` and `tags` columns, and `tags` columns should be the multi-selected property. **the name of the columns is case sensitive. You should use small letter.**
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 0.2.1
|
||||
|
||||
- Restructure the code
|
||||
|
||||
### 0.2.0
|
||||
|
||||
- From this version, the interactive logic has been rewritten. When you click the ribbon icon, it will display the sync command for all presetting NotionNext databases. You can choose the database you want to sync to. **However, only NotionNext database is supported for now.**
|
||||
|
||||
### 0.1.10
|
||||
|
||||
- Fix the Chinese support in the settings.
|
||||
|
||||
### 0.1.8
|
||||
|
||||
- Rebuild the uploadCommand function, and add one button to select the different databases. **However, only NotionNext database is supported for now.**
|
||||
|
||||
### 0.1.7
|
||||
|
||||
- [x] Removed the `convert tag` option. Now, you can directly add tags in the YAML front matter. If you don't want to add tags, you can delete the tags in the YAML front matter or leave the tags blank.
|
||||
|
||||
</details>
|
||||
|
||||
<details> <summary> Previous How to Use </summary>
|
||||
|
||||
### Precautions
|
||||
|
||||
For now, this plugin is exclusively for [NotionNext](https://github.com/tangly1024/NotionNext). If you're not using this template, you'll keep receiving `error 400`.
|
||||
|
||||
For those without a NotionNext requirement, please use the original [Obsidian-to-notion](https://github.com/EasyChris/obsidian-to-notion).
|
||||
|
||||
### Pre-Installation Steps
|
||||
|
||||
Before installing the plugin, you must have set up the following:
|
||||
|
||||
1. Your NotionNext database.
|
||||
2. According to the original author's readme.md, set up the Notion API, and it should already be associated with your NotionNext repository.
|
||||
3. NotionNext Database ID
|
||||
4. Your NotionNext database should have the following contents:
|
||||
- type
|
||||
- title
|
||||
- slug
|
||||
- category
|
||||
- tags
|
||||
- date
|
||||
- status
|
||||
- summary
|
||||
- password
|
||||
- icon
|
||||
|
||||
From version 0.0.6, I also add the following contents:
|
||||
- titleicon: the unique icon for each post, it can only support emoji currently.
|
||||
- cover url: the cover image for each post, it should be end with a type of image, such as .jpg, .png, .gif, etc.
|
||||
|
||||
**If you've directly copied the NotionNext template, these contents should already exist. I've made changes to this plugin based on the original author's work. All you need to ensure is that your database has the above content, and every letter is in lowercase!!!**
|
||||
|
||||
**⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn't matter!**
|
||||
|
||||
### Plugin Installation
|
||||
|
||||
#### Install via Community Plugins
|
||||
|
||||
Open `Obsidian settings -> Community Plugins -> Browse -> NotionNext -> Share to NotionNext`
|
||||
|
||||
#### Mannually Install
|
||||
|
||||
1. Close Obsidian.
|
||||
2. Download the plugin file from Release and unzip it into your Obsidian plugin directory.
|
||||
3. Re-open Obsidian, go to settings, and enable the plugin.
|
||||
4. In the settings, find Obsidian to NotionNext, and enter your NotionNext Database ID and API token.
|
||||
|
||||
### How to Use
|
||||
|
||||
### Using the Plugin
|
||||
|
||||
In the repository, I have uploaded a template which you can directly copy into your template folder. After that, use Obsidian's template feature to create a new note with one click.
|
||||
|
||||
If you don't want to use the template, you can also directly create a new file in Obsidian and then copy the content below. Then save it.
|
||||
|
||||
```markdown
|
||||
---
|
||||
# default value has been set.
|
||||
# for any unwanted value, you can delete it or set it to empty.
|
||||
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
|
||||
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
|
||||
# 例如你不需要密码选项,你可以将password: "1234"删除,或者将它设置为空。
|
||||
# !!!!!!!!!!!!
|
||||
# 现在阶段一定不要修改表头的名字, please do not change the name of the header in YAML front matter
|
||||
# !!!!!!!!!!!!
|
||||
titleicon: 📎 # emoji icon, default is 📜, 默认是📜
|
||||
date: 2023-07-23 # default is today, 默认是今天。 Format is YYYY-MM-DD, 格式是YYYY-MM-DD
|
||||
coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空
|
||||
type: Post # Post or Page, default is Post, 默认是Post
|
||||
slug: test # slug for url, default is empty, 默认是空
|
||||
stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft
|
||||
category: test # default is 'Obsidian', 默认是'Obsidian'
|
||||
summary: this is a summary for test post # default is empty, 默认是空
|
||||
icon: fa-solid fa-camera # you can ignore this, default is empty, 默认是空,可直接删除
|
||||
password: "1234" # if you donot want to set password, you can delete this line, default is empty, 默认是空,可直接删除
|
||||
# 现在必须开启tags选项,否则会报错
|
||||
tags:
|
||||
- test # tags for post
|
||||
- web # add more tags if you want
|
||||
---
|
||||
|
||||
Contents Below
|
||||
|
||||
```
|
||||
|
||||
Usage of the template is as follows:
|
||||

|
||||
|
||||
**Plugin preview is shown below**
|
||||

|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
<details> <summary> Original README.md </summary>
|
||||
|
||||
Many Thanks for the original author's work. I've only made some changes to the original author's work. If you find this plugin useful, please give the [original author](https://github.com/EasyChris/obsidian-to-notion) a star.
|
||||
|
||||
@@ -41,6 +41,7 @@ const ctx = await esbuild.context({
|
||||
"@codemirror/view",
|
||||
...builtins,
|
||||
],
|
||||
platform: "node",
|
||||
format: "cjs",
|
||||
target: "es2016",
|
||||
logLevel: "info",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "share-to-notionnext",
|
||||
"name": "Share to NotionNext",
|
||||
"version": "2.2.5",
|
||||
"version": "2.4.0",
|
||||
"minAppVersion": "0.0.1",
|
||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||
"author": "EasyChris, jxpeng98",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "share-to-notionnext",
|
||||
"version": "2.2.5",
|
||||
"version": "2.4.0",
|
||||
"type": "module",
|
||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||
"main": "main.js",
|
||||
@@ -19,13 +19,14 @@
|
||||
"@typescript-eslint/parser": "^6.16.0",
|
||||
"builtin-modules": "^3.3.0",
|
||||
"esbuild": "0.19.5",
|
||||
"obsidian": "latest",
|
||||
"obsidian": "^1.6.6",
|
||||
"tslib": "2.6.2",
|
||||
"typescript": "5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tryfabric/martian": "^1.2.4",
|
||||
"@jxpeng98/martian": "^1.2.7",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"node-fetch": "^3.3.2",
|
||||
"process": "^0.11.10",
|
||||
"remark-math": "^6.0.0",
|
||||
"yaml": "^2.3.4",
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface DatabaseList {
|
||||
}
|
||||
|
||||
|
||||
export class FuzzySuggester extends FuzzySuggestModal<DatabaseList>{
|
||||
export class FuzzySuggester extends FuzzySuggestModal<DatabaseList> {
|
||||
private plugin: MyPlugin;
|
||||
private data: DatabaseList[];
|
||||
private callback: any;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { i18nConfig } from "src/lang/I18n";
|
||||
import {Editor, MarkdownView, setTooltip} from "obsidian";
|
||||
import { Editor, MarkdownView, setTooltip } from "obsidian";
|
||||
import { FuzzySuggester, DatabaseList } from "./FuzzySuggester";
|
||||
import {uploadCommandCustom, uploadCommandGeneral, uploadCommandNext} from "../upload/uploadCommand";
|
||||
import { uploadCommandCustom, uploadCommandGeneral, uploadCommandNext } from "../upload/uploadCommand";
|
||||
import ObsidianSyncNotionPlugin from "src/main";
|
||||
import {DatabaseDetails} from "../ui/settingTabs";
|
||||
import { DatabaseDetails } from "../ui/settingTabs";
|
||||
|
||||
|
||||
interface Command {
|
||||
|
||||
@@ -27,12 +27,14 @@ export const en = {
|
||||
DatabaseIDText: "Enter your Database ID",
|
||||
BannerUrl: "Banner url (optional)",
|
||||
BannerUrlDesc:
|
||||
"Default is empty, if you want to show a banner, please enter the url (like: https://abc.com/b.png)",
|
||||
"Default is empty, if you want to show a banner, please enter the url (like: https://abc.com/b.png)",
|
||||
BannerUrlText: "Enter your banner url",
|
||||
NotionUser: "Notion ID (username, optional)",
|
||||
NotionUserDesc:
|
||||
"Collect from share link likes:https://username.notion.site. Your notion id is [username]",
|
||||
"Collect from share link likes:https://username.notion.site. Your notion id is [username]",
|
||||
NotionUserText: "Enter your notion ID",
|
||||
NotionLinkDisplay: "Notion Link Display",
|
||||
NotionLinkDisplayDesc: "Default is ON, if you want to hide the link in the front matter, please turn it off",
|
||||
NotionGeneralSettingHeader: "General Notion Database Settings",
|
||||
NotionGeneralButton: "Notion General Sync",
|
||||
NotionGeneralButtonDesc: "Open this option, Sync to Notion General Database command will be displayed in the command palette (default: ON)",
|
||||
@@ -46,23 +48,23 @@ export const en = {
|
||||
NotionCustomValues: "Customise values property",
|
||||
NotionCustomValuesDesc: "Modify the column name of the Notion database,one per line",
|
||||
NotionCustomValuesText: "Enter all properties that you want to sync",
|
||||
NotYetFinish:
|
||||
"Not finished. This function will be available in the next version",
|
||||
NotYetFinish: "Not finished. This function will be available in the next version",
|
||||
PlaceHolder: "Enter database Name",
|
||||
"notion-logo": "Share to NotionNext",
|
||||
"sync-success": "Sync to NotionNext success: \n",
|
||||
"sync-fail": "Sync to NotionNext fail: \n",
|
||||
"sync-preffix": "Sync to ",
|
||||
"sync-success": "success",
|
||||
"sync-fail": "failed",
|
||||
"open-notion": "Please open the file that needs to be synchronized",
|
||||
"config-secrets-notion-api":
|
||||
"Please set up the notion API in the settings tab.",
|
||||
"Please set up the notion API in the settings tab.",
|
||||
"config-secrets-database-id":
|
||||
"Please set up the database id in the settings tab.",
|
||||
"Please set up the database id in the settings tab.",
|
||||
"set-tags-fail":
|
||||
"Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
||||
"Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
||||
NNonMissing:
|
||||
"The 'NNon' property is missing in the settings. Please set it up.",
|
||||
"The 'NNon' property is missing in the settings. Please set it up.",
|
||||
"set-api-id":
|
||||
"Please set up the notion API and database ID in the settings tab.",
|
||||
"Please set up the notion API and database ID in the settings tab.",
|
||||
NotionCustomSettingHeader: "Notion Custom Database Settings",
|
||||
NotionCustomButton: "Notion Customised command switch",
|
||||
NotionCustomButtonDesc: "Open this option, Sync to Notion Customised Database command will be displayed in the command palette",
|
||||
@@ -73,4 +75,8 @@ export const en = {
|
||||
AddCustomProperty: "Add Custom Property",
|
||||
AddNewProperty: "Add New Property",
|
||||
AddNewPropertyDesc: "Add new property match with your notion database",
|
||||
CopyErrorMessage: "Auto copy failed, please copy it manually",
|
||||
BlockUploaded: "All blocks uploaded",
|
||||
ExtraBlockUploaded: "Extra blocks uploaded",
|
||||
CheckConsole: "Check the console for more information \n opt+cmd+i/ctrl+shift+i",
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ export const ja = {
|
||||
NotionUser: "Notion ID(ユーザー名、任意)",
|
||||
NotionUserDesc: "共有リンクから取得(例:https://username.notion.site)。Notion IDは[username]です",
|
||||
NotionUserText: "Notion IDを入力",
|
||||
NotionLinkDisplay: "Notionリンク表示",
|
||||
NotionLinkDisplayDesc: "デフォルトはONです。front matterにリンクを非表示にしたい場合は、オフにしてください",
|
||||
NotionGeneralSettingHeader: "一般的なNotionデータベース設定",
|
||||
NotionGeneralButton: "一般的なNotion同期",
|
||||
NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されます(デフォルト:ON)",
|
||||
@@ -65,4 +67,8 @@ export const ja = {
|
||||
AddCustomProperty: "カスタムプロパティを追加",
|
||||
AddNewProperty: "新しいプロパティを追加",
|
||||
AddNewPropertyDesc: "新しいプロパティを追加してください",
|
||||
CopyErrorMessage: "自動コピーに失敗しました",
|
||||
BlockUploaded: "ブロックがアップロードされました",
|
||||
ExtraBlockUploaded: "追加ブロックがアップロードされました",
|
||||
CheckConsole: "詳細情報を確認するには、コンソールを開いてください \n opt+cmd+i/ctrl+shift+i",
|
||||
};
|
||||
|
||||
@@ -33,6 +33,8 @@ export const zh = {
|
||||
NotionUserDesc:
|
||||
"数据库分享链接类似:https://username.notion.site/。你的 Notion ID 是 [username]",
|
||||
NotionUserText: "输入你的 Notion ID",
|
||||
NotionLinkDisplay: "Notion 链接显示",
|
||||
NotionLinkDisplayDesc: "默认开启,如果你不想在front matter中显示链接,请关闭",
|
||||
NotionGeneralSettingHeader: "普通 Notion 数据库设置",
|
||||
NotionGeneralButton: "普通数据库同步",
|
||||
NotionGeneralButtonDesc: "打开此选项,同步到普通数据库命令将显示在命令面板中(默认:开)",
|
||||
@@ -68,4 +70,8 @@ export const zh = {
|
||||
AddCustomProperty: "添加自定义属性",
|
||||
AddNewProperty: "添加新属性",
|
||||
AddNewPropertyDesc: "添加一个和Notion数据库匹配的新属性",
|
||||
CopyErrorMessage: "复制链接失败,请手动复制",
|
||||
BlockUploaded: "所有内容已成功上传",
|
||||
ExtraBlockUploaded: "额外内容已成功上传",
|
||||
CheckConsole: "opt+cmd+i/ctrl+shift+i,\n打开控制台查看更多信息",
|
||||
}
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
import {App, Modal, Setting} from "obsidian";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {ObsidianSettingTab} from "./settingTabs";
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
|
||||
export class CustomModal extends Modal {
|
||||
propertyLines: Setting[] = []; // Store all property line settings
|
||||
properties: { customName: string, customType: string }[] = []; // Array to store property values and types
|
||||
plugin: ObsidianSyncNotionPlugin;
|
||||
settingTab: ObsidianSettingTab;
|
||||
|
||||
constructor(app: App) {
|
||||
super(app);
|
||||
}
|
||||
|
||||
createPropertyLine(containerEl: HTMLElement): void {
|
||||
const propertyIndex = this.properties.length;
|
||||
this.properties.push({customName: "", customType: ""}); // Initialize with empty values
|
||||
|
||||
const propertyLine = new Setting(containerEl)
|
||||
|
||||
if (propertyIndex === 0) {
|
||||
propertyLine
|
||||
.setName(i18nConfig.CustomPropertyFirstColumn)
|
||||
.setDesc(i18nConfig.CustomPropertyFirstColumnDesc)
|
||||
|
||||
propertyLine.addText((text) => {
|
||||
text
|
||||
.setPlaceholder("Property name")
|
||||
.setValue("")
|
||||
.onChange(async (value) => {
|
||||
this.properties[propertyIndex].customName = value; // Update the customValue of the specific property
|
||||
});
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
propertyLine.addDropdown((dropdown) => {
|
||||
dropdown
|
||||
.addOption("title", "Title")
|
||||
.setValue("")
|
||||
.onChange(async (value) => {
|
||||
this.properties[propertyIndex].customType = value; // Update the customType of the specific property
|
||||
});
|
||||
}
|
||||
)
|
||||
} else {
|
||||
propertyLine
|
||||
.setName(i18nConfig.CustomProperty + (propertyIndex))
|
||||
|
||||
propertyLine.addText((text) => {
|
||||
text
|
||||
.setPlaceholder(i18nConfig.CustomPropertyName)
|
||||
.setValue("")
|
||||
.onChange(async (value) => {
|
||||
this.properties[propertyIndex].customName = value; // Update the customValue of the specific property
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
propertyLine.addDropdown((dropdown) => {
|
||||
dropdown
|
||||
// .addOption("none", '')
|
||||
.addOption("text", "Text")
|
||||
.addOption("number", "Number")
|
||||
.addOption("select", "Select")
|
||||
.addOption("multi_select", "Multi-Select")
|
||||
.addOption("date", "Date")
|
||||
// .addOption("person", "Person")
|
||||
.addOption("files", "Files & Media")
|
||||
.addOption("checkbox", "Checkbox")
|
||||
.addOption("url", "URL")
|
||||
.addOption("email", "Email")
|
||||
.addOption("phone_number", "Phone Number")
|
||||
// .addOption("formula", "Formula")
|
||||
// .addOption("relation", "Relation")
|
||||
// .addOption("rollup", "Rollup")
|
||||
// .addOption("created_time", "Created time")
|
||||
// .addOption("created_by", "Created by")
|
||||
// .addOption("last_edited_time", "Last Edited Time")
|
||||
// .addOption("last_edited_by", "Last Edited By")
|
||||
.setValue("")
|
||||
.onChange(async (value) => {
|
||||
this.properties[propertyIndex].customType = value; // Update the customType of the specific property
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
propertyLine.addButton((button) => {
|
||||
return button
|
||||
.setTooltip("Delete")
|
||||
.setIcon("trash")
|
||||
.onClick(async () => {
|
||||
// Handle the deletion of this property line
|
||||
this.propertyLines = this.propertyLines.filter(line => line !== propertyLine);
|
||||
this.properties.splice(propertyIndex, 1); // Remove the property from the array
|
||||
propertyLine.settingEl.remove();
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
this.propertyLines.push(propertyLine);
|
||||
}
|
||||
|
||||
|
||||
display(): void {
|
||||
|
||||
this.containerEl.addClass("custom-modal");
|
||||
this.titleEl.setText(i18nConfig.AddCustomProperty);
|
||||
|
||||
let {contentEl} = this;
|
||||
contentEl.empty();
|
||||
|
||||
const customDiv = contentEl.createDiv("custom-div");
|
||||
|
||||
new Setting(customDiv)
|
||||
.setName(i18nConfig.AddNewProperty)
|
||||
.setDesc(i18nConfig.AddNewPropertyDesc)
|
||||
.addButton((button) => {
|
||||
return button
|
||||
.setTooltip("Add")
|
||||
.setIcon("plus")
|
||||
.onClick(async () => {
|
||||
const customTabs = customDiv.createDiv("custom-tabs");
|
||||
this.createPropertyLine(customTabs);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
let footerEl = this.contentEl.createDiv("save-custom-value");
|
||||
let saveButton = new Setting(footerEl)
|
||||
saveButton.addButton((button) => {
|
||||
return button
|
||||
.setTooltip("Save")
|
||||
.setIcon("checkmark")
|
||||
.onClick(async () => {
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
saveButton.addExtraButton((button) => {
|
||||
return button
|
||||
.setTooltip("Cancel")
|
||||
.setIcon("cross")
|
||||
.onClick(async () => {
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
onOpen(): void {
|
||||
this.display();
|
||||
}
|
||||
|
||||
onClose(): void {
|
||||
const {contentEl} = this;
|
||||
|
||||
contentEl.empty();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import {App, ButtonComponent, Modal, Setting} from "obsidian";
|
||||
import {DatabaseDetails, ObsidianSettingTab} from "./settingTabs";
|
||||
import { App, ButtonComponent, Modal, Setting } from "obsidian";
|
||||
import { DatabaseDetails, ObsidianSettingTab } from "./settingTabs";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
|
||||
export class DeleteModal extends Modal {
|
||||
@@ -21,12 +21,12 @@ export class DeleteModal extends Modal {
|
||||
this.containerEl.addClass("delete-modal");
|
||||
this.titleEl.setText('Delete Database');
|
||||
|
||||
let {contentEl} = this;
|
||||
let { contentEl } = this;
|
||||
contentEl.empty();
|
||||
|
||||
const deleteDiv = contentEl.createDiv('delete-div');
|
||||
deleteDiv.createEl('h4', {text: 'Are you sure you want to delete the following database?'});
|
||||
deleteDiv.createEl('h2', {text: this.dbDetails.fullName + ' (' + this.dbDetails.abName + ', ' + this.dbDetails.format +')'});
|
||||
deleteDiv.createEl('h4', { text: 'Are you sure you want to delete the following database?' });
|
||||
deleteDiv.createEl('h2', { text: this.dbDetails.fullName + ' (' + this.dbDetails.abName + ', ' + this.dbDetails.format + ')' });
|
||||
|
||||
|
||||
// add delete button
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import {App, ButtonComponent, Modal, Setting} from "obsidian";
|
||||
import {SettingModal} from "./settingModal";
|
||||
import { App, ButtonComponent, Setting } from "obsidian";
|
||||
import { customProperty, SettingModal } from "./settingModal";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {DatabaseDetails, ObsidianSettingTab} from "./settingTabs";
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
import {CustomModal} from "./CustomModal";
|
||||
import { DatabaseDetails, ObsidianSettingTab } from "./settingTabs";
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
|
||||
export class EditModal extends SettingModal {
|
||||
propertyLines: Setting[] = []; // Store all property line settings
|
||||
[key: string]: any; // Index signature
|
||||
dataTemp: Record<string, any> = {
|
||||
databaseFormatTemp: '',
|
||||
// databaseFormatTempInd: false,
|
||||
@@ -70,7 +71,7 @@ export class EditModal extends SettingModal {
|
||||
this.dataTemp.tagButtonTemp = dbDetails.tagButton;
|
||||
this.dataTemp.customTitleButtonTemp = dbDetails.customTitleButton;
|
||||
this.dataTemp.customTitleNameTemp = dbDetails.customTitleName;
|
||||
this.dataTemp.customPropertiesTemp = dbDetails.customProperties;
|
||||
this.dataTemp.customPropertiesTemp = dbDetails.customProperties.map(prop => ({ ...prop })); // Ensure deep copy
|
||||
// this.dataTemp.customValues = dbDetails.customValues;
|
||||
this.dataTemp.savedTemp = dbDetails.saved;
|
||||
|
||||
@@ -83,7 +84,7 @@ export class EditModal extends SettingModal {
|
||||
this.dataPrev.tagButtonPrev = dbDetails.tagButton;
|
||||
this.dataPrev.customTitleButtonPrev = dbDetails.customTitleButton;
|
||||
this.dataPrev.customTitleNamePrev = dbDetails.customTitleName;
|
||||
this.dataPrev.customPropertiesPrev = dbDetails.customProperties;
|
||||
this.dataPrev.customPropertiesPrev = dbDetails.customProperties.map(prop => ({ ...prop })); // Ensure deep copy
|
||||
// this.dataTemp.customValues = dbDetails.customValues;
|
||||
this.dataPrev.savedPrev = dbDetails.saved;
|
||||
}
|
||||
@@ -94,12 +95,13 @@ export class EditModal extends SettingModal {
|
||||
this.containerEl.addClass("edit-modal");
|
||||
this.titleEl.setText('Edit Database');
|
||||
|
||||
let {contentEl} = this;
|
||||
let { contentEl } = this;
|
||||
contentEl.empty();
|
||||
|
||||
const editDiv = contentEl.createDiv('edit-div');
|
||||
const nextTabs = contentEl.createDiv('next-tabs');
|
||||
|
||||
|
||||
new Setting(editDiv)
|
||||
.setName(i18nConfig.databaseFormat)
|
||||
.setDesc(i18nConfig.databaseFormatDesc)
|
||||
@@ -131,6 +133,8 @@ export class EditModal extends SettingModal {
|
||||
.onClick(async () => {
|
||||
this.dataTemp.savedTempInd = true;
|
||||
this.dataTemp.savedTemp = true;
|
||||
// console.log(this.dataTemp);
|
||||
// console.log(this.dataPrev);
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
@@ -140,19 +144,18 @@ export class EditModal extends SettingModal {
|
||||
.setTooltip('Cancel')
|
||||
.setIcon('cross')
|
||||
.onClick(() => {
|
||||
this.dataTemp.savedTempInd = false;
|
||||
// console.log(this.dataTemp);
|
||||
// console.log(this.dataPrev);
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
onOpen(): void {
|
||||
this.display()
|
||||
}
|
||||
|
||||
|
||||
updateContentBasedOnSelection(value: string, nextTabs: HTMLElement): void {
|
||||
// Clear existing content
|
||||
nextTabs.empty();
|
||||
@@ -162,13 +165,13 @@ export class EditModal extends SettingModal {
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionGeneralSettingHeader });
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.dataTemp.databaseFullNameTemp,'dataTemp', 'databaseFullNameTemp')
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.dataTemp.databaseFullNameTemp, 'dataTemp', 'databaseFullNameTemp')
|
||||
|
||||
// add abbreviate name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseAbbreviateName, i18nConfig.databaseAbbreviateNameDesc, 'text', i18nConfig.databaseAbbreviateNameText, this.dataTemp.databaseAbbreviateNameTemp, 'dataTemp','databaseAbbreviateNameTemp')
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseAbbreviateName, i18nConfig.databaseAbbreviateNameDesc, 'text', i18nConfig.databaseAbbreviateNameText, this.dataTemp.databaseAbbreviateNameTemp, 'dataTemp', 'databaseAbbreviateNameTemp')
|
||||
|
||||
// tag button
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionTagButton, i18nConfig.NotionTagButtonDesc, 'toggle', i18nConfig.NotionCustomTitleText, this.dataTemp.tagButtonTemp, 'dataTemp','tagButtonTemp')
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionTagButton, i18nConfig.NotionTagButtonDesc, 'toggle', i18nConfig.NotionCustomTitleText, this.dataTemp.tagButtonTemp, 'dataTemp', 'tagButtonTemp')
|
||||
|
||||
// add custom title button
|
||||
|
||||
@@ -180,49 +183,28 @@ export class EditModal extends SettingModal {
|
||||
.setValue(this.dataTemp.customTitleButtonTemp)
|
||||
.onChange(async (value) => {
|
||||
this.dataTemp.customTitleButtonTemp = value;
|
||||
|
||||
this.updateSettingEl(CustomNameEl, value)
|
||||
|
||||
// this.updateSettingEl(CustomValuesEl, value)
|
||||
|
||||
// await this.plugin.saveSettings();
|
||||
// await this.plugin.commands.updateCommand();
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
// add custom title name
|
||||
const CustomNameEl = this.createStyleDiv('custom-name', (this.dataTemp.customTitleButtonTemp), nextTabs);
|
||||
this.createSettingEl(CustomNameEl, i18nConfig.NotionCustomTitleName, i18nConfig.NotionCustomTitleNameDesc, 'text', i18nConfig.NotionCustomTitleText, this.dataTemp.customTitleNameTemp,'dataTemp', 'customTitleNameTemp')
|
||||
this.createSettingEl(CustomNameEl, i18nConfig.NotionCustomTitleName, i18nConfig.NotionCustomTitleNameDesc, 'text', i18nConfig.NotionCustomTitleText, this.dataTemp.customTitleNameTemp, 'dataTemp', 'customTitleNameTemp')
|
||||
|
||||
|
||||
// add api key
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.dataTemp.notionAPITemp, 'dataTemp','notionAPITemp')
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.dataTemp.notionAPITemp, 'dataTemp', 'notionAPITemp')
|
||||
|
||||
// add database id
|
||||
this.createSettingEl(nextTabs, i18nConfig.DatabaseID, i18nConfig.DatabaseIDDesc, 'password', i18nConfig.DatabaseIDText, this.dataTemp.databaseIDTemp, 'dataTemp','databaseIDTemp')
|
||||
this.createSettingEl(nextTabs, i18nConfig.DatabaseID, i18nConfig.DatabaseIDDesc, 'password', i18nConfig.DatabaseIDText, this.dataTemp.databaseIDTemp, 'dataTemp', 'databaseIDTemp')
|
||||
|
||||
|
||||
} else if (value === 'next') {
|
||||
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionNextSettingHeader });
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.dataTemp.databaseFullNameTemp, 'dataTemp','databaseFullNameTemp')
|
||||
|
||||
// add abbreviate name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseAbbreviateName, i18nConfig.databaseAbbreviateNameDesc, 'text', i18nConfig.databaseAbbreviateNameText, this.dataTemp.databaseAbbreviateNameTemp, 'dataTemp','databaseAbbreviateNameTemp')
|
||||
|
||||
// add api key
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.dataTemp.notionAPITemp, 'dataTemp','notionAPITemp')
|
||||
|
||||
// add database id
|
||||
this.createSettingEl(nextTabs, i18nConfig.DatabaseID, i18nConfig.DatabaseIDDesc, 'password', i18nConfig.DatabaseIDText, this.dataTemp.databaseIDTemp, 'dataTemp','databaseIDTemp')
|
||||
|
||||
} else if (value === 'custom') {
|
||||
|
||||
nextTabs.createEl('h3', {text: i18nConfig.NotionCustomSettingHeader});
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.dataTemp.databaseFullNameTemp, 'dataTemp', 'databaseFullNameTemp')
|
||||
|
||||
@@ -235,31 +217,123 @@ export class EditModal extends SettingModal {
|
||||
// add database id
|
||||
this.createSettingEl(nextTabs, i18nConfig.DatabaseID, i18nConfig.DatabaseIDDesc, 'password', i18nConfig.DatabaseIDText, this.dataTemp.databaseIDTemp, 'dataTemp', 'databaseIDTemp')
|
||||
|
||||
// add new property button
|
||||
new Setting(nextTabs)
|
||||
.setName(i18nConfig.NotionCustomValues)
|
||||
.setDesc(i18nConfig.NotionCustomValuesDesc)
|
||||
.addButton((button: ButtonComponent) => {
|
||||
return button
|
||||
.setTooltip('Add new property')
|
||||
.setIcon('plus')
|
||||
.onClick(async () => {
|
||||
let customModal = new CustomModal(this.app);
|
||||
} else if (value === 'custom') {
|
||||
|
||||
customModal.onClose = () => {
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionCustomSettingHeader });
|
||||
|
||||
this.renderCustomPreview(customModal.properties, nextTabs)
|
||||
this.dataTemp.customPropertiesTemp = customModal.properties;
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.dataTemp.databaseFullNameTemp, 'dataTemp', 'databaseFullNameTemp')
|
||||
|
||||
// add abbreviate name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseAbbreviateName, i18nConfig.databaseAbbreviateNameDesc, 'text', i18nConfig.databaseAbbreviateNameText, this.dataTemp.databaseAbbreviateNameTemp, 'dataTemp', 'databaseAbbreviateNameTemp')
|
||||
|
||||
// add api key
|
||||
this.createSettingEl(nextTabs, i18nConfig.NotionAPI, i18nConfig.NotionAPIDesc, 'password', i18nConfig.NotionAPIText, this.dataTemp.notionAPITemp, 'dataTemp', 'notionAPITemp')
|
||||
|
||||
// add database id
|
||||
this.createSettingEl(nextTabs, i18nConfig.DatabaseID, i18nConfig.DatabaseIDDesc, 'password', i18nConfig.DatabaseIDText, this.dataTemp.databaseIDTemp, 'dataTemp', 'databaseIDTemp')
|
||||
|
||||
// add custom properties
|
||||
this.initializePropertyLines(nextTabs, this.dataTemp.customPropertiesTemp);
|
||||
}
|
||||
}
|
||||
|
||||
customModal.open();
|
||||
initializePropertyLines(containerEl: HTMLElement, properties: customProperty[]): void {
|
||||
if (!containerEl) {
|
||||
console.error('Failed to initialize property lines: containerEl is null');
|
||||
return;
|
||||
}
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Add New Property")
|
||||
.setDesc("Click to add a new property")
|
||||
.addButton(button => {
|
||||
return button
|
||||
.setButtonText('Add')
|
||||
.setTooltip('Add one more property')
|
||||
.onClick(() => {
|
||||
this.createPropertyLine(containerEl, properties);
|
||||
});
|
||||
});
|
||||
|
||||
properties.forEach(property => {
|
||||
this.updatePropertyLine(containerEl, property, properties);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
updatePropertyLine(containerEl: HTMLElement, property: customProperty, properties: customProperty[]) {
|
||||
let isExistingProperty = property !== null;
|
||||
const propertyIndex = isExistingProperty ? property.index : properties.length;
|
||||
|
||||
const propertyLine = new Setting(containerEl)
|
||||
.setName(propertyIndex === 0 ? i18nConfig.CustomPropertyFirstColumn : `${i18nConfig.CustomProperty} ${propertyIndex}`)
|
||||
.setDesc(propertyIndex === 0 ? i18nConfig.CustomPropertyFirstColumnDesc : "");
|
||||
|
||||
propertyLine.addText(text => {
|
||||
text.setPlaceholder(i18nConfig.CustomPropertyName)
|
||||
.setValue(isExistingProperty ? property.customName : "")
|
||||
.onChange(value => {
|
||||
const actualIndex = properties.findIndex(p => p.index === propertyIndex);
|
||||
if (actualIndex !== -1) {
|
||||
properties[actualIndex].customName = value;
|
||||
} else {
|
||||
properties.push({ customName: value, customType: '', index: propertyIndex });
|
||||
isExistingProperty = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
propertyLine.addDropdown((dropdown) => {
|
||||
const options: Record<string, string> = {
|
||||
'rich_text': 'Text',
|
||||
'number': 'Number',
|
||||
'select': 'Select',
|
||||
'multi_select': 'Multi-Select',
|
||||
'date': 'Date',
|
||||
'files': 'Files & Media',
|
||||
'checkbox': 'Checkbox',
|
||||
'url': 'URL',
|
||||
'email': 'Email',
|
||||
'phone_number': 'Phone Number'
|
||||
};
|
||||
|
||||
if (propertyIndex === 0) {
|
||||
dropdown.addOption('title', 'Title');
|
||||
} else {
|
||||
Object.keys(options).forEach(key => {
|
||||
dropdown.addOption(key, options[key]);
|
||||
});
|
||||
}
|
||||
|
||||
dropdown.setValue(isExistingProperty ? property.customType : "")
|
||||
.onChange(value => {
|
||||
const actualIndex = properties.findIndex(p => p.index === propertyIndex);
|
||||
if (actualIndex !== -1) {
|
||||
properties[actualIndex].customType = value;
|
||||
} else if (!isExistingProperty) {
|
||||
properties.push({ customName: '', customType: value, index: propertyIndex });
|
||||
isExistingProperty = true; // Update the flag to prevent re-adding
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (propertyIndex > 0) {
|
||||
propertyLine.addButton(button => {
|
||||
return button
|
||||
.setTooltip("Delete")
|
||||
.setIcon("trash")
|
||||
.onClick(() => {
|
||||
console.log('Deleting property', properties[propertyIndex]);
|
||||
this.deleteProperty(propertyIndex, properties);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.propertyLines.push(propertyLine);
|
||||
this.updatePropertyLines();
|
||||
|
||||
}
|
||||
|
||||
createStyleDiv(className: string, commandValue: boolean = false, parentEl: HTMLElement): HTMLDivElement {
|
||||
return super.createStyleDiv(className, commandValue, parentEl);
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import {App, ExtraButtonComponent, Modal, Notice, Setting} from "obsidian";
|
||||
import { App, ExtraButtonComponent, Modal, Notice, Setting } from "obsidian";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {DatabaseDetails, ObsidianSettingTab} from "./settingTabs";
|
||||
import { DatabaseDetails, ObsidianSettingTab } from "./settingTabs";
|
||||
import { customProperty } from "./settingModal";
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
|
||||
export class PreviewModal extends Modal {
|
||||
plugin: ObsidianSyncNotionPlugin;
|
||||
settingTab: ObsidianSettingTab;
|
||||
dbDetails: DatabaseDetails;
|
||||
|
||||
constructor(app:App, plugin: ObsidianSyncNotionPlugin, settingTab: ObsidianSettingTab, dbDetails: DatabaseDetails) {
|
||||
constructor(app: App, plugin: ObsidianSyncNotionPlugin, settingTab: ObsidianSettingTab, dbDetails: DatabaseDetails) {
|
||||
super(app);
|
||||
this.plugin = plugin;
|
||||
this.settingTab = settingTab;
|
||||
@@ -120,12 +122,9 @@ export class PreviewModal extends Modal {
|
||||
|
||||
if (this.dbDetails.format === 'custom') {
|
||||
|
||||
const customPropertiesEl = new Setting(previewEl)
|
||||
customPropertiesEl
|
||||
.setName('Custom Properties')
|
||||
.addTextArea(text => text
|
||||
.setValue(JSON.stringify(this.dbDetails.customProperties, null, 2))
|
||||
.setDisabled(true));
|
||||
const customPrv = previewEl.createDiv("custom-tabs");
|
||||
|
||||
this.previewPropertyLine(previewEl, this.dbDetails.customProperties);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,4 +135,44 @@ export class PreviewModal extends Modal {
|
||||
}
|
||||
|
||||
|
||||
previewPropertyLine(containerEl: HTMLElement, properties: customProperty[]): void {
|
||||
|
||||
properties.forEach((property, index) => {
|
||||
const propertyLine = new Setting(containerEl)
|
||||
.setName(index === 0 ? i18nConfig.CustomPropertyFirstColumn : `${i18nConfig.CustomProperty} ${index}`)
|
||||
.setDesc(index === 0 ? i18nConfig.CustomPropertyFirstColumnDesc : "");
|
||||
|
||||
propertyLine.addText(text => {
|
||||
text.setPlaceholder(i18nConfig.CustomPropertyName)
|
||||
.setValue(property.customName)
|
||||
.setDisabled(true);
|
||||
});
|
||||
|
||||
propertyLine.addDropdown((dropdown) => {
|
||||
const options: Record<string, string> = {
|
||||
'title': 'Title',
|
||||
'rich_text': 'Text',
|
||||
'number': 'Number',
|
||||
'select': 'Select',
|
||||
'multi_select': 'Multi-Select',
|
||||
'date': 'Date',
|
||||
'files': 'Files & Media',
|
||||
'checkbox': 'Checkbox',
|
||||
'url': 'URL',
|
||||
'email': 'Email',
|
||||
'phone_number': 'Phone Number',
|
||||
// Additional options can be added here
|
||||
};
|
||||
|
||||
// Populate dropdown with options
|
||||
Object.keys(options).forEach(key => {
|
||||
dropdown.addOption(key, options[key]);
|
||||
});
|
||||
|
||||
dropdown.setValue(property.customType)
|
||||
.setDisabled(true); // Disable dropdown to prevent changes
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import {
|
||||
Modal,
|
||||
Setting,
|
||||
PluginSettingTab,
|
||||
ButtonComponent, App
|
||||
} from 'obsidian';
|
||||
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {DatabaseDetails, ObsidianSettingTab} from "./settingTabs";
|
||||
import {CustomModal} from "./CustomModal";
|
||||
import { DatabaseDetails, ObsidianSettingTab } from "./settingTabs";
|
||||
|
||||
export interface customProperty {
|
||||
customName: string;
|
||||
customType: string;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export class SettingModal extends Modal {
|
||||
propertyLines: Setting[] = []; // Store all property line settings
|
||||
properties: customProperty[] = []; // Array to store property values and types
|
||||
[key: string]: any; // Index signature
|
||||
data: Record<string, any> = {
|
||||
databaseFormat: 'none',
|
||||
@@ -47,7 +52,6 @@ export class SettingModal extends Modal {
|
||||
// this.data.customValues = dbDetails.customValues;
|
||||
this.data.saved = dbDetails.saved;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
display(): void {
|
||||
@@ -55,14 +59,13 @@ export class SettingModal extends Modal {
|
||||
this.titleEl.setText('Add new database');
|
||||
|
||||
// create the dropdown button to select the database format
|
||||
let {contentEl} = this;
|
||||
let { contentEl } = this;
|
||||
contentEl.empty();
|
||||
|
||||
const settingDiv = contentEl.createDiv('setting-div');
|
||||
const nextTabs = contentEl.createDiv('next-tabs');
|
||||
|
||||
|
||||
if (this.data.saved) {
|
||||
new Setting(settingDiv)
|
||||
.setName(i18nConfig.databaseFormat)
|
||||
.setDesc(i18nConfig.databaseFormatDesc)
|
||||
@@ -80,31 +83,10 @@ export class SettingModal extends Modal {
|
||||
});
|
||||
|
||||
// Initialize content based on the current dropdown value
|
||||
this.updateContentBasedOnSelection(this.data.databaseFormat, nextTabs);
|
||||
});
|
||||
(this.data.saved) ? this.updateContentBasedOnSelection(this.data.databaseFormat, nextTabs) : this.updateContentBasedOnSelection(this.plugin.settings.databaseFormat, nextTabs);
|
||||
|
||||
} else {
|
||||
new Setting(settingDiv)
|
||||
.setName(i18nConfig.databaseFormat)
|
||||
.setDesc(i18nConfig.databaseFormatDesc)
|
||||
.addDropdown((component) => {
|
||||
component
|
||||
.addOption('none', '')
|
||||
.addOption('general', i18nConfig.databaseGeneral)
|
||||
.addOption('next', i18nConfig.databaseNext)
|
||||
.addOption('custom', i18nConfig.databaseCustom)
|
||||
.setValue(this.data.databaseFormat)
|
||||
.onChange(async (value) => {
|
||||
this.data.databaseFormat = value;
|
||||
nextTabs.empty();
|
||||
this.updateContentBasedOnSelection(value, nextTabs);
|
||||
});
|
||||
|
||||
// Initialize content based on the current dropdown value
|
||||
this.updateContentBasedOnSelection(this.plugin.settings.databaseFormat, nextTabs);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// add save button
|
||||
let footerEl = contentEl.createDiv('save-button');
|
||||
@@ -115,6 +97,7 @@ export class SettingModal extends Modal {
|
||||
.setIcon('checkmark')
|
||||
.onClick(async () => {
|
||||
this.data.saved = true;
|
||||
this.data.customProperties = this.properties;
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
@@ -125,6 +108,7 @@ export class SettingModal extends Modal {
|
||||
.setIcon('cross')
|
||||
.onClick(() => {
|
||||
this.data.saved = false;
|
||||
// this.data.customProperties = this.properties;
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
@@ -137,7 +121,7 @@ export class SettingModal extends Modal {
|
||||
|
||||
// Generate content based on the selected value
|
||||
if (value === 'general') {
|
||||
nextTabs.createEl('h3', {text: i18nConfig.NotionGeneralSettingHeader});
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionGeneralSettingHeader });
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.data.databaseFullName, 'data', 'databaseFullName')
|
||||
@@ -158,13 +142,8 @@ export class SettingModal extends Modal {
|
||||
.setValue(this.data.customTitleButton)
|
||||
.onChange(async (value) => {
|
||||
this.data.customTitleButton = value;
|
||||
|
||||
this.updateSettingEl(CustomNameEl, value)
|
||||
|
||||
// this.updateSettingEl(CustomValuesEl, value)
|
||||
|
||||
// await this.plugin.saveSettings();
|
||||
// await this.plugin.commands.updateCommand();
|
||||
})
|
||||
);
|
||||
|
||||
@@ -183,7 +162,7 @@ export class SettingModal extends Modal {
|
||||
|
||||
} else if (value === 'next') {
|
||||
|
||||
nextTabs.createEl('h3', {text: i18nConfig.NotionNextSettingHeader});
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionNextSettingHeader });
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.data.databaseFullName, 'data', 'databaseFullName')
|
||||
@@ -200,7 +179,7 @@ export class SettingModal extends Modal {
|
||||
|
||||
} else if (value === 'custom') {
|
||||
|
||||
nextTabs.createEl('h3', {text: i18nConfig.NotionCustomSettingHeader});
|
||||
nextTabs.createEl('h3', { text: i18nConfig.NotionCustomSettingHeader });
|
||||
|
||||
// add full name
|
||||
this.createSettingEl(nextTabs, i18nConfig.databaseFullName, i18nConfig.databaseFullNameDesc, 'text', i18nConfig.databaseFullNameText, this.data.databaseFullName, 'data', 'databaseFullName')
|
||||
@@ -220,23 +199,15 @@ export class SettingModal extends Modal {
|
||||
.setDesc(i18nConfig.NotionCustomValuesDesc)
|
||||
.addButton((button: ButtonComponent) => {
|
||||
return button
|
||||
.setTooltip('Add new property')
|
||||
.setIcon('plus')
|
||||
.setTooltip('Add one more property')
|
||||
.setButtonText('Add New Property')
|
||||
.onClick(async () => {
|
||||
let customModal = new CustomModal(this.app);
|
||||
|
||||
customModal.onClose = () => {
|
||||
|
||||
this.renderCustomPreview(customModal.properties, nextTabs)
|
||||
this.data.customProperties = customModal.properties;
|
||||
}
|
||||
|
||||
customModal.open();
|
||||
const customTabs = nextTabs.createDiv("custom-tabs");
|
||||
this.createPropertyLine(customTabs, this.properties);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -245,16 +216,108 @@ export class SettingModal extends Modal {
|
||||
this.display()
|
||||
}
|
||||
|
||||
renderCustomPreview(properties: any[], nextTabs: HTMLElement) {
|
||||
const previewContainer = nextTabs.createDiv('preview-container');
|
||||
createPropertyLine(containerEl: HTMLElement, properties: customProperty[]): void {
|
||||
const propertyIndex = properties.length;
|
||||
|
||||
properties.forEach((property: { customName: any; customType: any; }) => {
|
||||
const propertyEl = previewContainer.createEl('div', {cls: 'property-preview'});
|
||||
propertyEl.createEl('span', {text: `Property: ${property.customName}, Type: ${property.customType}`});
|
||||
properties.push({ customName: "", customType: "", index: propertyIndex });
|
||||
|
||||
const propertyLine = new Setting(containerEl)
|
||||
.setName(propertyIndex === 0 ? i18nConfig.CustomPropertyFirstColumn : `${i18nConfig.CustomProperty} ${propertyIndex}`)
|
||||
.setDesc(propertyIndex === 0 ? i18nConfig.CustomPropertyFirstColumnDesc : "");
|
||||
|
||||
propertyLine.addText(text => {
|
||||
text.setPlaceholder(i18nConfig.CustomPropertyName)
|
||||
.setValue("")
|
||||
.onChange(value => {
|
||||
let actualIndex = properties.findIndex(p => p.index === propertyIndex);
|
||||
if (actualIndex !== -1) {
|
||||
properties[actualIndex].customName = value;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
propertyLine.addDropdown((dropdown) => {
|
||||
const options: Record<string, string> = {
|
||||
'rich_text': 'Text',
|
||||
'number': 'Number',
|
||||
'select': 'Select',
|
||||
'multi_select': 'Multi-Select',
|
||||
'date': 'Date',
|
||||
'files': 'Files & Media',
|
||||
'checkbox': 'Checkbox',
|
||||
'url': 'URL',
|
||||
'email': 'Email',
|
||||
'phone_number': 'Phone Number',
|
||||
// 'formula': 'Formula',
|
||||
// 'relation': 'Relation',
|
||||
// 'rollup': 'Rollup',
|
||||
// 'created_time': 'Created time',
|
||||
// 'created_by': 'Created by',
|
||||
// 'last_edited_time': 'Last Edited Time',
|
||||
// 'last_edited_by': 'Last Edited By',
|
||||
};
|
||||
|
||||
const currentProperty = properties[propertyIndex];
|
||||
|
||||
if (propertyIndex === 0) {
|
||||
dropdown.addOption("title", "Title");
|
||||
} else {
|
||||
Object.keys(options).forEach(key => {
|
||||
dropdown.addOption(key, options[key]);
|
||||
});
|
||||
}
|
||||
dropdown.setValue("")
|
||||
.onChange(value => {
|
||||
if (currentProperty) {
|
||||
currentProperty.customType = value;
|
||||
// Retrieve the index of currentProperty from the properties array
|
||||
const updatedIndex = properties.findIndex(p => p === currentProperty);
|
||||
console.log(`Updated value at index ${updatedIndex}: ${value}`);
|
||||
} else {
|
||||
console.log("Property not found, may have been deleted.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if (propertyIndex > 0) {
|
||||
propertyLine.addButton(button => {
|
||||
return button
|
||||
.setTooltip("Delete")
|
||||
.setIcon("trash")
|
||||
.onClick(() => {
|
||||
this.deleteProperty(propertyIndex, properties);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.propertyLines.push(propertyLine);
|
||||
this.updatePropertyLines(); // Ensure property lines are updated after creation
|
||||
}
|
||||
|
||||
deleteProperty(propertyIndex: number, properties: customProperty[]): void {
|
||||
let actualIndex = properties.findIndex(p => p.index === propertyIndex);
|
||||
if (actualIndex !== -1) {
|
||||
properties.splice(actualIndex, 1);
|
||||
if (this.propertyLines[actualIndex]) {
|
||||
this.propertyLines[actualIndex].settingEl.remove();
|
||||
this.propertyLines.splice(actualIndex, 1);
|
||||
}
|
||||
// Update indices in the properties array
|
||||
properties.forEach((prop, idx) => {
|
||||
prop.index = idx;
|
||||
});
|
||||
|
||||
this.updatePropertyLines();
|
||||
}
|
||||
}
|
||||
|
||||
updatePropertyLines() {
|
||||
this.propertyLines.forEach((line, idx) => {
|
||||
line.setName(idx === 0 ? i18nConfig.CustomPropertyFirstColumn : `${i18nConfig.CustomProperty} ${idx}`);
|
||||
});
|
||||
}
|
||||
|
||||
// create a function to create a div with a style for pop over elements
|
||||
public createStyleDiv(className: string, commandValue: boolean = false, parentEl: HTMLElement) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import {App, ButtonComponent, Modal, PluginSettingTab, Setting} from "obsidian";
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
import { App, ButtonComponent, PluginSettingTab, Setting } from "obsidian";
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {SettingModal} from "./settingModal";
|
||||
import {set} from "yaml/dist/schema/yaml-1.1/set";
|
||||
import {PreviewModal} from "./PreviewModal";
|
||||
import {EditModal} from "./EditModal";
|
||||
import {DeleteModal} from "./DeleteModal";
|
||||
import { SettingModal } from "./settingModal";
|
||||
import { PreviewModal } from "./PreviewModal";
|
||||
import { EditModal } from "./EditModal";
|
||||
import { DeleteModal } from "./DeleteModal";
|
||||
|
||||
export interface PluginSettings {
|
||||
NextButton: boolean;
|
||||
@@ -13,6 +12,7 @@ export interface PluginSettings {
|
||||
databaseIDNext: string;
|
||||
bannerUrl: string;
|
||||
notionUser: string;
|
||||
NotionLinkDisplay: boolean;
|
||||
proxy: string;
|
||||
GeneralButton: boolean;
|
||||
tagButton: boolean;
|
||||
@@ -37,7 +37,7 @@ export interface DatabaseDetails {
|
||||
tagButton: boolean;
|
||||
customTitleButton: boolean;
|
||||
customTitleName: string;
|
||||
customProperties:{ customName: string, customType: string }[];
|
||||
customProperties: { customName: string, customType: string, index: number }[];
|
||||
// customValues: string;
|
||||
saved: boolean;
|
||||
}
|
||||
@@ -48,6 +48,7 @@ export const DEFAULT_SETTINGS: PluginSettings = {
|
||||
databaseIDNext: "",
|
||||
bannerUrl: "",
|
||||
notionUser: "",
|
||||
NotionLinkDisplay: true,
|
||||
proxy: "",
|
||||
GeneralButton: true,
|
||||
tagButton: true,
|
||||
@@ -84,9 +85,10 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
||||
|
||||
this.createSettingEl(containerEl, i18nConfig.NotionUser, i18nConfig.NotionUserDesc, 'text', i18nConfig.NotionUserText, this.plugin.settings.notionUser, 'notionUser')
|
||||
|
||||
this.createSettingEl(containerEl, i18nConfig.NotionLinkDisplay, i18nConfig.NotionLinkDisplayDesc, 'toggle', i18nConfig.NotionLinkDisplay, this.plugin.settings.NotionLinkDisplay, 'NotionLinkDisplay')
|
||||
|
||||
|
||||
// add new button
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Add New Database")
|
||||
.setDesc("Add New Database")
|
||||
@@ -126,52 +128,21 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
||||
});
|
||||
|
||||
// new section to display all created database
|
||||
containerEl.createEl('h2', {text: "Database List"});
|
||||
containerEl.createEl('h2', { text: "Database List" });
|
||||
|
||||
this.databaseEl = containerEl.createDiv('database-list');
|
||||
// list all created database
|
||||
this.showDatabase();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// // notion next database settings
|
||||
//
|
||||
// const NextTabs = new SettingNextTabs(this.app, this.plugin, this);
|
||||
//
|
||||
// NextTabs.display();
|
||||
//
|
||||
//
|
||||
// // General Database Settings
|
||||
// const GeneralTabs = new SettingGeneralTabs(this.app, this.plugin, this);
|
||||
//
|
||||
// GeneralTabs.display();
|
||||
|
||||
|
||||
// Custom Database Settings
|
||||
|
||||
// containerEl.createEl('h2', {text: i18nConfig.NotionCustomSettingHeader});
|
||||
//
|
||||
// new Setting(containerEl)
|
||||
// .setName(i18nConfig.NotionCustomButton)
|
||||
// .setDesc(i18nConfig.NotionCustomButtonDesc)
|
||||
// .addToggle((toggle) =>
|
||||
// toggle
|
||||
// .setValue(this.plugin.settings.CustomButton)
|
||||
// .onChange(async (value) => {
|
||||
// this.plugin.settings.CustomButton = value;
|
||||
// await this.plugin.saveSettings();
|
||||
// })
|
||||
// );
|
||||
}
|
||||
|
||||
// create a function to create a div with a style for pop over elements
|
||||
public createStyleDiv(className: string, commandValue: boolean = false) {
|
||||
return this.containerEl.createDiv(className, (div) => {
|
||||
this.updateSettingEl(div, commandValue);
|
||||
});
|
||||
}
|
||||
// public createStyleDiv(className: string, commandValue: boolean = false) {
|
||||
// return this.containerEl.createDiv(className, (div) => {
|
||||
// this.updateSettingEl(div, commandValue);
|
||||
// });
|
||||
// }
|
||||
|
||||
// update the setting display style in the setting tab
|
||||
public updateSettingEl(element: HTMLElement, commandValue: boolean) {
|
||||
element.style.borderTop = commandValue ? "1px solid var(--background-modifier-border)" : "none";
|
||||
@@ -317,6 +288,8 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
||||
if (modal.data.deleted) {
|
||||
this.plugin.deleteDatabaseDetails(dbDetails);
|
||||
|
||||
console.log(dbDetails.fullName + " deleted");
|
||||
|
||||
this.plugin.commands.updateCommand();
|
||||
|
||||
this.display()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { App, Notice, TFile } from "obsidian";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import {DatabaseDetails} from "../ui/settingTabs";
|
||||
import { DatabaseDetails } from "../ui/settingTabs";
|
||||
import { i18nConfig } from "src/lang/I18n";
|
||||
|
||||
export async function updateYamlInfo(
|
||||
yamlContent: string,
|
||||
@@ -10,9 +11,9 @@ export async function updateYamlInfo(
|
||||
plugin: ObsidianSyncNotionPlugin,
|
||||
dbDetails: DatabaseDetails,
|
||||
) {
|
||||
let { url, id } = res.json
|
||||
let { url, id } = res;
|
||||
// replace www to notionID
|
||||
const { notionUser } = plugin.settings;
|
||||
const { notionUser, NotionLinkDisplay } = plugin.settings;
|
||||
const { abName } = dbDetails
|
||||
const notionIDKey = `NotionID-${abName}`;
|
||||
const linkKey = `link-${abName}`;
|
||||
@@ -31,25 +32,13 @@ export async function updateYamlInfo(
|
||||
}
|
||||
// add new notionID and link
|
||||
yamlContent[notionIDKey] = id;
|
||||
yamlContent[linkKey] = url;
|
||||
(NotionLinkDisplay) ? yamlContent[linkKey] = url : null;
|
||||
});
|
||||
|
||||
try {
|
||||
await navigator.clipboard.writeText(url)
|
||||
} catch (error) {
|
||||
new Notice(`复制链接失败,请手动复制${error}`)
|
||||
console.log(error)
|
||||
new Notice(`${i18nConfig.CopyErrorMessage}`);
|
||||
}
|
||||
// const __content = yamlContent.__content;
|
||||
// delete yamlContent.__content
|
||||
// const yamlhead = yaml.stringify(yamlContent)
|
||||
// // if yamlhead hava last \n remove it
|
||||
// const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
||||
// // if __content have start \n remove it
|
||||
// const __content_remove_n = __content.replace(/^\n/, '')
|
||||
// const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
||||
// try {
|
||||
// await nowFile.vault.modify(nowFile, content)
|
||||
// } catch (error) {
|
||||
// new Notice(`write file error ${error}`)
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -18,13 +18,6 @@ export async function uploadCommandNext(
|
||||
|
||||
const {notionAPI, databaseID} = dbDetails;
|
||||
|
||||
// Check if NNon exists
|
||||
// if (NNon === undefined) {
|
||||
// const NNonmessage = i18nConfig.NNonMissing;
|
||||
// new Notice(NNonmessage);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Check if the user has set up the Notion API and database ID
|
||||
if (notionAPI === "" || databaseID === "") {
|
||||
const setAPIMessage = i18nConfig["set-api-id"];
|
||||
@@ -50,13 +43,15 @@ export async function uploadCommandNext(
|
||||
|
||||
if (markDownData) {
|
||||
const {basename} = nowFile;
|
||||
|
||||
const upload = new Upload2NotionNext(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
||||
|
||||
if (res.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -87,10 +82,11 @@ export async function uploadCommandGeneral(
|
||||
const upload = new Upload2NotionGeneral(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
||||
|
||||
if (res.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -116,15 +112,16 @@ export async function uploadCommandCustom(
|
||||
const {markDownData, nowFile, cover, customValues} = await getNowFileMarkdownContentCustom(app, dbDetails)
|
||||
|
||||
if (markDownData) {
|
||||
const { basename} = nowFile;
|
||||
const {basename} = nowFile;
|
||||
|
||||
const upload = new Upload2NotionCustom(plugin, dbDetails);
|
||||
const res = await upload.syncMarkdownToNotionCustom(cover, customValues, markDownData, nowFile, this.app);
|
||||
|
||||
if (res.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
const {response} = res;
|
||||
if (response.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
new Notice(`${i18nConfig["sync-fail"]} ${basename}`, 5000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {App, Notice, requestUrl, TFile} from "obsidian";
|
||||
import {Client} from '@notionhq/client';
|
||||
import {markdownToBlocks,} from "@tryfabric/martian";
|
||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||
import { Client } from '@notionhq/client';
|
||||
import { markdownToBlocks, } from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails} from "../../ui/settingTabs";
|
||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
||||
|
||||
export class UploadBaseGeneral {
|
||||
plugin: MyPlugin;
|
||||
@@ -19,7 +19,7 @@ export class UploadBaseGeneral {
|
||||
|
||||
async deletePage(notionID: string) {
|
||||
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
return requestUrl({
|
||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||
method: 'DELETE',
|
||||
@@ -33,7 +33,7 @@ export class UploadBaseGeneral {
|
||||
}
|
||||
|
||||
async getDataBase(databaseID: string) {
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
const response = await requestUrl({
|
||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||
method: 'GET',
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||
import { Client } from "@notionhq/client";
|
||||
import { markdownToBlocks } from "@tryfabric/martian";
|
||||
import {App, Notice, TFile} from "obsidian";
|
||||
import {Client} from "@notionhq/client";
|
||||
import {markdownToBlocks} from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails, PluginSettings} from "../../ui/settingTabs";
|
||||
import { UploadBaseGeneral } from "./BaseUpload2NotionGeneral";
|
||||
import { updateYamlInfo } from "../updateYaml";
|
||||
import {UploadBaseGeneral} from "./BaseUpload2NotionGeneral";
|
||||
import {updateYamlInfo} from "../updateYaml";
|
||||
import fetch from 'node-fetch';
|
||||
import {i18nConfig} from "../../lang/I18n";
|
||||
|
||||
export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
settings: PluginSettings;
|
||||
@@ -28,7 +30,7 @@ export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
) {
|
||||
await this.deletePage(notionID);
|
||||
|
||||
const { databaseID } = this.dbDetails;
|
||||
const {databaseID} = this.dbDetails;
|
||||
|
||||
const databaseCover = await this.getDataBase(
|
||||
databaseID,
|
||||
@@ -56,6 +58,28 @@ export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
notionAPI
|
||||
} = this.dbDetails;
|
||||
|
||||
// check the length of the childArr and split it into chunks of 100
|
||||
const childArrLength = childArr.length;
|
||||
let extraArr: any[] = [];
|
||||
let firstArr: any;
|
||||
let pushCount = 0;
|
||||
|
||||
console.log(`Page includes ${childArrLength} blocks`)
|
||||
|
||||
if (childArrLength > 100) {
|
||||
for (let i = 0; i < childArr.length; i += 100) {
|
||||
if (i == 0) {
|
||||
firstArr = childArr.slice(0, 100);
|
||||
} else {
|
||||
const chunk = childArr.slice(i, i + 100);
|
||||
extraArr.push(chunk);
|
||||
pushCount++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
firstArr = childArr;
|
||||
}
|
||||
|
||||
const bodyString: any = {
|
||||
parent: {
|
||||
database_id: databaseID,
|
||||
@@ -75,12 +99,12 @@ export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
...(tagButton
|
||||
? {
|
||||
tags: {
|
||||
multi_select: tags && true ? tags.map((tag) => ({ name: tag })) : [],
|
||||
multi_select: tags && true ? tags.map((tag) => ({name: tag})) : [],
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
children: childArr,
|
||||
children: firstArr,
|
||||
};
|
||||
|
||||
if (cover) {
|
||||
@@ -101,21 +125,64 @@ export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
return await requestUrl({
|
||||
url: `https://api.notion.com/v1/pages`,
|
||||
console.log(bodyString)
|
||||
|
||||
const response = await fetch("https://api.notion.com/v1/pages", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
// 'User-Agent': 'obsidian.md',
|
||||
Authorization:
|
||||
"Bearer " + notionAPI,
|
||||
"Authorization": "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(bodyString),
|
||||
});
|
||||
} catch (error) {
|
||||
new Notice(`network error ${error}`);
|
||||
|
||||
const data: any = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
new Notice(`Error ${data.status}: ${data.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||
} else {
|
||||
console.log(`Page created: ${data.url}`);
|
||||
console.log(`Page ID: ${data.id}`);
|
||||
}
|
||||
|
||||
// upload the rest of the blocks
|
||||
if (pushCount > 0) {
|
||||
for (let i = 0; i < pushCount; i++) {
|
||||
const extraBlocks = {
|
||||
children: extraArr[i],
|
||||
};
|
||||
|
||||
console.log(extraBlocks)
|
||||
|
||||
const extraResponse = await fetch(`https://api.notion.com/v1/blocks/${data.id}/children`, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(extraBlocks),
|
||||
});
|
||||
|
||||
const extraData: any = await extraResponse.json();
|
||||
|
||||
if (!extraResponse.ok) {
|
||||
new Notice(`Error ${extraData.status}: ${extraData.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||
console.log(`Error message: \n ${extraData.message}`);
|
||||
} else {
|
||||
console.log(`${i18nConfig["ExtraBlockUploaded"]} to page: ${data.id}`);
|
||||
if (i === pushCount - 1) {
|
||||
console.log(`${i18nConfig["BlockUploaded"]} to page: ${data.id}`);
|
||||
new Notice(`${i18nConfig["BlockUploaded"]} page: ${data.id}`, 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
response, // for status code
|
||||
data // for id and url
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,11 +221,15 @@ export class Upload2NotionGeneral extends UploadBaseGeneral {
|
||||
} else {
|
||||
res = await this.createPage(title, cover, tags, file2Block);
|
||||
}
|
||||
if (res.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
||||
} else {
|
||||
new Notice(`${res.text}`);
|
||||
|
||||
let {response, data} = res;
|
||||
|
||||
// console.log(response)
|
||||
|
||||
if (response && response.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, data, app, this.plugin, this.dbDetails);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {App, Notice} from "obsidian";
|
||||
import {i18nConfig} from "../../lang/I18n";
|
||||
import {PluginSettings} from "../../ui/settingTabs";
|
||||
import { App, Notice } from "obsidian";
|
||||
import { i18nConfig } from "../../lang/I18n";
|
||||
import { PluginSettings } from "../../ui/settingTabs";
|
||||
|
||||
export async function getNowFileMarkdownContentGeneral(
|
||||
app: App,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||
import { Client } from '@notionhq/client';
|
||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
||||
import { markdownToBlocks, } from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails} from "../../ui/settingTabs";
|
||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
||||
|
||||
export class UploadBaseNext {
|
||||
plugin: MyPlugin;
|
||||
@@ -18,7 +18,7 @@ export class UploadBaseNext {
|
||||
}
|
||||
|
||||
async deletePage(notionID: string) {
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
return requestUrl({
|
||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||
method: 'DELETE',
|
||||
@@ -32,7 +32,7 @@ export class UploadBaseNext {
|
||||
}
|
||||
|
||||
async getDataBase(databaseID: string) {
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
|
||||
const response = await requestUrl({
|
||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
import { UploadBaseNext } from "./BaseUpload2NotionNext";
|
||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||
import { Client } from '@notionhq/client';
|
||||
import { markdownToBlocks, } from "@tryfabric/martian";
|
||||
import {UploadBaseNext} from "./BaseUpload2NotionNext";
|
||||
import {App, Notice, TFile} from "obsidian";
|
||||
import {Client} from "@notionhq/client";
|
||||
import {markdownToBlocks} from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails, PluginSettings} from "../../ui/settingTabs";
|
||||
import { updateYamlInfo } from "../updateYaml";
|
||||
import {LIMITS, paragraph} from "@tryfabric/martian/src/notion";
|
||||
import {updateYamlInfo} from "../updateYaml";
|
||||
import {LIMITS, paragraph} from "@jxpeng98/martian/src/notion";
|
||||
import fetch from "node-fetch";
|
||||
import {i18nConfig} from "../../lang/I18n";
|
||||
|
||||
export class Upload2NotionNext extends UploadBaseNext {
|
||||
settings: PluginSettings;
|
||||
dbDetails: DatabaseDetails
|
||||
dbDetails: DatabaseDetails;
|
||||
|
||||
constructor(plugin: MyPlugin, dbDetails: DatabaseDetails) {
|
||||
super(plugin, dbDetails);
|
||||
this.dbDetails = dbDetails
|
||||
this.dbDetails = dbDetails;
|
||||
}
|
||||
|
||||
// 因为需要解析notion的block进行对比,非常的麻烦,
|
||||
@@ -34,16 +36,16 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
paword: string,
|
||||
favicon: string,
|
||||
datetime: string,
|
||||
childArr: any
|
||||
childArr: any,
|
||||
) {
|
||||
await this.deletePage(notionID)
|
||||
await this.deletePage(notionID);
|
||||
|
||||
const { databaseID} = this.dbDetails
|
||||
const {databaseID} = this.dbDetails;
|
||||
|
||||
const databaseCover = await this.getDataBase(databaseID)
|
||||
const databaseCover = await this.getDataBase(databaseID);
|
||||
|
||||
if (cover == null) {
|
||||
cover = databaseCover
|
||||
cover = databaseCover;
|
||||
}
|
||||
|
||||
return await this.createPage(
|
||||
@@ -59,7 +61,8 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
paword,
|
||||
favicon,
|
||||
datetime,
|
||||
childArr)
|
||||
childArr,
|
||||
);
|
||||
}
|
||||
|
||||
async createPage(
|
||||
@@ -75,16 +78,34 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
pawrod: string,
|
||||
favicon: string,
|
||||
datetime: string,
|
||||
childArr: any
|
||||
childArr: any,
|
||||
) {
|
||||
const {databaseID, notionAPI} = this.dbDetails;
|
||||
|
||||
const {
|
||||
databaseID,
|
||||
notionAPI
|
||||
} = this.dbDetails
|
||||
// check the length of the childArr
|
||||
// if it is too long, split it into multiple pages
|
||||
const childArrLength = childArr.length;
|
||||
let extraArr: any[] = [];
|
||||
let firstArr: any;
|
||||
let pushCount = 0;
|
||||
|
||||
console.log(`Page includes ${childArrLength} blocks`)
|
||||
|
||||
const bodyString: any = {
|
||||
if (childArrLength > 100) {
|
||||
for (let i = 0; i < childArr.length; i += 100) {
|
||||
if (i == 0) {
|
||||
firstArr = childArr.slice(0, 100);
|
||||
} else {
|
||||
const chunk = childArr.slice(i, i + 100);
|
||||
extraArr.push(chunk);
|
||||
pushCount++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
firstArr = childArr;
|
||||
}
|
||||
|
||||
const pageProperties: any = {
|
||||
parent: {
|
||||
database_id: databaseID,
|
||||
},
|
||||
@@ -93,132 +114,184 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
title: [
|
||||
{
|
||||
text: {
|
||||
content: title
|
||||
content: title,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
type: {
|
||||
select: {
|
||||
name: type || 'Post'
|
||||
}
|
||||
name: type || "Post",
|
||||
},
|
||||
},
|
||||
status: {
|
||||
select: {
|
||||
name: stats || 'Draft'
|
||||
}
|
||||
name: stats || "Draft",
|
||||
},
|
||||
},
|
||||
category: {
|
||||
select: {
|
||||
name: category || 'Obsidian'
|
||||
}
|
||||
name: category || "Obsidian",
|
||||
},
|
||||
},
|
||||
|
||||
password: {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: pawrod || ''
|
||||
}
|
||||
}
|
||||
]
|
||||
content: pawrod || "",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
icon: {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: favicon || ''
|
||||
}
|
||||
}
|
||||
]
|
||||
content: favicon || "",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
date: {
|
||||
date: {
|
||||
start: datetime || new Date().toISOString()
|
||||
}
|
||||
}
|
||||
start: datetime || new Date().toISOString(),
|
||||
},
|
||||
children: childArr,
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// add tags
|
||||
if (tags) {
|
||||
bodyString.properties.tags = {
|
||||
multi_select: tags.map(tag => {
|
||||
return { "name": tag }
|
||||
})
|
||||
}
|
||||
pageProperties.properties.tags = {
|
||||
multi_select: tags.map((tag) => {
|
||||
return {name: tag};
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
// add title icon
|
||||
if (emoji) {
|
||||
bodyString.icon = {
|
||||
emoji: emoji
|
||||
}
|
||||
pageProperties.icon = {
|
||||
emoji: emoji,
|
||||
};
|
||||
}
|
||||
|
||||
// add slug
|
||||
if (slug) {
|
||||
bodyString.properties.slug = {
|
||||
pageProperties.properties.slug = {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: slug
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
content: slug,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
// check if summary is available
|
||||
if (summary) {
|
||||
bodyString.properties.summary = {
|
||||
pageProperties.properties.summary = {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: summary
|
||||
content: summary,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (cover) {
|
||||
bodyString.cover = {
|
||||
pageProperties.cover = {
|
||||
type: "external",
|
||||
external: {
|
||||
url: cover
|
||||
}
|
||||
}
|
||||
url: cover,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (!bodyString.cover && this.plugin.settings.bannerUrl) {
|
||||
bodyString.cover = {
|
||||
if (!pageProperties.cover && this.plugin.settings.bannerUrl) {
|
||||
pageProperties.cover = {
|
||||
type: "external",
|
||||
external: {
|
||||
url: this.plugin.settings.bannerUrl
|
||||
}
|
||||
}
|
||||
url: this.plugin.settings.bannerUrl,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
return await requestUrl({
|
||||
url: `https://api.notion.com/v1/pages`,
|
||||
method: 'POST',
|
||||
const bodyString: any = {
|
||||
...pageProperties,
|
||||
children: firstArr,
|
||||
};
|
||||
|
||||
console.log(bodyString);
|
||||
|
||||
const response = await fetch("https://api.notion.com/v1/pages", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
// 'User-Agent': 'obsidian.md',
|
||||
'Authorization': 'Bearer ' + notionAPI,
|
||||
'Notion-Version': '2022-06-28',
|
||||
"Content-Type": "application/json",
|
||||
Authorization: "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(bodyString),
|
||||
})
|
||||
} catch (error) {
|
||||
new Notice(`network error ${error}`)
|
||||
});
|
||||
|
||||
const data: any = await response.json();
|
||||
|
||||
// can use response.ok or response.status === 200
|
||||
if (!response.ok) {
|
||||
new Notice(`Error ${data.status}: ${data.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||
console.log(`Error message: \n ${data.message}`);
|
||||
} else {
|
||||
console.log(`Page created: ${data.url}`);
|
||||
console.log(`Page ID: ${data.id}`);
|
||||
}
|
||||
|
||||
// if the childArr is over 100, patch the rest of the blocks append to the page
|
||||
if (pushCount > 0) {
|
||||
for (let i = 0; i < pushCount; i++) {
|
||||
const extraBlocks = {
|
||||
children: extraArr[i]
|
||||
}
|
||||
|
||||
console.log(extraBlocks)
|
||||
|
||||
const extraResponse = await fetch(
|
||||
`https://api.notion.com/v1/blocks/${data.id}/children`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(extraBlocks),
|
||||
});
|
||||
|
||||
const extraData: any = await extraResponse.json();
|
||||
|
||||
if (!extraResponse.ok) {
|
||||
new Notice(
|
||||
`Extra Block: Error ${extraData.status}: ${extraData.code} \n ${i18nConfig["CheckConsole"]}`,
|
||||
5000,
|
||||
);
|
||||
console.log(`Error message: \n ${extraData.message}`);
|
||||
} else {
|
||||
console.log(`${i18nConfig["ExtraBlockUploaded"]} to page: ${data.id}`);
|
||||
if (i === pushCount - 1) {
|
||||
console.log(`${i18nConfig["BlockUploaded"]} to page: ${data.id}`);
|
||||
new Notice(`${i18nConfig["BlockUploaded"]} page: ${data.id}`, 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
response, // for status code
|
||||
data, // for id and url
|
||||
};
|
||||
}
|
||||
|
||||
async syncMarkdownToNotionNext(
|
||||
@@ -241,38 +314,36 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
const options = {
|
||||
notionLimits: {
|
||||
truncate: false,
|
||||
}
|
||||
}
|
||||
let res: any
|
||||
},
|
||||
};
|
||||
let res: any;
|
||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||
const __content = yamlContent.__content
|
||||
const __content = yamlContent.__content;
|
||||
const file2Block = markdownToBlocks(__content, options);
|
||||
const frontmasster = app.metadataCache.getFileCache(nowFile)?.frontmatter
|
||||
const {abName} = this.dbDetails
|
||||
const frontmatter =
|
||||
app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
||||
const {abName} = this.dbDetails;
|
||||
const notionIDKey = `NotionID-${abName}`;
|
||||
const notionID = frontmasster ? frontmasster[notionIDKey] : null;
|
||||
|
||||
const notionID = frontmatter ? frontmatter[notionIDKey] : null;
|
||||
|
||||
// increase the limits
|
||||
// Motivated by https://github.com/tryfabric/martian/issues/51
|
||||
file2Block.forEach((block,index) => {
|
||||
file2Block.forEach((block, index) => {
|
||||
if (
|
||||
block.type === 'paragraph' &&
|
||||
block.type === "paragraph" &&
|
||||
block.paragraph.rich_text.length > LIMITS.RICH_TEXT_ARRAYS
|
||||
) {
|
||||
|
||||
const newParagraphBlocks: any[] = []
|
||||
const chunk:any = []
|
||||
const richTextChunks = chunk(block.paragraph.rich_text, 100)
|
||||
const newParagraphBlocks: any[] = [];
|
||||
const chunk: any = [];
|
||||
const richTextChunks = chunk(block.paragraph.rich_text, 100);
|
||||
|
||||
richTextChunks.forEach((chunk: any) => {
|
||||
newParagraphBlocks.push(paragraph(chunk))
|
||||
})
|
||||
|
||||
file2Block.splice(index, 1, ...newParagraphBlocks)
|
||||
newParagraphBlocks.push(paragraph(chunk));
|
||||
});
|
||||
|
||||
file2Block.splice(index, 1, ...newParagraphBlocks);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
if (notionID) {
|
||||
res = await this.updatePage(
|
||||
@@ -289,7 +360,7 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
paword,
|
||||
favicon,
|
||||
datetime,
|
||||
file2Block
|
||||
file2Block,
|
||||
);
|
||||
} else {
|
||||
res = await this.createPage(
|
||||
@@ -305,16 +376,23 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
paword,
|
||||
favicon,
|
||||
datetime,
|
||||
file2Block
|
||||
file2Block,
|
||||
);
|
||||
}
|
||||
|
||||
if (res.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails)
|
||||
} else {
|
||||
new Notice(`${res.text}`)
|
||||
let {response, data} = res;
|
||||
|
||||
if (response && response.status === 200) {
|
||||
await updateYamlInfo(
|
||||
markdown,
|
||||
nowFile,
|
||||
data,
|
||||
app,
|
||||
this.plugin,
|
||||
this.dbDetails,
|
||||
);
|
||||
}
|
||||
return res
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {App, Notice, requestUrl, TFile} from "obsidian";
|
||||
import {Client} from '@notionhq/client';
|
||||
import {markdownToBlocks,} from "@tryfabric/martian";
|
||||
import { App, Notice, requestUrl, TFile } from "obsidian";
|
||||
import { Client } from '@notionhq/client';
|
||||
import { markdownToBlocks, } from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails} from "../../ui/settingTabs";
|
||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
||||
|
||||
export class UploadBaseCustom {
|
||||
plugin: MyPlugin;
|
||||
@@ -18,7 +18,7 @@ export class UploadBaseCustom {
|
||||
}
|
||||
|
||||
async deletePage(notionID: string) {
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
return requestUrl({
|
||||
url: `https://api.notion.com/v1/blocks/${notionID}`,
|
||||
method: 'DELETE',
|
||||
@@ -32,7 +32,7 @@ export class UploadBaseCustom {
|
||||
}
|
||||
|
||||
async getDataBase(databaseID: string) {
|
||||
const {notionAPI} = this.dbDetails
|
||||
const { notionAPI } = this.dbDetails
|
||||
const response = await requestUrl({
|
||||
url: `https://api.notion.com/v1/databases/${databaseID}`,
|
||||
method: 'GET',
|
||||
@@ -50,46 +50,4 @@ export class UploadBaseCustom {
|
||||
return null; // or some other default value, if you prefer
|
||||
}
|
||||
}
|
||||
|
||||
// async updateYamlInfo(yamlContent: string, nowFile: TFile, res: any, app: App, settings: any) {
|
||||
// let {url, id} = res.json
|
||||
// // replace www to notionID
|
||||
// const {notionUser} = this.plugin.settings;
|
||||
//
|
||||
// if (notionUser !== "") {
|
||||
// // replace url str "www" to notionID
|
||||
// url = url.replace("www.notion.so", `${notionUser}.notion.site`)
|
||||
// }
|
||||
//
|
||||
// await app.fileManager.processFrontMatter(nowFile, yamlContent => {
|
||||
// if (yamlContent['notionID']) {
|
||||
// delete yamlContent['notionID']
|
||||
// }
|
||||
// if (yamlContent['link']) {
|
||||
// delete yamlContent['link']
|
||||
// }
|
||||
// // add new notionID and link
|
||||
// yamlContent.notionID = id;
|
||||
// yamlContent.link = url;
|
||||
// });
|
||||
//
|
||||
// try {
|
||||
// await navigator.clipboard.writeText(url)
|
||||
// } catch (error) {
|
||||
// new Notice(`复制链接失败,请手动复制${error}`)
|
||||
// }
|
||||
// // const __content = yamlContent.__content;
|
||||
// // delete yamlContent.__content
|
||||
// // const yamlhead = yaml.stringify(yamlContent)
|
||||
// // // if yamlhead hava last \n remove it
|
||||
// // const yamlhead_remove_n = yamlhead.replace(/\n$/, '')
|
||||
// // // if __content have start \n remove it
|
||||
// // const __content_remove_n = __content.replace(/^\n/, '')
|
||||
// // const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n;
|
||||
// // try {
|
||||
// // await nowFile.vault.modify(nowFile, content)
|
||||
// // } catch (error) {
|
||||
// // new Notice(`write file error ${error}`)
|
||||
// // }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import {App, Notice, requestUrl, TFile} from "obsidian";
|
||||
import {markdownToBlocks} from "@tryfabric/martian";
|
||||
import {App, Notice, TFile} from "obsidian";
|
||||
import {markdownToBlocks} from "@jxpeng98/martian";
|
||||
import * as yamlFrontMatter from "yaml-front-matter";
|
||||
// import * as yaml from "yaml"
|
||||
import MyPlugin from "src/main";
|
||||
import {DatabaseDetails, PluginSettings} from "../../ui/settingTabs";
|
||||
import {updateYamlInfo} from "../updateYaml";
|
||||
import {UploadBaseCustom} from "./BaseUpload2NotionCustom";
|
||||
import fetch from 'node-fetch';
|
||||
import {i18nConfig} from "../../lang/I18n";
|
||||
|
||||
|
||||
export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
settings: PluginSettings;
|
||||
@@ -51,7 +54,29 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
notionAPI
|
||||
} = this.dbDetails;
|
||||
|
||||
const bodyString: any = this.buildBodyString(customProperties, customValues, childArr);
|
||||
// check the length of the childArr and split it into chunks of 100
|
||||
const childArrLength = childArr.length;
|
||||
let extraArr: any[] = [];
|
||||
let firstArr: any;
|
||||
let pushCount = 0;
|
||||
|
||||
console.log(`Page includes ${childArrLength} blocks`)
|
||||
|
||||
if (childArrLength > 100) {
|
||||
for (let i = 0; i < childArr.length; i += 100) {
|
||||
if (i == 0) {
|
||||
firstArr = childArr.slice(0, 100);
|
||||
} else {
|
||||
const chunk = childArr.slice(i, i + 100);
|
||||
extraArr.push(chunk);
|
||||
pushCount++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
firstArr = childArr;
|
||||
}
|
||||
|
||||
const bodyString: any = this.buildBodyString(customProperties, customValues, firstArr);
|
||||
|
||||
if (cover) {
|
||||
bodyString.cover = {
|
||||
@@ -71,21 +96,65 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
return await requestUrl({
|
||||
url: `https://api.notion.com/v1/pages`,
|
||||
console.log(bodyString)
|
||||
|
||||
const response = await fetch("https://api.notion.com/v1/pages", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
// 'User-Agent': 'obsidian.md',
|
||||
Authorization:
|
||||
"Bearer " + notionAPI,
|
||||
"Authorization": "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(bodyString),
|
||||
});
|
||||
} catch (error) {
|
||||
new Notice(`network error ${error}`);
|
||||
|
||||
const data: any = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
new Notice(`Error ${data.status}: ${data.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||
console.log(`Error message: \n ${data.message}`);
|
||||
} else {
|
||||
console.log(`Page created: ${data.url}`);
|
||||
console.log(`Page ID: ${data.id}`);
|
||||
}
|
||||
|
||||
// upload the rest of the blocks
|
||||
if (pushCount > 0) {
|
||||
for (let i = 0; i < pushCount; i++) {
|
||||
const extraBlocks = {
|
||||
children: extraArr[i],
|
||||
};
|
||||
|
||||
console.log(extraBlocks)
|
||||
|
||||
const extraResponse = await fetch(`https://api.notion.com/v1/blocks/${data.id}/children`, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer " + notionAPI,
|
||||
"Notion-Version": "2022-06-28",
|
||||
},
|
||||
body: JSON.stringify(extraBlocks),
|
||||
});
|
||||
|
||||
const extraData: any = await extraResponse.json();
|
||||
|
||||
if (!extraResponse.ok) {
|
||||
new Notice(`Error ${extraData.status}: ${extraData.code} \n ${i18nConfig["CheckConsole"]}`, 5000);
|
||||
console.log(`Error message: \n ${extraData.message}`);
|
||||
} else {
|
||||
console.log(`${i18nConfig["ExtraBlockUploaded"]} to page: ${data.id}`);
|
||||
if (i === pushCount - 1) {
|
||||
console.log(`${i18nConfig["BlockUploaded"]} to page: ${data.id}`);
|
||||
new Notice(`${i18nConfig["BlockUploaded"]} page: ${data.id}`, 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
response, // for status code
|
||||
data // for id and url
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +166,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
app: App,
|
||||
): Promise<any> {
|
||||
const options = {
|
||||
strictImageUrls: true,
|
||||
notionLimits: {
|
||||
truncate: false,
|
||||
}
|
||||
@@ -105,11 +175,11 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
const yamlContent: any = yamlFrontMatter.loadFront(markdown);
|
||||
const __content = yamlContent.__content;
|
||||
const file2Block = markdownToBlocks(__content, options);
|
||||
const frontmasster =
|
||||
const frontMatter =
|
||||
app.metadataCache.getFileCache(nowFile)?.frontmatter;
|
||||
const {abName} = this.dbDetails
|
||||
const notionIDKey = `NotionID-${abName}`;
|
||||
const notionID = frontmasster ? frontmasster[notionIDKey] : null;
|
||||
const notionID = frontMatter ? frontMatter[notionIDKey] : null;
|
||||
|
||||
if (notionID) {
|
||||
res = await this.updatePage(
|
||||
@@ -121,11 +191,15 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
} else {
|
||||
res = await this.createPage(cover, customValues, file2Block);
|
||||
}
|
||||
if (res.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
||||
} else {
|
||||
new Notice(`${res.text}`);
|
||||
|
||||
let {response, data} = res;
|
||||
|
||||
// console.log(response)
|
||||
|
||||
if (response && response.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, data, app, this.plugin, this.dbDetails);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -218,11 +292,15 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
|
||||
const properties: { [key: string]: any } = {};
|
||||
|
||||
// Only include custom properties that have values
|
||||
customProperties.forEach(({customName, customType}) => {
|
||||
if (customValues[customName] !== undefined) {
|
||||
properties[customName] = this.buildPropertyObject(customName, customType, customValues);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// console.log(properties)
|
||||
|
||||
return {
|
||||
parent: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {App, Notice} from "obsidian";
|
||||
import {i18nConfig} from "../../lang/I18n";
|
||||
import {DatabaseDetails} from "../../ui/settingTabs";
|
||||
import { App, Notice } from "obsidian";
|
||||
import { i18nConfig } from "../../lang/I18n";
|
||||
import { DatabaseDetails } from "../../ui/settingTabs";
|
||||
|
||||
export async function getNowFileMarkdownContentCustom(
|
||||
app: App,
|
||||
|
||||
361
yarn.lock
361
yarn.lock
@@ -120,9 +120,20 @@
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@eslint-community/regexpp@^4.5.1":
|
||||
version "4.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
|
||||
integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==
|
||||
version "4.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
|
||||
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==
|
||||
|
||||
"@jxpeng98/martian@^1.2.7":
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/@jxpeng98/martian/-/martian-1.2.7.tgz#43c8e5403064eb0bae1afe44d0c369ecdd1b4888"
|
||||
integrity sha512-SeGqHRUeDkCP9SEJt5sddXit+VVoGQhx/U1ePiqcww6dbK0gnv2CiDzfgtRkBFW8zoCBzkq50m/UBS0xz/VGig==
|
||||
dependencies:
|
||||
"@notionhq/client" "^1.0.4"
|
||||
remark-gfm "^1.0.0"
|
||||
remark-math "^4.0.0"
|
||||
remark-parse "^9.0.0"
|
||||
unified "^9.2.1"
|
||||
|
||||
"@nodelib/fs.scandir@2.1.5":
|
||||
version "2.1.5"
|
||||
@@ -153,17 +164,6 @@
|
||||
"@types/node-fetch" "^2.5.10"
|
||||
node-fetch "^2.6.1"
|
||||
|
||||
"@tryfabric/martian@^1.2.4":
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/@tryfabric/martian/-/martian-1.2.4.tgz#3fdfe7129f1c28bccddc34854cf353b0f37c0c02"
|
||||
integrity sha512-g7SP7beaxrjxLnW//vskra07a1jsJowqp07KMouxh4gCwaF+ItHbRZN8O+1dhJivBi3VdasT71BPyk+8wzEreQ==
|
||||
dependencies:
|
||||
"@notionhq/client" "^1.0.4"
|
||||
remark-gfm "^1.0.0"
|
||||
remark-math "^4.0.0"
|
||||
remark-parse "^9.0.0"
|
||||
unified "^9.2.1"
|
||||
|
||||
"@types/codemirror@5.60.8":
|
||||
version "5.60.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.8.tgz#b647d04b470e8e1836dd84b2879988fc55c9de68"
|
||||
@@ -184,9 +184,9 @@
|
||||
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
|
||||
|
||||
"@types/hast@^3.0.0":
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.3.tgz#7f75e6b43bc3f90316046a287d9ad3888309f7e1"
|
||||
integrity sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa"
|
||||
integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==
|
||||
dependencies:
|
||||
"@types/unist" "*"
|
||||
|
||||
@@ -201,9 +201,9 @@
|
||||
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||
|
||||
"@types/katex@^0.16.0":
|
||||
version "0.16.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.6.tgz#6dd82f78a1a1d2eceeff6bb97ba98d7c062454cb"
|
||||
integrity sha512-rZYO1HInM99rAFYNwGqbYPxHZHxu2IwZYKj4bJ4oh6edVrm1UId8mmbHIZLBtG253qU6y3piag0XYe/joNnwzQ==
|
||||
version "0.16.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.16.7.tgz#03ab680ab4fa4fbc6cb46ecf987ecad5d8019868"
|
||||
integrity sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==
|
||||
|
||||
"@types/mdast@^3.0.0":
|
||||
version "3.0.15"
|
||||
@@ -213,9 +213,9 @@
|
||||
"@types/unist" "^2"
|
||||
|
||||
"@types/mdast@^4.0.0":
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.3.tgz#1e011ff013566e919a4232d1701ad30d70cab333"
|
||||
integrity sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6"
|
||||
integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==
|
||||
dependencies:
|
||||
"@types/unist" "*"
|
||||
|
||||
@@ -225,29 +225,29 @@
|
||||
integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
|
||||
|
||||
"@types/node-fetch@^2.5.10":
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e"
|
||||
integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==
|
||||
version "2.6.11"
|
||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24"
|
||||
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
form-data "^4.0.0"
|
||||
|
||||
"@types/node@*", "@types/node@^20.5.7":
|
||||
version "20.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298"
|
||||
integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==
|
||||
version "20.14.12"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.12.tgz#129d7c3a822cb49fc7ff661235f19cfefd422b49"
|
||||
integrity sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==
|
||||
dependencies:
|
||||
undici-types "~5.26.4"
|
||||
|
||||
"@types/semver@^7.5.0":
|
||||
version "7.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35"
|
||||
integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==
|
||||
version "7.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
|
||||
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
|
||||
|
||||
"@types/tern@*":
|
||||
version "0.23.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.7.tgz#f3c27fb7d6db5e86d7f069e7d5124bfa677a5b2d"
|
||||
integrity sha512-0YS9XCZ0LAhlP11HV9SqncUYyz9Ggsgc7Om/AmchKvoeFyj0qPaJmX6rJ93mJVExizWDzUMb49gAtVpI1uHd8Q==
|
||||
version "0.23.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.9.tgz#6f6093a4a9af3e6bb8dde528e024924d196b367c"
|
||||
integrity sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==
|
||||
dependencies:
|
||||
"@types/estree" "*"
|
||||
|
||||
@@ -270,15 +270,15 @@
|
||||
"@types/node" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.16.0.tgz#cc29fbd208ea976de3db7feb07755bba0ce8d8bc"
|
||||
integrity sha512-O5f7Kv5o4dLWQtPX4ywPPa+v9G+1q1x8mz0Kr0pXUtKsevo+gIJHLkGc8RxaZWtP8RrhwhSNIWThnW42K9/0rQ==
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3"
|
||||
integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==
|
||||
dependencies:
|
||||
"@eslint-community/regexpp" "^4.5.1"
|
||||
"@typescript-eslint/scope-manager" "6.16.0"
|
||||
"@typescript-eslint/type-utils" "6.16.0"
|
||||
"@typescript-eslint/utils" "6.16.0"
|
||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/type-utils" "6.21.0"
|
||||
"@typescript-eslint/utils" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
debug "^4.3.4"
|
||||
graphemer "^1.4.0"
|
||||
ignore "^5.2.4"
|
||||
@@ -287,46 +287,46 @@
|
||||
ts-api-utils "^1.0.1"
|
||||
|
||||
"@typescript-eslint/parser@^6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.16.0.tgz#36f39f63b126aa25af2ad2df13d9891e9fd5b40c"
|
||||
integrity sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b"
|
||||
integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "6.16.0"
|
||||
"@typescript-eslint/types" "6.16.0"
|
||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.16.0.tgz#f3e9a00fbc1d0701356359cd56489c54d9e37168"
|
||||
integrity sha512-0N7Y9DSPdaBQ3sqSCwlrm9zJwkpOuc6HYm7LpzLAPqBL7dmzAUimr4M29dMkOP/tEwvOCC/Cxo//yOfJD3HUiw==
|
||||
"@typescript-eslint/scope-manager@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1"
|
||||
integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.16.0"
|
||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
|
||||
"@typescript-eslint/type-utils@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.16.0.tgz#5f21c3e49e540ad132dc87fc99af463c184d5ed1"
|
||||
integrity sha512-ThmrEOcARmOnoyQfYkHw/DX2SEYBalVECmoldVuH6qagKROp/jMnfXpAU/pAIWub9c4YTxga+XwgAkoA0pxfmg==
|
||||
"@typescript-eslint/type-utils@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e"
|
||||
integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
||||
"@typescript-eslint/utils" "6.16.0"
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
"@typescript-eslint/utils" "6.21.0"
|
||||
debug "^4.3.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
|
||||
"@typescript-eslint/types@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.16.0.tgz#a3abe0045737d44d8234708d5ed8fef5d59dc91e"
|
||||
integrity sha512-hvDFpLEvTJoHutVl87+MG/c5C8I6LOgEx05zExTSJDEVU7hhR3jhV8M5zuggbdFCw98+HhZWPHZeKS97kS3JoQ==
|
||||
"@typescript-eslint/types@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d"
|
||||
integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==
|
||||
|
||||
"@typescript-eslint/typescript-estree@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.16.0.tgz#d6e0578e4f593045f0df06c4b3a22bd6f13f2d03"
|
||||
integrity sha512-VTWZuixh/vr7nih6CfrdpmFNLEnoVBF1skfjdyGnNwXOH1SLeHItGdZDHhhAIzd3ACazyY2Fg76zuzOVTaknGA==
|
||||
"@typescript-eslint/typescript-estree@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46"
|
||||
integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.16.0"
|
||||
"@typescript-eslint/visitor-keys" "6.16.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/visitor-keys" "6.21.0"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
@@ -334,31 +334,31 @@
|
||||
semver "^7.5.4"
|
||||
ts-api-utils "^1.0.1"
|
||||
|
||||
"@typescript-eslint/utils@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.16.0.tgz#1c291492d34670f9210d2b7fcf6b402bea3134ae"
|
||||
integrity sha512-T83QPKrBm6n//q9mv7oiSvy/Xq/7Hyw9SzSEhMHJwznEmQayfBM87+oAlkNAMEO7/MjIwKyOHgBJbxB0s7gx2A==
|
||||
"@typescript-eslint/utils@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134"
|
||||
integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils" "^4.4.0"
|
||||
"@types/json-schema" "^7.0.12"
|
||||
"@types/semver" "^7.5.0"
|
||||
"@typescript-eslint/scope-manager" "6.16.0"
|
||||
"@typescript-eslint/types" "6.16.0"
|
||||
"@typescript-eslint/typescript-estree" "6.16.0"
|
||||
"@typescript-eslint/scope-manager" "6.21.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
"@typescript-eslint/typescript-estree" "6.21.0"
|
||||
semver "^7.5.4"
|
||||
|
||||
"@typescript-eslint/visitor-keys@6.16.0":
|
||||
version "6.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.16.0.tgz#d50da18a05d91318ed3e7e8889bda0edc35f3a10"
|
||||
integrity sha512-QSFQLruk7fhs91a/Ep/LqRdbJCZ1Rq03rqBdKT5Ky17Sz8zRLUksqIe9DW0pKtg/Z35/ztbLQ6qpOCN6rOC11A==
|
||||
"@typescript-eslint/visitor-keys@6.21.0":
|
||||
version "6.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47"
|
||||
integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "6.16.0"
|
||||
"@typescript-eslint/types" "6.21.0"
|
||||
eslint-visitor-keys "^3.4.1"
|
||||
|
||||
agent-base@^7.0.2:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434"
|
||||
integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317"
|
||||
integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==
|
||||
dependencies:
|
||||
debug "^4.3.4"
|
||||
|
||||
@@ -401,12 +401,12 @@ brace-expansion@^2.0.1:
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
|
||||
braces@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
||||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
||||
braces@^3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
|
||||
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
|
||||
dependencies:
|
||||
fill-range "^7.0.1"
|
||||
fill-range "^7.1.1"
|
||||
|
||||
builtin-modules@^3.3.0:
|
||||
version "3.3.0"
|
||||
@@ -460,10 +460,15 @@ commander@^8.3.0:
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
|
||||
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
|
||||
|
||||
data-uri-to-buffer@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e"
|
||||
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==
|
||||
|
||||
debug@4, debug@^4.0.0, debug@^4.3.4:
|
||||
version "4.3.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
|
||||
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
|
||||
version "4.3.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b"
|
||||
integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
@@ -558,16 +563,24 @@ fast-glob@^3.2.9:
|
||||
micromatch "^4.0.4"
|
||||
|
||||
fastq@^1.6.0:
|
||||
version "1.15.0"
|
||||
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a"
|
||||
integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==
|
||||
version "1.17.1"
|
||||
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47"
|
||||
integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==
|
||||
dependencies:
|
||||
reusify "^1.0.4"
|
||||
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
||||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
||||
fetch-blob@^3.1.2, fetch-blob@^3.1.4:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9"
|
||||
integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==
|
||||
dependencies:
|
||||
node-domexception "^1.0.0"
|
||||
web-streams-polyfill "^3.0.3"
|
||||
|
||||
fill-range@^7.1.1:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
|
||||
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
|
||||
dependencies:
|
||||
to-regex-range "^5.0.1"
|
||||
|
||||
@@ -580,6 +593,13 @@ form-data@^4.0.0:
|
||||
combined-stream "^1.0.8"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
formdata-polyfill@^4.0.10:
|
||||
version "4.0.10"
|
||||
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
|
||||
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
|
||||
dependencies:
|
||||
fetch-blob "^3.1.2"
|
||||
|
||||
glob-parent@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||
@@ -605,17 +625,17 @@ graphemer@^1.4.0:
|
||||
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
|
||||
|
||||
https-proxy-agent@^7.0.2:
|
||||
version "7.0.2"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b"
|
||||
integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==
|
||||
version "7.0.5"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2"
|
||||
integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==
|
||||
dependencies:
|
||||
agent-base "^7.0.2"
|
||||
debug "4"
|
||||
|
||||
ignore@^5.2.0, ignore@^5.2.4:
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78"
|
||||
integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==
|
||||
version "5.3.1"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
|
||||
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
|
||||
|
||||
is-alphabetical@^1.0.0:
|
||||
version "1.0.4"
|
||||
@@ -688,9 +708,9 @@ katex@^0.12.0:
|
||||
commander "^2.19.0"
|
||||
|
||||
katex@^0.16.0:
|
||||
version "0.16.9"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.9.tgz#bc62d8f7abfea6e181250f85a56e4ef292dcb1fa"
|
||||
integrity sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==
|
||||
version "0.16.11"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.11.tgz#4bc84d5584f996abece5f01c6ad11304276a33f5"
|
||||
integrity sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==
|
||||
dependencies:
|
||||
commander "^8.3.0"
|
||||
|
||||
@@ -704,13 +724,6 @@ longest-streak@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4"
|
||||
integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==
|
||||
|
||||
lru-cache@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
|
||||
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
markdown-table@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b"
|
||||
@@ -739,9 +752,9 @@ mdast-util-from-markdown@^0.8.0:
|
||||
unist-util-stringify-position "^2.0.0"
|
||||
|
||||
mdast-util-from-markdown@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.0.tgz#52f14815ec291ed061f2922fd14d6689c810cb88"
|
||||
integrity sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.1.tgz#32a6e8f512b416e1f51eb817fc64bd867ebcd9cc"
|
||||
integrity sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==
|
||||
dependencies:
|
||||
"@types/mdast" "^4.0.0"
|
||||
"@types/unist" "^3.0.0"
|
||||
@@ -821,9 +834,9 @@ mdast-util-math@^3.0.0:
|
||||
unist-util-remove-position "^5.0.0"
|
||||
|
||||
mdast-util-phrasing@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz#468cbbb277375523de807248b8ad969feb02a5c7"
|
||||
integrity sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3"
|
||||
integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==
|
||||
dependencies:
|
||||
"@types/mdast" "^4.0.0"
|
||||
unist-util-is "^6.0.0"
|
||||
@@ -872,9 +885,9 @@ merge2@^1.3.0, merge2@^1.4.1:
|
||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||
|
||||
micromark-core-commonmark@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.0.tgz#50740201f0ee78c12a675bf3e68ffebc0bf931a3"
|
||||
integrity sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.1.tgz#9a45510557d068605c6e9a80f282b2bb8581e43d"
|
||||
integrity sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==
|
||||
dependencies:
|
||||
decode-named-character-reference "^1.0.0"
|
||||
devlop "^1.0.0"
|
||||
@@ -947,9 +960,9 @@ micromark-extension-math@^0.1.0:
|
||||
micromark "~2.11.0"
|
||||
|
||||
micromark-extension-math@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-3.0.0.tgz#c7a47d6ce990812243ad3946a30bb60e4c2a8c76"
|
||||
integrity sha512-iJ2Q28vBoEovLN5o3GO12CpqorQRYDPT+p4zW50tGwTfJB+iv/VnB6Ini+gqa24K97DwptMBBIvVX6Bjk49oyQ==
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz#c42ee3b1dd5a9a03584e83dd8f08e3de510212c1"
|
||||
integrity sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==
|
||||
dependencies:
|
||||
"@types/katex" "^0.16.0"
|
||||
devlop "^1.0.0"
|
||||
@@ -1007,9 +1020,9 @@ micromark-factory-whitespace@^2.0.0:
|
||||
micromark-util-types "^2.0.0"
|
||||
|
||||
micromark-util-character@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.0.1.tgz#52b824c2e2633b6fb33399d2ec78ee2a90d6b298"
|
||||
integrity sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.0.tgz#31320ace16b4644316f6bf057531689c71e2aee1"
|
||||
integrity sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==
|
||||
dependencies:
|
||||
micromark-util-symbol "^2.0.0"
|
||||
micromark-util-types "^2.0.0"
|
||||
@@ -1089,9 +1102,9 @@ micromark-util-sanitize-uri@^2.0.0:
|
||||
micromark-util-symbol "^2.0.0"
|
||||
|
||||
micromark-util-subtokenize@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.0.tgz#9f412442d77e0c5789ffdf42377fa8a2bcbdf581"
|
||||
integrity sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.1.tgz#76129c49ac65da6e479c09d0ec4b5f29ec6eace5"
|
||||
integrity sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==
|
||||
dependencies:
|
||||
devlop "^1.0.0"
|
||||
micromark-util-chunked "^2.0.0"
|
||||
@@ -1140,11 +1153,11 @@ micromark@^4.0.0:
|
||||
micromark-util-types "^2.0.0"
|
||||
|
||||
micromatch@^4.0.4:
|
||||
version "4.0.5"
|
||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
|
||||
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
|
||||
version "4.0.7"
|
||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5"
|
||||
integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==
|
||||
dependencies:
|
||||
braces "^3.0.2"
|
||||
braces "^3.0.3"
|
||||
picomatch "^2.3.1"
|
||||
|
||||
mime-db@1.52.0:
|
||||
@@ -1181,6 +1194,11 @@ natural-compare@^1.4.0:
|
||||
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||
|
||||
node-domexception@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
|
||||
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
|
||||
|
||||
node-fetch@^2.6.1:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
|
||||
@@ -1188,10 +1206,19 @@ node-fetch@^2.6.1:
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
obsidian@latest:
|
||||
version "1.4.11"
|
||||
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.4.11.tgz#5cba594c83a74ebad58b630c610265018abdadaa"
|
||||
integrity sha512-BCVYTvaXxElJMl6MMbDdY/CGK+aq18SdtDY/7vH8v6BxCBQ6KF4kKxL0vG9UZ0o5qh139KpUoJHNm+6O5dllKA==
|
||||
node-fetch@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b"
|
||||
integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==
|
||||
dependencies:
|
||||
data-uri-to-buffer "^4.0.0"
|
||||
fetch-blob "^3.1.4"
|
||||
formdata-polyfill "^4.0.10"
|
||||
|
||||
obsidian@^1.6.6:
|
||||
version "1.6.6"
|
||||
resolved "https://registry.yarnpkg.com/obsidian/-/obsidian-1.6.6.tgz#d45c4021c291765e1b77ed4a1c645e562ff6e77f"
|
||||
integrity sha512-GZHzeOiwmw/wBjB5JwrsxAZBLqxGQmqtEKSvJJvT0LtTcqeOFnV8jv0ZK5kO7hBb44WxJc+LdS7mZgLXbb+qXQ==
|
||||
dependencies:
|
||||
"@types/codemirror" "5.60.8"
|
||||
moment "2.29.4"
|
||||
@@ -1279,11 +1306,9 @@ run-parallel@^1.1.9:
|
||||
queue-microtask "^1.2.2"
|
||||
|
||||
semver@^7.5.4:
|
||||
version "7.5.4"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
|
||||
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
version "7.6.3"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
|
||||
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
|
||||
|
||||
slash@^3.0.0:
|
||||
version "3.0.0"
|
||||
@@ -1313,14 +1338,14 @@ trough@^1.0.0:
|
||||
integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==
|
||||
|
||||
trough@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876"
|
||||
integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f"
|
||||
integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==
|
||||
|
||||
ts-api-utils@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331"
|
||||
integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1"
|
||||
integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==
|
||||
|
||||
tslib@2.6.2:
|
||||
version "2.6.2"
|
||||
@@ -1338,9 +1363,9 @@ undici-types@~5.26.4:
|
||||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
||||
|
||||
unified@^11.0.0:
|
||||
version "11.0.4"
|
||||
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.4.tgz#f4be0ac0fe4c88cb873687c07c64c49ed5969015"
|
||||
integrity sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==
|
||||
version "11.0.5"
|
||||
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1"
|
||||
integrity sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==
|
||||
dependencies:
|
||||
"@types/unist" "^3.0.0"
|
||||
bail "^2.0.0"
|
||||
@@ -1448,14 +1473,19 @@ vfile@^4.0.0:
|
||||
vfile-message "^2.0.0"
|
||||
|
||||
vfile@^6.0.0:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.1.tgz#1e8327f41eac91947d4fe9d237a2dd9209762536"
|
||||
integrity sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.2.tgz#ef49548ea3d270097a67011921411130ceae7deb"
|
||||
integrity sha512-zND7NlS8rJYb/sPqkb13ZvbbUoExdbi4w3SfRrMq6R3FvnLQmmfpajJNITuuYm6AZ5uao9vy4BAos3EXBPf2rg==
|
||||
dependencies:
|
||||
"@types/unist" "^3.0.0"
|
||||
unist-util-stringify-position "^4.0.0"
|
||||
vfile-message "^4.0.0"
|
||||
|
||||
web-streams-polyfill@^3.0.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b"
|
||||
integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==
|
||||
|
||||
webidl-conversions@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
@@ -1469,11 +1499,6 @@ whatwg-url@^5.0.0:
|
||||
tr46 "~0.0.3"
|
||||
webidl-conversions "^3.0.0"
|
||||
|
||||
yallist@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
||||
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
||||
|
||||
yaml-front-matter@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/yaml-front-matter/-/yaml-front-matter-4.1.1.tgz#66eaa9a998fc3dd723708c73aa8e06e79cac91c9"
|
||||
@@ -1483,9 +1508,9 @@ yaml-front-matter@^4.1.1:
|
||||
js-yaml "^3.14.1"
|
||||
|
||||
yaml@^2.3.4:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
|
||||
integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d"
|
||||
integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==
|
||||
|
||||
zwitch@^1.0.0:
|
||||
version "1.0.5"
|
||||
|
||||
Reference in New Issue
Block a user