@notionhq/custom-blocks 0.1.34 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import { useCustomBlockHost } from "./useHostState.js"
9
9
  *
10
10
  * @param key - The semantic data source key the block is wired to (e.g. `"people"`).
11
11
  * @param options - Optional live snapshot options. `limit` defaults to 20 and
12
- * is capped at 999.
12
+ * is capped at 999. `sorts` are applied in array order.
13
13
  *
14
14
  * @example
15
15
  * const { items, isLoading, hasMore, error } = useDataSource("default", { limit: 25 })
package/src/types.ts CHANGED
@@ -154,6 +154,10 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress &
154
154
  | { date: NotionDataSourceDateFilterOperator }
155
155
  )
156
156
 
157
+ export type NotionDataSourceSort = NotionDataSourcePropertyAddress & {
158
+ direction: "ascending" | "descending"
159
+ }
160
+
157
161
  export type NotionDataSourceFilter =
158
162
  | NotionDataSourcePropertyFilter
159
163
  | { and: NotionDataSourcePropertyFilter[] }
@@ -204,6 +208,10 @@ export type UseDataSourceOptions = {
204
208
  * it sends the query to the host.
205
209
  */
206
210
  filter?: NotionDataSourceFilter
211
+ /**
212
+ * Optional property sorts. The host applies them in array order.
213
+ */
214
+ sorts?: NotionDataSourceSort[]
207
215
  }
208
216
 
209
217
  /**