@idealyst/mcp-server 1.2.127 → 1.2.129
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.
- package/dist/{chunk-PLKNERFG.js → chunk-RZIMKJRB.js} +447 -1
- package/dist/chunk-RZIMKJRB.js.map +1 -0
- package/dist/index.cjs +444 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/index.cjs +448 -0
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +11 -3
- package/dist/tools/index.d.ts +11 -3
- package/dist/tools/index.js +5 -1
- package/package.json +5 -5
- package/dist/chunk-PLKNERFG.js.map +0 -1
|
@@ -412,6 +412,21 @@ var getNotificationsGuideDefinition = {
|
|
|
412
412
|
required: ["topic"]
|
|
413
413
|
}
|
|
414
414
|
};
|
|
415
|
+
var getPdfGuideDefinition = {
|
|
416
|
+
name: "get_pdf_guide",
|
|
417
|
+
description: "Get documentation for @idealyst/pdf cross-platform PDF viewer package. Covers PDFViewer component, PDFViewerRef imperative methods, and examples.",
|
|
418
|
+
inputSchema: {
|
|
419
|
+
type: "object",
|
|
420
|
+
properties: {
|
|
421
|
+
topic: {
|
|
422
|
+
type: "string",
|
|
423
|
+
description: "Topic to get docs for: 'overview', 'api', 'examples'",
|
|
424
|
+
enum: ["overview", "api", "examples"]
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
required: ["topic"]
|
|
428
|
+
}
|
|
429
|
+
};
|
|
415
430
|
var listPackagesDefinition = {
|
|
416
431
|
name: "list_packages",
|
|
417
432
|
description: "List all available Idealyst packages with descriptions, categories, and documentation status. Use this to discover what packages are available in the framework.",
|
|
@@ -602,6 +617,7 @@ var toolDefinitions = [
|
|
|
602
617
|
getNotificationsGuideDefinition,
|
|
603
618
|
getLiveActivityGuideDefinition,
|
|
604
619
|
getNetworkGuideDefinition,
|
|
620
|
+
getPdfGuideDefinition,
|
|
605
621
|
// Package tools
|
|
606
622
|
listPackagesDefinition,
|
|
607
623
|
getPackageDocsDefinition,
|
|
@@ -10453,6 +10469,305 @@ async function quickHealthCheck() {
|
|
|
10453
10469
|
`
|
|
10454
10470
|
};
|
|
10455
10471
|
|
|
10472
|
+
// src/data/pdf-guides.ts
|
|
10473
|
+
var pdfGuides = {
|
|
10474
|
+
"idealyst://pdf/overview": `# @idealyst/pdf
|
|
10475
|
+
|
|
10476
|
+
Cross-platform PDF viewer for React and React Native.
|
|
10477
|
+
|
|
10478
|
+
## Installation
|
|
10479
|
+
|
|
10480
|
+
\`\`\`bash
|
|
10481
|
+
yarn add @idealyst/pdf
|
|
10482
|
+
\`\`\`
|
|
10483
|
+
|
|
10484
|
+
### Platform peer dependencies
|
|
10485
|
+
|
|
10486
|
+
| Platform | Peer Dependency | Install |
|
|
10487
|
+
|----------|----------------|---------|
|
|
10488
|
+
| Web | \`pdfjs-dist\` | \`yarn add pdfjs-dist\` |
|
|
10489
|
+
| Native | \`react-native-pdf\` | \`yarn add react-native-pdf react-native-blob-util\` |
|
|
10490
|
+
|
|
10491
|
+
**Web**: Uses Mozilla PDF.js to render PDF pages to canvas.
|
|
10492
|
+
**Native**: Uses react-native-pdf (PDFKit on iOS, PdfRenderer on Android).
|
|
10493
|
+
|
|
10494
|
+
## Key Exports
|
|
10495
|
+
|
|
10496
|
+
| Export | Type | Description |
|
|
10497
|
+
|--------|------|-------------|
|
|
10498
|
+
| \`PDFViewer\` | Component | PDF viewer with zoom, page nav, scroll |
|
|
10499
|
+
| \`PDFViewerRef\` | Ref type | Imperative: \`goToPage()\`, \`setZoom()\` |
|
|
10500
|
+
| \`PDFSource\` | Type | \`string \\| { uri: string } \\| { base64: string }\` |
|
|
10501
|
+
| \`PDFDocumentInfo\` | Type | \`{ totalPages: number }\` |
|
|
10502
|
+
| \`FitPolicy\` | Type | \`'width' \\| 'height' \\| 'both'\` |
|
|
10503
|
+
| \`PDFDirection\` | Type | \`'horizontal' \\| 'vertical'\` |
|
|
10504
|
+
|
|
10505
|
+
## Quick Start
|
|
10506
|
+
|
|
10507
|
+
\`\`\`tsx
|
|
10508
|
+
import { PDFViewer } from '@idealyst/pdf';
|
|
10509
|
+
|
|
10510
|
+
function DocumentScreen() {
|
|
10511
|
+
return (
|
|
10512
|
+
<PDFViewer
|
|
10513
|
+
source="https://example.com/document.pdf"
|
|
10514
|
+
onLoad={({ totalPages }) => console.log('Pages:', totalPages)}
|
|
10515
|
+
onPageChange={(page, total) => console.log(page, '/', total)}
|
|
10516
|
+
style={{ flex: 1 }}
|
|
10517
|
+
/>
|
|
10518
|
+
);
|
|
10519
|
+
}
|
|
10520
|
+
\`\`\`
|
|
10521
|
+
|
|
10522
|
+
## Common Mistakes
|
|
10523
|
+
|
|
10524
|
+
1. **Forgetting peer deps** \u2014 Web needs \`pdfjs-dist\`, native needs \`react-native-pdf\` + \`react-native-blob-util\`
|
|
10525
|
+
2. **PDF.js worker not configured** \u2014 On web, the worker URL is auto-configured from CDN. If using a custom bundler setup, set \`pdfjs.GlobalWorkerOptions.workerSrc\` before rendering.
|
|
10526
|
+
3. **page is 1-indexed** \u2014 First page is \`1\`, not \`0\`
|
|
10527
|
+
4. **fitPolicy is a string** \u2014 Use \`'width'\`, \`'height'\`, or \`'both'\` (NOT numeric values)
|
|
10528
|
+
5. **base64 source** \u2014 Use \`{ base64: 'JVBERi...' }\` without the data URI prefix
|
|
10529
|
+
`,
|
|
10530
|
+
"idealyst://pdf/api": `# @idealyst/pdf \u2014 API Reference
|
|
10531
|
+
|
|
10532
|
+
## PDFViewerProps
|
|
10533
|
+
|
|
10534
|
+
\`\`\`typescript
|
|
10535
|
+
interface PDFViewerProps {
|
|
10536
|
+
/** PDF source \u2014 URL string, { uri } object, or { base64 } data */
|
|
10537
|
+
source: PDFSource;
|
|
10538
|
+
|
|
10539
|
+
/** Current page (1-indexed). Default: 1 */
|
|
10540
|
+
page?: number;
|
|
10541
|
+
|
|
10542
|
+
/** Called when page changes */
|
|
10543
|
+
onPageChange?: (page: number, totalPages: number) => void;
|
|
10544
|
+
|
|
10545
|
+
/** Called when document loads */
|
|
10546
|
+
onLoad?: (info: PDFDocumentInfo) => void;
|
|
10547
|
+
|
|
10548
|
+
/** Called on error */
|
|
10549
|
+
onError?: (error: Error) => void;
|
|
10550
|
+
|
|
10551
|
+
/** Enable zoom. Default: true */
|
|
10552
|
+
zoomEnabled?: boolean;
|
|
10553
|
+
|
|
10554
|
+
/** Min zoom. Default: 1 */
|
|
10555
|
+
minZoom?: number;
|
|
10556
|
+
|
|
10557
|
+
/** Max zoom. Default: 5 */
|
|
10558
|
+
maxZoom?: number;
|
|
10559
|
+
|
|
10560
|
+
/** Scroll direction. Default: 'vertical' */
|
|
10561
|
+
direction?: PDFDirection;
|
|
10562
|
+
|
|
10563
|
+
/** Show page indicator. Default: true */
|
|
10564
|
+
showPageIndicator?: boolean;
|
|
10565
|
+
|
|
10566
|
+
/** Fit policy. Default: 'width' */
|
|
10567
|
+
fitPolicy?: FitPolicy;
|
|
10568
|
+
|
|
10569
|
+
/** Container style */
|
|
10570
|
+
style?: ViewStyle;
|
|
10571
|
+
|
|
10572
|
+
/** Test ID */
|
|
10573
|
+
testID?: string;
|
|
10574
|
+
}
|
|
10575
|
+
\`\`\`
|
|
10576
|
+
|
|
10577
|
+
## Types
|
|
10578
|
+
|
|
10579
|
+
\`\`\`typescript
|
|
10580
|
+
type PDFSource = string | { uri: string } | { base64: string };
|
|
10581
|
+
|
|
10582
|
+
type FitPolicy = 'width' | 'height' | 'both';
|
|
10583
|
+
|
|
10584
|
+
type PDFDirection = 'horizontal' | 'vertical';
|
|
10585
|
+
|
|
10586
|
+
interface PDFDocumentInfo {
|
|
10587
|
+
totalPages: number;
|
|
10588
|
+
}
|
|
10589
|
+
\`\`\`
|
|
10590
|
+
|
|
10591
|
+
## PDFViewerRef (Imperative)
|
|
10592
|
+
|
|
10593
|
+
\`\`\`typescript
|
|
10594
|
+
interface PDFViewerRef {
|
|
10595
|
+
/** Navigate to page (1-indexed) */
|
|
10596
|
+
goToPage: (page: number) => void;
|
|
10597
|
+
|
|
10598
|
+
/** Set zoom level */
|
|
10599
|
+
setZoom: (level: number) => void;
|
|
10600
|
+
}
|
|
10601
|
+
\`\`\`
|
|
10602
|
+
|
|
10603
|
+
Usage:
|
|
10604
|
+
\`\`\`tsx
|
|
10605
|
+
const pdfRef = useRef<PDFViewerRef>(null);
|
|
10606
|
+
|
|
10607
|
+
<PDFViewer ref={pdfRef} source="..." />
|
|
10608
|
+
|
|
10609
|
+
pdfRef.current?.goToPage(5);
|
|
10610
|
+
pdfRef.current?.setZoom(2);
|
|
10611
|
+
\`\`\`
|
|
10612
|
+
`,
|
|
10613
|
+
"idealyst://pdf/examples": `# @idealyst/pdf \u2014 Examples
|
|
10614
|
+
|
|
10615
|
+
## Basic URL Viewer
|
|
10616
|
+
|
|
10617
|
+
\`\`\`tsx
|
|
10618
|
+
import { PDFViewer } from '@idealyst/pdf';
|
|
10619
|
+
import { View } from '@idealyst/components';
|
|
10620
|
+
|
|
10621
|
+
function BasicPDFScreen() {
|
|
10622
|
+
return (
|
|
10623
|
+
<View style={{ flex: 1 }}>
|
|
10624
|
+
<PDFViewer
|
|
10625
|
+
source="https://example.com/document.pdf"
|
|
10626
|
+
style={{ flex: 1 }}
|
|
10627
|
+
/>
|
|
10628
|
+
</View>
|
|
10629
|
+
);
|
|
10630
|
+
}
|
|
10631
|
+
\`\`\`
|
|
10632
|
+
|
|
10633
|
+
## With Page Navigation Controls
|
|
10634
|
+
|
|
10635
|
+
\`\`\`tsx
|
|
10636
|
+
import { useRef, useState } from 'react';
|
|
10637
|
+
import { PDFViewer, PDFViewerRef } from '@idealyst/pdf';
|
|
10638
|
+
import { View, Text, Button } from '@idealyst/components';
|
|
10639
|
+
|
|
10640
|
+
function PDFWithControls() {
|
|
10641
|
+
const pdfRef = useRef<PDFViewerRef>(null);
|
|
10642
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
10643
|
+
const [totalPages, setTotalPages] = useState(0);
|
|
10644
|
+
|
|
10645
|
+
return (
|
|
10646
|
+
<View style={{ flex: 1 }}>
|
|
10647
|
+
<PDFViewer
|
|
10648
|
+
ref={pdfRef}
|
|
10649
|
+
source="https://example.com/document.pdf"
|
|
10650
|
+
onLoad={({ totalPages: total }) => setTotalPages(total)}
|
|
10651
|
+
onPageChange={(page) => setCurrentPage(page)}
|
|
10652
|
+
showPageIndicator={false}
|
|
10653
|
+
style={{ flex: 1 }}
|
|
10654
|
+
/>
|
|
10655
|
+
<View direction="row" justify="center" align="center" gap="md" padding="md">
|
|
10656
|
+
<Button
|
|
10657
|
+
label="Previous"
|
|
10658
|
+
size="sm"
|
|
10659
|
+
onPress={() => pdfRef.current?.goToPage(Math.max(1, currentPage - 1))}
|
|
10660
|
+
/>
|
|
10661
|
+
<Text>{currentPage} / {totalPages}</Text>
|
|
10662
|
+
<Button
|
|
10663
|
+
label="Next"
|
|
10664
|
+
size="sm"
|
|
10665
|
+
onPress={() => pdfRef.current?.goToPage(Math.min(totalPages, currentPage + 1))}
|
|
10666
|
+
/>
|
|
10667
|
+
</View>
|
|
10668
|
+
</View>
|
|
10669
|
+
);
|
|
10670
|
+
}
|
|
10671
|
+
\`\`\`
|
|
10672
|
+
|
|
10673
|
+
## Base64 Source
|
|
10674
|
+
|
|
10675
|
+
\`\`\`tsx
|
|
10676
|
+
import { PDFViewer } from '@idealyst/pdf';
|
|
10677
|
+
|
|
10678
|
+
function Base64PDF({ base64Data }: { base64Data: string }) {
|
|
10679
|
+
return (
|
|
10680
|
+
<PDFViewer
|
|
10681
|
+
source={{ base64: base64Data }}
|
|
10682
|
+
fitPolicy="both"
|
|
10683
|
+
style={{ flex: 1 }}
|
|
10684
|
+
/>
|
|
10685
|
+
);
|
|
10686
|
+
}
|
|
10687
|
+
\`\`\`
|
|
10688
|
+
|
|
10689
|
+
## Horizontal Mode
|
|
10690
|
+
|
|
10691
|
+
\`\`\`tsx
|
|
10692
|
+
import { PDFViewer } from '@idealyst/pdf';
|
|
10693
|
+
|
|
10694
|
+
function HorizontalPDF() {
|
|
10695
|
+
return (
|
|
10696
|
+
<PDFViewer
|
|
10697
|
+
source="https://example.com/slides.pdf"
|
|
10698
|
+
direction="horizontal"
|
|
10699
|
+
fitPolicy="both"
|
|
10700
|
+
style={{ flex: 1 }}
|
|
10701
|
+
/>
|
|
10702
|
+
);
|
|
10703
|
+
}
|
|
10704
|
+
\`\`\`
|
|
10705
|
+
|
|
10706
|
+
## With Error Handling
|
|
10707
|
+
|
|
10708
|
+
\`\`\`tsx
|
|
10709
|
+
import { useState } from 'react';
|
|
10710
|
+
import { PDFViewer } from '@idealyst/pdf';
|
|
10711
|
+
import { View, Text } from '@idealyst/components';
|
|
10712
|
+
|
|
10713
|
+
function SafePDFViewer({ url }: { url: string }) {
|
|
10714
|
+
const [error, setError] = useState<string | null>(null);
|
|
10715
|
+
|
|
10716
|
+
if (error) {
|
|
10717
|
+
return (
|
|
10718
|
+
<View style={{ flex: 1 }} align="center" justify="center">
|
|
10719
|
+
<Text intent="danger">Failed to load PDF: {error}</Text>
|
|
10720
|
+
</View>
|
|
10721
|
+
);
|
|
10722
|
+
}
|
|
10723
|
+
|
|
10724
|
+
return (
|
|
10725
|
+
<PDFViewer
|
|
10726
|
+
source={url}
|
|
10727
|
+
onError={(err) => setError(err.message)}
|
|
10728
|
+
style={{ flex: 1 }}
|
|
10729
|
+
/>
|
|
10730
|
+
);
|
|
10731
|
+
}
|
|
10732
|
+
\`\`\`
|
|
10733
|
+
|
|
10734
|
+
## Zoom Controls
|
|
10735
|
+
|
|
10736
|
+
\`\`\`tsx
|
|
10737
|
+
import { useRef, useState } from 'react';
|
|
10738
|
+
import { PDFViewer, PDFViewerRef } from '@idealyst/pdf';
|
|
10739
|
+
import { View, Button } from '@idealyst/components';
|
|
10740
|
+
|
|
10741
|
+
function ZoomablePDF() {
|
|
10742
|
+
const pdfRef = useRef<PDFViewerRef>(null);
|
|
10743
|
+
const [zoom, setZoom] = useState(1);
|
|
10744
|
+
|
|
10745
|
+
const handleZoom = (level: number) => {
|
|
10746
|
+
setZoom(level);
|
|
10747
|
+
pdfRef.current?.setZoom(level);
|
|
10748
|
+
};
|
|
10749
|
+
|
|
10750
|
+
return (
|
|
10751
|
+
<View style={{ flex: 1 }}>
|
|
10752
|
+
<PDFViewer
|
|
10753
|
+
ref={pdfRef}
|
|
10754
|
+
source="https://example.com/document.pdf"
|
|
10755
|
+
minZoom={0.5}
|
|
10756
|
+
maxZoom={4}
|
|
10757
|
+
style={{ flex: 1 }}
|
|
10758
|
+
/>
|
|
10759
|
+
<View direction="row" justify="center" gap="sm" padding="sm">
|
|
10760
|
+
<Button label="50%" size="sm" onPress={() => handleZoom(0.5)} />
|
|
10761
|
+
<Button label="100%" size="sm" onPress={() => handleZoom(1)} />
|
|
10762
|
+
<Button label="200%" size="sm" onPress={() => handleZoom(2)} />
|
|
10763
|
+
</View>
|
|
10764
|
+
</View>
|
|
10765
|
+
);
|
|
10766
|
+
}
|
|
10767
|
+
\`\`\`
|
|
10768
|
+
`
|
|
10769
|
+
};
|
|
10770
|
+
|
|
10456
10771
|
// src/data/packages.ts
|
|
10457
10772
|
var packages = {
|
|
10458
10773
|
components: {
|
|
@@ -11681,6 +11996,50 @@ function App() {
|
|
|
11681
11996
|
"NetworkState { isConnected, isInternetReachable, type, effectiveType, cellularGeneration, downlink, rtt, isDataSaving }"
|
|
11682
11997
|
],
|
|
11683
11998
|
relatedPackages: ["storage", "config"]
|
|
11999
|
+
},
|
|
12000
|
+
pdf: {
|
|
12001
|
+
name: "PDF",
|
|
12002
|
+
npmName: "@idealyst/pdf",
|
|
12003
|
+
description: "Cross-platform PDF viewer for React and React Native. Renders PDFs from URL, local file, or base64 with page navigation, zoom, and scroll.",
|
|
12004
|
+
category: "media",
|
|
12005
|
+
platforms: ["web", "native"],
|
|
12006
|
+
documentationStatus: "full",
|
|
12007
|
+
installation: "yarn add @idealyst/pdf",
|
|
12008
|
+
peerDependencies: [
|
|
12009
|
+
"pdfjs-dist (web)",
|
|
12010
|
+
"react-native-pdf (native)",
|
|
12011
|
+
"react-native-blob-util (native)"
|
|
12012
|
+
],
|
|
12013
|
+
features: [
|
|
12014
|
+
"Render PDFs from URL, file path, or base64",
|
|
12015
|
+
"Page navigation (controlled or free scroll)",
|
|
12016
|
+
"Pinch-to-zoom with configurable limits",
|
|
12017
|
+
"Horizontal and vertical scroll modes",
|
|
12018
|
+
"Page indicator overlay",
|
|
12019
|
+
"Fit-to-width, fit-to-height, fit-both modes",
|
|
12020
|
+
"PDFViewerRef for imperative control (goToPage, setZoom)"
|
|
12021
|
+
],
|
|
12022
|
+
quickStart: `import { PDFViewer } from '@idealyst/pdf';
|
|
12023
|
+
|
|
12024
|
+
function DocumentScreen() {
|
|
12025
|
+
return (
|
|
12026
|
+
<PDFViewer
|
|
12027
|
+
source="https://example.com/document.pdf"
|
|
12028
|
+
onLoad={({ totalPages }) => console.log('Pages:', totalPages)}
|
|
12029
|
+
onPageChange={(page, total) => console.log(page, '/', total)}
|
|
12030
|
+
style={{ flex: 1 }}
|
|
12031
|
+
/>
|
|
12032
|
+
);
|
|
12033
|
+
}`,
|
|
12034
|
+
apiHighlights: [
|
|
12035
|
+
"PDFViewer component",
|
|
12036
|
+
"PDFViewerRef \u2014 goToPage(page), setZoom(level)",
|
|
12037
|
+
"PDFSource = string | { uri: string } | { base64: string }",
|
|
12038
|
+
"fitPolicy: 'width' | 'height' | 'both'",
|
|
12039
|
+
"direction: 'horizontal' | 'vertical'",
|
|
12040
|
+
"onLoad, onPageChange, onError callbacks"
|
|
12041
|
+
],
|
|
12042
|
+
relatedPackages: ["components"]
|
|
11684
12043
|
}
|
|
11685
12044
|
};
|
|
11686
12045
|
function getPackagesByCategory() {
|
|
@@ -15875,6 +16234,79 @@ function Test() {
|
|
|
15875
16234
|
solution: "Check that you're running on a supported platform (iOS 16.2+ or Android API 24+). On web, Live Activities are not supported and will always return not_supported."
|
|
15876
16235
|
}
|
|
15877
16236
|
]
|
|
16237
|
+
},
|
|
16238
|
+
// =====================================================================
|
|
16239
|
+
// MEDIA PACKAGES — PDF
|
|
16240
|
+
// =====================================================================
|
|
16241
|
+
pdf: {
|
|
16242
|
+
packageName: "PDF",
|
|
16243
|
+
npmName: "@idealyst/pdf",
|
|
16244
|
+
description: "Cross-platform PDF viewer using pdfjs-dist (web) and react-native-pdf (native)",
|
|
16245
|
+
platforms: ["web", "native"],
|
|
16246
|
+
complexity: "moderate",
|
|
16247
|
+
installation: {
|
|
16248
|
+
yarn: "yarn add @idealyst/pdf",
|
|
16249
|
+
npm: "npm install @idealyst/pdf"
|
|
16250
|
+
},
|
|
16251
|
+
peerDependencies: [
|
|
16252
|
+
{
|
|
16253
|
+
name: "pdfjs-dist",
|
|
16254
|
+
required: true,
|
|
16255
|
+
platforms: ["web"],
|
|
16256
|
+
note: "Mozilla PDF.js for web rendering"
|
|
16257
|
+
},
|
|
16258
|
+
{
|
|
16259
|
+
name: "react-native-pdf",
|
|
16260
|
+
required: true,
|
|
16261
|
+
platforms: ["native"],
|
|
16262
|
+
note: "Native PDF renderer (PDFKit on iOS, PdfRenderer on Android)"
|
|
16263
|
+
},
|
|
16264
|
+
{
|
|
16265
|
+
name: "react-native-blob-util",
|
|
16266
|
+
required: true,
|
|
16267
|
+
platforms: ["native"],
|
|
16268
|
+
note: "Required peer dependency of react-native-pdf for file handling"
|
|
16269
|
+
}
|
|
16270
|
+
],
|
|
16271
|
+
ios: {
|
|
16272
|
+
podInstallRequired: true,
|
|
16273
|
+
additionalSteps: [
|
|
16274
|
+
"cd ios && pod install",
|
|
16275
|
+
"Ensure minimum iOS deployment target is 13.0 or higher"
|
|
16276
|
+
]
|
|
16277
|
+
},
|
|
16278
|
+
android: {
|
|
16279
|
+
permissions: [],
|
|
16280
|
+
additionalSteps: [
|
|
16281
|
+
"No special permissions required for PDF viewing",
|
|
16282
|
+
"Ensure minSdkVersion is 21 or higher"
|
|
16283
|
+
]
|
|
16284
|
+
},
|
|
16285
|
+
web: {
|
|
16286
|
+
additionalDependencies: ["pdfjs-dist"],
|
|
16287
|
+
notes: [
|
|
16288
|
+
"The pdfjs-dist worker is auto-configured from CDN by default.",
|
|
16289
|
+
"For custom setups: set pdfjs.GlobalWorkerOptions.workerSrc before rendering PDFViewer.",
|
|
16290
|
+
"For Vite: import pdfjs-dist/build/pdf.worker.min.mjs and set as workerSrc."
|
|
16291
|
+
]
|
|
16292
|
+
},
|
|
16293
|
+
verification: `import { PDFViewer } from '@idealyst/pdf';
|
|
16294
|
+
// Should render without errors:
|
|
16295
|
+
<PDFViewer source="https://example.com/sample.pdf" style={{ flex: 1 }} />`,
|
|
16296
|
+
troubleshooting: [
|
|
16297
|
+
{
|
|
16298
|
+
issue: "PDF.js worker not found on web",
|
|
16299
|
+
solution: "Set pdfjs.GlobalWorkerOptions.workerSrc to the correct worker URL before rendering PDFViewer. The package sets a CDN default, but custom bundler setups may need manual configuration."
|
|
16300
|
+
},
|
|
16301
|
+
{
|
|
16302
|
+
issue: "react-native-pdf not linking on iOS",
|
|
16303
|
+
solution: "Run cd ios && pod install and rebuild the project. Ensure minimum deployment target is iOS 13.0+."
|
|
16304
|
+
},
|
|
16305
|
+
{
|
|
16306
|
+
issue: "Blank screen on Android",
|
|
16307
|
+
solution: "Ensure minSdkVersion is 21+ in android/build.gradle. Also check that react-native-blob-util is installed as a peer of react-native-pdf."
|
|
16308
|
+
}
|
|
16309
|
+
]
|
|
15878
16310
|
}
|
|
15879
16311
|
};
|
|
15880
16312
|
function getInstallGuide(packageName) {
|
|
@@ -66865,6 +67297,17 @@ function getNetworkGuide(args) {
|
|
|
66865
67297
|
}
|
|
66866
67298
|
return textResponse(guide);
|
|
66867
67299
|
}
|
|
67300
|
+
function getPdfGuide(args) {
|
|
67301
|
+
const topic = args.topic;
|
|
67302
|
+
const uri = `idealyst://pdf/${topic}`;
|
|
67303
|
+
const guide = pdfGuides[uri];
|
|
67304
|
+
if (!guide) {
|
|
67305
|
+
return textResponse(
|
|
67306
|
+
`Topic "${topic}" not found. Available topics: overview, api, examples`
|
|
67307
|
+
);
|
|
67308
|
+
}
|
|
67309
|
+
return textResponse(guide);
|
|
67310
|
+
}
|
|
66868
67311
|
function listPackages(args = {}) {
|
|
66869
67312
|
const category = args.category;
|
|
66870
67313
|
if (category) {
|
|
@@ -67116,6 +67559,7 @@ var toolHandlers = {
|
|
|
67116
67559
|
get_notifications_guide: getNotificationsGuide,
|
|
67117
67560
|
get_live_activity_guide: getLiveActivityGuide,
|
|
67118
67561
|
get_network_guide: getNetworkGuide,
|
|
67562
|
+
get_pdf_guide: getPdfGuide,
|
|
67119
67563
|
list_packages: listPackages,
|
|
67120
67564
|
get_package_docs: getPackageDocs,
|
|
67121
67565
|
search_packages: searchPackages2,
|
|
@@ -67166,6 +67610,7 @@ export {
|
|
|
67166
67610
|
getBiometricsGuideDefinition,
|
|
67167
67611
|
getPaymentsGuideDefinition,
|
|
67168
67612
|
getNotificationsGuideDefinition,
|
|
67613
|
+
getPdfGuideDefinition,
|
|
67169
67614
|
listPackagesDefinition,
|
|
67170
67615
|
getPackageDocsDefinition,
|
|
67171
67616
|
searchPackagesDefinition,
|
|
@@ -67210,6 +67655,7 @@ export {
|
|
|
67210
67655
|
getNotificationsGuide,
|
|
67211
67656
|
getLiveActivityGuide,
|
|
67212
67657
|
getNetworkGuide,
|
|
67658
|
+
getPdfGuide,
|
|
67213
67659
|
listPackages,
|
|
67214
67660
|
getPackageDocs,
|
|
67215
67661
|
searchPackages2 as searchPackages,
|
|
@@ -67221,4 +67667,4 @@ export {
|
|
|
67221
67667
|
toolHandlers,
|
|
67222
67668
|
callTool
|
|
67223
67669
|
};
|
|
67224
|
-
//# sourceMappingURL=chunk-
|
|
67670
|
+
//# sourceMappingURL=chunk-RZIMKJRB.js.map
|